1.5.1 • Published 4 years ago

@nearshorecode/impuestos-bo v1.5.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Build Status semantic-release codecov

Utility Library for Impuestos Bolivia

Usage

To use this library install it from npm:

npm i @nearshorecode/impuestos-bo

or

yarn add @nearshorecode/impuestos-bo

Then you can use it to generate V7 Control code, for example:

const { v7 } = require('@nearshorecode/impuestos-bo')

const data = {
  authorization: '29040011007',
  number: '1503',
  nitci: '4189179011',
  date: '2007/07/02',
  amount: '2500',
}

const controlCode = v7(data, '9rCB7Sv4X29d)5k7N%3ab89p-3(5[A') // returns control code string

You can convert a number to literal, for example:

const { literal } = require('@nearshorecode/impuestos-bo')

const data = '17'

const literal = literal(data) // returns 'DIECISIETE 00/100 BOLIVIANOS'

You can also request QR code string that you can later use it to render, for this you need to send it additional parameters:

const { v7 } = require('@nearshorecode/impuestos-bo')

const data = {
  authorization: '29040011007',
  number: '1503',
  nitci: '4189179011',
  date: '2007/07/02',
  amount: '2500',
  qr: {
    sellerNITCI: '1122332233',
    total: '2500',
    amounts: {
      'ice-iehd-tasas': '0', // defaults to 0
      gravado: '0', // defaults to 0
      'no-tax': '0' // defaults to 0
      discounts: '0' // defaults to 0
    }
  }
}

const result = v7(data, '9rCB7Sv4X29d)5k7N%3ab89p-3(5[A')

console.log(result.controlCode)
console.log(result.qrCode)

QR Code Reference

PositionFieldTypeMandatoryMax Length
1NITNumberY12
2FacturaNumberY10
3AuthorizationNumberY15
4DateDD/MM/AAAAY10
5TotalNumber (decimal point)Y11
6AmountNumber (decimal point)Y11
7Codigo de ControlStringY17
8Buyer NIT/CI/CEX/0StringY12
9Amount ICE/IEHD/Tasas/0Number (decimal point)N11
10Amount Gravado/0Number (decimal point)N11
11Amount No-Tax/0Number (decimal point)N11
12Discounts/BonusNumber (decimal point)N11

Local Development

First clone this project and install dependencies using:

  git clone https://github.com/nearshorecode/impuestos-bo
  yarn install

We are using semantic-release and conventional commits for this project, once you want to submit a PR make sure to run linter and to run or add unit tests in the tests folder on the root level.

1.5.1

4 years ago

1.4.2

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago