@plasoft/boletos 1.0.42 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.mts +8 -3
- package/build/index.d.ts +8 -3
- package/build/index.js +14 -14
- package/build/index.mjs +14 -14
- package/package.json +1 -1
package/build/index.d.mts
CHANGED
|
@@ -80,7 +80,7 @@ interface IDadosPDF$4 {
|
|
|
80
80
|
numeroDocumento: string;
|
|
81
81
|
nossoNumero: string;
|
|
82
82
|
especieDocumento: string;
|
|
83
|
-
aceite:
|
|
83
|
+
aceite: string;
|
|
84
84
|
moeda: string;
|
|
85
85
|
usoDoBanco?: string;
|
|
86
86
|
cip?: string;
|
|
@@ -134,6 +134,7 @@ interface IDadosRemessa$4 {
|
|
|
134
134
|
nossoNumero: string;
|
|
135
135
|
numeroDocumento: string;
|
|
136
136
|
parcela: number | string;
|
|
137
|
+
aceite: string;
|
|
137
138
|
pagador: {
|
|
138
139
|
nome: string;
|
|
139
140
|
pessoa: 'F' | 'J';
|
|
@@ -396,7 +397,7 @@ interface IDadosPDF$2 {
|
|
|
396
397
|
numeroDocumento: string;
|
|
397
398
|
nossoNumero: string;
|
|
398
399
|
especieDocumento: string;
|
|
399
|
-
aceite:
|
|
400
|
+
aceite: string;
|
|
400
401
|
moeda: string;
|
|
401
402
|
usoDoBanco?: string;
|
|
402
403
|
cip?: string;
|
|
@@ -449,6 +450,7 @@ interface IDadosRemessa$2 {
|
|
|
449
450
|
nossoNumero: string;
|
|
450
451
|
numeroDocumento: string;
|
|
451
452
|
parcela: number | string;
|
|
453
|
+
aceite: string;
|
|
452
454
|
pagador: {
|
|
453
455
|
nome: string;
|
|
454
456
|
pessoa: 'F' | 'J';
|
|
@@ -535,6 +537,7 @@ interface IDadosPDF$1 {
|
|
|
535
537
|
quantidade?: number | string;
|
|
536
538
|
valor?: number | string;
|
|
537
539
|
parcela: number | string;
|
|
540
|
+
aceite: string;
|
|
538
541
|
numeroDocumento: string;
|
|
539
542
|
nossoNumero: string;
|
|
540
543
|
especieDocumento: string;
|
|
@@ -582,6 +585,7 @@ interface IDadosRemessa$1 {
|
|
|
582
585
|
nossoNumero: string;
|
|
583
586
|
numeroDocumento: string;
|
|
584
587
|
parcela: number | string;
|
|
588
|
+
aceite: string;
|
|
585
589
|
pagador: {
|
|
586
590
|
nome: string;
|
|
587
591
|
pessoa: 'F' | 'J';
|
|
@@ -682,7 +686,7 @@ interface IDadosPDF {
|
|
|
682
686
|
numeroDocumento: string;
|
|
683
687
|
nossoNumero: string;
|
|
684
688
|
especieDocumento: string;
|
|
685
|
-
aceite:
|
|
689
|
+
aceite: string;
|
|
686
690
|
moeda: string;
|
|
687
691
|
usoDoBanco?: string;
|
|
688
692
|
cip?: string;
|
|
@@ -739,6 +743,7 @@ interface IDadosRemessa {
|
|
|
739
743
|
nossoNumero: string;
|
|
740
744
|
numeroDocumento: string;
|
|
741
745
|
parcela: number | string;
|
|
746
|
+
aceite: string;
|
|
742
747
|
pagador: {
|
|
743
748
|
nome: string;
|
|
744
749
|
pessoa: 'F' | 'J';
|
package/build/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ interface IDadosPDF$4 {
|
|
|
80
80
|
numeroDocumento: string;
|
|
81
81
|
nossoNumero: string;
|
|
82
82
|
especieDocumento: string;
|
|
83
|
-
aceite:
|
|
83
|
+
aceite: string;
|
|
84
84
|
moeda: string;
|
|
85
85
|
usoDoBanco?: string;
|
|
86
86
|
cip?: string;
|
|
@@ -134,6 +134,7 @@ interface IDadosRemessa$4 {
|
|
|
134
134
|
nossoNumero: string;
|
|
135
135
|
numeroDocumento: string;
|
|
136
136
|
parcela: number | string;
|
|
137
|
+
aceite: string;
|
|
137
138
|
pagador: {
|
|
138
139
|
nome: string;
|
|
139
140
|
pessoa: 'F' | 'J';
|
|
@@ -396,7 +397,7 @@ interface IDadosPDF$2 {
|
|
|
396
397
|
numeroDocumento: string;
|
|
397
398
|
nossoNumero: string;
|
|
398
399
|
especieDocumento: string;
|
|
399
|
-
aceite:
|
|
400
|
+
aceite: string;
|
|
400
401
|
moeda: string;
|
|
401
402
|
usoDoBanco?: string;
|
|
402
403
|
cip?: string;
|
|
@@ -449,6 +450,7 @@ interface IDadosRemessa$2 {
|
|
|
449
450
|
nossoNumero: string;
|
|
450
451
|
numeroDocumento: string;
|
|
451
452
|
parcela: number | string;
|
|
453
|
+
aceite: string;
|
|
452
454
|
pagador: {
|
|
453
455
|
nome: string;
|
|
454
456
|
pessoa: 'F' | 'J';
|
|
@@ -535,6 +537,7 @@ interface IDadosPDF$1 {
|
|
|
535
537
|
quantidade?: number | string;
|
|
536
538
|
valor?: number | string;
|
|
537
539
|
parcela: number | string;
|
|
540
|
+
aceite: string;
|
|
538
541
|
numeroDocumento: string;
|
|
539
542
|
nossoNumero: string;
|
|
540
543
|
especieDocumento: string;
|
|
@@ -582,6 +585,7 @@ interface IDadosRemessa$1 {
|
|
|
582
585
|
nossoNumero: string;
|
|
583
586
|
numeroDocumento: string;
|
|
584
587
|
parcela: number | string;
|
|
588
|
+
aceite: string;
|
|
585
589
|
pagador: {
|
|
586
590
|
nome: string;
|
|
587
591
|
pessoa: 'F' | 'J';
|
|
@@ -682,7 +686,7 @@ interface IDadosPDF {
|
|
|
682
686
|
numeroDocumento: string;
|
|
683
687
|
nossoNumero: string;
|
|
684
688
|
especieDocumento: string;
|
|
685
|
-
aceite:
|
|
689
|
+
aceite: string;
|
|
686
690
|
moeda: string;
|
|
687
691
|
usoDoBanco?: string;
|
|
688
692
|
cip?: string;
|
|
@@ -739,6 +743,7 @@ interface IDadosRemessa {
|
|
|
739
743
|
nossoNumero: string;
|
|
740
744
|
numeroDocumento: string;
|
|
741
745
|
parcela: number | string;
|
|
746
|
+
aceite: string;
|
|
742
747
|
pagador: {
|
|
743
748
|
nome: string;
|
|
744
749
|
pessoa: 'F' | 'J';
|
package/build/index.js
CHANGED
|
@@ -484,7 +484,7 @@ function gerarRemessa({ dados }) {
|
|
|
484
484
|
arquivo.add(dadosBancario.agencia.padStart(5, "0"));
|
|
485
485
|
arquivo.add(dadosBancario.agenciaDigito);
|
|
486
486
|
arquivo.add("02");
|
|
487
|
-
arquivo.add(
|
|
487
|
+
arquivo.add(boleto.aceite);
|
|
488
488
|
arquivo.add(data);
|
|
489
489
|
arquivo.add(codigoJuro);
|
|
490
490
|
arquivo.add(jurosVencimento);
|
|
@@ -1430,7 +1430,8 @@ function gerarRemessa3({ dados }) {
|
|
|
1430
1430
|
arquivo.add((0, import_date_fns4.format)(new Date(boleto.vencimento), "ddMMyy"));
|
|
1431
1431
|
arquivo.add(Number(boleto.valor).toFixed(2).replace(".", "").padStart(13, "0"));
|
|
1432
1432
|
arquivo.add(" ".padEnd(9, " "));
|
|
1433
|
-
arquivo.add("
|
|
1433
|
+
arquivo.add("A");
|
|
1434
|
+
arquivo.add(boleto.aceite);
|
|
1434
1435
|
arquivo.add((0, import_date_fns4.format)(new Date(boleto.emissao), "ddMMyy"));
|
|
1435
1436
|
arquivo.add(protestar);
|
|
1436
1437
|
arquivo.add(String(dadosBancario.diasProtesto).padStart(2, "0"));
|
|
@@ -1586,8 +1587,8 @@ function gerarDadosBoleto4({ dados }) {
|
|
|
1586
1587
|
}
|
|
1587
1588
|
}
|
|
1588
1589
|
function getNossoNumero2(agencia, codigo_cliente, id_boleto) {
|
|
1589
|
-
codigo_cliente = codigo_cliente
|
|
1590
|
-
id_boleto = id_boleto
|
|
1590
|
+
codigo_cliente = padLeft(codigo_cliente, 10);
|
|
1591
|
+
id_boleto = padLeft(id_boleto, 7);
|
|
1591
1592
|
const aux = `${agencia}${codigo_cliente}${id_boleto}`;
|
|
1592
1593
|
let i = 22, m = 3, soma = 0;
|
|
1593
1594
|
while (true) {
|
|
@@ -1595,13 +1596,13 @@ function getNossoNumero2(agencia, codigo_cliente, id_boleto) {
|
|
|
1595
1596
|
soma += m * Number(copy(aux, i, i));
|
|
1596
1597
|
if (i === 1)
|
|
1597
1598
|
break;
|
|
1598
|
-
if (m === 3)
|
|
1599
|
+
else if (m === 3)
|
|
1599
1600
|
m = 7;
|
|
1600
|
-
if (m === 7)
|
|
1601
|
+
else if (m === 7)
|
|
1601
1602
|
m = 9;
|
|
1602
|
-
if (m === 9)
|
|
1603
|
+
else if (m === 9)
|
|
1603
1604
|
m = 1;
|
|
1604
|
-
if (m === 1)
|
|
1605
|
+
else if (m === 1)
|
|
1605
1606
|
m = 3;
|
|
1606
1607
|
}
|
|
1607
1608
|
let dig = soma % 11;
|
|
@@ -1616,7 +1617,6 @@ function getDigitoGeral4(texto) {
|
|
|
1616
1617
|
let i = 43;
|
|
1617
1618
|
let j = 1;
|
|
1618
1619
|
let soma = 0;
|
|
1619
|
-
let digito = 0;
|
|
1620
1620
|
while (i >= 1) {
|
|
1621
1621
|
j++;
|
|
1622
1622
|
if (j === 10)
|
|
@@ -1625,9 +1625,9 @@ function getDigitoGeral4(texto) {
|
|
|
1625
1625
|
soma += j * valor;
|
|
1626
1626
|
i--;
|
|
1627
1627
|
}
|
|
1628
|
-
const
|
|
1629
|
-
digito = 11 -
|
|
1630
|
-
if (digito === 0 || digito
|
|
1628
|
+
const resto = soma % 11;
|
|
1629
|
+
let digito = 11 - resto;
|
|
1630
|
+
if (digito === 0 || digito > 9)
|
|
1631
1631
|
digito = 1;
|
|
1632
1632
|
return String(digito);
|
|
1633
1633
|
}
|
|
@@ -1747,7 +1747,7 @@ function gerarRemessa4({ dados }) {
|
|
|
1747
1747
|
arquivo.add("00000");
|
|
1748
1748
|
arquivo.add(" ");
|
|
1749
1749
|
arquivo.add("02");
|
|
1750
|
-
arquivo.add(
|
|
1750
|
+
arquivo.add(boleto.aceite);
|
|
1751
1751
|
arquivo.add(data);
|
|
1752
1752
|
arquivo.add("1");
|
|
1753
1753
|
arquivo.add((0, import_date_fns5.format)((0, import_date_fns5.addDays)(new Date(boleto.vencimento), 1), "ddMMyyyy"));
|
|
@@ -2409,7 +2409,7 @@ function gerarRemessa5({ dados }) {
|
|
|
2409
2409
|
);
|
|
2410
2410
|
arquivo.add("00000 ");
|
|
2411
2411
|
arquivo.add("02");
|
|
2412
|
-
arquivo.add(
|
|
2412
|
+
arquivo.add(boleto.aceite);
|
|
2413
2413
|
arquivo.add(data);
|
|
2414
2414
|
arquivo.add("1");
|
|
2415
2415
|
arquivo.add("00000000");
|
package/build/index.mjs
CHANGED
|
@@ -447,7 +447,7 @@ function gerarRemessa({ dados }) {
|
|
|
447
447
|
arquivo.add(dadosBancario.agencia.padStart(5, "0"));
|
|
448
448
|
arquivo.add(dadosBancario.agenciaDigito);
|
|
449
449
|
arquivo.add("02");
|
|
450
|
-
arquivo.add(
|
|
450
|
+
arquivo.add(boleto.aceite);
|
|
451
451
|
arquivo.add(data);
|
|
452
452
|
arquivo.add(codigoJuro);
|
|
453
453
|
arquivo.add(jurosVencimento);
|
|
@@ -1393,7 +1393,8 @@ function gerarRemessa3({ dados }) {
|
|
|
1393
1393
|
arquivo.add(format3(new Date(boleto.vencimento), "ddMMyy"));
|
|
1394
1394
|
arquivo.add(Number(boleto.valor).toFixed(2).replace(".", "").padStart(13, "0"));
|
|
1395
1395
|
arquivo.add(" ".padEnd(9, " "));
|
|
1396
|
-
arquivo.add("
|
|
1396
|
+
arquivo.add("A");
|
|
1397
|
+
arquivo.add(boleto.aceite);
|
|
1397
1398
|
arquivo.add(format3(new Date(boleto.emissao), "ddMMyy"));
|
|
1398
1399
|
arquivo.add(protestar);
|
|
1399
1400
|
arquivo.add(String(dadosBancario.diasProtesto).padStart(2, "0"));
|
|
@@ -1549,8 +1550,8 @@ function gerarDadosBoleto4({ dados }) {
|
|
|
1549
1550
|
}
|
|
1550
1551
|
}
|
|
1551
1552
|
function getNossoNumero2(agencia, codigo_cliente, id_boleto) {
|
|
1552
|
-
codigo_cliente = codigo_cliente
|
|
1553
|
-
id_boleto = id_boleto
|
|
1553
|
+
codigo_cliente = padLeft(codigo_cliente, 10);
|
|
1554
|
+
id_boleto = padLeft(id_boleto, 7);
|
|
1554
1555
|
const aux = `${agencia}${codigo_cliente}${id_boleto}`;
|
|
1555
1556
|
let i = 22, m = 3, soma = 0;
|
|
1556
1557
|
while (true) {
|
|
@@ -1558,13 +1559,13 @@ function getNossoNumero2(agencia, codigo_cliente, id_boleto) {
|
|
|
1558
1559
|
soma += m * Number(copy(aux, i, i));
|
|
1559
1560
|
if (i === 1)
|
|
1560
1561
|
break;
|
|
1561
|
-
if (m === 3)
|
|
1562
|
+
else if (m === 3)
|
|
1562
1563
|
m = 7;
|
|
1563
|
-
if (m === 7)
|
|
1564
|
+
else if (m === 7)
|
|
1564
1565
|
m = 9;
|
|
1565
|
-
if (m === 9)
|
|
1566
|
+
else if (m === 9)
|
|
1566
1567
|
m = 1;
|
|
1567
|
-
if (m === 1)
|
|
1568
|
+
else if (m === 1)
|
|
1568
1569
|
m = 3;
|
|
1569
1570
|
}
|
|
1570
1571
|
let dig = soma % 11;
|
|
@@ -1579,7 +1580,6 @@ function getDigitoGeral4(texto) {
|
|
|
1579
1580
|
let i = 43;
|
|
1580
1581
|
let j = 1;
|
|
1581
1582
|
let soma = 0;
|
|
1582
|
-
let digito = 0;
|
|
1583
1583
|
while (i >= 1) {
|
|
1584
1584
|
j++;
|
|
1585
1585
|
if (j === 10)
|
|
@@ -1588,9 +1588,9 @@ function getDigitoGeral4(texto) {
|
|
|
1588
1588
|
soma += j * valor;
|
|
1589
1589
|
i--;
|
|
1590
1590
|
}
|
|
1591
|
-
const
|
|
1592
|
-
digito = 11 -
|
|
1593
|
-
if (digito === 0 || digito
|
|
1591
|
+
const resto = soma % 11;
|
|
1592
|
+
let digito = 11 - resto;
|
|
1593
|
+
if (digito === 0 || digito > 9)
|
|
1594
1594
|
digito = 1;
|
|
1595
1595
|
return String(digito);
|
|
1596
1596
|
}
|
|
@@ -1710,7 +1710,7 @@ function gerarRemessa4({ dados }) {
|
|
|
1710
1710
|
arquivo.add("00000");
|
|
1711
1711
|
arquivo.add(" ");
|
|
1712
1712
|
arquivo.add("02");
|
|
1713
|
-
arquivo.add(
|
|
1713
|
+
arquivo.add(boleto.aceite);
|
|
1714
1714
|
arquivo.add(data);
|
|
1715
1715
|
arquivo.add("1");
|
|
1716
1716
|
arquivo.add(format4(addDays3(new Date(boleto.vencimento), 1), "ddMMyyyy"));
|
|
@@ -2372,7 +2372,7 @@ function gerarRemessa5({ dados }) {
|
|
|
2372
2372
|
);
|
|
2373
2373
|
arquivo.add("00000 ");
|
|
2374
2374
|
arquivo.add("02");
|
|
2375
|
-
arquivo.add(
|
|
2375
|
+
arquivo.add(boleto.aceite);
|
|
2376
2376
|
arquivo.add(data);
|
|
2377
2377
|
arquivo.add("1");
|
|
2378
2378
|
arquivo.add("00000000");
|