voucher-calculation

3.0.28 • Public • Published

Invock Digital Private Limited. voucher calculation for fronttend and backend

call setRefItemList() function and pass item in it. call setPartyState() function to pass party's state in it call setBranchState() function to pass branch's state in it call setRefOtherChargesList() function to pass other charges list json in it. call setRefOtherChargesAfterTaxList() function to pass other charges after tax list json in it.

to calcualte qtySellPrice and tax , discount, lineAmount call their function and pass index of itemList in that function.

to get finalBillAmount, call billFinalnAmount() function it will give you final amount with adjustments, shipping charges and othercharges if available.

call getTaxAnalysis() to get tax analysis it will return following response [ { index, itemId, itemName, itemPrice, itemTaxAmount, otherChargesTaxBreakup: [ {accountName, accountId, priceWeightage, taxWeightage}, {accountName, accountId, priceWeightage, taxWeightage} ], totalPriceWeightage, totalTaxWeightage } ]

to get tax breakup array, use getTaxBreakUp() function then pass taxbreakupArray it will match taxPercentage and return first array and assign to existing if existing value null or existing.taxPercentage is not match with provided item percentage * then it will push that element in filteredArray else if its match with existing percentage * then it will add other values in that object ie. requestd data { percentage: 5, tax: 10, cgst: 5, sgst: 5, igst: 0 } { percentage: 5, tax: 20, cgst: 10, sgst : 10, igst:0 } { percentage: 3, tax: 6, cgst: 3, sgst: 3, igst : 0 }

Function will return belows vaues { percentage :5, tax: 30, cgst: 15, sgst: 15, igst: 0 } { percentage: 3, tax: 6, cgst: 3, sgst: 3, igst: 0 }

How to test.

remove the reference form package.json of your project, it should look something like this

"voucher-calculation": "3.0.xxx",

clone this repository in your local computer and then link it with yout global npm using the following command

npm link

Next open the project folder (bankend or UI or mobile) and execute the following command

npm link voucher-calculation

Now you should be able to test teh reference directly to your local version of this library. Any chnages you make to the lib will reflect automatically in your calling project.

Readme

Keywords

none

Package Sidebar

Install

npm i voucher-calculation

Weekly Downloads

84

Version

3.0.28

License

ISC

Unpacked Size

205 kB

Total Files

17

Last publish

Collaborators

  • invock