|
@@ -129,7 +129,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
"ma_receivecode as receivecode, ma_receivename as receivename, '客户委外验收单' as piclass, 'make$acceptitem' as sourcetable, " +
|
|
"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$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$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, , pr_unit as produnit, " +
|
|
|
|
|
|
|
+ "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$accept.ma_venduu as enuu, " +
|
|
|
"mai_id as sourceid, ma_sendcode as sendcode, ma_factory as factory, en_name custname from make$accept " +
|
|
"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$acceptitem on make$accept.ma_id = mai_paid " +
|
|
@@ -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, " +
|
|
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, " +
|
|
"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_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, pr_unit as produnit, " +
|
|
|
|
|
|
|
+ "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, pr_venduu as enuu, " +
|
|
|
"pri_id as sourceid, pr_sendcode as sendcode, pd_factory as factory, en_name custname from purc$return " +
|
|
"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 " +
|
|
"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, " +
|
|
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, " +
|
|
"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, " +
|
|
"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, pr_unit as produnit, " +
|
|
|
|
|
|
|
+ "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, " +
|
|
"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, 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 " +
|
|
"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) {
|
|
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, " +
|
|
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_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, pr_unit as produnit, " +
|
|
|
|
|
|
|
+ "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 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_enuu enuu, aa_id sourceid, aa_sendcode sendcode, " +
|
|
|
"aa_factory factory, aa_custname custname from purc$apbilladjustment where aa_enuu = ").append(enUU).append(" ");
|
|
"aa_factory factory, aa_custname custname from purc$apbilladjustment where aa_enuu = ").append(enUU).append(" ");
|