|
@@ -206,6 +206,8 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
syCostAllocation.setSalesordersLocaltotal(BigDecimal.valueOf((Double)orderMap.get("salesordersLocaltotal")));//美元
|
|
syCostAllocation.setSalesordersLocaltotal(BigDecimal.valueOf((Double)orderMap.get("salesordersLocaltotal")));//美元
|
|
|
syCostAllocation.setSalesrrdersOriginaltotal(new BigDecimal(orderMap.get("salesrrdersOriginaltotal").toString()));//美元*汇率=人民币
|
|
syCostAllocation.setSalesrrdersOriginaltotal(new BigDecimal(orderMap.get("salesrrdersOriginaltotal").toString()));//美元*汇率=人民币
|
|
|
syCostAllocation.setGarmentContractno(strs3.toString().substring(1,strs3.toString().length()-1));
|
|
syCostAllocation.setGarmentContractno(strs3.toString().substring(1,strs3.toString().length()-1));
|
|
|
|
|
+ String orderType=orderMap.get("orderType").toString();
|
|
|
|
|
+ syCostAllocation.setOrderType(orderType);//采购类型
|
|
|
// 销售订单附件
|
|
// 销售订单附件
|
|
|
List<AccessorItem> accessorItemList = new ArrayList<>();
|
|
List<AccessorItem> accessorItemList = new ArrayList<>();
|
|
|
if (org.jeecg.modules.system.util.oConvertUtils.isNotEmpty(syCostAllocation.getGarmentContractno())) {
|
|
if (org.jeecg.modules.system.util.oConvertUtils.isNotEmpty(syCostAllocation.getGarmentContractno())) {
|
|
@@ -486,39 +488,49 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
BigDecimal notincludestaxTotal = BigDecimal.ZERO;
|
|
BigDecimal notincludestaxTotal = BigDecimal.ZERO;
|
|
|
//合计面料成本美元
|
|
//合计面料成本美元
|
|
|
BigDecimal includestaxTotal = BigDecimal.ZERO;
|
|
BigDecimal includestaxTotal = BigDecimal.ZERO;
|
|
|
-// System.out.println("getFabriccostIncludestax\t"+str.getFabriccostIncludestax());
|
|
|
|
|
- if(fabriccostIncludestax.size()!=0){
|
|
|
|
|
-// syCostAllocation.setTaxrate(new BigDecimal(0));
|
|
|
|
|
- for(SyCostAllocation str : fabriccostIncludestax){
|
|
|
|
|
- for(SyCostAllocationFabric li:list3){
|
|
|
|
|
- String goodsName=li.getGoodsName();
|
|
|
|
|
- if (goodsName.indexOf("--")!=-1){
|
|
|
|
|
- goodsName=goodsName.substring(0,goodsName.indexOf("--"));
|
|
|
|
|
- }
|
|
|
|
|
- if(str.getCInvName().equals(goodsName)){
|
|
|
|
|
- BigDecimal quantity=li.getUsageQuantity();
|
|
|
|
|
- if (li.getFabrictransferQuantity()!=null){
|
|
|
|
|
- quantity=li.getUsageQuantity().subtract(li.getFabrictransferQuantity());
|
|
|
|
|
|
|
+ System.out.println("fabriccostIncludestaxUsd1\t"+syCostAllocation.getFabriccostIncludestaxUsd());
|
|
|
|
|
+ syCostAllocation.setTaxrate2(new BigDecimal("13"));
|
|
|
|
|
+ if(syCostAllocation.getFabriccostIncludestaxUsd()!=null){
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestaxUsd(syCostAllocation.getFabriccostIncludestaxUsd().divide(new BigDecimal("1.13"),4,BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ syCostAllocation.setTaxrate2(new BigDecimal("0"));
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println("fabriccostIncludestaxUsd2\t"+syCostAllocation.getFabriccostIncludestaxUsd());
|
|
|
|
|
+ System.out.println("fabriccostIncludestax\t"+syCostAllocation.getFabriccostIncludestax());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(!orderType.equals("国内加工单")||syCostAllocation.getFabriccostIncludestaxUsd()==null){
|
|
|
|
|
+ if(fabriccostIncludestax.size()!=0){
|
|
|
|
|
+ for(SyCostAllocation str : fabriccostIncludestax){
|
|
|
|
|
+ for(SyCostAllocationFabric li:list3){
|
|
|
|
|
+ String goodsName=li.getGoodsName();
|
|
|
|
|
+ if (goodsName.indexOf("--")!=-1){
|
|
|
|
|
+ goodsName=goodsName.substring(0,goodsName.indexOf("--"));
|
|
|
}
|
|
}
|
|
|
- //-- fabriccostincludestax=面料含税成本 fabriccostNotincludestax=面料不含税成本
|
|
|
|
|
|
|
+ if(str.getCInvName().equals(goodsName)){
|
|
|
|
|
+ BigDecimal quantity=li.getUsageQuantity();
|
|
|
|
|
+ if (li.getFabrictransferQuantity()!=null){
|
|
|
|
|
+ quantity=li.getUsageQuantity().subtract(li.getFabrictransferQuantity());
|
|
|
|
|
+ }
|
|
|
|
|
+ //-- fabriccostincludestax=面料含税成本 fabriccostNotincludestax=面料不含税成本
|
|
|
// System.out.println("getFabriccostIncludestax "+str.getFabriccostIncludestax()+" getFabriccostNotincludestax "+str.getFabriccostNotincludestax()
|
|
// System.out.println("getFabriccostIncludestax "+str.getFabriccostIncludestax()+" getFabriccostNotincludestax "+str.getFabriccostNotincludestax()
|
|
|
// +"getFabriccostIncludestaxUsd"+str.getFabriccostIncludestaxUsd()+" getInvoiceQuantity "+str.getInvoiceQuantity()+" quantity "+quantity);
|
|
// +"getFabriccostIncludestaxUsd"+str.getFabriccostIncludestaxUsd()+" getInvoiceQuantity "+str.getInvoiceQuantity()+" quantity "+quantity);
|
|
|
- if (str.getInvoiceQuantity().compareTo(quantity)!=0){
|
|
|
|
|
- BigDecimal money = str.getFabriccostIncludestax().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- BigDecimal num = money.multiply(quantity);
|
|
|
|
|
- usageQuantityTotal = usageQuantityTotal.add(num);
|
|
|
|
|
- BigDecimal money1 = str.getFabriccostNotincludestax().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- BigDecimal num1 = money1.multiply(quantity);
|
|
|
|
|
- notincludestaxTotal = notincludestaxTotal.add(num1);
|
|
|
|
|
- BigDecimal money2 = str.getFabriccostIncludestaxUsd().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
- BigDecimal num2 = money2.multiply(quantity);
|
|
|
|
|
- includestaxTotal = includestaxTotal.add(num2);
|
|
|
|
|
- }else{
|
|
|
|
|
- usageQuantityTotal = usageQuantityTotal.add(str.getFabriccostIncludestax());
|
|
|
|
|
- notincludestaxTotal = notincludestaxTotal.add(str.getFabriccostNotincludestax());
|
|
|
|
|
- includestaxTotal = includestaxTotal.add(str.getFabriccostIncludestaxUsd());
|
|
|
|
|
- }
|
|
|
|
|
- System.out.println(" getInvoiceQuantity "+str.getInvoiceQuantity()+" quantity "+quantity);
|
|
|
|
|
|
|
+ if (str.getInvoiceQuantity().compareTo(quantity)!=0){
|
|
|
|
|
+ BigDecimal money = str.getFabriccostIncludestax().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ BigDecimal num = money.multiply(quantity);
|
|
|
|
|
+ usageQuantityTotal = usageQuantityTotal.add(num);
|
|
|
|
|
+ BigDecimal money1 = str.getFabriccostNotincludestax().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ BigDecimal num1 = money1.multiply(quantity);
|
|
|
|
|
+ notincludestaxTotal = notincludestaxTotal.add(num1);
|
|
|
|
|
+ BigDecimal money2 = str.getFabriccostIncludestaxUsd().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ BigDecimal num2 = money2.multiply(quantity);
|
|
|
|
|
+ includestaxTotal = includestaxTotal.add(num2);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ usageQuantityTotal = usageQuantityTotal.add(str.getFabriccostIncludestax());
|
|
|
|
|
+ notincludestaxTotal = notincludestaxTotal.add(str.getFabriccostNotincludestax());
|
|
|
|
|
+ includestaxTotal = includestaxTotal.add(str.getFabriccostIncludestaxUsd());
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println(" getInvoiceQuantity "+str.getInvoiceQuantity()+" quantity "+quantity);
|
|
|
// BigDecimal money = str.getFabriccostIncludestax().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal money = str.getFabriccostIncludestax().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
// BigDecimal num = money.multiply(li.getUsageQuantity());
|
|
// BigDecimal num = money.multiply(li.getUsageQuantity());
|
|
|
// usageQuantityTotal = usageQuantityTotal.add(num);
|
|
// usageQuantityTotal = usageQuantityTotal.add(num);
|
|
@@ -529,42 +541,42 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
|
// BigDecimal money2 = str.getFabriccostIncludestaxUsd().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
// BigDecimal money2 = str.getFabriccostIncludestaxUsd().divide(str.getInvoiceQuantity(),2,BigDecimal.ROUND_HALF_UP);
|
|
|
// BigDecimal num2 = money2.multiply(li.getUsageQuantity());
|
|
// BigDecimal num2 = money2.multiply(li.getUsageQuantity());
|
|
|
// includestaxTotal = includestaxTotal.add(num2);
|
|
// includestaxTotal = includestaxTotal.add(num2);
|
|
|
- //(发票金额/发票数量)*使用数量
|
|
|
|
|
|
|
+ //(发票金额/发票数量)*使用数量
|
|
|
// System.out.println("面料含税成本\t"+usageQuantityTotal+"\t面料不含税成本\t"+notincludestaxTotal+"\t发票数量\t"+str.getInvoiceQuantity()+"\t使用数量\t"+li.getUsageQuantity());
|
|
// System.out.println("面料含税成本\t"+usageQuantityTotal+"\t面料不含税成本\t"+notincludestaxTotal+"\t发票数量\t"+str.getInvoiceQuantity()+"\t使用数量\t"+li.getUsageQuantity());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
// System.out.println("面料含税人民币2\t"+usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
// System.out.println("面料含税人民币2\t"+usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
// System.out.println("实际总金额2\t"+usageQuantityTotal);
|
|
// System.out.println("实际总金额2\t"+usageQuantityTotal);
|
|
|
|
|
|
|
|
- if (syCostAllocation.getFabriccostIncludestax()!=null){
|
|
|
|
|
- syCostAllocation.setFabriccostIncludestax(syCostAllocation.getFabriccostIncludestax().add(usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP)));
|
|
|
|
|
- }else{
|
|
|
|
|
- syCostAllocation.setFabriccostIncludestax(usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
- }
|
|
|
|
|
- if (syCostAllocation.getFabriccostNotincludestax()!=null){
|
|
|
|
|
- syCostAllocation.setFabriccostNotincludestax(syCostAllocation.getFabriccostNotincludestax().add(notincludestaxTotal));
|
|
|
|
|
- }else{
|
|
|
|
|
- syCostAllocation.setFabriccostNotincludestax(notincludestaxTotal);
|
|
|
|
|
- }
|
|
|
|
|
- System.out.println("includestaxTotal\t"+includestaxTotal+" getFabriccostIncludestaxUsd "+syCostAllocation.getFabriccostIncludestaxUsd());
|
|
|
|
|
- if (syCostAllocation.getFabriccostIncludestaxUsd()!=null){
|
|
|
|
|
- syCostAllocation.setFabriccostIncludestaxUsd(syCostAllocation.getFabriccostIncludestaxUsd().add(includestaxTotal));
|
|
|
|
|
|
|
+ if (syCostAllocation.getFabriccostIncludestax()!=null){
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestax(syCostAllocation.getFabriccostIncludestax().add(usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP)));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestax(usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (syCostAllocation.getFabriccostNotincludestax()!=null){
|
|
|
|
|
+ syCostAllocation.setFabriccostNotincludestax(syCostAllocation.getFabriccostNotincludestax().add(notincludestaxTotal));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ syCostAllocation.setFabriccostNotincludestax(notincludestaxTotal);
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println("includestaxTotal\t"+includestaxTotal+" getFabriccostIncludestaxUsd "+syCostAllocation.getFabriccostIncludestaxUsd());
|
|
|
|
|
+ if (syCostAllocation.getFabriccostIncludestaxUsd()!=null){
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestaxUsd(syCostAllocation.getFabriccostIncludestaxUsd().add(includestaxTotal));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestaxUsd(includestaxTotal);
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
- syCostAllocation.setFabriccostIncludestaxUsd(includestaxTotal);
|
|
|
|
|
- }
|
|
|
|
|
- }else{
|
|
|
|
|
- if (syCostAllocation.getFabriccostIncludestax()==null){
|
|
|
|
|
- syCostAllocation.setFabriccostIncludestax(BigDecimal.ZERO);
|
|
|
|
|
- }
|
|
|
|
|
- if (syCostAllocation.getFabriccostNotincludestax()==null){
|
|
|
|
|
- syCostAllocation.setFabriccostNotincludestax(BigDecimal.ZERO);
|
|
|
|
|
- }
|
|
|
|
|
- if (syCostAllocation.getFabriccostIncludestaxUsd()==null){
|
|
|
|
|
- syCostAllocation.setFabriccostIncludestaxUsd(BigDecimal.ZERO);
|
|
|
|
|
|
|
+ if (syCostAllocation.getFabriccostIncludestax()==null){
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestax(BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (syCostAllocation.getFabriccostNotincludestax()==null){
|
|
|
|
|
+ syCostAllocation.setFabriccostNotincludestax(BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (syCostAllocation.getFabriccostIncludestaxUsd()==null){
|
|
|
|
|
+ syCostAllocation.setFabriccostIncludestaxUsd(BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
long startTime3 = System.currentTimeMillis();
|
|
long startTime3 = System.currentTimeMillis();
|