lishiqiang před 4 dny
rodič
revize
cc3938fed5

+ 1 - 1
ship-module-trade/ship-module-trade-biz/src/main/java/com/yc/ship/module/trade/controller/app/order/TradeOrderController.java

@@ -199,7 +199,7 @@ public class TradeOrderController {
 
             // 4. 构造7字节包头
             // 第1字节为加密标志(0-不加密),后6字节为数据包长度(包含加密标志位),不足6位在右边用空格补足
-            int packetLen = xmlBytes.length + 1;
+            int packetLen = xmlBytes.length;
             String lengthStr = String.format("%-6s", packetLen);
             String headerStr = "0" + lengthStr;
             byte[] headerBytes = headerStr.getBytes("GBK");

+ 10 - 4
ship-module-trade/ship-module-trade-biz/src/main/java/com/yc/ship/module/trade/service/invoice/impl/InvoiceGroupServiceImpl.java

@@ -879,6 +879,8 @@ public class InvoiceGroupServiceImpl implements InvoiceGroupService {
             BigDecimal taxExcludedAmount = BigDecimal.ZERO;
             BigDecimal taxExcludedAmounttotal = BigDecimal.ZERO;
             BigDecimal se = BigDecimal.ZERO;
+            BigDecimal tse = BigDecimal.ZERO;
+            BigDecimal tje = BigDecimal.ZERO;
             BigDecimal taxIncludedAmount = BigDecimal.ZERO;
             BigDecimal taxIncludedAmounttotal = BigDecimal.ZERO;
             if (inventoryList.isEmpty()) {
@@ -907,10 +909,12 @@ public class InvoiceGroupServiceImpl implements InvoiceGroupService {
                 taxExcludedAmount = taxIncludedAmount.divide(new BigDecimal(1).add(taxRate), 2, RoundingMode.HALF_UP);
                 taxExcludedAmounttotal = taxIncludedAmounttotal.divide(new BigDecimal(1).add(taxRate), 2, RoundingMode.HALF_UP);
                 //金额
+                tje = taxIncludedAmount.setScale(2, RoundingMode.HALF_UP);
                 detailObj.set("JE", taxIncludedAmount.setScale(2, RoundingMode.HALF_UP));
                 //税额
-                se = taxIncludedAmount.subtract(taxExcludedAmount);
-                detailObj.set("SE", se.setScale(2, RoundingMode.HALF_UP));
+                se = taxIncludedAmount.subtract(taxExcludedAmount).setScale(2, RoundingMode.HALF_UP);
+                tse =se;
+                detailObj.set("SE", se);
                 //扣除额
                 detailObj.set("KCE", "");
                 //行性质。0-正常行 1-折扣行 2-被折扣行
@@ -940,9 +944,11 @@ public class InvoiceGroupServiceImpl implements InvoiceGroupService {
                     //不含税金额
                     taxExcludedAmount = taxIncludedAmount.divide(new BigDecimal(1).add(taxRate), 2, RoundingMode.HALF_UP);
                     //金额
+                    tje = tje.add(taxIncludedAmount.setScale(2, RoundingMode.HALF_UP));
                     detailObj2.set("JE", taxIncludedAmount.setScale(2, RoundingMode.HALF_UP));
                     //税额
                     se = taxIncludedAmount.subtract(taxExcludedAmount);
+                    tse = tse.add(se.setScale(2, RoundingMode.HALF_UP));
                     detailObj2.set("SE", se.setScale(2, RoundingMode.HALF_UP));
                     //扣除额
                     detailObj2.set("KCE", "");
@@ -1013,9 +1019,9 @@ public class InvoiceGroupServiceImpl implements InvoiceGroupService {
                 }
             }
             //合计金额
-            reqObj.set("HJJE", taxExcludedAmounttotal.setScale(2, RoundingMode.HALF_UP));
+            reqObj.set("HJJE", tje);
             //合计税额
-            reqObj.set("HJSE", se.setScale(2, RoundingMode.HALF_UP));
+            reqObj.set("HJSE", tse);
             if (StringUtils.isNotBlank(remark)) {
                 //备注
                 reqObj.set("BZ", remark);