|
|
@@ -2314,36 +2314,36 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
jsonObject.put("IORIMONEY",item.getTotal().multiply(u8Price).setScale(2, RoundingMode.HALF_UP));//改成使用报关单价*成衣参考单价
|
|
|
|
|
|
|
|
|
-// BigDecimal total=new BigDecimal(oConvertUtils.getString(item.getTotal()));//数量
|
|
|
-// BigDecimal nflat=new BigDecimal(oConvertUtils.getString(jsonObject1.get("IEXCHRATE")));//汇率
|
|
|
-// BigDecimal taxPrice=new BigDecimal(oConvertUtils.getString(u8Price));//原币含税单价
|
|
|
-// BigDecimal totalPrice=total.multiply(taxPrice).setScale(2,RoundingMode.HALF_UP);//含税单价*入库数量=总价
|
|
|
-// BigDecimal itaxrate=new BigDecimal("1.13");//税率
|
|
|
-// if (account.equals("101")){
|
|
|
-// itaxrate=new BigDecimal("1");//税率
|
|
|
-// }
|
|
|
-// BigDecimal ioricost=taxPrice.divide(itaxrate,4, RoundingMode.HALF_UP);//原币无税单价
|
|
|
-// BigDecimal totalIoricost=totalPrice.divide(itaxrate,2,RoundingMode.HALF_UP);//原币无税金额
|
|
|
-// BigDecimal taxrate2=totalPrice.subtract(totalIoricost);//税额
|
|
|
+ BigDecimal total=new BigDecimal(oConvertUtils.getString(item.getTotal()));//数量
|
|
|
+ BigDecimal nflat=new BigDecimal(oConvertUtils.getString(jsonObject1.get("IEXCHRATE")));//汇率
|
|
|
+ BigDecimal taxPrice=new BigDecimal(oConvertUtils.getString(u8Price));//原币含税单价
|
|
|
+ BigDecimal totalPrice=total.multiply(taxPrice).setScale(2,RoundingMode.HALF_UP);//含税单价*入库数量=总价
|
|
|
+ BigDecimal itaxrate=new BigDecimal("1.13");//税率
|
|
|
+ if (account.equals("101")){
|
|
|
+ itaxrate=new BigDecimal("1");//税率
|
|
|
+ }
|
|
|
+ BigDecimal ioricost=taxPrice.divide(itaxrate,4, RoundingMode.HALF_UP);//原币无税单价
|
|
|
+ BigDecimal totalIoricost=totalPrice.divide(itaxrate,2,RoundingMode.HALF_UP);//原币无税金额
|
|
|
+ BigDecimal taxrate2=totalPrice.subtract(totalIoricost);//税额
|
|
|
//
|
|
|
// jsonObject.put("MCPRICE","1");//不自动计算金额
|
|
|
// //原币
|
|
|
-// jsonObject.put("IORITAXCOST",oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
-// jsonObject.put("IORICOST",oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
-// jsonObject.put("IORIMONEY",oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
-// jsonObject.put("IORISUM",oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币含税金额
|
|
|
-// jsonObject.put("IORITAXPRICE",oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
+ jsonObject.put("IORITAXCOST",oConvertUtils.getString(taxPrice.setScale(4,RoundingMode.HALF_UP)));//原币含税单价
|
|
|
+ jsonObject.put("IORICOST",oConvertUtils.getString(ioricost.setScale(4,RoundingMode.HALF_UP)));//原币无税单价
|
|
|
+ jsonObject.put("IORIMONEY",oConvertUtils.getString(totalIoricost.setScale(2,RoundingMode.HALF_UP)));//原币无税金额
|
|
|
+ jsonObject.put("IORISUM",oConvertUtils.getString(totalPrice.setScale(2,RoundingMode.HALF_UP)));//原币含税金额
|
|
|
+ jsonObject.put("IORITAXPRICE",oConvertUtils.getString(taxrate2.setScale(2,RoundingMode.HALF_UP)));//原币税额
|
|
|
//// System.out.println("taxPrice\t"+taxPrice.setScale(2,RoundingMode.HALF_UP)
|
|
|
//// +"\tioricost\t"+ioricost.setScale(2,RoundingMode.HALF_UP)
|
|
|
//// +"\ttotalIoricost\t"+totalIoricost.setScale(2,RoundingMode.HALF_UP)
|
|
|
//// +"\ttotalPrice\t"+totalPrice.setScale(2,RoundingMode.HALF_UP)
|
|
|
//// +"\ttaxrate2\t"+taxrate2.setScale(2,RoundingMode.HALF_UP));
|
|
|
// //本币
|
|
|
-// jsonObject.put("INATTAXPRICE",oConvertUtils.getString(taxPrice.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币含税单价
|
|
|
-// jsonObject.put("ICOST",oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
-// jsonObject.put("IMONEY",oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币金额
|
|
|
-// jsonObject.put("ITAXPRICE",oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
-// jsonObject.put("ISUM",oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币含税金额
|
|
|
+ jsonObject.put("INATTAXPRICE",oConvertUtils.getString(taxPrice.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币含税单价
|
|
|
+ jsonObject.put("ICOST",oConvertUtils.getString(ioricost.multiply(nflat).setScale(4,RoundingMode.HALF_UP)));//本币无税单价
|
|
|
+ jsonObject.put("IMONEY",oConvertUtils.getString(totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币金额
|
|
|
+ jsonObject.put("ITAXPRICE",oConvertUtils.getString(taxrate2.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币税额
|
|
|
+ jsonObject.put("ISUM",oConvertUtils.getString(totalPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)));//本币含税金额
|
|
|
// System.out.println("1taxPrice\t"+taxPrice.multiply(nflat).setScale(2,RoundingMode.HALF_UP)
|
|
|
// +"\t1ioricost\t"+ioricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)
|
|
|
// +"\t1totalIoricost\t"+totalIoricost.multiply(nflat).setScale(2,RoundingMode.HALF_UP)
|
|
|
@@ -2364,19 +2364,20 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
jsonObject.put("CDEFINE33",item.getDeclarationName());//存货名称
|
|
|
jsonArrays.add(jsonObject);
|
|
|
}
|
|
|
-// dzMoney=dzMoney.setScale(2, RoundingMode.HALF_UP);
|
|
|
-// dzUsdMoney=dzUsdMoney.setScale(2, RoundingMode.HALF_UP);
|
|
|
-// System.out.println("dzMoney\t"+dzMoney);
|
|
|
-// System.out.println("u8Money\t"+u8Money);
|
|
|
-// System.out.println("dzUsdMoney\t"+dzUsdMoney);
|
|
|
-// System.out.println("u8UsdMoney\t"+u8UsdMoney);
|
|
|
-// if(dzMoney.compareTo(u8Money)!=0){
|
|
|
-// BigDecimal dividePrice =dzMoney.subtract(u8Money);
|
|
|
-// BigDecimal ioriMoney=new BigDecimal(jsonArrays.getJSONObject(jsonArrays.size()-1).get("IORIMONEY").toString());
|
|
|
-//// System.out.println("dividePrice\t"+dividePrice);
|
|
|
-//// System.out.println("ioriMoney\t"+ioriMoney);
|
|
|
-// jsonArrays.getJSONObject(jsonArrays.size()-1).put("IORIMONEY",ioriMoney.add(dividePrice));
|
|
|
-// }
|
|
|
+ dzMoney=dzMoney.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ dzUsdMoney=dzUsdMoney.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ System.out.println("dzMoney\t"+dzMoney);
|
|
|
+ System.out.println("u8Money\t"+u8Money);
|
|
|
+ System.out.println("dzUsdMoney\t"+dzUsdMoney);
|
|
|
+ System.out.println("u8UsdMoney\t"+u8UsdMoney);
|
|
|
+ if(dzMoney.compareTo(u8Money)!=0){
|
|
|
+ BigDecimal dividePrice =dzMoney.subtract(u8Money);
|
|
|
+ BigDecimal ioriMoney=new BigDecimal(jsonArrays.getJSONObject(jsonArrays.size()-1).get("IORIMONEY").toString());
|
|
|
+// System.out.println("dividePrice\t"+dividePrice);
|
|
|
+// System.out.println("ioriMoney\t"+ioriMoney);
|
|
|
+ jsonArrays.getJSONObject(jsonArrays.size()-1).put("MCPRICE","1");//不自动计算金额
|
|
|
+ jsonArrays.getJSONObject(jsonArrays.size()-1).put("IORIMONEY",ioriMoney.add(dividePrice));
|
|
|
+ }
|
|
|
// jsonObject.put("IORIMONEY",item.getUnitPrice());//金额
|
|
|
jsonObject1.put("DETAILList",jsonArrays);
|
|
|
if (syPackingListTailoring.getOmpoAccount().equals(account) && maps.get("isAhaa").toString().equals("国内") ){//国内托书的初始账套不进行推送
|
|
|
@@ -2425,6 +2426,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
JSONObject jsonObject=(JSONObject)j;
|
|
|
JSONObject jsonObject1=new JSONObject();
|
|
|
jsonObject1.put("CACCID",account);
|
|
|
+ jsonObject1.put("CSVMEMO",listTailorings.get(0).getShippingOrderNumber());
|
|
|
jsonObject1.put("CMAKER","进出口平台管理员");
|
|
|
jsonObject1.put("CVOUCHCODE_U8",jsonObject.get("CVOUCHCODE"));
|
|
|
jsonObject1.put("DDATE",jsonObject.get("DDATE"));
|
|
|
@@ -2454,8 +2456,6 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
return "推送成功";
|
|
|
}
|
|
|
@@ -2510,6 +2510,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
|
|
|
JSONObject jsonObject1=new JSONObject();
|
|
|
jsonObject1.put("CACCID",account);
|
|
|
jsonObject1.put("CMAKER","进出口平台管理员");
|
|
|
+ jsonObject1.put("CSVMEMO",packingListTailoring.getShippingOrderNumber());
|
|
|
jsonObject1.put("CVOUCHCODE_U8",documentNo);
|
|
|
jsonObject1.put("DDATE",packingListTailoring.getTheFinalShippingDate().substring(0,10));
|
|
|
jsonArrays2.add(jsonObject1);
|