|
@@ -454,13 +454,31 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
Ingredient.setTransferCost(BigDecimal.ZERO);
|
|
|
}
|
|
|
list4.add(Ingredient);
|
|
|
+ //辅料含税成本 美元
|
|
|
+ if(Ingredient.getUsdAmount()!=null){
|
|
|
+ if(syCostAllocation.getExcipiencostIncludestax()==null){
|
|
|
+ syCostAllocation.setExcipiencostIncludestax(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ syCostAllocation.setExcipiencostIncludestax(Ingredient.getUsdAmount().add(syCostAllocation.getExcipiencostIncludestax()));
|
|
|
+ }else {
|
|
|
+ syCostAllocation.setExcipiencostIncludestax(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ //辅料不含税成本
|
|
|
+ if(Ingredient.getPriceExcludingtax()!=null){
|
|
|
+ if(syCostAllocation.getExcipiencostNotincludestax()==null){
|
|
|
+ syCostAllocation.setExcipiencostNotincludestax(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ syCostAllocation.setExcipiencostNotincludestax(Ingredient.getPriceExcludingtax().add(syCostAllocation.getExcipiencostNotincludestax()));
|
|
|
+ }else {
|
|
|
+ syCostAllocation.setExcipiencostNotincludestax(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//发运明细
|
|
|
String sqlShipdetail = " SELECT " +
|
|
|
" sh.cDefine10 AS invoiceNum, " +
|
|
|
" CONVERT(varchar (100), max(sh.dcreatesystime), 23) as outdata , " +
|
|
|
- " count(shs.SBVID) as shipQuantity, " +
|
|
|
+ " sum(shs.iQuantity) as shipQuantity, " +
|
|
|
" sh.iExchRate AS exchangeRate, " +
|
|
|
" sh.cSOCode AS orderNum, " +
|
|
|
" c.cInvName AS poStyleNum, " +
|
|
@@ -469,7 +487,7 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
" sum(iNatSum) as rmbAmount, " +
|
|
|
" max(so.iTax) as procesUnitPriceusd, " +
|
|
|
" max(so.iNatTax) as procesUnitPricermb, " +
|
|
|
- " max(so.iNatTax) * count(shs.SBVID) as processCost, " +
|
|
|
+ " max(so.iNatTax) * sum(shs.iQuantity) as processCost, " +
|
|
|
" v.cVenName AS processUnit " +
|
|
|
" FROM " +
|
|
|
" SaleBillVouch sh " +
|
|
@@ -534,6 +552,10 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
syCostAllocation.setRmbProcesscost(BigDecimal.ZERO);
|
|
|
}
|
|
|
}
|
|
|
+ //短出数
|
|
|
+ if(syCostAllocation.getActualShipquantity()!=null && syCostAllocation.getPlanQuantity()!=null){
|
|
|
+ syCostAllocation.setShortseveral(syCostAllocation.getPlanQuantity().subtract(syCostAllocation.getActualShipquantity()));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
//费用支出
|