Tareas #5334
openReporte de Rendimiento de Personal
0%
Description
basado en REPORTE RESUMEN DE ÓRDENES TERMINADAS POR COSTURERO
la idea es sacar un grafico por mes, resumido por mes, de cantidad de ordenes terminadas
es por persona, por costurero, graf de lineas.
y otro grafico de % de atrados, igual por mes, con la form que esta en el reporte
Files
Updated by Armando Chuto 9 months ago
(select count(ot.documentno )
from c_order ot
where ot.salesrep_id=u.ad_user_id
and ot.c_activity_id=o.c_activity_id
and ot.DatePromised>=ot.finishDate
and ot.DateOrdered::date >= COALESCE
and ot.DateOrdered::date <= COALESCE
) as cantOrdenesTiempo,
'' as cantOrdenesAtraso
tiempo (año mes) x año - mes
cantidad de ordenes a tiempo (grafico) x mes
cantidad de de ordenes atraso (grafico) x mes
Updated by Armando Chuto 9 months ago
SELECT
sr.name as cliente,
TO_CHAR(o.DateOrdered, 'YYYY-MM') as fecha,
count(o.documentno) as cantOrdenes,
(select count(ot.documentno )
from c_order ot
where ot.salesrep_id=u.ad_user_id
and ot.c_activity_id=o.c_activity_id
and ot.DatePromised>=ot.finishDate
and ot.DateOrdered::date >= COALESCE
and ot.DateOrdered::date <= COALESCE
) as cantOrdenesTiempo
FROM c_order o
JOIN ad_org org on org.ad_org_id=o.ad_org_id
JOIN m_warehouse w on w.m_warehouse_id=o.m_warehouse_id
JOIN ad_user u on u.ad_user_id=o.salesrep_id
JOIN c_bpartner sr on sr.c_bpartner_id=u.c_bpartner_id
JOIN c_activity ac on ac.c_activity_id=o.c_activity_id
WHERE
o.ad_org_id=1000001 --$P{AD_Org_ID}
AND o.ad_client_ID=1000000 --$P{AD_Client_ID}
--and (sr.C_BPartner_ID=$P{C_BPartner_ID} OR $P{C_BPartner_ID} is null )
and (o.m_warehouse_id=1000012 /*$P{M_Warehouse_ID} or $P{M_Warehouse_ID} is null /)
and o.isactive='Y' and o.docstatus in ('CO','CL') and o.issotrx='Y'
and o.DateOrdered::date >= COALESCE(/$P{DateFrom}*/'2025-01-01'::date,'1990-01-01'::date)
and o.DateOrdered::date <= COALESCE
and o.IsFinished='Y'
group by 1,2,u.ad_user_id,o.c_activity_id
order by 1,2
A TIEMPO: $F{cantordenestiempo}
ATRASO: $F{cantordenes}-$F{cantordenestiempo}
Updated by Armando Chuto 9 months ago
WHERE
o.ad_org_id=1000001 --$P{AD_Org_ID}
AND o.ad_client_ID=1000000 --$P{AD_Client_ID}
--and (sr.C_BPartner_ID=$P{C_BPartner_ID} OR $P{C_BPartner_ID} is null )
and (o.m_warehouse_id=1000012 /*$P{M_Warehouse_ID} or $P{M_Warehouse_ID} is null /)
and o.isactive='Y' and o.docstatus in ('CO','CL') and o.issotrx='Y'
and o.DateOrdered::date >= COALESCE(/$P{DateFrom}*/'2025-01-01'::date,'1990-01-01'::date)
and o.DateOrdered::date <= COALESCE
and o.IsFinished='Y'
Updated by Armando Chuto 9 months ago
doblez> ->Reporte de Rendimiento de Personal