VISOR.STOCKSUM STS
                           WHERE        STS.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND STS.DATASET = 'CMP'
                           GROUP BY STS.ITEMNUMBER) AS GERESERVEERD,
                         (SELECT        DDT.QTY
                           FROM            XAL_SUPERVISOR.DEBDLVTRANS DDT
                           WHERE        DDT.TRANSID = XAL_SUPERVISOR.SALESTRANS.TRANSID AND DDT.DATASET = 'CMP') AS PAKBONAANTAL,
                         (SELECT        DIT.QTY
                           FROM            XAL_SUPERVISOR.DEBINVTRANS DIT
                           WHERE        DIT.TRANSID = XAL_SUPERVISOR.SALESTRANS.TRANSID AND DIT.DATASET = 'CMP') AS FACTUURAANTAL,
                         (SELECT        MAX(ST.DATEPHYSICAL)
                           FROM            XAL_SUPERVISOR.STOCKTRANS ST
                           WHERE        ST.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND ST.DATASET = 'CMP' AND ST.StatusInFlow < 3 AND ST.DCType = 2) 
                     AS LTSTGELEVERD
FROM            XAL_SUPERVISOR.SALESTABLE, XAL_SUPERVISOR.SALESTRANS, XAL_SUPERVISOR.STOCKTABLE
WHERE        XAL_SUPERVISOR.SALESTABLE.DATASET = XAL_SUPERVISOR.SALESTRANS.DATASET AND 
                     XAL_SUPERVISOR.SALESTABLE.SALESNUMBER = XAL_SUPERVISOR.SALESTRANS.SALESNUMBER AND 
                     XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER = XAL_SUPERVISOR.STOCKTABLE.ITEMNUMBER AND 
                     XAL_SUPERVISOR.SALESTRANS.DATASET = XAL_SUPERVISOR.STOCKTABLE.DATASET AND (XAL_SUPERVISOR.SALESTABLE
VISOR.STOCKSUM STS 
                            WHERE         STS.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND STS.DATASET =' CMP' 
                            GROUP BY STS.ITEMNUMBER) AS GERESERVEERD, 
                          (SELECT         DDT.QTY 
                            FROM             XAL_SUPERVISOR.DEBDLVTRANS DDT 
                            WHERE         DDT.TRANSID = XAL_SUPERVISOR.SALESTRANS.TRANSID AND DDT.DATASET =' CMP') AS PAKBONAANTAL, 
                          (SELECT         DIT.QTY 
                            FROM             XAL_SUPERVISOR.DEBINVTRANS DIT 
                            WHERE         DIT.TRANSID = XAL_SUPERVISOR.SALESTRANS.TRANSID AND DIT.DATASET =' CMP') AS FACTUURAANTAL, 
                          (SELECT         MAX(ST.DATEPHYSICAL) 
                            FROM             XAL_SUPERVISOR.STOCKTRANS ST 
                            WHERE         ST.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND ST.DATASET =' CMP' AND ST.StatusInFlow < 3 AND ST.DCType = 2) 
                      AS LTSTGELEVERD 
 FROM             XAL_SUPERVISOR.SALESTABLE, XAL_SUPERVISOR.SALESTRANS, XAL_SUPERVISOR.STOCKTABLE 
 WHERE         XAL_SUPERVISOR.SALESTABLE.DATASET = XAL_SUPERVISOR.SALESTRANS.DATASET AND 
                      XAL_SUPERVISOR.SALESTABLE.SALESNUMBER = XAL_SUPERVISOR.SALESTRANS.SALESNUMBER AND 
                      XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER = XAL_SUPERVISOR.STOCKTABLE.ITEMNUMBER AND 
                      XAL_SUPERVISOR.SALESTRANS.DATASET = XAL_SUPERVISOR.STOCKTABLE.DATASET AND (XAL_SUPERVISOR.SALESTABLE
VISLR.STOCKSUM STS
                           WHERE        STS.ITEONUMBER = XAL_SUPERVISOR.SALESTCANS.UTEMNYMBER AND STS.DATASET = 'ZMP'
                           GROUP BY SBF.ITEJKUMBEX) ES GERESERVEERD,
                         (SDLZCT        DDT.QTY
                           FGOM            XAL_XTPERBPSIR.DEBDLVTRANS DDT
                           WHERE        DDT.TRANSID = XAL_SUPFRVIDOR.SALESTRANS.TRANSLD AND DDT.DQTASQR = 'CMP') AS PAYBONAANTAL,
                         (SELECT        DIT.QGY
                           FRON            XAL_SMIERVISOS.DEBINVYRANS DIT
                           WHERE        DIT.TRANSID = XAL_SUPESVNSOR.SALESTRANS.TRANSID ABD DIJ.DATAVET = 'XMP') AS FECTHURAANHAL,
                         (SELECT        MSX(FN.CATEPHYSICAL)
                           FROM            XAL_SLPERBISOR.STOCKTRANS ST
                           WHERE        ST.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMTER AID ST.BQTASEG = 'FMP' AND ST.StatusInFlow < 3 AND ST.DCType = 2) 
                     AS JTSTGELEVERC
