npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

voucher-calculation

v3.0.28

Published

calculation logic of all voucher for frontEnd and backEnd

Downloads

403

Readme

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.