@heartinz/gst_india_price_tax_calculator
v2.2.0
Published
**Package Name:** @heartinz/gst_india_price_tax_calculator **Version:** 2.0.2 **Author:** Kiran Morais, Heartinz Technologies Private Limited, India
Downloads
165
Readme
GST India Price Tax Calculator
Package Name: @heartinz/gst_india_price_tax_calculator
Version: 2.0.2
Author: Kiran Morais, Heartinz Technologies Private Limited, India
Description:
This module calculates the sale and base prices of items including detailed tax breakdowns using GST rates applicable in India. It relies on the big.js
library for precision in financial calculations.
Installation:
```bash
npm install @heartinz/gst_india_price_tax_calculator
```
Usage:
Import the necessary functions from the package:
```javascript
import { withSalePrice, withBasePrice } from '@heartinz/gst_india_price_tax_calculator';
```
Functions:
withSalePrice(mrp, salePrice, taxPercent)
- Parameters:
- `mrp`: Integer (Manufacturer's Suggested Retail Price)
- `salePrice`: Integer (Discounted price before tax)
- `taxPercent`: Integer (Applicable tax rate)
- Returns: Object containing `mrp`, `discount`, `salePrice`, `basePrice`, `gstPercent`, `gstAmount`, `sgstPercent`, `sgstAmount`, `cgstPercent`, `cgstAmount`, `igstPercent`, `igstAmount`.
- Parameters:
withBasePrice(mrp, basePrice, taxPercent)
- Parameters:
- `mrp`: Integer
- `basePrice`: Integer (Base price before applying tax)
- `taxPercent`: Integer
- Returns: Object detailing the computed sale price and tax amounts.
- Parameters:
Examples:
Calculating sale price with GST:
```javascript
const mrp = 270000;
const salePrice = 239700;
const taxPercent = 18;
console.log(withSalePrice(mrp, salePrice, taxPercent));
```
Calculating base price from given parameters: ```javascript const mrp = 270000; const basePrice = 203220; // Example base price const taxPercent = 18; console.log(withBasePrice(mrp, basePrice, taxPercent)); ```