Skip to content

Commit 1b1fb0a

Browse files
Merge pull request #57 from pagarme/feat/BPROC-2543-send-cnabline-to-barramento
feat: return rawline when parsing edifile
2 parents 6528c0d + 4e72b21 commit 1b1fb0a

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

banks/bradesco/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ exports.parseEDIFile = function (fileContent) {
140140
boleto['valor_pago'] = formatters.removeTrailingZeros(line.substring(253, 266))
141141
boleto['juros_mora'] = formatters.removeTrailingZeros(line.substring(266, 279))
142142
boleto['outros_creditos'] = formatters.removeTrailingZeros(line.substring(279, 292))
143+
boleto['raw_line'] = line
143144

144145
parsedFile.boletos.push(boleto)
145146
}

banks/caixa/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ exports.parseEDIFile = function (fileContent) {
5252
boleto['valor_pago'] = formatters.removeTrailingZeros(line.substring(253, 266))
5353
boleto['juros_mora'] = formatters.removeTrailingZeros(line.substring(266, 279))
5454
boleto['outros_creditos'] = formatters.removeTrailingZeros(line.substring(279, 292))
55+
boleto['raw_line'] = line
5556

5657
parsedFile.boletos.push(boleto)
5758
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-boleto",
3-
"version": "2.2.3",
3+
"version": "2.3.0",
44
"description": "Boleto generator in Node.js",
55
"main": "index.js",
66
"scripts": {

test/integration/bradesco/edi.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ describe('Bradesco EDI Parser', () => {
5050
edi_line_number: 2,
5151
edi_line_checksum: '20c5b6ebeb167ffb24ebe64316a3433a193de0bf',
5252
edi_line_fingerprint: '2:20c5b6ebeb167ffb24ebe64316a3433a193de0bf',
53-
nosso_numero: '6'
53+
nosso_numero: '6',
54+
raw_line: '1021872705300017400000250122900004693 000000000000000000600000000000000000000000000506200516 00000000000000000000000000000000000150034103830 000000000000000000000000000000000000100000000000020000000000003000000000000400000000000010000000000005000000000000600 210516 00000000000000 000002'
5455
})
5556
})
5657

@@ -78,7 +79,8 @@ describe('Bradesco EDI Parser', () => {
7879
edi_line_number: 3,
7980
edi_line_checksum: '686bf39b5d6533b49466e78391d1eeb593cb0db4',
8081
edi_line_fingerprint: '3:686bf39b5d6533b49466e78391d1eeb593cb0db4',
81-
nosso_numero: '27861336'
82+
nosso_numero: '27861336',
83+
raw_line: '1021872705300017400000260122900004693 00000000000278613362000000000000000000000000060610041927861336 00000000000278613362090419000000000060934100262 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000071400000000001050000000000000 110419 00000000000000 152328'
8284
})
8385
})
8486

test/integration/caixa/edi.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ describe('Caixa EDI Parser', () => {
4444
edi_line_number: 2,
4545
edi_line_checksum: '63b840504d94be3e264437f18a90ed7cd79ce4ed',
4646
edi_line_fingerprint: '2:63b840504d94be3e264437f18a90ed7cd79ce4ed',
47-
nosso_numero: '73110483'
47+
nosso_numero: '73110483',
48+
raw_line: '10218727053000174 110338820 73110483 14000000073110483 012101022173110483 080221000000000011310408575090000000000115004101020221 0000000000000000000000000000000000000000000000000113000000000000000000000000001020221 000002'
4849
})
4950
})
5051

@@ -65,7 +66,8 @@ describe('Caixa EDI Parser', () => {
6566
edi_line_number: 3,
6667
edi_line_checksum: '1cab47fa2079068396aa5a3b1c4ccec59d1880be',
6768
edi_line_fingerprint: '3:1cab47fa2079068396aa5a3b1c4ccec59d1880be',
68-
nosso_numero: '73110483'
69+
nosso_numero: '73110483',
70+
raw_line: '10218727053000174 110338820 14000000073110483 010101022173110483 080221000000000011310400235090000000000000000000010221 0000000000000000000000000000000000000000000000000000000000000000000000000000001000000 000003'
6971
})
7072
})
7173

0 commit comments

Comments
 (0)