SELECT WP.Code as WPcode, WP.name as WPname, WP.Capacity as WPcapacity, D.code as Dcode, DQ.code || '-' || CAST(JORQ.OrdNumber AS VARCHAR(10)) || '/' ||PE.code as DocNumber,
CAST((A.TAC * MI.Quantity + A.TBC)/60.0 AS NUMERIC(15,6)) AS WPTime, {FIELDS}
FROM PLMJobOrdersRoutines A
JOIN PLMWorkPlaces WP ON WP.ID=A.WorkPlace_ID
JOIN Divisions D on D.ID=WP.Division_ID
JOIN PLMJOOutputItems MI ON MI.ID=A.Parent_ID
JOIN PLMJONodes N ON N.ID = MI.Owner_ID
JOIN PLMJobOrders JORQ ON JORQ.ID = N.Parent_ID
JOIN DocQueues DQ ON DQ.ID = JORQ.DocQueue_ID
JOIN Periods PE ON PE.ID = JORQ.Period_ID
where JORQ.FinishedBy_ID is null and A.Cooperation='N'
{ANDWHERE}
union all
SELECT WP.Code as WPcode, WP.name as WPname, WP.Capacity as WPcapacity, D.code as Dcode, DQ.code || '-' || CAST(JORQ.OrdNumber AS VARCHAR(10)) || '/' ||PE.code as DocNumber,
CAST((A.TAC * MI.Quantity + A.TBC) / 60.0 AS NUMERIC(15,6)) AS WPTime, {FIELDS}
FROM PLMReqRoutines A
JOIN PLMWorkPlaces WP ON WP.ID=A.WorkPlace_ID
JOIN Divisions D on D.ID=WP.Division_ID
JOIN PLMReqOutputItems MI ON MI.ID=A.Parent_ID
JOIN PLMReqNodes N ON N.ID = MI.Owner_ID
JOIN PLMProduceRequests JORQ ON JORQ.ID = N.Parent_ID
JOIN DocQueues DQ ON DQ.ID = JORQ.DocQueue_ID
JOIN Periods PE ON PE.ID = JORQ.Period_ID
where JORQ.joborder_id is null and A.Cooperation='N'
{ANDWHERE}
order by 1, 5
| Alias | CLSID objektu | Prefix | Popis |
|---|---|---|---|
| A | HRKADG42X2H4BJ2RL5KUAUG3PK |
##CASEOR {:VALUE} #
##1#(DQ.DocumentType = 'PQ')
##2#(DQ.DocumentType = 'JO')
##END#
Generated by ABRA Software a.s. 27.10.2021 16:36