yuansh il y a 1 mois
Parent
commit
51662e97e6

+ 5 - 3
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurOrderController.java

@@ -446,7 +446,8 @@ public class PurOrderController {
             String code = o.getBillCode();
             String version = o.getVersion();
 
-            if (status != null && status == 1) {
+            if (status != null && status.equals(1)) {
+//            if (status != null && status == 1) {
                 sb.append("单号" + code).append("客户已确认,无法取消提交;");
                 continue;
             }
@@ -536,7 +537,8 @@ public class PurOrderController {
                 sb.append("单据编码" + code).append("还未提交,无法确认;");
                 continue;
             }
-            if (getStatus != null && getStatus==1) {
+            if (getStatus != null && getStatus.equals(1)) {
+//            if (getStatus != null && getStatus==1) {
                 sb.append("单据编码" + code).append("已确认,请勿再次确认;");
                 continue;
             }
@@ -1062,7 +1064,7 @@ public class PurOrderController {
                             BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
 
                             BigDecimal getSalePrice = product.getTaxPrice() == null ? BigDecimal.ZERO : product.getTaxPrice();
-                            BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);//折前价
+                            BigDecimal setTaxPrice = getSalePrice.divide(dis, 2, BigDecimal.ROUND_HALF_UP);//折前价
 //                            BigDecimal quantity = product.getQuantity() == null ? BigDecimal.ZERO : product.getQuantity();
 
                             product.setTaxPrice(setTaxPrice);

+ 3 - 3
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java

@@ -896,17 +896,17 @@ public class SaleInvoiceController {
 
                             SaleQuotationProduct saleQuotationProduct = saleQuotationProductList.stream().filter(e -> e.getId().equals(saleOrderProduct.getSourceId())).findFirst().orElse(null);
 
-                            if (oConvertUtils.isNotEmpty(saleQuotationProduct.getDiscount())) {
+                            if (saleQuotationProduct !=null && oConvertUtils.isNotEmpty(saleQuotationProduct.getDiscount())) {
                                 o.setDiscountText(saleQuotationProduct.getDiscount().intValue() + "%");
                             }
-                            if (oConvertUtils.isNotEmpty(saleQuotationProduct.getSalePrice())) {
+                            if (saleQuotationProduct !=null && oConvertUtils.isNotEmpty(saleQuotationProduct.getSalePrice())) {
 
 
                                 BigDecimal dic = saleQuotationProduct.getDiscount() ==null?BigDecimal.ZERO:saleQuotationProduct.getDiscount();
                                 BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
 
                                 BigDecimal getSalePrice = saleQuotationProduct.getSalePrice() == null ? BigDecimal.ZERO : saleQuotationProduct.getSalePrice();
-                                BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);
+                                BigDecimal setTaxPrice = getSalePrice.divide(dis, 2, BigDecimal.ROUND_HALF_UP);
                                 o.setTaxPrice(setTaxPrice);
 
 //                                o.setTaxPrice(saleQuotationProduct.getSalePrice());

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java

@@ -1132,7 +1132,7 @@ public class SaleOrderController {
                                     BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
 
                                     BigDecimal getSalePrice = a.getSalePrice() == null ? BigDecimal.ZERO : a.getSalePrice();
-                                    BigDecimal setTaxPrice = getSalePrice.divide(dis, 4, BigDecimal.ROUND_HALF_UP);
+                                    BigDecimal setTaxPrice = getSalePrice.divide(dis, 2, BigDecimal.ROUND_HALF_UP);
 
                                     o.setTaxPrice(setTaxPrice);
                                 }

+ 7 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java

@@ -666,6 +666,13 @@ public class SaleQuotationController {
                     if (o.getDiscount() != null && o.getDiscount().intValue() != 0){
                         o.setDiscountText(String.valueOf(o.getDiscount()));
                     }
+
+                    BigDecimal dic = o.getDiscount() ==null?BigDecimal.ZERO:o.getDiscount();
+                    BigDecimal dis = (new BigDecimal("100").subtract(dic)).divide(new BigDecimal("100"));
+
+                    BigDecimal getSalePrice = o.getSalePrice() == null ? BigDecimal.ZERO : o.getSalePrice();
+                    BigDecimal setTaxPrice = getSalePrice.divide(dis, 2, BigDecimal.ROUND_HALF_UP);//折前价
+                    o.setSalePrice(setTaxPrice);
                 }
                 saleQuotation.setOrderMoney(orderMoney.setScale(2));
 

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProduct.java

@@ -160,6 +160,8 @@ public class SaleQuotationProduct implements Serializable {
 	@Excel(name = "销售单价(sale price)", width = 15)
     @ApiModelProperty(value = "销售单价(sale price)")
     private java.math.BigDecimal salePrice;
+	//折扣前价格
+    private java.math.BigDecimal taxPriceOriginal;
 	/**上一次报价(last price)*/
 	@Excel(name = "上一次报价(last price)", width = 15)
     @ApiModelProperty(value = "上一次报价(last price)")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationProductHis.java

@@ -194,4 +194,6 @@ public class SaleQuotationProductHis implements Serializable {
     private BigDecimal taxPriceGys;//供应商采购单价
     @TableField(exist = false)
     private BigDecimal preDiscountPrice;//折前单价(计算)
+    //折扣前价格
+    private java.math.BigDecimal taxPriceOriginal;
 }