Skip to content

Latest commit

 

History

History
64 lines (64 loc) · 1.82 KB

story.org

File metadata and controls

64 lines (64 loc) · 1.82 KB

税额计算 含折扣

映射关系

{ taxRate:”consolidatedTaxRate”, taxAmount:”invoiceTotalPriceTax”, tax:”invoiceTotalTax”, // invoiceTotalPriceTax * consolidatedTaxRate / (1 +consolidatedTaxRate) amountTaxFree:’invoiceTotalPrice’, // invoiceTotalPriceTax - invoiceTotalTax.toFixed(2) bonusAmount:’discountAmount || 0’, bonusTax:”( discountAmount || 0 ) * consolidatedTaxRate / (1 + consolidatedTaxRate )”, bonusAmountTaxFree:”( discountAmount || 0 ) - (( discountAmount || 0 ) * consolidatedTaxRate / (1 + consolidatedTaxRate )).toFixed(2)”, realAmount:”invoiceTotalPriceTax + ( discountAmount || 0 )”, realTax:”( invoiceTotalPriceTax + ( discountAmount || 0 )) * consolidatedTaxRate / (1 + consolidatedTaxRate )”, realAmountTaxTree:”( invoiceTotalPriceTax + ( discountAmount || 0 )) - (( invoiceTotalPriceTax + ( discountAmount || 0 )) * consolidatedTaxRate / (1 + consolidatedTaxRate )).toFixed(2)”, }

数据

{ consolidatedTaxRate:0.09, invoiceTotalPriceTax: 1000000, invoiceTotalTax: 82568.81, invoiceTotalPrice: 917431.19, discountAmount: -200000, }

预期

{ taxRate:0.09, taxAmount:1000000, tax:82568.81, amountTaxFree:917431.19, bonusAmount:-200000, bonusTax: -16513.761467889908, bonusAmountTaxFree:-183486.24, realAmount:800000, realTax:66055.04587155963, realAmountTaxTree:733944.95, }

rule 中支持字符串

映射关系

{ currentType:”partyKind || ‘MAIN’”, oppositeType:’oppositeKind || “REBATE”’, otherType:’otherKind || “REBATE”’, }

数据

{ partyKind:’REBATE’, oppositeKind:’MAIN’, }

预期参数

{ currentType:[“partyKind”], oppositeType:[‘oppositeKind’], otherType:[‘otherKind’] }

预期结果

{ currentType:’REBATE’, oppositeType:’MAIN’, otherType:’REBATE’, }

rule 中支持内部函数

映射关系

数据

预期参数

预期结果