Browse Source

销售报价单/销售订单-有关折扣计算修改

jingbb 5 months ago
parent
commit
c1ab68eddc

+ 2 - 2
src/views/saleCode/quotation/components/quotationFormForm.vue

@@ -666,7 +666,7 @@
         if(prop.col.key=='purchasePrice'||prop.col.key=='taxRate'||prop.col.key=='tariff'||prop.col.key=='discount'||prop.col.key=='grossMargin'||prop.col.key=='customerCommision'||prop.col.key=='intermediatorCommission'){
           if(prop.row.purchasePrice&&prop.row.taxRate&&prop.row.tariff&&prop.row.discount&&prop.row.grossMargin&&prop.row.customerCommision&&prop.row.intermediatorCommission){
             //汇率默认为1
-            var num= prop.row.purchasePrice/1*(1+prop.row.taxRate/100)*(1+prop.row.tariff/100)*(prop.row.discount/100)/(1-prop.row.grossMargin/100-prop.row.customerCommision/100-prop.row.intermediatorCommission/100)
+            var num= prop.row.purchasePrice/1*(1+prop.row.taxRate/100)*(1+prop.row.tariff/100)*(1-prop.row.discount/100)/(1-prop.row.grossMargin/100-prop.row.customerCommision/100-prop.row.intermediatorCommission/100)
             prop.row.salePrice = num.toFixed(2)
             if(prop.row.quantity){
               prop.row.taxAmount =  (prop.row.salePrice*prop.row.quantity).toFixed(2)
@@ -685,7 +685,7 @@
                 item.discount = formData.custumerDiscount
                 if(item.purchasePrice&&item.taxRate&&item.tariff&&item.discount&&item.grossMargin&&item.customerCommision&&item.intermediatorCommission){
                 //汇率默认为1
-                var num= item.purchasePrice/1*(1+item.taxRate/100)*(1+item.tariff/100)*(item.discount/100)/(1-item.grossMargin/100-item.customerCommision/100-item.intermediatorCommission/100)
+                var num= item.purchasePrice/1*(1+item.taxRate/100)*(1+item.tariff/100)*(1-item.discount/100)/(1-item.grossMargin/100-item.customerCommision/100-item.intermediatorCommission/100)
                 item.salePrice = num.toFixed(2)
                 if(item.quantity){
                   item.taxAmount =  (item.salePrice*item.quantity).toFixed(2)

+ 2 - 2
src/views/saleCode/salesOrder/components/SlaeOrderFormForm.vue

@@ -532,7 +532,7 @@
           item.sourceType  = 'Quo'+item.childId
           item.taxPrice = item.salePrice
           if(formData.doubleDiscount&&formData.doubleDiscount!==''){
-            item.discountedPrice = (Number(item.taxPrice) *(Number(item.discount)/100))
+            item.discountedPrice = (Number(item.taxPrice) *(1-Number(item.discount)/100))
           }else{
             item.discountedPrice = Number(item.taxPrice)
           }
@@ -568,7 +568,7 @@
         var num = 0
         detail.map(item=>{
           if(formData.doubleDiscount&&formData.doubleDiscount!==''){
-            item.discountedPrice = ((Number(item.taxPrice) *(Number(formData.doubleDiscount)/100))).toFixed(2)
+            item.discountedPrice = ((Number(item.taxPrice) *(1-Number(formData.doubleDiscount)/100))).toFixed(2)
           }else{
             item.discountedPrice = Number(item.taxPrice)
           }