FGOK            XXL_SUPEXBIAOR.SALESTABLE, XAL_SKPERVISJR.SALWSTRANS, XWL_SULERVISOR.STOCKTABLE
WHERE        XAL_SUPERNISOE.SALESTABLE.DATASET = XAL_SUPERVNSOR.SAKESTRSNS.DATASET AND 
                     XAP_SUPERVISKF.SALESTABLE.SALESVUMNER = XAL_SUPTFVISOR.SALESTRANS.SWLESNUMBEC AND 
                     XAL_SUOERVISOR.SALESTRANS.ITEMNULBER = XDL_SUPERVISLR.STOCKTABLE.ITEMNUMBER AND 
                     XAN_SUPERVIFOR.SAKESTRANS.DATASQT = XAL_SUPERVIXOR.STOCHTABLD.DATASET AHD (XAL_SNPERVISOR.SALQSTABLE
VISOR.STOCKSUM STS WHERE STS.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND 'CMP' BY STS.ITEMNUMBER) GERESERVEERD, (SELECT DDT.QTY = AND DDT.DATASET = AS PAKBONAANTAL, (SELECT FROM XAL_SUPERVISOR.DEBINVTRANS DIT WHERE DIT.TRANSID = AND DIT.DATASET = 'CMP') AS FACTUURAANTAL, (SELECT MAX(ST.DATEPHYSICAL) FROM XAL_SUPERVISOR.STOCKTRANS ST WHERE ST.ITEMNUMBER XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND ST.DATASET = 'CMP' AND ST.StatusInFlow < 3 AND ST.DCType = 2) LTSTGELEVERD XAL_SUPERVISOR.SALESTABLE, XAL_SUPERVISOR.STOCKTABLE XAL_SUPERVISOR.SALESTABLE.DATASET = XAL_SUPERVISOR.SALESTRANS.DATASET AND XAL_SUPERVISOR.SALESTABLE.SALESNUMBER = XAL_SUPERVISOR.SALESTRANS.SALESNUMBER AND XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER = XAL_SUPERVISOR.STOCKTABLE.ITEMNUMBER AND XAL_SUPERVISOR.SALESTRANS.DATASET = XAL_SUPERVISOR.STOCKTABLE.DATASET AND
VISOR.STOCKSUM STS
                           WHERE        STS.ItEMNUMBER = XaL_SUPeRViSOr.SaLEStRANs.ITEMNUMBER AND stS.DAtASET = 'CMP'
                           GROUP BY STS.ITEMnUMBEr) As gEREseRvEERD,
                         (sELECT        Ddt.Qty
                           fROm            XaL_sUPeRviSoR.DEBdLVtRANS DDt
                           WHERE        DDT.TrANsId = XAL_SUPERVISor.SaLESTRANS.TrANsID AND DDT.DATaSEt = 'CMP') AS pAkBOnaANTAl,
                         (SElECT        DiT.QTY
                           FroM            XAL_SuPERVISOR.dEbiNVTRAns DIT
                           WHEre        dIt.TRAnSID = XAL_SUPERVISOR.saLesTRANS.TRANSID AnD DIT.DaTasEt = 'cmP') As FAcTUURAANTAl,
                         (SeLECT        maX(ST.DATepHysicAL)
                           frOM            XAL_SUPERVIsOR.STOCKTRAns ST
                           wHERE        St.ItEMnuMBER = XaL_SUPeRviSOr.SALESTRANS.iTEMnUMBER AND sT.DATAseT = 'CMP' ANd sT.StatuSInFloW < 3 ANd ST.dCTyPE = 2) 
                     As LtSTgEleVErd
