|
|
@@ -76,7 +76,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
StringBuffer sql = new StringBuffer("select mr_code as inoutno, mr_date as pidate, mr_rate as rate, mr_receivecode as receivecode, " +
|
|
|
"mr_receivename as receivename, '客户委外验退单' as piclass, 'make$returnitem' as sourcetable, ma_code as ordercode, 0 as orderdetno, " +
|
|
|
"mri_number as detno, (-(1) * mri_qty ) as qty, mri_orderpice as orderprice, mr_currency as currency, mri_taxrate as taxrate, " +
|
|
|
- "mri_whname as whname, mri_ycheckqty as ycheckqty, pr_code as prodcode, pr_spec as prodspec, pr_title as prodtitle, " +
|
|
|
+ "mri_whname as whname, mri_ycheckqty as ycheckqty, pr_code as prodcode, pr_spec as prodspec, pr_title as prodtitle, pr_unit as produnit, " +
|
|
|
"((-(1) * mri_qty ) - coalesce(mri_ycheckqty, 0)) as thischeckqty, mr_enuu as custuu, mr_venduu as enuu, mri_id as sourceid, " +
|
|
|
"mr_sendcode as sendcode, ma_factory as pd_factory, en_name custname from make$return " +
|
|
|
"join make$returnitem on mr_id = mri_paid " +
|
|
|
@@ -129,7 +129,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"ma_receivecode as receivecode, ma_receivename as receivename, '客户委外验收单' as piclass, 'make$acceptitem' as sourcetable, " +
|
|
|
"make$orders.ma_code as ordercode, 0 as orderdetno, mai_number as detno, mai_qty as qty, mai_orderpice as orderprice, " +
|
|
|
"make$accept.ma_currency as currency, mai_taxrate as taxrate, mai_whname as whname, mai_ycheckqty as ycheckqty, " +
|
|
|
- "make$orders.pr_code as prodcode, make$orders.pr_spec as prodspec, make$orders.pr_title as prodtitle, " +
|
|
|
+ "make$orders.pr_code as prodcode, make$orders.pr_spec as prodspec, make$orders.pr_title as prodtitle, , pr_unit as produnit, " +
|
|
|
"(mai_qty - coalesce(mai_ycheckqty, 0)) as thischeckqty, make$accept.ma_enuu as custuu, make$accept.ma_venduu as enuu, " +
|
|
|
"mai_id as sourceid, ma_sendcode as sendcode, ma_factory as factory, en_name custname from make$accept " +
|
|
|
"join make$acceptitem on make$accept.ma_id = mai_paid " +
|
|
|
@@ -181,7 +181,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
StringBuffer sql = new StringBuffer("select po_code as inoutno, po_date as pidate, po_rate as rate, po_receivecode as receivecode, " +
|
|
|
"po_receivename as receivename, '客户不良品出库单' as piclass, 'purc$badoutitem' as sourcetable, pu_code as pd_ordercode, " +
|
|
|
"purc$orderitems.pd_number as orderdetno, poi_number as detno, (-(1) * poi_qty ) as qty, 0 as pd_orderprice, po_currency as currency, " +
|
|
|
- "poi_taxrate as taxrate, poi_whname as whname, poi_ycheckqty as ycheckqty, pr_code as prodcode, pr_spec as prodspec, pr_title as prodtitle, " +
|
|
|
+ "poi_taxrate as taxrate, poi_whname as whname, poi_ycheckqty as ycheckqty, pr_code as prodcode, pr_spec as prodspec, pr_title as prodtitle, pr_unit as produnit, " +
|
|
|
"((-(1) * poi_qty ) - coalesce( poi_ycheckqty, 0)) as thischeckqty, po_enuu as custuu, po_venduu as enuu, poi_id as sourceid, " +
|
|
|
"po_sendcode as sendcode, purc$orderitems.pd_factory as factory, en_name custname from purc$badout " +
|
|
|
"join purc$badoutitem on po_id = poi_poid " +
|
|
|
@@ -234,7 +234,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
StringBuffer sql = new StringBuffer("select pb_code as inoutno, pb_date as pidate, pb_rate as rate, pb_receivecode as receivecode, " +
|
|
|
"pb_receivename as receivename, '客户不良品入库单' as piclass, 'purc$badinitem' as sourcetable, pu_code as ordercode, " +
|
|
|
"pd_number as orderdetno, pbi_number as detno, pbi_qty as qty, 0 as pd_orderprice, pb_currency as currency, pbi_taxrate as taxrate, " +
|
|
|
- "pbi_whname as whname, pbi_ycheckqty as ycheckqty, pr_code as prodcode, pr_spec as prodspec, pr_title as prodtitle, " +
|
|
|
+ "pbi_whname as whname, pbi_ycheckqty as ycheckqty, pr_code as prodcode, pr_spec as prodspec, pr_title as prodtitle, pr_unit as produnit, " +
|
|
|
"(pbi_qty - coalesce(pbi_ycheckqty, 0)) as thischeckqty, pb_enuu as custuu, pb_venduu as enuu, pbi_id as sourceid, " +
|
|
|
"pb_sendcode as sendcode, pd_factory as factory, en_name custname from purc$badin " +
|
|
|
"join purc$badinitem on pb_id = pbi_pbid " +
|
|
|
@@ -287,7 +287,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
StringBuffer sql = new StringBuffer("select purc$return.pr_code as inoutno, pr_date as pidate, pr_rate as rate, pr_receivecode as receivecode, " +
|
|
|
"pr_receivename as receivename, '客户采购验退单' as piclass, 'purc$returnitem' as sourcetable, pu_code as ordercode, pd_number as orderdetno, " +
|
|
|
"pri_number as detno, (-(1) * pri_qty ) as qty, pri_orderprice as orderprice, pr_currency as currency, pri_taxrate as taxrate, " +
|
|
|
- "pri_whname as whname, purc$returnitem.pr_code as prodcode, purc$returnitem.pr_spec as prodspec, purc$returnitem.pr_title as prodtitle, " +
|
|
|
+ "pri_whname as whname, purc$returnitem.pr_code as prodcode, purc$returnitem.pr_spec as prodspec, purc$returnitem.pr_title as prodtitle, pr_unit as produnit, " +
|
|
|
"pri_ycheckqty as ycheckqty, ((-(1) * pri_qty ) - coalesce(pri_ycheckqty, 0)) as thischeckqty, pr_enuu as custuu, pr_venduu as enuu, " +
|
|
|
"pri_id as sourceid, pr_sendcode as sendcode, pd_factory as factory, en_name custname from purc$return " +
|
|
|
"join purc$returnitem on pr_id = pri_prid " +
|
|
|
@@ -340,7 +340,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
StringBuffer sql = new StringBuffer("select pa_code as inoutno, pa_date as pidate, pa_rate as rate, pa_receivecode as receivcode, " +
|
|
|
"pa_receivename as receivename, '客户采购验收单' as piclass, 'purc$acceptitem' as sourcetable, pu_code as ordercode, " +
|
|
|
"pd_number as orderdetno, pai_number as detno, pai_qty as qty, pai_orderprice as orderprice, pa_currency as currency, " +
|
|
|
- "pai_taxrate as taxrate, pai_whname as whname, purc$acceptitem.pr_code as prodcode, purc$acceptitem.pr_spec as prodspec, " +
|
|
|
+ "pai_taxrate as taxrate, pai_whname as whname, purc$acceptitem.pr_code as prodcode, purc$acceptitem.pr_spec as prodspec, pr_unit as produnit, " +
|
|
|
"purc$acceptitem.pr_title as prodtitle, pai_ycheckqty as ycheckqty, (pai_qty - coalesce(pai_ycheckqty, 0)) as thischeckqty, " +
|
|
|
"pa_enuu as custuu, pa_venduu as enuu, pai_id as sourceid, pa_sendcode as sendcode, pd_factory as factory, en_name custname from purc$accept " +
|
|
|
"join purc$acceptitem on pai_paid = pa_id " +
|
|
|
@@ -392,7 +392,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
private List<ErpProdIODetail> getAdjustments(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select aa_inoutno inoutno, aa_orderdate pidate, aa_rate rate, aa_receivecode receivecode, " +
|
|
|
"aa_receivename receivename, '货款调账' as piclass, 'purc$apbilladjustment' as sourcetable, aa_ordercode ordercode, " +
|
|
|
- "aa_orderdetno orderdetno, aa_detno detno, aa_prid prid, aa_prodcode prodcode, aa_prodspec prodspec, aa_prodtitle prodtitle, " +
|
|
|
+ "aa_orderdetno orderdetno, aa_detno detno, aa_prid prid, aa_prodcode prodcode, aa_prodspec prodspec, aa_prodtitle prodtitle, pr_unit as produnit, " +
|
|
|
"aa_qty qty, aa_orderprice orderprice, aa_currency currency, aa_taxrate taxrate, aa_whname whname, aa_ycheckqty ycheckqty, " +
|
|
|
"(aa_qty - coalesce(aa_ycheckqty, 0)) as thischeckqty, aa_custuu custuu, aa_enuu enuu, aa_id sourceid, aa_sendcode sendcode, " +
|
|
|
"aa_factory factory, aa_custname custname from purc$apbilladjustment where aa_enuu = ").append(enUU).append(" ");
|