String invoiceSql="SELECT A.ITEM_CODE,A.DESCR,A.LOADED_QTY,A.QUANTITY,A.TRANSFER_IN,A.TRANSFER_OUT,A.BREAK_ADD_QTY, A.BREAK_DEDUCT_QTY, " + 
						" (A.LOADED_QTY+A.TRANSFER_IN+A.BREAK_ADD_QTY-A.QUANTITY-A.TRANSFER_OUT-A.BREAK_DEDUCT_QTY) AS retDepot" + 
						" FROM (SELECT DISTINCT smi.item_code ITEM_CODE,i.descr AS DESCR, " + 
						" (case WHEN smi.LOAD_QTY is null then 0 else smi.LOAD_QTY END) AS LOADED_QTY, sum(smi.quantity) as QUANTITY, " + 
						" FN_GET_STOCK_TRANFER_DATA('TRANSFER_IN',SMI.ITEM_CODE,'400385    ','27-MAY-23') AS TRANSFER_IN," + 
						" FN_GET_STOCK_TRANFER_DATA('TRANSFER_OUT',SMI.ITEM_CODE,'400385    ','27-MAY-23') AS TRANSFER_OUT, " + 
						" FN_GET_STOCK_TRANFER_DATA('BREAK_ADD_QTY',SMI.ITEM_CODE,'400385    ','27-MAY-23') AS BREAK_ADD_QTY, " + 
						" FN_GET_STOCK_TRANFER_DATA('BREAK_DEDUCT_QTY',SMI.ITEM_CODE,'400385    ','27-MAY-23') AS BREAK_DEDUCT_QTY " + 
						" FROM strg_meet_invoice smi  " + 
						" left outer join item i  on smi.item_code = i.item_code WHERE  SMI.DCR_ID IN('WF00001323')  " + 
						" group by smi.item_code,i.descr,smi.LOAD_QTY " + 
						" UNION " + 
						" SELECT DISTINCT ITEM.ITEM_CODE AS ITEM_CODE ,ITEM.DESCR AS DESCR,(S.QUANTITY-S.ALLOC_QTY) AS LOADED_QTY " + 
						" ,0 AS QUANTITY, " + 
						" FN_GET_STOCK_TRANFER_DATA('TRANSFER_IN',ITEM.ITEM_CODE,?,'27-MAY-23') AS TRANSFER_IN, " + 
						" FN_GET_STOCK_TRANFER_DATA('TRANSFER_OUT',ITEM.ITEM_CODE,'400385    ','27-MAY-23') AS TRANSFER_OUT, " + 
						" FN_GET_STOCK_TRANFER_DATA('BREAK_ADD_QTY',ITEM.ITEM_CODE,'400385    ','27-MAY-23') AS BREAK_ADD_QTY, " + 
						" FN_GET_STOCK_TRANFER_DATA('BREAK_DEDUCT_QTY',ITEM.ITEM_CODE,'400385    ','27-MAY-23') AS BREAK_DEDUCT_QTY " + 
						" FROM ITEM ITEM LEFT OUTER JOIN PRICELIST  PM ON ITEM.ITEM_CODE = PM.ITEM_CODE,STOCK S,SALES_PERS SP " + 
						" WHERE PM.PRICE_LIST IN ('PLGW1','') " + 
						" AND ITEM.ACTIVE = 'Y' AND SP.ITEM_SER=ITEM.ITEM_SER " + 
						" AND RTRIM((CASE WHEN ITEM.ITEM_USAGE IS NULL THEN 'O' ELSE ITEM.ITEM_USAGE END )) NOT IN('S','G') " + 
						" AND RTRIM((CASE WHEN ITEM.ITEM_USAGE IS NULL THEN 'O' ELSE ITEM.ITEM_USAGE END ))='F' " + 
						" AND S.ITEM_CODE=ITEM.ITEM_CODE AND S.SITE_CODE =(SELECT EMP_SITE FROM EMPLOYEE WHERE EMP_CODE= '400385' ) " + 
						" AND S.LOC_CODE='400385' AND S.ITEM_SER=ITEM.ITEM_SER AND S.INV_STAT='SALE'  AND S.QUANTITY >0 " + 
						" AND S.ITEM_CODE NOT IN (SELECT DISTINCT item_code FROM strg_meet_invoice WHERE DCR_ID IN ('WF00001323'))" + 
						") A ORDER BY A.DESCR";