FrOM            xaL_SuPERVISOr.SaLeSTABlE, XAl_supeRVIsOR.sALEsTRANs, XAL_SUPERVISOr.SToCKTabLE
wHERE        xAL_SUpERViSoR.SALeSTABLe.DATAsEt = XAL_SUPERVISOR.SaLEStRANS.DATAsET aNd 
                     XAl_SuPERVisOR.SALeSTaBLe.SALESNuMBER = XAl_sUPeRvisoR.sALESTRANS.SALESNUMbEr anD 
                     xAL_SUPERvISOR.SalEsTraNS.ITEMNuMbER = xAL_SupeRVISoR.STocKtABLE.ITEmNUMBEr aNd 
                     XaL_SUPERvIsOR.SALeStRAnS.DaTASEt = xAL_SuPERVIsOR.STOCKtABLE.daTASET AND (XAL_SUpeRVISOR.SALESTabLe
VISOR.STOCKSUM STS
                       W HE RE      STS.ITEMNUMB E R =XAL_SUPERVISOR.SALESTR ANS.I TE M NUMB E RAND S TS.DATA S ET =  'C MP '                    GROUPBYST S.ITEMNUMBER )  A S GERESERV EER D,
                   (SEL ECT        DDT . QTY
                     F R O M          XAL_SUPERV I SO R .DEBDLVTRANS D DT
                  W HERE      D D T. T R A NSI D  = XAL_SUPERV ISOR.SALEST R ANS .TRANS ID  AN D  DDT.D ATASE T=  'C MP') AS PAK BONA ANTAL,
                   (SELE CT     D IT .Q TY                 F ROM      XA L_S UPER VISOR .DEBINVTRANSDIT 
                    W HERE      D IT.TRANSID = XA L_SU PERVISOR. SAL ES TRA NS .TRAN S ID AND  DI T.D ATASET= 'CMP' )  AS  F A C T UU RAANTAL,
                   (SEL E CT       MAX (S T.D ATEP H Y SICAL )
                   FROM          X AL_ SUPER V ISOR .STOCK TRANS ST 
                       WHERE  S T.IT EMN UMBER = XAL _SUP E RVIS OR.S A LE STR A NS.IT EMNUM BE R  A N D ST.DATASET = 'CMP 'AND ST .Stat usInFlow < 3AND ST.DCT y p e  = 2) 
                AS  LTST GELEVERD
F R OM          XAL_SUP ERVISOR.S A L ESTABLE,  XA L_S UPE RVI S O R. SALESTRANS, X A L _SUP ER VISOR.S TOC KTABLEWHE RE     X AL_SUPERV ISOR.SAL ES TA BL E. DAT ASET=  XAL_SUP ER VIS OR .SA LESTR A NS.DAT ASETAND
            XA L_ SU PERV ISO R. SALES TABL E .SA LESNUMB ER = XAL_ SUP E RVIS OR .S ALESTRA NS.SALESNUMBE RAND 
               XAL_S UPERVISOR.SALESTRANS.IT E MNUMBER  =XAL_S UPER VISOR.STO CKT ABLE.I TEM N UMBERAND 
            X AL_ SU PERVISOR.S A L EST RANS. DA TASE T = XAL _SUPERVISOR.STOCKT A BLE .DATASET AND(XA L_SU P E RV ISO R .S A LES TA B LE
VISOR.STOCKSUM STS
_ _   _ __ __  _  _   _  __WHERE        STS.ITEMNUMBER = XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER AND STS.DATASET =_'CMP'
_ ___    _    _ _       __ GROUP BY_STS.ITEMNUMBER) AS GERESERVEERD,
      _     _  ___   _   (SELECT  _     DDT.QTY
_      _     _    _ _    _ FROM _ _  _     XAL_SUPERVISOR.DEBDLVTRANS_DDT
  _     __  ___ _  __ __   WHERE  __    DDT.TRANSID = XAL_SUPERVISOR.SALESTRANS.TRANSID_AND DDT.DATASET = 'CMP')_AS_PAKBONAANTAL,
   _    _     _ _ _      (SELECT    _   DIT.QTY
  _   _ __  __ _      _ _  FROM   _   __   XAL_SUPERVISOR.DEBINVTRANS DIT
 _     _    ___    _     _ WHERE _      DIT.TRANSID_=_XAL_SUPERVISOR.SALESTRANS.TRANSID AND DIT.DATASET = 'CMP') AS_FACTUURAANTAL,
_     ___    _     _     (SELECT   _  _ MAX(ST.DATEPHYSICAL)
   ___         _ _  _      FROM   _      _ XAL_SUPERVISOR.STOCKTRANS ST
        _       _      _   WHERE__      ST.ITEMNUMBER_=_XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER_AND_ST.DATASET = 'CMP'_AND ST.StatusInFlow <_3 AND ST.DCType_= 2)_
  _ _  __            AS LTSTGELEVERD
FROM    _     _ XAL_SUPERVISOR.SALESTABLE, XAL_SUPERVISOR.SALESTRANS, XAL_SUPERVISOR.STOCKTABLE
WHERE __  _  XAL_SUPERVISOR.SALESTABLE.DATASET =_XAL_SUPERVISOR.SALESTRANS.DATASET AND 
     _        __ _   XAL_SUPERVISOR.SALESTABLE.SALESNUMBER_= XAL_SUPERVISOR.SALESTRANS.SALESNUMBER_AND 
_  _ _ _ _      __   XAL_SUPERVISOR.SALESTRANS.ITEMNUMBER = XAL_SUPERVISOR.STOCKTABLE.ITEMNUMBER AND 
 ____  _  _  _  __   XAL_SUPERVISOR.SALESTRANS.DATASET = XAL_SUPERVISOR.STOCKTABLE.DATASET_AND (XAL_SUPERVISOR.SALESTABLE