|
|
@@ -76,7 +76,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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, 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, " +
|
|
|
+ "((-(1) * mri_qty ) - coalesce(mri_ycheckqty, 0)) as thischeckqty, mr_enuu as custuu, ma_useruu custuseruu, 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 " +
|
|
|
"join make$orders on mri_odid = ma_id " +
|
|
|
@@ -129,7 +129,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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_unit as produnit, " +
|
|
|
- "(mai_qty - coalesce(mai_ycheckqty, 0)) as thischeckqty, make$accept.ma_enuu as custuu, make$accept.ma_venduu as enuu, " +
|
|
|
+ "(mai_qty - coalesce(mai_ycheckqty, 0)) as thischeckqty, make$accept.ma_enuu as custuu, make$orders.ma_useruu custuseruu, 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 " +
|
|
|
"join make$orders on mai_odid = make$orders.ma_id " +
|
|
|
@@ -181,7 +181,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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, 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, " +
|
|
|
+ "((-(1) * poi_qty ) - coalesce( poi_ycheckqty, 0)) as thischeckqty, po_enuu as custuu, pu_useruu custuseruu, 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 " +
|
|
|
"left join purc$orderitems on poi_pdid = pd_id " +
|
|
|
@@ -234,7 +234,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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, pr_unit as produnit, " +
|
|
|
- "(pbi_qty - coalesce(pbi_ycheckqty, 0)) as thischeckqty, pb_enuu as custuu, pb_venduu as enuu, pbi_id as sourceid, " +
|
|
|
+ "(pbi_qty - coalesce(pbi_ycheckqty, 0)) as thischeckqty, pb_enuu as custuu, pu_useruu custuseruu, 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 " +
|
|
|
"left join purc$orderitems on pbi_pdid = pd_id " +
|
|
|
@@ -287,7 +287,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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, purc$returnitem.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_ycheckqty as ycheckqty, ((-(1) * pri_qty ) - coalesce(pri_ycheckqty, 0)) as thischeckqty, pr_enuu as custuu, pu_useruu custuseruu, 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 " +
|
|
|
"left join purc$orderitems on pri_pdid = pd_id " +
|
|
|
@@ -341,7 +341,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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, purc$acceptitem.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 " +
|
|
|
+ "pa_enuu as custuu, pu_useruu custuseruu, 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 " +
|
|
|
"left join purc$orderitems on pai_pdid = pd_id " +
|
|
|
"left join purc$orders on purc$orders.pu_id = pd_puid " +
|
|
|
@@ -393,7 +393,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"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_produnit 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_qty - coalesce(aa_ycheckqty, 0)) as thischeckqty, aa_custuu custuu, aa_custuseruu custuseruu, aa_enuu enuu, aa_id sourceid, aa_sendcode sendcode, " +
|
|
|
"aa_factory factory, aa_custname custname from purc$apbilladjustment where coalesce(aa_thischeckqty, 0) <> 0 and aa_enuu = ").append(enUU).append(" ");
|
|
|
if (!StringUtils.isEmpty(keyword.getReceiveName())) {
|
|
|
sql.append("and aa_receivename = '").append(keyword.getReceiveName()).append("' ");
|