@plasoft/boletos 1.0.16 → 1.0.18
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/ailos-boleto.hbs +490 -490
- package/build/index.d.mts +305 -23
- package/build/index.d.ts +305 -23
- package/build/index.js +904 -75
- package/build/index.mjs +904 -75
- package/build/sicoob-boleto.hbs +842 -0
- package/build/sicredi-boleto.hbs +581 -0
- package/build/teste.html +842 -0
- package/build/teste2.html +490 -0
- package/package.json +3 -5
package/build/index.js
CHANGED
|
@@ -56,16 +56,19 @@ __export(src_exports, {
|
|
|
56
56
|
});
|
|
57
57
|
module.exports = __toCommonJS(src_exports);
|
|
58
58
|
|
|
59
|
-
// src/
|
|
60
|
-
var Banco = /* @__PURE__ */ ((Banco2) => {
|
|
61
|
-
Banco2["AILOS"] = "085";
|
|
62
|
-
Banco2["BRADESCO"] = "005";
|
|
63
|
-
return Banco2;
|
|
64
|
-
})(Banco || {});
|
|
65
|
-
|
|
66
|
-
// src/ailos/gerarDadosBoleto.ts
|
|
59
|
+
// src/banks/ailos/gerarDadosBoleto.ts
|
|
67
60
|
var import_date_fns = require("date-fns");
|
|
68
61
|
|
|
62
|
+
// src/utils/pafLeft.ts
|
|
63
|
+
function padLeft(numero, tamanho) {
|
|
64
|
+
numero = String(numero);
|
|
65
|
+
if (numero.length < tamanho) {
|
|
66
|
+
numero = `0${numero}`;
|
|
67
|
+
return padLeft(numero, tamanho);
|
|
68
|
+
}
|
|
69
|
+
return numero;
|
|
70
|
+
}
|
|
71
|
+
|
|
69
72
|
// src/utils/copy.ts
|
|
70
73
|
function copy(texto, startPosition, endPosition) {
|
|
71
74
|
let retorno2 = "";
|
|
@@ -83,15 +86,7 @@ function copy(texto, startPosition, endPosition) {
|
|
|
83
86
|
return retorno2;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
// src/
|
|
87
|
-
function padLeft(numero, size) {
|
|
88
|
-
let numeroPadLeft = `${numero}`;
|
|
89
|
-
while (numeroPadLeft.length < size)
|
|
90
|
-
numeroPadLeft = `0${numeroPadLeft}`;
|
|
91
|
-
return numeroPadLeft;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/ailos/gerarDadosBoleto.ts
|
|
89
|
+
// src/banks/ailos/gerarDadosBoleto.ts
|
|
95
90
|
function gerarDadosBoleto({ dados }) {
|
|
96
91
|
try {
|
|
97
92
|
const { bancario, parcela } = dados;
|
|
@@ -182,18 +177,9 @@ function getDigito(texto) {
|
|
|
182
177
|
return String(digito);
|
|
183
178
|
}
|
|
184
179
|
|
|
185
|
-
// src/ailos/gerarPDF.ts
|
|
180
|
+
// src/banks/ailos/gerarPDF.ts
|
|
186
181
|
var import_bwip_js = __toESM(require("bwip-js"));
|
|
187
182
|
|
|
188
|
-
// src/utils/compileHbs.ts
|
|
189
|
-
var import_handlebars = __toESM(require("handlebars"));
|
|
190
|
-
var import_fs = __toESM(require("fs"));
|
|
191
|
-
function compileHbs(templatePath, data) {
|
|
192
|
-
const html = import_fs.default.readFileSync(templatePath, "utf-8");
|
|
193
|
-
const content = import_handlebars.default.compile(html)(data);
|
|
194
|
-
return content;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
183
|
// src/utils/maskFormat.ts
|
|
198
184
|
var import_string_mask = __toESM(require("string-mask"));
|
|
199
185
|
function retornaCpfCnpjFormatado(cpfCnpj) {
|
|
@@ -225,12 +211,14 @@ var maskFormat_default = {
|
|
|
225
211
|
codigoBarra
|
|
226
212
|
};
|
|
227
213
|
|
|
228
|
-
// src/
|
|
229
|
-
var
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
214
|
+
// src/utils/compileHbs.ts
|
|
215
|
+
var import_handlebars = __toESM(require("handlebars"));
|
|
216
|
+
var import_fs = __toESM(require("fs"));
|
|
217
|
+
function compileHbs(templatePath, data) {
|
|
218
|
+
const html = import_fs.default.readFileSync(templatePath, "utf-8");
|
|
219
|
+
const content = import_handlebars.default.compile(html)(data);
|
|
220
|
+
return content;
|
|
221
|
+
}
|
|
234
222
|
|
|
235
223
|
// src/utils/getPathTemplates.ts
|
|
236
224
|
var import_path = __toESM(require("path"));
|
|
@@ -241,7 +229,14 @@ function getPathTemplates(template) {
|
|
|
241
229
|
return import_path.default.resolve(__dirname, template);
|
|
242
230
|
}
|
|
243
231
|
|
|
244
|
-
// src/
|
|
232
|
+
// src/services/api.ts
|
|
233
|
+
var import_config = require("dotenv/config");
|
|
234
|
+
var import_axios = __toESM(require("axios"));
|
|
235
|
+
var api = import_axios.default.create({
|
|
236
|
+
baseURL: process.env.API_URL
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// src/banks/ailos/gerarPDF.ts
|
|
245
240
|
function gerarPDF(_0) {
|
|
246
241
|
return __async(this, arguments, function* ({ dados }) {
|
|
247
242
|
var _a, _b, _c, _d;
|
|
@@ -333,7 +328,7 @@ function gerarPDF(_0) {
|
|
|
333
328
|
});
|
|
334
329
|
}
|
|
335
330
|
|
|
336
|
-
// src/ailos/gerarRemessa.ts
|
|
331
|
+
// src/banks/ailos/gerarRemessa.ts
|
|
337
332
|
var import_date_fns2 = require("date-fns");
|
|
338
333
|
|
|
339
334
|
// src/lib/Arquivo.ts
|
|
@@ -353,8 +348,12 @@ var Arquivo = class {
|
|
|
353
348
|
}
|
|
354
349
|
};
|
|
355
350
|
|
|
356
|
-
// src/
|
|
357
|
-
|
|
351
|
+
// src/utils/removerAcentos.ts
|
|
352
|
+
function removerAcentos(texto) {
|
|
353
|
+
return texto.normalize("NFD").replace(/[\u0300-\u036f.]/g, "");
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// src/banks/ailos/gerarRemessa.ts
|
|
358
357
|
function gerarRemessa({ dados }) {
|
|
359
358
|
try {
|
|
360
359
|
const { dadosBancario, beneficiario, boletos } = dados.remessa;
|
|
@@ -377,7 +376,7 @@ function gerarRemessa({ dados }) {
|
|
|
377
376
|
arquivo.add(dadosBancario.conta.padStart(12, "0"));
|
|
378
377
|
arquivo.add(dadosBancario.contaDigito);
|
|
379
378
|
arquivo.add(" ");
|
|
380
|
-
arquivo.add((
|
|
379
|
+
arquivo.add(removerAcentos(beneficiario.nome).substring(0, 30).padEnd(30, " "));
|
|
381
380
|
arquivo.add("AILOS".padEnd(30, " "));
|
|
382
381
|
arquivo.add(" ");
|
|
383
382
|
arquivo.add("1");
|
|
@@ -406,7 +405,7 @@ function gerarRemessa({ dados }) {
|
|
|
406
405
|
arquivo.add(dadosBancario.conta.padStart(12, "0"));
|
|
407
406
|
arquivo.add(dadosBancario.contaDigito);
|
|
408
407
|
arquivo.add(" ");
|
|
409
|
-
arquivo.add((
|
|
408
|
+
arquivo.add(removerAcentos(beneficiario.nome).substring(0, 30).padEnd(30, " "));
|
|
410
409
|
arquivo.add(" ".padEnd(40, " "));
|
|
411
410
|
arquivo.add(" ".padEnd(40, " "));
|
|
412
411
|
arquivo.add(dadosBancario.numeroRemessa.padStart(8, "0"));
|
|
@@ -483,7 +482,7 @@ function gerarRemessa({ dados }) {
|
|
|
483
482
|
} else {
|
|
484
483
|
tipoInscricao = "2";
|
|
485
484
|
}
|
|
486
|
-
pagador.endereco.logradouro = `${(
|
|
485
|
+
pagador.endereco.logradouro = `${removerAcentos(pagador.endereco.logradouro).substring(0, 32).padEnd(32, " ")}${pagador.endereco.numero.padEnd(8, " ")}`;
|
|
487
486
|
arquivo.add("085");
|
|
488
487
|
arquivo.add("0001");
|
|
489
488
|
arquivo.add("3");
|
|
@@ -493,13 +492,13 @@ function gerarRemessa({ dados }) {
|
|
|
493
492
|
arquivo.add("01");
|
|
494
493
|
arquivo.add(tipoInscricao);
|
|
495
494
|
arquivo.add(pagador.cpfCnpj.padStart(15, "0"));
|
|
496
|
-
arquivo.add((
|
|
497
|
-
arquivo.add((
|
|
498
|
-
arquivo.add((
|
|
495
|
+
arquivo.add(removerAcentos(pagador.nome).substring(0, 40).padEnd(40, " "));
|
|
496
|
+
arquivo.add(removerAcentos(pagador.endereco.logradouro).substring(0, 40).padEnd(40, " "));
|
|
497
|
+
arquivo.add(removerAcentos(pagador.endereco.bairro).substring(0, 15).padEnd(15, " "));
|
|
499
498
|
arquivo.add(pagador.endereco.cep.substring(0, 5).padStart(5, "0"));
|
|
500
499
|
arquivo.add(pagador.endereco.cep.substring(5, 7).padStart(3, "0"));
|
|
501
|
-
arquivo.add((
|
|
502
|
-
arquivo.add((
|
|
500
|
+
arquivo.add(removerAcentos(pagador.endereco.municipio).substring(0, 15).padEnd(15, " "));
|
|
501
|
+
arquivo.add(removerAcentos(pagador.endereco.uf).padEnd(2, " "));
|
|
503
502
|
arquivo.add("0");
|
|
504
503
|
arquivo.add("000000000000000");
|
|
505
504
|
arquivo.add(" ".padEnd(40, " "));
|
|
@@ -578,7 +577,7 @@ function gerarRemessa({ dados }) {
|
|
|
578
577
|
}
|
|
579
578
|
}
|
|
580
579
|
|
|
581
|
-
// src/ailos/gerarRetorno.ts
|
|
580
|
+
// src/banks/ailos/gerarRetorno.ts
|
|
582
581
|
function gerarRetorno({ dados }) {
|
|
583
582
|
try {
|
|
584
583
|
const { arquivo } = dados;
|
|
@@ -636,7 +635,7 @@ function gerarRetorno({ dados }) {
|
|
|
636
635
|
}
|
|
637
636
|
}
|
|
638
637
|
|
|
639
|
-
// src/ailos/index.ts
|
|
638
|
+
// src/banks/ailos/index.ts
|
|
640
639
|
var ailos = {
|
|
641
640
|
gerarDadosBoleto,
|
|
642
641
|
gerarPDF,
|
|
@@ -644,7 +643,16 @@ var ailos = {
|
|
|
644
643
|
gerarRetorno
|
|
645
644
|
};
|
|
646
645
|
|
|
647
|
-
// src/
|
|
646
|
+
// src/types/Boletos.ts
|
|
647
|
+
var Banco = /* @__PURE__ */ ((Banco2) => {
|
|
648
|
+
Banco2["AILOS"] = "085";
|
|
649
|
+
Banco2["BRADESCO"] = "005";
|
|
650
|
+
Banco2["SICREDI"] = "748";
|
|
651
|
+
Banco2["SICOOB"] = "756";
|
|
652
|
+
return Banco2;
|
|
653
|
+
})(Banco || {});
|
|
654
|
+
|
|
655
|
+
// src/banks/bradesco/gerarDadosBoleto.ts
|
|
648
656
|
var import_date_fns3 = require("date-fns");
|
|
649
657
|
function gerarDadosBoleto2({ dados }) {
|
|
650
658
|
try {
|
|
@@ -737,7 +745,7 @@ function getDigito2(texto) {
|
|
|
737
745
|
return String(digito);
|
|
738
746
|
}
|
|
739
747
|
|
|
740
|
-
// src/bradesco/gerarPDF.ts
|
|
748
|
+
// src/banks/bradesco/gerarPDF.ts
|
|
741
749
|
var import_bwip_js2 = __toESM(require("bwip-js"));
|
|
742
750
|
function gerarPDF2(_0) {
|
|
743
751
|
return __async(this, arguments, function* ({ dados }) {
|
|
@@ -781,7 +789,7 @@ function gerarPDF2(_0) {
|
|
|
781
789
|
dadosPDF.boleto.quantidade = maskFormat_default.numberToReal(dadosPDF.boleto.quantidade);
|
|
782
790
|
}
|
|
783
791
|
dadosPDF.boleto.valor = maskFormat_default.numberToReal(dadosPDF.boleto.valor);
|
|
784
|
-
const content = compileHbs(getPathTemplates("bradesco-boleto.hbs"),
|
|
792
|
+
const content = compileHbs(getPathTemplates("bradesco-boleto.hbs"), dadosPDF);
|
|
785
793
|
const config = {
|
|
786
794
|
displayHeaderFooter: false,
|
|
787
795
|
path: "./boleto.pdf",
|
|
@@ -811,7 +819,7 @@ function gerarPDF2(_0) {
|
|
|
811
819
|
});
|
|
812
820
|
}
|
|
813
821
|
|
|
814
|
-
// src/bradesco/gerarRemessa.ts
|
|
822
|
+
// src/banks/bradesco/gerarRemessa.ts
|
|
815
823
|
var import_date_fns4 = require("date-fns");
|
|
816
824
|
function gerarRemessa2(_0) {
|
|
817
825
|
return __async(this, arguments, function* ({ dados }) {
|
|
@@ -1038,7 +1046,7 @@ function gerarRemessa2(_0) {
|
|
|
1038
1046
|
});
|
|
1039
1047
|
}
|
|
1040
1048
|
|
|
1041
|
-
// src/bradesco/gerarRetorno.ts
|
|
1049
|
+
// src/banks/bradesco/gerarRetorno.ts
|
|
1042
1050
|
function gerarRetorno2({ dados }) {
|
|
1043
1051
|
try {
|
|
1044
1052
|
const { arquivo } = dados;
|
|
@@ -1078,8 +1086,10 @@ function gerarRetorno2({ dados }) {
|
|
|
1078
1086
|
id_documento: idDocumento,
|
|
1079
1087
|
especie,
|
|
1080
1088
|
valor: valorTotal,
|
|
1081
|
-
|
|
1082
|
-
|
|
1089
|
+
valor_desconto: 0,
|
|
1090
|
+
valor_juros: 0,
|
|
1091
|
+
valor_multa: 0,
|
|
1092
|
+
valor_total: 0
|
|
1083
1093
|
};
|
|
1084
1094
|
documentos.push(documento);
|
|
1085
1095
|
}
|
|
@@ -1094,7 +1104,7 @@ function gerarRetorno2({ dados }) {
|
|
|
1094
1104
|
}
|
|
1095
1105
|
}
|
|
1096
1106
|
|
|
1097
|
-
// src/bradesco/index.ts
|
|
1107
|
+
// src/banks/bradesco/index.ts
|
|
1098
1108
|
var bradesco = {
|
|
1099
1109
|
gerarDadosBoleto: gerarDadosBoleto2,
|
|
1100
1110
|
gerarPDF: gerarPDF2,
|
|
@@ -1102,33 +1112,852 @@ var bradesco = {
|
|
|
1102
1112
|
gerarRetorno: gerarRetorno2
|
|
1103
1113
|
};
|
|
1104
1114
|
|
|
1105
|
-
// src/
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1115
|
+
// src/banks/sicredi/gerarDadosBoleto.ts
|
|
1116
|
+
var import_date_fns5 = require("date-fns");
|
|
1117
|
+
function gerarDadosBoleto3({ dados }) {
|
|
1118
|
+
try {
|
|
1119
|
+
const { bancario, parcela } = dados;
|
|
1120
|
+
parcela.valor = Number(parcela.valor);
|
|
1121
|
+
const fatorVencimento = getFatorVencimento3(parcela.vencimento);
|
|
1122
|
+
const valor = getValor3(parcela.valor);
|
|
1123
|
+
const nossoNumero = getNossoNumero(
|
|
1124
|
+
parcela.numeroUnico,
|
|
1125
|
+
bancario.agencia,
|
|
1126
|
+
bancario.posto,
|
|
1127
|
+
bancario.codigoCedente
|
|
1128
|
+
);
|
|
1129
|
+
let campoLivre = bancario.tipoCobranca + bancario.tipoCarteira + nossoNumero + bancario.agencia.padStart(4, "0") + bancario.posto.padStart(2, "0") + bancario.codigoCedente.padStart(5, "0") + 10;
|
|
1130
|
+
const digitoCampoLivre = getDigitoCampoLivre(campoLivre);
|
|
1131
|
+
campoLivre = campoLivre + digitoCampoLivre;
|
|
1132
|
+
const digitoGeral = getDigitoGeral3(`7489${fatorVencimento}${valor}${campoLivre}`);
|
|
1133
|
+
const codigoBarra2 = `7489${digitoGeral}${fatorVencimento}${valor}${campoLivre}`;
|
|
1134
|
+
const campo1 = copy(codigoBarra2, 1, 3) + copy(codigoBarra2, 4, 4) + copy(codigoBarra2, 20, 24);
|
|
1135
|
+
const campo2 = copy(codigoBarra2, 25, 34);
|
|
1136
|
+
const campo3 = copy(codigoBarra2, 35, 44);
|
|
1137
|
+
const campo4 = copy(codigoBarra2, 5, 5);
|
|
1138
|
+
const campo5 = copy(codigoBarra2, 6, 9) + copy(codigoBarra2, 10, 19);
|
|
1139
|
+
const digito1 = getDigito3(campo1);
|
|
1140
|
+
const digito2 = getDigito3(campo2);
|
|
1141
|
+
const digito3 = getDigito3(campo3);
|
|
1142
|
+
const linhaDigitavel = campo1 + digito1 + campo2 + digito2 + campo3 + digito3 + campo4 + /*digito4*/
|
|
1143
|
+
+campo5;
|
|
1144
|
+
const dadosBoleto = {
|
|
1145
|
+
linhaDigitavel,
|
|
1146
|
+
fatorVencimento,
|
|
1147
|
+
valor,
|
|
1148
|
+
nossoNumero,
|
|
1149
|
+
campoLivre,
|
|
1150
|
+
digitoGeral,
|
|
1151
|
+
codigoBarra: codigoBarra2
|
|
1152
|
+
};
|
|
1153
|
+
return dadosBoleto;
|
|
1154
|
+
} catch (error) {
|
|
1155
|
+
console.log("Falha ao gerar dados do boleto", error);
|
|
1156
|
+
return null;
|
|
1109
1157
|
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1158
|
+
}
|
|
1159
|
+
function getNossoNumero(id, agencia, posto, codigoCedente) {
|
|
1160
|
+
let i = 19;
|
|
1161
|
+
let j = 1;
|
|
1162
|
+
let soma = 0;
|
|
1163
|
+
let digito = 0;
|
|
1164
|
+
const texto = agencia.padStart(4, "0") + posto.padStart(2, "0") + codigoCedente.padStart(5, "0") + id.padStart(8, "0");
|
|
1165
|
+
while (i >= 1) {
|
|
1166
|
+
j++;
|
|
1167
|
+
if (j === 10)
|
|
1168
|
+
j = 2;
|
|
1169
|
+
const valor = Number(copy(texto, i, i));
|
|
1170
|
+
soma += j * valor;
|
|
1171
|
+
i--;
|
|
1112
1172
|
}
|
|
1173
|
+
const restoDivisao = soma % 11;
|
|
1174
|
+
digito = 11 - restoDivisao;
|
|
1175
|
+
if (restoDivisao === 0 || restoDivisao === 1)
|
|
1176
|
+
digito = 0;
|
|
1177
|
+
return id.padStart(8, "0") + digito.toString();
|
|
1113
1178
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1179
|
+
function getFatorVencimento3(vencimento) {
|
|
1180
|
+
const data = new Date(1997, 9, 7);
|
|
1181
|
+
return (0, import_date_fns5.differenceInDays)(new Date(vencimento), data).toString();
|
|
1182
|
+
}
|
|
1183
|
+
function getValor3(valor) {
|
|
1184
|
+
const valorFormatado = valor.toFixed(2).replace(/\D/g, "");
|
|
1185
|
+
return valorFormatado.padStart(10, "0");
|
|
1186
|
+
}
|
|
1187
|
+
function getDigitoCampoLivre(texto) {
|
|
1188
|
+
let i = 24;
|
|
1189
|
+
let j = 1;
|
|
1190
|
+
let soma = 0;
|
|
1191
|
+
let digito = 0;
|
|
1192
|
+
while (i >= 1) {
|
|
1193
|
+
j++;
|
|
1194
|
+
if (j === 10)
|
|
1195
|
+
j = 2;
|
|
1196
|
+
let valor = Number(copy(texto, i, i));
|
|
1197
|
+
soma += valor * j;
|
|
1198
|
+
i--;
|
|
1119
1199
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1200
|
+
const restoDivisao = soma % 11;
|
|
1201
|
+
if (restoDivisao > 1)
|
|
1202
|
+
digito = 11 - restoDivisao;
|
|
1203
|
+
return String(digito);
|
|
1204
|
+
}
|
|
1205
|
+
function getDigitoGeral3(texto) {
|
|
1206
|
+
let i = 43;
|
|
1207
|
+
let j = 1;
|
|
1208
|
+
let soma = 0;
|
|
1209
|
+
let digito = 0;
|
|
1210
|
+
while (i >= 1) {
|
|
1211
|
+
j++;
|
|
1212
|
+
if (j === 10)
|
|
1213
|
+
j = 2;
|
|
1214
|
+
const valor = Number(copy(texto, i, i));
|
|
1215
|
+
soma += j * valor;
|
|
1216
|
+
i--;
|
|
1217
|
+
}
|
|
1218
|
+
const restoDivisao = soma % 11;
|
|
1219
|
+
digito = 11 - restoDivisao;
|
|
1220
|
+
if (digito <= 1 || digito >= 10)
|
|
1221
|
+
digito = 1;
|
|
1222
|
+
return String(digito);
|
|
1223
|
+
}
|
|
1224
|
+
function getDigito3(texto) {
|
|
1225
|
+
let i = texto.length;
|
|
1226
|
+
let j = 1;
|
|
1227
|
+
let total = 0;
|
|
1228
|
+
let soma = 0;
|
|
1229
|
+
let digito = 0;
|
|
1230
|
+
while (i >= 1) {
|
|
1231
|
+
j = j === 1 ? 2 : 1;
|
|
1232
|
+
let valor = Number(copy(texto, i, i));
|
|
1233
|
+
total = valor * j;
|
|
1234
|
+
if (total >= 10) {
|
|
1235
|
+
valor = Number(copy(total, 1, 1)) + Number(copy(total, 2, 2));
|
|
1236
|
+
} else {
|
|
1237
|
+
valor = total;
|
|
1238
|
+
}
|
|
1239
|
+
soma += valor;
|
|
1240
|
+
i--;
|
|
1122
1241
|
}
|
|
1242
|
+
const uni = Number(copy(soma, String(soma).length, String(soma).length));
|
|
1243
|
+
digito = 10 - uni;
|
|
1244
|
+
if (digito === 10)
|
|
1245
|
+
digito = 0;
|
|
1246
|
+
return String(digito);
|
|
1123
1247
|
}
|
|
1124
1248
|
|
|
1125
|
-
// src/
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1249
|
+
// src/banks/sicredi/gerarPDF.ts
|
|
1250
|
+
var import_bwip_js3 = __toESM(require("bwip-js"));
|
|
1251
|
+
function gerarPDF3(_0) {
|
|
1252
|
+
return __async(this, arguments, function* ({ dados }) {
|
|
1253
|
+
var _a, _b, _c, _d;
|
|
1254
|
+
try {
|
|
1255
|
+
const { generatePDF, dadosPDF } = dados;
|
|
1256
|
+
const codigoBarra2 = yield import_bwip_js3.default.toBuffer({
|
|
1257
|
+
bcid: "interleaved2of5",
|
|
1258
|
+
text: dadosPDF.boleto.codigoBarra,
|
|
1259
|
+
height: 20
|
|
1260
|
+
});
|
|
1261
|
+
dadosPDF.beneficiario.dadosBancario.agencia = dadosPDF.beneficiario.dadosBancario.agencia.padStart(4, "0");
|
|
1262
|
+
dadosPDF.boleto.linhaDigitavel = maskFormat_default.codigoBarra(dadosPDF.boleto.linhaDigitavel);
|
|
1263
|
+
dadosPDF.boleto.codigoBarraImage = codigoBarra2.toString("base64");
|
|
1264
|
+
dadosPDF.beneficiario.cnpj = maskFormat_default.retornaCpfCnpjFormatado(
|
|
1265
|
+
dadosPDF.beneficiario.cnpj
|
|
1266
|
+
);
|
|
1267
|
+
dadosPDF.beneficiario.endereco.cep = maskFormat_default.retornaCEPFormatado(
|
|
1268
|
+
dadosPDF.beneficiario.endereco.cep
|
|
1269
|
+
);
|
|
1270
|
+
dadosPDF.pagador.endereco.cep = maskFormat_default.retornaCEPFormatado(
|
|
1271
|
+
dadosPDF.pagador.endereco.cep
|
|
1272
|
+
);
|
|
1273
|
+
dadosPDF.pagador.cnpj = maskFormat_default.retornaCpfCnpjFormatado(dadosPDF.pagador.cnpj);
|
|
1274
|
+
dadosPDF.boleto.valorAcrescimo = maskFormat_default.numberToReal(
|
|
1275
|
+
dadosPDF.boleto.valorAcrescimo
|
|
1276
|
+
);
|
|
1277
|
+
dadosPDF.boleto.valorCobrado = maskFormat_default.numberToReal(
|
|
1278
|
+
dadosPDF.boleto.valorCobrado
|
|
1279
|
+
);
|
|
1280
|
+
dadosPDF.boleto.valorDescontoAbatimento = maskFormat_default.numberToReal(
|
|
1281
|
+
dadosPDF.boleto.valorDescontoAbatimento
|
|
1282
|
+
);
|
|
1283
|
+
dadosPDF.boleto.valorDocumento = maskFormat_default.numberToReal(
|
|
1284
|
+
dadosPDF.boleto.valorDocumento
|
|
1285
|
+
);
|
|
1286
|
+
dadosPDF.boleto.valorMulta = maskFormat_default.numberToReal(dadosPDF.boleto.valorMulta);
|
|
1287
|
+
dadosPDF.boleto.valorOutrasDeducoes = maskFormat_default.numberToReal(
|
|
1288
|
+
dadosPDF.boleto.valorOutrasDeducoes
|
|
1289
|
+
);
|
|
1290
|
+
if (dadosPDF.boleto.quantidade) {
|
|
1291
|
+
dadosPDF.boleto.quantidade = maskFormat_default.numberToReal(dadosPDF.boleto.quantidade);
|
|
1292
|
+
}
|
|
1293
|
+
const jurosMes = Number(((_a = dadosPDF.beneficiario.dadosBancario) == null ? void 0 : _a.juros) || 0);
|
|
1294
|
+
if (jurosMes > 0) {
|
|
1295
|
+
dadosPDF.boleto.instrucao1 = `COBRAR JUROS DE ${jurosMes}% AO M\xCAS, AP\xD3S O VENCIMENTO`;
|
|
1296
|
+
}
|
|
1297
|
+
const descontoVencimento = Number(((_b = dadosPDF.beneficiario.dadosBancario) == null ? void 0 : _b.desconto) || 0);
|
|
1298
|
+
if (descontoVencimento > 0) {
|
|
1299
|
+
dadosPDF.boleto.instrucao2 = `AT\xC9 O VENCIMENTO, CONCEDER DESCONTO DE ${descontoVencimento}%`;
|
|
1300
|
+
}
|
|
1301
|
+
const multaAtraso = Number(((_c = dadosPDF.beneficiario.dadosBancario) == null ? void 0 : _c.multa) || 0);
|
|
1302
|
+
if (multaAtraso > 0) {
|
|
1303
|
+
dadosPDF.boleto.instrucao3 = `MULTA DE ${multaAtraso} %`;
|
|
1304
|
+
}
|
|
1305
|
+
const protestoDias = Number(((_d = dadosPDF.beneficiario.dadosBancario) == null ? void 0 : _d.protesto) || 0);
|
|
1306
|
+
if (protestoDias > 0) {
|
|
1307
|
+
dadosPDF.boleto.instrucao4 = `PROTESTAR AP\xD3S ${protestoDias} DIAS CORRIDOS DO VENCIMENTO`;
|
|
1308
|
+
}
|
|
1309
|
+
dadosPDF.boleto.valor = maskFormat_default.numberToReal(dadosPDF.boleto.valor);
|
|
1310
|
+
const content = compileHbs(getPathTemplates("sicredi-boleto.hbs"), dadosPDF);
|
|
1311
|
+
const config = {
|
|
1312
|
+
displayHeaderFooter: false,
|
|
1313
|
+
path: "./boleto.pdf",
|
|
1314
|
+
format: "a4",
|
|
1315
|
+
printBackground: true
|
|
1316
|
+
};
|
|
1317
|
+
let pdfBase64 = null;
|
|
1318
|
+
if (generatePDF) {
|
|
1319
|
+
pdfBase64 = yield generatePDF(content, config);
|
|
1320
|
+
} else {
|
|
1321
|
+
if (!api.defaults.baseURL) {
|
|
1322
|
+
throw new Error("BaseURL api not found");
|
|
1323
|
+
}
|
|
1324
|
+
const response = yield api.post("/", { content, config });
|
|
1325
|
+
pdfBase64 = response.data;
|
|
1326
|
+
}
|
|
1327
|
+
return {
|
|
1328
|
+
erro: false,
|
|
1329
|
+
dados: pdfBase64
|
|
1330
|
+
};
|
|
1331
|
+
} catch (error) {
|
|
1332
|
+
console.log(error);
|
|
1333
|
+
return {
|
|
1334
|
+
erro: true,
|
|
1335
|
+
dados: error
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// src/banks/sicredi/gerarRemessa.ts
|
|
1342
|
+
var import_date_fns6 = require("date-fns");
|
|
1343
|
+
function gerarRemessa3({ dados }) {
|
|
1344
|
+
try {
|
|
1345
|
+
const { dadosBancario, beneficiario, boletos } = dados.remessa;
|
|
1346
|
+
const arquivo = new Arquivo();
|
|
1347
|
+
const dataAtual = (0, import_date_fns6.format)(/* @__PURE__ */ new Date(), "ddMMyyyy");
|
|
1348
|
+
const dia = copy(dataAtual, 1, 2);
|
|
1349
|
+
const mes = copy(dataAtual, 2, 4);
|
|
1350
|
+
let protestar = "00";
|
|
1351
|
+
let negativar = "0000";
|
|
1352
|
+
if (dadosBancario.diasProtesto > 0) {
|
|
1353
|
+
protestar = "06";
|
|
1354
|
+
}
|
|
1355
|
+
const remessa2 = `${dadosBancario.codigo_cedente}`;
|
|
1356
|
+
arquivo.add("01REMESSA");
|
|
1357
|
+
arquivo.add("01");
|
|
1358
|
+
arquivo.add("COBRANCA".padEnd(15, " "));
|
|
1359
|
+
arquivo.add(dadosBancario.codigo_cedente);
|
|
1360
|
+
arquivo.add(beneficiario.cnpj);
|
|
1361
|
+
arquivo.add(" ".padEnd(31, " "));
|
|
1362
|
+
arquivo.add("748");
|
|
1363
|
+
arquivo.add("SICREDI".padEnd(15, " "));
|
|
1364
|
+
arquivo.add((0, import_date_fns6.format)(/* @__PURE__ */ new Date(), "yyyyMMdd"));
|
|
1365
|
+
arquivo.add(" ".padEnd(8, " "));
|
|
1366
|
+
arquivo.add(dadosBancario.numeroRemessa.padStart(7, "0"));
|
|
1367
|
+
arquivo.add(" ".padEnd(273, " "));
|
|
1368
|
+
arquivo.add("2.00");
|
|
1369
|
+
arquivo.add("000001");
|
|
1370
|
+
arquivo.addLine();
|
|
1371
|
+
let sequencia = 2;
|
|
1372
|
+
let total = 0;
|
|
1373
|
+
for (const boleto of boletos) {
|
|
1374
|
+
const { pagador } = boleto;
|
|
1375
|
+
total += Number(boleto.valor);
|
|
1376
|
+
console.log(pagador);
|
|
1377
|
+
let nossoNumero = "100010001";
|
|
1378
|
+
let tipoInscricao = pagador.pessoa === "F" ? "1" : "";
|
|
1379
|
+
const desconto = dadosBancario.descontoPagamento > 0 ? dadosBancario.descontoPagamento.toFixed(2) : "0";
|
|
1380
|
+
const dataDesconto = (0, import_date_fns6.format)(new Date(boleto.vencimento), "ddMMyy");
|
|
1381
|
+
let valorJurosDias = Number(boleto.valor) + Number(dadosBancario.jurosMes) / 100 / 30;
|
|
1382
|
+
let multaAtraso = String(dadosBancario.multaAtraso * 100);
|
|
1383
|
+
arquivo.add("1");
|
|
1384
|
+
arquivo.add("AAA");
|
|
1385
|
+
arquivo.add(" ".padEnd(12, " "));
|
|
1386
|
+
arquivo.add("AAA");
|
|
1387
|
+
arquivo.add(" ".padEnd(28, " "));
|
|
1388
|
+
arquivo.add(nossoNumero.padEnd(9, " "));
|
|
1389
|
+
arquivo.add(" ".padEnd(6, " "));
|
|
1390
|
+
arquivo.add((0, import_date_fns6.format)(new Date(boleto.emissao), "yyyyMMdd"));
|
|
1391
|
+
arquivo.add(" ");
|
|
1392
|
+
arquivo.add("N");
|
|
1393
|
+
arquivo.add(" ");
|
|
1394
|
+
arquivo.add("B");
|
|
1395
|
+
arquivo.add("0000");
|
|
1396
|
+
arquivo.add(" ".padEnd(4, " "));
|
|
1397
|
+
arquivo.add("0".padEnd(10, "0"));
|
|
1398
|
+
arquivo.add(multaAtraso.padStart(4, "0"));
|
|
1399
|
+
arquivo.add(" ".padEnd(12, " "));
|
|
1400
|
+
arquivo.add("01");
|
|
1401
|
+
arquivo.add(boleto.identificacaoTitulo.padEnd(10, " "));
|
|
1402
|
+
arquivo.add((0, import_date_fns6.format)(new Date(boleto.vencimento), "ddMMyy"));
|
|
1403
|
+
arquivo.add(Number(boleto.valor).toFixed(2).replace(".", "").padStart(13, "0"));
|
|
1404
|
+
arquivo.add(" ".padEnd(9, " "));
|
|
1405
|
+
arquivo.add("AN");
|
|
1406
|
+
arquivo.add((0, import_date_fns6.format)(new Date(boleto.emissao), "ddMMyy"));
|
|
1407
|
+
arquivo.add(protestar);
|
|
1408
|
+
arquivo.add(String(dadosBancario.diasProtesto).padStart(2, "0"));
|
|
1409
|
+
arquivo.add(Number(valorJurosDias).toFixed(2).replace(".", "").padStart(13, "0"));
|
|
1410
|
+
arquivo.add(dataDesconto);
|
|
1411
|
+
arquivo.add(Number(desconto).toFixed(2).replace(".", "").padStart(13, "0"));
|
|
1412
|
+
arquivo.add(negativar);
|
|
1413
|
+
arquivo.add("0".padEnd(22, "0"));
|
|
1414
|
+
arquivo.add(tipoInscricao);
|
|
1415
|
+
arquivo.add("0");
|
|
1416
|
+
arquivo.add(pagador.cpfCnpj.padStart(14, "0"));
|
|
1417
|
+
arquivo.add(removerAcentos(pagador.nome).substring(0, 40).padEnd(40, " "));
|
|
1418
|
+
arquivo.add(pagador.endereco.logradouro.substring(0, 40).padEnd(40, " "));
|
|
1419
|
+
arquivo.add("0".padEnd(11, "0"));
|
|
1420
|
+
arquivo.add(" ");
|
|
1421
|
+
arquivo.add(pagador.endereco.cep.padEnd(8, " "));
|
|
1422
|
+
arquivo.add("00000");
|
|
1423
|
+
arquivo.add(" ".padEnd(55, " "));
|
|
1424
|
+
arquivo.add(String(sequencia).padStart(6, "0"));
|
|
1425
|
+
arquivo.addLine();
|
|
1426
|
+
sequencia++;
|
|
1427
|
+
}
|
|
1428
|
+
arquivo.add("91748");
|
|
1429
|
+
arquivo.add(dadosBancario.codigo_cedente);
|
|
1430
|
+
arquivo.add(" ".padEnd(384, " "));
|
|
1431
|
+
arquivo.add(String(sequencia).padStart(6, "0"));
|
|
1432
|
+
return {
|
|
1433
|
+
download: "teste.rem",
|
|
1434
|
+
arquivo: arquivo.getArquivo()
|
|
1435
|
+
};
|
|
1436
|
+
} catch (error) {
|
|
1437
|
+
console.log(error);
|
|
1438
|
+
return null;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// src/banks/sicredi/index.ts
|
|
1443
|
+
var sicredi = {
|
|
1444
|
+
gerarDadosBoleto: gerarDadosBoleto3,
|
|
1445
|
+
gerarPDF: gerarPDF3,
|
|
1446
|
+
gerarRemessa: gerarRemessa3
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
// src/banks/sicoob/gerarDadosBoleto.ts
|
|
1450
|
+
var import_date_fns7 = require("date-fns");
|
|
1451
|
+
function gerarDadosBoleto4({ dados }) {
|
|
1452
|
+
try {
|
|
1453
|
+
const { bancario, parcela } = dados;
|
|
1454
|
+
if (!bancario.modalidade) {
|
|
1455
|
+
bancario.modalidade = "01";
|
|
1456
|
+
}
|
|
1457
|
+
bancario.modalidade = padLeft(bancario.modalidade, 2);
|
|
1458
|
+
const nossoNumero = getNossoNumero2(bancario.agencia, bancario.codigo_cliente, parcela.id_boleto);
|
|
1459
|
+
const fatorVencimento = getFatorVencimento4(parcela.vencimento);
|
|
1460
|
+
const valor = getValor4(Number(parcela.valor));
|
|
1461
|
+
const campoLivre = "1" + padLeft(copy(bancario.agencia, 1, 4), 4) + bancario.modalidade + padLeft(bancario.codigo_cliente, 7) + nossoNumero + padLeft(parcela.parcela, 3);
|
|
1462
|
+
const digitoGeral = getDigitoGeral4(`7569${fatorVencimento}${valor}${campoLivre}`);
|
|
1463
|
+
const codigoBarra2 = `7569${digitoGeral}${fatorVencimento}${valor}${campoLivre}`;
|
|
1464
|
+
const campo1 = copy(codigoBarra2, 1, 4) + copy(codigoBarra2, 20, 24);
|
|
1465
|
+
const campo2 = copy(codigoBarra2, 25, 34);
|
|
1466
|
+
const campo3 = copy(codigoBarra2, 35, 44);
|
|
1467
|
+
const campo4 = copy(codigoBarra2, 5, 5);
|
|
1468
|
+
const campo5 = copy(codigoBarra2, 6, 9) + copy(codigoBarra2, 10, 19);
|
|
1469
|
+
const digito1 = getDigito4(campo1);
|
|
1470
|
+
const digito2 = getDigito4(campo2);
|
|
1471
|
+
const digito3 = getDigito4(campo3);
|
|
1472
|
+
const linhaDigitavel = campo1 + digito1 + campo2 + digito2 + campo3 + digito3 + campo4 + campo5;
|
|
1473
|
+
const dadosBoleto = {
|
|
1474
|
+
linhaDigitavel,
|
|
1475
|
+
fatorVencimento,
|
|
1476
|
+
valor,
|
|
1477
|
+
nossoNumero,
|
|
1478
|
+
campoLivre,
|
|
1479
|
+
digitoGeral,
|
|
1480
|
+
codigoBarra: codigoBarra2
|
|
1481
|
+
};
|
|
1482
|
+
return dadosBoleto;
|
|
1483
|
+
} catch (error) {
|
|
1484
|
+
console.log("Falha ao gerar dados do boleto", error);
|
|
1485
|
+
return null;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
function getFatorVencimento4(vencimento) {
|
|
1489
|
+
const data = new Date(1997, 9, 7);
|
|
1490
|
+
return (0, import_date_fns7.differenceInDays)(new Date(vencimento), data).toString().padStart(4, "0");
|
|
1491
|
+
}
|
|
1492
|
+
function getNossoNumero2(numero_cooperativa, codigo_cliente, id_boleto) {
|
|
1493
|
+
const constante_calculo = "3197";
|
|
1494
|
+
numero_cooperativa = padLeft(copy(numero_cooperativa, 1, 4), 4);
|
|
1495
|
+
codigo_cliente = padLeft(codigo_cliente, 10);
|
|
1496
|
+
id_boleto = padLeft(`${id_boleto}2`, 7);
|
|
1497
|
+
const sequencia_concatenada = numero_cooperativa + codigo_cliente + id_boleto;
|
|
1498
|
+
let soma = 0;
|
|
1499
|
+
for (let i = sequencia_concatenada.length - 1; i >= 0; i--) {
|
|
1500
|
+
soma += Number(sequencia_concatenada[i]) * Number(constante_calculo[i % constante_calculo.length]);
|
|
1501
|
+
}
|
|
1502
|
+
let dig = soma % 11;
|
|
1503
|
+
dig = dig === 1 ? dig = 0 : 11 - dig;
|
|
1504
|
+
return `${id_boleto}${dig}`;
|
|
1505
|
+
}
|
|
1506
|
+
function getValor4(valor) {
|
|
1507
|
+
const valorFormatado = valor.toFixed(2).replace(/\D/g, "");
|
|
1508
|
+
return padLeft(valorFormatado, 10);
|
|
1509
|
+
}
|
|
1510
|
+
function getDigitoGeral4(texto) {
|
|
1511
|
+
let i = 43;
|
|
1512
|
+
let j = 1;
|
|
1513
|
+
let soma = 0;
|
|
1514
|
+
let digito = 0;
|
|
1515
|
+
while (i >= 1) {
|
|
1516
|
+
j++;
|
|
1517
|
+
if (j === 10)
|
|
1518
|
+
j = 2;
|
|
1519
|
+
const valor = Number(copy(texto, i, i));
|
|
1520
|
+
soma += j * valor;
|
|
1521
|
+
i--;
|
|
1522
|
+
}
|
|
1523
|
+
const restoDivisao = soma % 11;
|
|
1524
|
+
digito = 11 - restoDivisao;
|
|
1525
|
+
if (digito === 0 || digito === 1 || digito > 9)
|
|
1526
|
+
digito = 1;
|
|
1527
|
+
return String(digito);
|
|
1528
|
+
}
|
|
1529
|
+
function getDigito4(texto) {
|
|
1530
|
+
let i = texto.length;
|
|
1531
|
+
let j = 1;
|
|
1532
|
+
let total = 0;
|
|
1533
|
+
let soma = 0;
|
|
1534
|
+
let digito = 0;
|
|
1535
|
+
while (i >= 1) {
|
|
1536
|
+
j = j === 1 ? 2 : 1;
|
|
1537
|
+
let valor = Number(copy(texto, i, i));
|
|
1538
|
+
total = valor * j;
|
|
1539
|
+
if (total >= 10) {
|
|
1540
|
+
valor = Number(copy(total, 1, 1)) + Number(copy(total, 2, 2));
|
|
1541
|
+
} else {
|
|
1542
|
+
valor = total;
|
|
1543
|
+
}
|
|
1544
|
+
soma += valor;
|
|
1545
|
+
i--;
|
|
1546
|
+
}
|
|
1547
|
+
const uni = Number(copy(soma, String(soma).length, String(soma).length));
|
|
1548
|
+
digito = 10 - uni;
|
|
1549
|
+
if (digito === 10)
|
|
1550
|
+
digito = 0;
|
|
1551
|
+
return String(digito);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
// src/banks/sicoob/gerarRemessa.ts
|
|
1555
|
+
var import_date_fns8 = require("date-fns");
|
|
1556
|
+
function gerarRemessa4({ dados }) {
|
|
1557
|
+
try {
|
|
1558
|
+
const { dadosBancario, beneficiario, boletos } = dados.remessa;
|
|
1559
|
+
const arquivo = new Arquivo();
|
|
1560
|
+
const dataAtual = /* @__PURE__ */ new Date();
|
|
1561
|
+
const data = (0, import_date_fns8.format)(dataAtual, "ddMMyyyy");
|
|
1562
|
+
const hora = (0, import_date_fns8.format)(dataAtual, "HHmmss");
|
|
1563
|
+
const remessa2 = `REM${dadosBancario.numeroRemessa.padStart(6, "0")}.REM`;
|
|
1564
|
+
arquivo.add("756");
|
|
1565
|
+
arquivo.add("0000");
|
|
1566
|
+
arquivo.add("0");
|
|
1567
|
+
arquivo.add(" ".padEnd(9, " "));
|
|
1568
|
+
arquivo.add("2");
|
|
1569
|
+
arquivo.add(beneficiario.cnpj);
|
|
1570
|
+
arquivo.add(" ".padEnd(20, " "));
|
|
1571
|
+
arquivo.add(dadosBancario.agencia.padStart(6, "0"));
|
|
1572
|
+
arquivo.add(dadosBancario.conta.padStart(13, "0"));
|
|
1573
|
+
arquivo.add("0");
|
|
1574
|
+
arquivo.add(beneficiario.nome.padEnd(30, " "));
|
|
1575
|
+
arquivo.add("SICOOB".padEnd(30, " "));
|
|
1576
|
+
arquivo.add(" ".padEnd(10, " "));
|
|
1577
|
+
arquivo.add("1");
|
|
1578
|
+
arquivo.add(data);
|
|
1579
|
+
arquivo.add(hora);
|
|
1580
|
+
arquivo.add(dadosBancario.numeroRemessa.padStart(6, "0"));
|
|
1581
|
+
arquivo.add("081");
|
|
1582
|
+
arquivo.add("00000");
|
|
1583
|
+
arquivo.add(" ".padEnd(69, " "));
|
|
1584
|
+
arquivo.addLine();
|
|
1585
|
+
arquivo.add("756");
|
|
1586
|
+
arquivo.add("0001");
|
|
1587
|
+
arquivo.add("1");
|
|
1588
|
+
arquivo.add("R");
|
|
1589
|
+
arquivo.add("01");
|
|
1590
|
+
arquivo.add(" ");
|
|
1591
|
+
arquivo.add("040");
|
|
1592
|
+
arquivo.add(" ");
|
|
1593
|
+
arquivo.add("2");
|
|
1594
|
+
arquivo.add(beneficiario.cnpj.padStart(15, "0"));
|
|
1595
|
+
arquivo.add(" ".padEnd(20, " "));
|
|
1596
|
+
arquivo.add(dadosBancario.agencia.padStart(6, "0"));
|
|
1597
|
+
arquivo.add(dadosBancario.conta.padStart(13, "0"));
|
|
1598
|
+
arquivo.add(" ");
|
|
1599
|
+
arquivo.add(beneficiario.nome.padEnd(30, " "));
|
|
1600
|
+
arquivo.add(" ".padEnd(80, " "));
|
|
1601
|
+
arquivo.add(dadosBancario.numeroRemessa.padStart(8, "0"));
|
|
1602
|
+
arquivo.add(data);
|
|
1603
|
+
arquivo.add("00000000");
|
|
1604
|
+
arquivo.add(" ".padEnd(33, " "));
|
|
1605
|
+
arquivo.addLine();
|
|
1606
|
+
let sequencia = 0;
|
|
1607
|
+
let quantidadeRegistro = 0;
|
|
1608
|
+
let total = 0;
|
|
1609
|
+
for (const boleto of boletos) {
|
|
1610
|
+
const { pagador } = boleto;
|
|
1611
|
+
const vencimento = (0, import_date_fns8.format)(new Date(boleto.vencimento), "ddMMyyyy");
|
|
1612
|
+
const valor_juros_dia = Number(boleto.valor) * dadosBancario.jurosMes / 100 / 30;
|
|
1613
|
+
const protesto = dadosBancario.diasProtesto > 0 ? "1" : "3";
|
|
1614
|
+
const diasProtesto = protesto === "1" ? dadosBancario.diasProtesto.toString() : "00";
|
|
1615
|
+
if (dadosBancario.aceite === "S") {
|
|
1616
|
+
dadosBancario.aceite = "A";
|
|
1617
|
+
}
|
|
1618
|
+
total += Number(boleto.valor);
|
|
1619
|
+
sequencia++;
|
|
1620
|
+
arquivo.add("756");
|
|
1621
|
+
arquivo.add("0001");
|
|
1622
|
+
arquivo.add("3");
|
|
1623
|
+
arquivo.add(sequencia.toString().padStart(5, "0"));
|
|
1624
|
+
arquivo.add("P");
|
|
1625
|
+
arquivo.add(" ");
|
|
1626
|
+
arquivo.add("01");
|
|
1627
|
+
arquivo.add(dadosBancario.agencia.padStart(6, "0"));
|
|
1628
|
+
arquivo.add(dadosBancario.conta.padStart(13, "0"));
|
|
1629
|
+
arquivo.add(" ");
|
|
1630
|
+
arquivo.add(boleto.nossoNumero.padStart(10, "0"));
|
|
1631
|
+
arquivo.add(boleto.parcela.toString().padStart(2, "0"));
|
|
1632
|
+
arquivo.add(dadosBancario.modalidade.padStart(2, "0"));
|
|
1633
|
+
arquivo.add("6");
|
|
1634
|
+
arquivo.add(" ".padEnd(5, " "));
|
|
1635
|
+
arquivo.add(dadosBancario.carteira);
|
|
1636
|
+
arquivo.add("0 22");
|
|
1637
|
+
arquivo.add(`${boleto.numeroDocumento}/${Number(boleto.parcela)}`.padEnd(15, " "));
|
|
1638
|
+
arquivo.add(vencimento);
|
|
1639
|
+
arquivo.add(Number(boleto.valor).toFixed(2).replace(".", "").padStart(15, "0"));
|
|
1640
|
+
arquivo.add("00000");
|
|
1641
|
+
arquivo.add(" ");
|
|
1642
|
+
arquivo.add("02");
|
|
1643
|
+
arquivo.add(dadosBancario.aceite);
|
|
1644
|
+
arquivo.add(data);
|
|
1645
|
+
arquivo.add("1");
|
|
1646
|
+
arquivo.add((0, import_date_fns8.format)((0, import_date_fns8.addDays)(new Date(boleto.vencimento), 1), "ddMMyyyy"));
|
|
1647
|
+
arquivo.add(valor_juros_dia.toFixed(2).replace(".", "").padStart(15, "0"));
|
|
1648
|
+
arquivo.add("0");
|
|
1649
|
+
arquivo.add("00000000");
|
|
1650
|
+
arquivo.add("000000000000000");
|
|
1651
|
+
arquivo.add("000000000000000");
|
|
1652
|
+
arquivo.add("000000000000000");
|
|
1653
|
+
arquivo.add(" ".padEnd(25, " "));
|
|
1654
|
+
arquivo.add(protesto);
|
|
1655
|
+
arquivo.add(diasProtesto.padStart(2, "0"));
|
|
1656
|
+
arquivo.add("0");
|
|
1657
|
+
arquivo.add(" ");
|
|
1658
|
+
arquivo.add("09");
|
|
1659
|
+
arquivo.add("0000000000");
|
|
1660
|
+
arquivo.add(" ");
|
|
1661
|
+
sequencia++;
|
|
1662
|
+
arquivo.addLine();
|
|
1663
|
+
let tipoInscricao = "1";
|
|
1664
|
+
if (pagador.pessoa === "F") {
|
|
1665
|
+
tipoInscricao = "1";
|
|
1666
|
+
} else {
|
|
1667
|
+
tipoInscricao = "2";
|
|
1668
|
+
}
|
|
1669
|
+
pagador.endereco.bairro = pagador.endereco.bairro.toUpperCase();
|
|
1670
|
+
pagador.endereco.logradouro = pagador.endereco.logradouro.toUpperCase();
|
|
1671
|
+
pagador.endereco.municipio = pagador.endereco.municipio.toUpperCase();
|
|
1672
|
+
pagador.endereco.uf = pagador.endereco.uf.toUpperCase();
|
|
1673
|
+
const { tipo_logradouro, logradouro } = getLogradouro(pagador.endereco.logradouro);
|
|
1674
|
+
arquivo.add("756");
|
|
1675
|
+
arquivo.add("0001");
|
|
1676
|
+
arquivo.add("3");
|
|
1677
|
+
arquivo.add(sequencia.toString().padStart(5, "0"));
|
|
1678
|
+
arquivo.add("Q");
|
|
1679
|
+
arquivo.add(" ");
|
|
1680
|
+
arquivo.add("01");
|
|
1681
|
+
arquivo.add(tipoInscricao);
|
|
1682
|
+
arquivo.add(pagador.cpfCnpj.padStart(15, "0"));
|
|
1683
|
+
arquivo.add(removerAcentos(pagador.nome.toUpperCase()).substring(0, 40).padEnd(40, " "));
|
|
1684
|
+
arquivo.add(removerAcentos(tipo_logradouro).padEnd(3, " "));
|
|
1685
|
+
arquivo.add(" ");
|
|
1686
|
+
arquivo.add(removerAcentos(logradouro).substring(0, 29).padEnd(29, " "));
|
|
1687
|
+
arquivo.add(" ");
|
|
1688
|
+
arquivo.add(pagador.endereco.numero.padEnd(6, " "));
|
|
1689
|
+
arquivo.add(removerAcentos(pagador.endereco.bairro).substring(0, 15).padEnd(15, " "));
|
|
1690
|
+
arquivo.add(pagador.endereco.cep.padEnd(8, " "));
|
|
1691
|
+
arquivo.add(removerAcentos(pagador.endereco.municipio).substring(0, 15).padEnd(15, " "));
|
|
1692
|
+
arquivo.add(removerAcentos(pagador.endereco.uf).padEnd(2, " "));
|
|
1693
|
+
arquivo.add("0");
|
|
1694
|
+
arquivo.add("000000000000000");
|
|
1695
|
+
arquivo.add(" ".padEnd(40, " "));
|
|
1696
|
+
arquivo.add("000");
|
|
1697
|
+
arquivo.add(" ".padEnd(28, " "));
|
|
1698
|
+
sequencia++;
|
|
1699
|
+
let multa = "0";
|
|
1700
|
+
let data_multa = "00000000";
|
|
1701
|
+
let percentual_multa = "000000000000000";
|
|
1702
|
+
dadosBancario.multaAtraso = Number(dadosBancario.multaAtraso || 0);
|
|
1703
|
+
if (dadosBancario.multaAtraso > 0) {
|
|
1704
|
+
multa = "2";
|
|
1705
|
+
data_multa = (0, import_date_fns8.format)((0, import_date_fns8.addDays)(new Date(boleto.vencimento), 1), "ddMMyyyy");
|
|
1706
|
+
percentual_multa = (dadosBancario.multaAtraso * 100).toString().padStart(15, "0");
|
|
1707
|
+
}
|
|
1708
|
+
arquivo.add("756");
|
|
1709
|
+
arquivo.add("0001");
|
|
1710
|
+
arquivo.add("3");
|
|
1711
|
+
arquivo.add("");
|
|
1712
|
+
arquivo.add(sequencia.toString().padStart(5, "0"));
|
|
1713
|
+
arquivo.add("R");
|
|
1714
|
+
arquivo.add(" ");
|
|
1715
|
+
arquivo.add("01");
|
|
1716
|
+
arquivo.add("0");
|
|
1717
|
+
arquivo.add("00000000");
|
|
1718
|
+
arquivo.add("000000000000000");
|
|
1719
|
+
arquivo.add("0");
|
|
1720
|
+
arquivo.add("00000000");
|
|
1721
|
+
arquivo.add("000000000000000");
|
|
1722
|
+
arquivo.add(multa);
|
|
1723
|
+
arquivo.add(data_multa);
|
|
1724
|
+
arquivo.add(percentual_multa);
|
|
1725
|
+
arquivo.add(" ".padEnd(10, " "));
|
|
1726
|
+
arquivo.add(" ".padEnd(40, " "));
|
|
1727
|
+
arquivo.add(" ".padEnd(40, " "));
|
|
1728
|
+
arquivo.add(" ".padEnd(20, " "));
|
|
1729
|
+
arquivo.add("00000000");
|
|
1730
|
+
arquivo.add("000");
|
|
1731
|
+
arquivo.add("00000");
|
|
1732
|
+
arquivo.add(" ");
|
|
1733
|
+
arquivo.add("000000000000");
|
|
1734
|
+
arquivo.add(" ");
|
|
1735
|
+
arquivo.add("0");
|
|
1736
|
+
arquivo.add(" ".padEnd(9, " "));
|
|
1737
|
+
arquivo.addLine();
|
|
1738
|
+
quantidadeRegistro++;
|
|
1739
|
+
}
|
|
1740
|
+
arquivo.add("756");
|
|
1741
|
+
arquivo.add("0001");
|
|
1742
|
+
arquivo.add("5");
|
|
1743
|
+
arquivo.add(" ".padEnd(9, " "));
|
|
1744
|
+
arquivo.add((sequencia + 2).toString().padStart(6, "0"));
|
|
1745
|
+
arquivo.add(quantidadeRegistro.toString().padStart(6, "0"));
|
|
1746
|
+
arquivo.add("00");
|
|
1747
|
+
arquivo.add(total.toFixed(2).replace(".", "").padStart(15, "0"));
|
|
1748
|
+
arquivo.add("000000000000000000000000000000000000000000000000000000000000000000000");
|
|
1749
|
+
arquivo.add(" ".padEnd(125, " "));
|
|
1750
|
+
arquivo.addLine();
|
|
1751
|
+
arquivo.add("756");
|
|
1752
|
+
arquivo.add("9999");
|
|
1753
|
+
arquivo.add("9");
|
|
1754
|
+
arquivo.add(" ".padEnd(9, " "));
|
|
1755
|
+
arquivo.add("000001");
|
|
1756
|
+
arquivo.add((sequencia + 4).toString().padStart(6, "0"));
|
|
1757
|
+
arquivo.add("000000");
|
|
1758
|
+
arquivo.add(" ".padEnd(205, " "));
|
|
1759
|
+
return {
|
|
1760
|
+
download: remessa2,
|
|
1761
|
+
arquivo: arquivo.getArquivo()
|
|
1762
|
+
};
|
|
1763
|
+
} catch (error) {
|
|
1764
|
+
console.log(error);
|
|
1765
|
+
return null;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
function getLogradouro(logradouro) {
|
|
1769
|
+
const logradouro_split = logradouro.split(" ");
|
|
1770
|
+
let tipo_logradouro = "RUA";
|
|
1771
|
+
if (/^R(\.|UA)?\b/i.test(logradouro_split[0])) {
|
|
1772
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1773
|
+
} else if (/^AV(\.|ENIDA)?\b/i.test(logradouro_split[0])) {
|
|
1774
|
+
tipo_logradouro = "AV";
|
|
1775
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1776
|
+
} else if (/^SERVIDAO\b/i.test(logradouro_split[0])) {
|
|
1777
|
+
tipo_logradouro = "SEV";
|
|
1778
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1779
|
+
} else if (/^SEV(\.)?\b/i.test(logradouro_split[0])) {
|
|
1780
|
+
tipo_logradouro = "SEV";
|
|
1781
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1782
|
+
} else if (/^ROD(\.|OVIA)?\b/i.test(logradouro_split[0])) {
|
|
1783
|
+
tipo_logradouro = "ROD";
|
|
1784
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1785
|
+
} else if (/^FAZ(\.|ENDA)?\b/i.test(logradouro_split[0])) {
|
|
1786
|
+
tipo_logradouro = "FAZ";
|
|
1787
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1788
|
+
} else if (/^EST(\.|RADA)?\b/i.test(logradouro_split[0])) {
|
|
1789
|
+
tipo_logradouro = "EST";
|
|
1790
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1791
|
+
} else if (/^ALA(\.|MEDA)?\b/i.test(logradouro_split[0])) {
|
|
1792
|
+
tipo_logradouro = "ALA";
|
|
1793
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1794
|
+
} else if (/^ENC(\.|RUZILHADA)?\b/i.test(logradouro_split[0])) {
|
|
1795
|
+
tipo_logradouro = "ENC";
|
|
1796
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1797
|
+
} else if (/^PR(\.|ACA)?\b/i.test(logradouro_split[0])) {
|
|
1798
|
+
tipo_logradouro = "PR";
|
|
1799
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1800
|
+
} else if (/^TRAVESSA\b/i.test(logradouro_split[0])) {
|
|
1801
|
+
tipo_logradouro = "TV";
|
|
1802
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1803
|
+
} else if (/^TV(\.)?\b/i.test(logradouro_split[0])) {
|
|
1804
|
+
tipo_logradouro = "TV";
|
|
1805
|
+
logradouro = logradouro_split.slice(1).join(" ");
|
|
1806
|
+
}
|
|
1807
|
+
return { tipo_logradouro, logradouro };
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
// src/banks/sicoob/gerarPDF.ts
|
|
1811
|
+
var import_bwip_js4 = __toESM(require("bwip-js"));
|
|
1812
|
+
var import_string_mask2 = __toESM(require("string-mask"));
|
|
1813
|
+
function gerarPDF4(_0) {
|
|
1814
|
+
return __async(this, arguments, function* ({ dados }) {
|
|
1815
|
+
try {
|
|
1816
|
+
const { dadosPDF, generatePDF } = dados;
|
|
1817
|
+
const codigoBarra2 = yield import_bwip_js4.default.toBuffer({
|
|
1818
|
+
bcid: "interleaved2of5",
|
|
1819
|
+
text: dadosPDF.boleto.codigoBarra,
|
|
1820
|
+
height: 20
|
|
1821
|
+
});
|
|
1822
|
+
dadosPDF.boleto.numeroDocumento = formatNumeroDocumento(
|
|
1823
|
+
dadosPDF.boleto.numeroDocumento,
|
|
1824
|
+
dadosPDF.boleto.parcela
|
|
1825
|
+
);
|
|
1826
|
+
dadosPDF.beneficiario.dadosBancario.agencia = formatAgenciaCodigoCedente(
|
|
1827
|
+
dadosPDF.beneficiario.dadosBancario.agencia,
|
|
1828
|
+
dadosPDF.beneficiario.dadosBancario.codigo_cliente
|
|
1829
|
+
);
|
|
1830
|
+
dadosPDF.boleto.nossoNumero = formatNossoNumero(
|
|
1831
|
+
dadosPDF.boleto.parcela,
|
|
1832
|
+
dadosPDF.boleto.nossoNumero
|
|
1833
|
+
);
|
|
1834
|
+
dadosPDF.pagador.cnpj = dadosPDF.pagador.cnpj.length === 11 ? `CPF: ${maskFormat_default.retornaCpfCnpjFormatado(dadosPDF.pagador.cnpj)}` : `CNPJ: ${maskFormat_default.retornaCpfCnpjFormatado(dadosPDF.pagador.cnpj)}`;
|
|
1835
|
+
dadosPDF.boleto.linhaDigitavel = maskFormat_default.codigoBarra(dadosPDF.boleto.linhaDigitavel);
|
|
1836
|
+
dadosPDF.boleto.codigoBarra = maskFormat_default.codigoBarra(dadosPDF.boleto.codigoBarra);
|
|
1837
|
+
dadosPDF.boleto.codigoBarraImage = codigoBarra2.toString("base64");
|
|
1838
|
+
dadosPDF.pagador.endereco.cep = maskFormat_default.retornaCEPFormatado(
|
|
1839
|
+
dadosPDF.pagador.endereco.cep
|
|
1840
|
+
);
|
|
1841
|
+
dadosPDF.boleto.valorAcrescimo = maskFormat_default.numberToReal(
|
|
1842
|
+
dadosPDF.boleto.valorAcrescimo
|
|
1843
|
+
);
|
|
1844
|
+
dadosPDF.boleto.valorCobrado = maskFormat_default.numberToReal(
|
|
1845
|
+
dadosPDF.boleto.valorCobrado
|
|
1846
|
+
);
|
|
1847
|
+
dadosPDF.boleto.valorDescontoAbatimento = maskFormat_default.numberToReal(
|
|
1848
|
+
dadosPDF.boleto.valorDescontoAbatimento
|
|
1849
|
+
);
|
|
1850
|
+
dadosPDF.boleto.valorDocumento = maskFormat_default.numberToReal(
|
|
1851
|
+
dadosPDF.boleto.valorDocumento
|
|
1852
|
+
);
|
|
1853
|
+
dadosPDF.boleto.valorMulta = maskFormat_default.numberToReal(dadosPDF.boleto.valorMulta);
|
|
1854
|
+
dadosPDF.boleto.valorOutrasDeducoes = maskFormat_default.numberToReal(
|
|
1855
|
+
dadosPDF.boleto.valorOutrasDeducoes
|
|
1856
|
+
);
|
|
1857
|
+
if (dadosPDF.boleto.quantidade) {
|
|
1858
|
+
dadosPDF.boleto.quantidade = maskFormat_default.numberToReal(dadosPDF.boleto.quantidade);
|
|
1859
|
+
}
|
|
1860
|
+
dadosPDF.boleto.valor = maskFormat_default.numberToReal(dadosPDF.boleto.valor);
|
|
1861
|
+
const content = compileHbs(getPathTemplates("sicoob-boleto.hbs"), dadosPDF);
|
|
1862
|
+
const config = {
|
|
1863
|
+
displayHeaderFooter: false,
|
|
1864
|
+
path: "./boleto.pdf",
|
|
1865
|
+
format: "a4",
|
|
1866
|
+
printBackground: true
|
|
1867
|
+
};
|
|
1868
|
+
let pdfBase64 = null;
|
|
1869
|
+
if (generatePDF) {
|
|
1870
|
+
pdfBase64 = yield generatePDF(content, config);
|
|
1871
|
+
} else {
|
|
1872
|
+
if (!api.defaults.baseURL) {
|
|
1873
|
+
throw new Error("BaseURL api not found");
|
|
1874
|
+
}
|
|
1875
|
+
const response = yield api.post("/", { content, config });
|
|
1876
|
+
pdfBase64 = response.data;
|
|
1877
|
+
}
|
|
1878
|
+
return {
|
|
1879
|
+
erro: false,
|
|
1880
|
+
dados: pdfBase64
|
|
1881
|
+
};
|
|
1882
|
+
} catch (error) {
|
|
1883
|
+
return {
|
|
1884
|
+
erro: true,
|
|
1885
|
+
dados: null
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
function formatAgenciaCodigoCedente(agencia, conta) {
|
|
1891
|
+
agencia = agencia.slice(0, -1).padStart(4, "0");
|
|
1892
|
+
conta = conta.padStart(7, "0");
|
|
1893
|
+
const agenciaFmt = new import_string_mask2.default("0000.000000-0");
|
|
1894
|
+
return agenciaFmt.apply(agencia + conta);
|
|
1895
|
+
}
|
|
1896
|
+
function formatNossoNumero(parcela, nossoNumero) {
|
|
1897
|
+
parcela = String(parcela).padStart(2, "0");
|
|
1898
|
+
nossoNumero = nossoNumero.padStart(8, "0");
|
|
1899
|
+
const nossoNumeroFmt = new import_string_mask2.default("00/0000000-0");
|
|
1900
|
+
return nossoNumeroFmt.apply(parcela + nossoNumero);
|
|
1901
|
+
}
|
|
1902
|
+
function formatNumeroDocumento(numeroDocumento, parcela) {
|
|
1903
|
+
parcela = String(parcela).padStart(2, "0");
|
|
1904
|
+
numeroDocumento = numeroDocumento.padStart(6, "0");
|
|
1905
|
+
const numeroDoctoFmt = new import_string_mask2.default("000000-00");
|
|
1906
|
+
return numeroDoctoFmt.apply(numeroDocumento + parcela);
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
// src/banks/sicoob/index.ts
|
|
1910
|
+
var sicoob = {
|
|
1911
|
+
gerarDadosBoleto: gerarDadosBoleto4,
|
|
1912
|
+
gerarRemessa: gerarRemessa4,
|
|
1913
|
+
gerarPDF: gerarPDF4
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
// src/gerar.ts
|
|
1917
|
+
function gerar({ banco, dados }) {
|
|
1918
|
+
if (banco === "085" /* AILOS */) {
|
|
1919
|
+
return ailos.gerarDadosBoleto({ banco, dados });
|
|
1920
|
+
}
|
|
1921
|
+
if (banco === "005" /* BRADESCO */) {
|
|
1922
|
+
return bradesco.gerarDadosBoleto({ banco, dados });
|
|
1923
|
+
}
|
|
1924
|
+
if (banco === "748" /* SICREDI */) {
|
|
1925
|
+
return sicredi.gerarDadosBoleto({ banco, dados });
|
|
1926
|
+
}
|
|
1927
|
+
if (banco === "756" /* SICOOB */) {
|
|
1928
|
+
return sicoob.gerarDadosBoleto({ banco, dados });
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
// src/pdf.ts
|
|
1933
|
+
function pdf({ banco, dados }) {
|
|
1934
|
+
if (banco === "085" /* AILOS */) {
|
|
1935
|
+
return ailos.gerarPDF({ banco, dados });
|
|
1936
|
+
}
|
|
1937
|
+
if (banco === "005" /* BRADESCO */) {
|
|
1938
|
+
return bradesco.gerarPDF({ banco, dados });
|
|
1939
|
+
}
|
|
1940
|
+
if (banco === "748" /* SICREDI */) {
|
|
1941
|
+
return sicredi.gerarPDF({ banco, dados });
|
|
1942
|
+
}
|
|
1943
|
+
if (banco === "756" /* SICOOB */) {
|
|
1944
|
+
return sicoob.gerarPDF({ banco, dados });
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
// src/remessa.ts
|
|
1949
|
+
function remessa({ banco, dados }) {
|
|
1950
|
+
if (banco === "085" /* AILOS */) {
|
|
1951
|
+
return ailos.gerarRemessa({ banco, dados });
|
|
1952
|
+
}
|
|
1953
|
+
if (banco === "005" /* BRADESCO */) {
|
|
1954
|
+
return bradesco.gerarRemessa({ banco, dados });
|
|
1955
|
+
}
|
|
1956
|
+
if (banco === "748" /* SICREDI */) {
|
|
1957
|
+
return sicredi.gerarRemessa({ banco, dados });
|
|
1958
|
+
}
|
|
1959
|
+
if (banco === "756" /* SICOOB */) {
|
|
1960
|
+
return sicoob.gerarRemessa({ banco, dados });
|
|
1132
1961
|
}
|
|
1133
1962
|
}
|
|
1134
1963
|
|