|
|
@@ -1492,6 +1492,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
int num1=1;
|
|
|
List<String> moDetailsIds=new ArrayList<>();//记录进来的数据
|
|
|
Map<String,BigDecimal> bigDecimalMap=new HashMap<>();//k:委外采购订单id v:合计数量
|
|
|
+ Map<String,BigDecimal> priceDecimalMap=new HashMap<>();//k:委外采购订单id v:合计数量
|
|
|
Map<String,Boolean> booleanMap=new HashMap<>();
|
|
|
if(mapt.get("account").equals("101")){//101账套
|
|
|
for (SyPackingListFabricItem item : main.getSyPackingListFabricItem()){
|
|
|
@@ -1512,10 +1513,25 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
bigDecimalMap.put(itemKey,item.getActualDeclaredQuantity());
|
|
|
}
|
|
|
}
|
|
|
+ if(priceDecimalMap.containsKey(itemKey)){//再次
|
|
|
+ if(item.getMasterMetering().equals("KG")){
|
|
|
+ priceDecimalMap.put(itemKey,priceDecimalMap.get(itemKey).add(item.getNetWeight().multiply(item.getPrice()).setScale(2,BigDecimal.ROUND_HALF_UP)));
|
|
|
+ }else{
|
|
|
+ priceDecimalMap.put(itemKey,priceDecimalMap.get(itemKey).add(item.getActualDeclaredQuantity().multiply(item.getPrice()).setScale(2,BigDecimal.ROUND_HALF_UP)));
|
|
|
+ }
|
|
|
+ }else{//初次
|
|
|
+ if(item.getMasterMetering().equals("KG")){
|
|
|
+ priceDecimalMap.put(itemKey,item.getNetWeight().multiply(item.getPrice()).setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
+ }else{
|
|
|
+ priceDecimalMap.put(itemKey,item.getActualDeclaredQuantity().multiply(item.getPrice()).setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- ////System.out.println("bigDecimalMap12345\n"+bigDecimalMap);
|
|
|
+ System.out.println("priceDecimalMap\n"+priceDecimalMap);
|
|
|
+ System.out.println("bigDecimalMap\n"+bigDecimalMap);
|
|
|
}
|
|
|
}
|
|
|
+ BigDecimal iquantity=new BigDecimal("0");
|
|
|
for (SyPackingListFabricItem item : main.getSyPackingListFabricItem()){
|
|
|
String itemKey=item.getInventoryCode()+item.getPlanLotNumber()+item.getColour()+item.getWidth()+item.getSyOrderDataItemId()+item.getGramWeight();
|
|
|
if(mapt.get("account").equals("101")&&booleanMap.containsKey(itemKey)){
|
|
|
@@ -1858,33 +1874,45 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
if(item.getAccount().equals("102")&&mapt.get("account").equals("102")){//销售发票
|
|
|
mapItem6.put("ITAXUNITPRICE",item.getPrice());//改成使用报关单价
|
|
|
}
|
|
|
+ System.out.println("getMasterMetering\t"+item.getMasterMetering());
|
|
|
+ iquantity=new BigDecimal(oConvertUtils.getString(mapItem5.get("IQUANTITY")));
|
|
|
+ BigDecimal u8Price=new BigDecimal(mapItem5.get("IORITAXCOST").toString());
|
|
|
+
|
|
|
+ if(mapt.get("account").equals("101")&&(item.getInventoryCcode().indexOf("04")!=-1||item.getInventoryCcode().indexOf("03")!=-1)){
|
|
|
+ mapItem5.put("IORIMONEY",priceDecimalMap.get(itemKey).setScale(2, RoundingMode.HALF_UP));//改成使用报关单价*成衣参考单价
|
|
|
+ }
|
|
|
|
|
|
BigDecimal total=new BigDecimal(oConvertUtils.getString(mapItem5.get("IQUANTITY")));//数量
|
|
|
BigDecimal nflat=new BigDecimal(oConvertUtils.getString(map5.get("IEXCHRATE")));//汇率
|
|
|
BigDecimal taxPrice=new BigDecimal(oConvertUtils.getString(item.getPrice()));//原币含税单价
|
|
|
|
|
|
BigDecimal totalPrice=total.multiply(taxPrice).setScale(2,RoundingMode.HALF_UP);//含税单价*入库数量=总价
|
|
|
- BigDecimal itaxrate=new BigDecimal("1");//税率
|
|
|
-
|
|
|
+ BigDecimal itaxrate=new BigDecimal(1);//税率
|
|
|
+ if(!mapt.get("account").equals("101")){
|
|
|
+ itaxrate=new BigDecimal(1.13);//税率
|
|
|
+ }
|
|
|
BigDecimal ioricost=taxPrice.divide(itaxrate,4, RoundingMode.HALF_UP);//原币无税单价
|
|
|
BigDecimal totalIoricost=totalPrice.divide(itaxrate,2,RoundingMode.HALF_UP);//原币无税金额
|
|
|
BigDecimal taxrate2=totalPrice.subtract(totalIoricost);//税额
|
|
|
|
|
|
// mapItem5.put("MCPRICE","1");//不自动计算金额
|
|
|
// //原币
|
|
|
-// mapItem5.put("IORITAXCOST", oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
-// mapItem5.put("IORICOST", oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
-// mapItem5.put("IORIMONEY", oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
-// mapItem5.put("IORISUM", oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币含税金额
|
|
|
-// mapItem5.put("IORITAXPRICE", oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
+ mapItem5.put("IORITAXCOST", oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
+ mapItem5.put("IORICOST", oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
+ mapItem5.put("IORIMONEY", oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
+ if(mapt.get("account").equals("101")&&(item.getInventoryCcode().indexOf("04")!=-1||item.getInventoryCcode().indexOf("03")!=-1)){
|
|
|
+ mapItem5.put("IORIMONEY",priceDecimalMap.get(itemKey).setScale(2, RoundingMode.HALF_UP));//改成使用报关单价*成衣参考单价
|
|
|
+ }
|
|
|
+ mapItem5.put("IORISUM", oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币含税金额
|
|
|
+ mapItem5.put("IORITAXPRICE", oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
//
|
|
|
// //本币
|
|
|
-// mapItem5.put("INATTAXPRICE", oConvertUtils.getString(taxPrice.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币含税单价
|
|
|
-// mapItem5.put("ICOST", oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
-// mapItem5.put("IMONEY", oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币金额
|
|
|
-// mapItem5.put("ITAXPRICE", oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
-// mapItem5.put("ISUM", oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币含税金额
|
|
|
-
|
|
|
+ mapItem5.put("INATTAXPRICE", oConvertUtils.getString(taxPrice.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币含税单价
|
|
|
+ mapItem5.put("ICOST", oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
+ mapItem5.put("IMONEY", oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币金额
|
|
|
+ mapItem5.put("ITAXPRICE", oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
+ mapItem5.put("ISUM", oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币含税金额
|
|
|
+ mapItem5.put("MCPRICE","1");//不自动计算金额
|
|
|
|
|
|
mapItem5.put("CINVCODE",item.getInventoryCode());//存货编码
|
|
|
|
|
|
@@ -1897,7 +1925,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
mapItems5.add(mapItem5);
|
|
|
mapItems6.add(mapItem6);
|
|
|
}
|
|
|
-
|
|
|
map.put("DETAILList",mapItems);//明细集合
|
|
|
mapList.add(map);
|
|
|
if(mapItems2!=null&&mapItems2.size()!=0){
|
|
|
@@ -1911,6 +1938,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
map4.put("DETAILList",mapItems4);//明细集合
|
|
|
mapList4.add(map4);
|
|
|
map5.put("DETAILList",mapItems5);//明细集合
|
|
|
+ System.out.println("采购发票map5\t"+map5);
|
|
|
mapList5.add(map5);
|
|
|
map6.put("DETAILList",mapItems6);//明细集合
|
|
|
mapList6.add(map6);
|
|
|
@@ -1925,7 +1953,6 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
mapt.put("itemSort",mapSort);
|
|
|
//System.out.println("mapsort\n"+mapSort);
|
|
|
}
|
|
|
-
|
|
|
mapt.put("number","two");//销售订单id
|
|
|
if(mapList2!=null&&mapList2.size()>0){
|
|
|
// text(mapList2,"材料出库单");
|
|
|
@@ -2891,17 +2918,17 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
BigDecimal totalIoricost=totalPrice.divide(itaxrate,2,RoundingMode.HALF_UP);//原币无税金额
|
|
|
BigDecimal taxrate2=totalPrice.subtract(totalIoricost);//税额
|
|
|
|
|
|
-// jsonObject.put("MCPRICE","1");//不自动计算金额
|
|
|
-// jsonObject.put("IUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
-// jsonObject.put("ITAXUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
-// jsonObject.put("IMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
-// jsonObject.put("ITAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
-// jsonObject.put("ISUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币价税合计
|
|
|
+ jsonObject.put("MCPRICE","1");//不自动计算金额
|
|
|
+ jsonObject.put("IUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
+ jsonObject.put("ITAXUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
+ jsonObject.put("IMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
+ jsonObject.put("ITAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
+ jsonObject.put("ISUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币价税合计
|
|
|
//
|
|
|
-// jsonObject.put("INATUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
-// jsonObject.put("INATMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币无税金额
|
|
|
-// jsonObject.put("INATTAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
-// jsonObject.put("INATSUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币价税合计
|
|
|
+ jsonObject.put("INATUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
+ jsonObject.put("INATMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币无税金额
|
|
|
+ jsonObject.put("INATTAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
+ jsonObject.put("INATSUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币价税合计
|
|
|
|
|
|
if(item.getMasterMetering()!=null&&item.getMasterMetering().equals("KG")){
|
|
|
jsonObject.put("CDEFINE23","千克");//报关单位
|
|
|
@@ -3096,17 +3123,17 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
BigDecimal totalIoricost=totalPrice.divide(itaxrate,2,RoundingMode.HALF_UP);//原币无税金额
|
|
|
BigDecimal taxrate2=totalPrice.subtract(totalIoricost);//税额
|
|
|
|
|
|
-// jsonObject.put("MCPRICE","1");//不自动计算金额
|
|
|
-// jsonObject.put("IUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
-// jsonObject.put("ITAXUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
-// jsonObject.put("IMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
-// jsonObject.put("ITAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
-// jsonObject.put("ISUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币价税合计
|
|
|
-//
|
|
|
-// jsonObject.put("INATUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
-// jsonObject.put("INATMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币无税金额
|
|
|
-// jsonObject.put("INATTAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
-// jsonObject.put("INATSUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币价税合计
|
|
|
+ jsonObject.put("MCPRICE","1");//不自动计算金额
|
|
|
+ jsonObject.put("IUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
+ jsonObject.put("ITAXUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
+ jsonObject.put("IMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
+ jsonObject.put("ITAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
+ jsonObject.put("ISUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币价税合计
|
|
|
+
|
|
|
+ jsonObject.put("INATUNITPRICE", org.jeecg.common.util.oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
+ jsonObject.put("INATMONEY", org.jeecg.common.util.oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币无税金额
|
|
|
+ jsonObject.put("INATTAX", org.jeecg.common.util.oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
+ jsonObject.put("INATSUM", org.jeecg.common.util.oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币价税合计
|
|
|
|
|
|
if(item.getMasterMetering()!=null&&item.getMasterMetering().equals("KG")){
|
|
|
jsonObject.put("CDEFINE23","千克");//报关单位
|
|
|
@@ -3332,8 +3359,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
jsonObject.put("AUTOID_PO",map.get("AutoID"));
|
|
|
jsonObject.put("IORITAXCOST",item.getPrice());//改成使用报关单价
|
|
|
BigDecimal u8Price=new BigDecimal(jsonObject.get("IORITAXCOST").toString());
|
|
|
- dzMoney=dzMoney.add(iquantity.multiply(u8Price).setScale(2,RoundingMode.HALF_UP));//单证合计
|
|
|
- u8Money=u8Money.add(u8Price.multiply(iquantity).setScale(2, RoundingMode.HALF_UP));//单证合计
|
|
|
+ dzMoney=dzMoney.add(iquantity.multiply(u8Price).setScale(4,RoundingMode.HALF_UP));//单证合计
|
|
|
+ u8Money=u8Money.add(u8Price.multiply(iquantity).setScale(4, RoundingMode.HALF_UP));//单证合计
|
|
|
jsonObject.put("IORIMONEY",iquantity.multiply(u8Price).setScale(2, RoundingMode.HALF_UP));//改成使用报关单价*成衣参考单价
|
|
|
getcFree(jsonObject,map);
|
|
|
// jsonObject.put("CDEFINE28",item.getSmallPo());//小po
|
|
|
@@ -3383,6 +3410,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
|
|
|
BigDecimal dividePrice =dzMoney.subtract(u8Money);
|
|
|
BigDecimal ioriMoney=new BigDecimal(jsonArrays.getJSONObject(jsonArrays.size()-1).get("IORIMONEY").toString());
|
|
|
jsonArrays.getJSONObject(jsonArrays.size()-1).put("IORIMONEY",ioriMoney.add(dividePrice));
|
|
|
+ jsonArrays.getJSONObject(jsonArrays.size()-1).put("MCPRICE","1");//不自动计算金额
|
|
|
}
|
|
|
// jsonObject.put("IORIMONEY",item.getUnitPrice());//金额
|
|
|
jsonObject1.put("DETAILList",jsonArrays);
|