Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@nomada-sh/mx-invoice-tax-calculation
Advanced tools
These functions help you to obtain the tax calculation for an invoice in mexico. You can get the calculation for vat tranferred and witheld, isr and ieps.
These functions help you to obtain the tax calculation for an invoice in mexico. You can get the calculation for vat tranferred and witheld, isr and ieps.
Install package
$ npm install @nomada-sh/mx-invoice-tax-calculation
or
$ yarn add @nomada-sh/mx-invoice-tax-calculation
To use the calculation functions you need to know the structure of a concept, below you can see the interface of a concept
export interface IConcept {
valorUnitario: number;
descuento: number;
porcDescuento: number;
descripcion: string;
cantidad: number;
key: string;
impuestos: {traslados: ITax[], retenciones: ITax[]};
}
export interface ITax {
tipoImpuesto : 'traslado' | 'retencion';
impuesto : '001' | '002' | '003':
nombreImpuesto : 'IEPS' | 'IVA' | 'ISR';
valorTasaOcuota : number;
valorTasaOcuotaPorc : number;
rangoFijo : string;
tipoFactor : string;
key : string;
};
import { calcMannyConcepts, calculateConceptTax } from '@nomada-sh/mx-invoice-tax-calculation';
import { IConcept } from '@nomada-sh/mx-invoice-tax-calculation/dist/interfaces';
const conceptExample: IConcept = {
key: '58efbeb4-0b7c-45b4-84e4-9588d3f47dc9',
descripcion: 'concept1',
cantidad: 6,
valorUnitario: 55,
descuento: 0,
porcDescuento: 0,
impuestos: {
traslados: [
{
key: '1c1011aa-040f-496a-b170-0224cd632d53',
tasaOcuota: '',
valorTasaOcuota: 0.16,
valorTasaOcuotaPorc: 16,
impuesto: '002',
nombreImpuesto: 'IVA',
tipoImpuesto: 'traslado',
rangoFijo: 'Fijo',
tipoFactor: 'Tasa',
},
{
tipoImpuesto: 'traslado',
impuesto: '003',
nombreImpuesto: 'IEPS',
tasaOcuota: 'f27c5a1c-f445-473d-8727-5feb94a3cca1',
valorTasaOcuota: 0.30,
valorTasaOcuotaPorc: 30,
importeImpuesto: '0.00',
rangoFijo: 'Fijo',
tipoFactor: 'Tasa',
key: 'c2e20350-003c-4326-aabd-5f9c8d3e1121',
},
],
retenciones: [],
},
};
Allows to calculate multiple concepts
const calculatedTaxes = calcMannyConcepts([conceptExample, conceptExample]);
console.log(calculatedTaxes);
calcMannyconcepts's answer
{
"amount": 660,
"discount": {
"value": 0,
"data": []
},
"ivaTransferred": {
"value": 137.28,
"data": [
{
"value": 68.64,
"porcentage": 16,
"desc": "concept1",
"key": "58efbeb4-0b7c-45b4-84e4-9588d3f47dc9"
},
{
"value": 68.64,
"porcentage": 16,
"desc": "concept1",
"key": "58efbeb4-0b7c-45b4-84e4-9588d3f47dc9"
}
]
},
"ivaWitheld": {
"value": 0,
"data": []
},
"ieps": {
"value": 198,
"data": [
{
"value": 99,
"porcentage": 30,
"desc": "concept1",
"key": "58efbeb4-0b7c-45b4-84e4-9588d3f47dc9"
},
{
"value": 99,
"porcentage": 30,
"desc": "concept1",
"key": "58efbeb4-0b7c-45b4-84e4-9588d3f47dc9"
}
]
},
"isr": {
"value": 0,
"data": []
},
"subtotal": 660,
"total": 995.28
}
allows to calculate only one concept
const calculatedTaxes= calculateConceptTax(conceptExample);
console.log(calculatedTaxes);
calculateConceptTax's answer
{
"key": "58efbeb4-0b7c-45b4-84e4-9588d3f47dc9",
"description": "concept1",
"amount": 330,
"discount": 0,
"porcDescuento": 0,
"subTotal": 330,
"iepsT": {
"type": "transferred",
"percentage": 30,
"valuePercentage": 0.3,
"factorType": "Tasa",
"taxName": "IEPS",
"iepsValue": 99
},
"ivaT": {
"type": "transferred",
"percentage": 16,
"valuePercentage": 0.16,
"taxName": "IVA",
"ivaValue": 68.64
},
"total": 497.64
}
FAQs
These functions help you to obtain the tax calculation for an invoice in mexico. You can get the calculation for vat tranferred and witheld, isr and ieps.
We found that @nomada-sh/mx-invoice-tax-calculation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.