瀏覽代碼

修改成本

huangzhiguo 1 年之前
父節點
當前提交
560a1baa89

+ 9 - 0
src/main/java/com/caimei/modules/order/entity/NewOrderProduct.java

@@ -88,6 +88,7 @@ public class NewOrderProduct extends DataEntity<NewOrderProduct> {
     // *****************  虚拟字段
     private Integer deliveryNum; // 发货数量
     private Integer outStoreTimes;  // 发货批次
+    private Double costPriceTax;  // 成本价 不含税
     private Double costPrice; // 成本价(快照商品成本价格)
     private Double organizeCostPrice; // 集团成本价
     private Double cmCostPrice; // 采美成本价
@@ -647,6 +648,14 @@ public class NewOrderProduct extends DataEntity<NewOrderProduct> {
         this.outStoreTimes = outStoreTimes;
     }
 
+    public Double getCostPriceTax() {
+        return costPriceTax;
+    }
+
+    public void setCostPriceTax(Double costPriceTax) {
+        this.costPriceTax = costPriceTax;
+    }
+
     public Double getCostPrice() {
         return costPrice;
     }

+ 4 - 1
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -527,7 +527,10 @@ public class CmPayShopController extends BaseController {
         shopOrder.setModifyShouldPayNote(modifyShouldPayNote);  //备注
         shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());  //修改人的用户id
         shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));  //修改时间
-        double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee() - postFee; // + shopOrder.getShopTaxFee();
+        double shouldPayShopAmount = shopOrder.getShopProductAmount();
+        if (null != shopOrder.getShopPostFee()) {
+            shouldPayShopAmount += (shopOrder.getShopPostFee() - postFee);
+        }
         if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
             shopOrder.setPayStatus("3");
         }

+ 2 - 2
src/main/java/com/caimei/modules/order/web/CmShopOrderController.java

@@ -222,9 +222,9 @@ public class CmShopOrderController extends BaseController {
         for (NewOrderProduct p : list.get(0).getNewOrderProducts()) {
             Double newCostPrice = 0d;
             newCostPrice = p.getCostPrice();
-            if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
+            /*if ("0".equals(p.getIncludedTax()) && null != p.getTaxRate() && p.getTaxRate() > 0d) {
                 p.setCostPrice(MathUtil.div(p.getCostPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
-            }
+            }*/
             p.setNewCostPrice(newCostPrice);
         }
         BigDecimal payShopOtherFee = cmPayShopRecordDao.findPayShopOtherFee(newShopOrder.getShopOrderID());

+ 1 - 0
src/main/resources/mappings/modules/order/OrderProductMapper.xml

@@ -561,6 +561,7 @@
                cs.organizeId      AS organizeId,
                cs.unit as productUnit,
                (cop.discountPrice - cop.costPrice - cop.cmCostPrice) as brokerage,
+               cop.costPriceTax            AS costPriceTax,
                cop.costPrice               AS costPrice,
                ifnull(cop.organizeCostPrice, 0)       AS organizeCostPrice,
                ifnull(cop.cmCostPrice, 0)             AS cmCostPrice,

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayShopChange.jsp

@@ -241,7 +241,7 @@
                             <td width="40%" id="productName${index.index}">${product.name}</td>
                             <td width="30%"><input id="costPrice" style="width: 80px;float: left"
                                                    name="newOrderProducts[${index.index}].costPrice"
-                                                   value="${product.costPrice}"
+                                                   value="${product.costPriceTax}"
                                                    onchange="changeShouldPay(this,${index.index})"/>
                                 <c:if test="${product.includedTax != null and product.includedTax != '' and product.includedTax ne 2}">
                                     <label style="color: red">