diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_OUTBILLQUERY.wql b/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_OUTBILLQUERY.wql index 19a03e98b..eac6cfdb5 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_OUTBILLQUERY.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_OUTBILLQUERY.wql @@ -266,8 +266,8 @@ base.cust_name, dis.sect_name, dis.box_no, - bib.material_code box_material_code, - bib.material_name box_material_name, + sub.box_type box_material_code, + mmm.material_name box_material_name, dis.qty_unit_name, mater.material_code, mater.material_name, @@ -330,6 +330,7 @@ record.bill_code, record.container_name, record.package_box_sn, + record.box_type, record.sap_pcsn, max(record.customer_name) as customer_name, max(record.customer_description) as customer_description, @@ -353,7 +354,9 @@ record.bill_code, record.container_name, record.sap_pcsn, - record.package_box_sn) sub ON (sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = mst.iostorinv_id) + record.package_box_sn, + record.box_type) sub ON (sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = mst.iostorinv_id) + LEFT JOIN md_me_materialbase mmm ON sub.box_type = mmm.material_code LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name LEFT JOIN (SELECT container_name, @@ -388,8 +391,8 @@ base.cust_name, dis.sect_name, dis.box_no, - bib.material_code box_material_code, - bib.material_name box_material_name, + sub.box_type box_material_code, + mmm.material_name box_material_name, dis.qty_unit_name, mater.material_code, mater.material_name, @@ -441,7 +444,6 @@ a.pcsn ) AS c inner JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id - LEFT JOIN bst_ivt_boxinfo bib ON dis.box_no = bib.box_no inner JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id inner JOIN st_ivt_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id LEFT JOIN md_cs_transportationbase base ON base.cust_code = mst.trans_code @@ -452,6 +454,7 @@ record.bill_code, record.container_name, record.package_box_sn, + record.box_type, record.sap_pcsn, max(record.customer_name) as customer_name, max(record.customer_description) as customer_description, @@ -475,7 +478,9 @@ record.bill_code, record.container_name, record.sap_pcsn, - record.package_box_sn) sub ON (sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = mst.iostorinv_id) + record.package_box_sn, + record.box_type) sub ON (sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id = mst.iostorinv_id) + LEFT JOIN md_me_materialbase mmm ON sub.box_type = mmm.material_code LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name LEFT JOIN (SELECT container_name,