@alexssmusica/node-pdf-nfe 1.0.58 → 1.0.59

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.
@@ -7,7 +7,7 @@ const linha_horizontal_1 = require("./linha-horizontal");
7
7
  const linha_vertical_1 = require("./linha-vertical");
8
8
  const date_fns_1 = require("date-fns");
9
9
  function getFaturaDuplicata({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, cobr }) {
10
- if (cobr !== undefined) {
10
+ if (cobr !== undefined && Object.keys(cobr).length > 0) {
11
11
  (0, secao_1.secao)({ doc, value: 'FATURA / DUPLICATA', x: 1.5, y: y + 12, largura: 0, ajusteX, ajusteY, margemEsquerda, margemTopo });
12
12
  if (cobr.fat !== undefined) {
13
13
  doc.font('negrito')
@@ -23,14 +23,16 @@ function getFaturaDuplicata({ y, doc, ajusteX, ajusteY, margemDireita, margemEsq
23
23
  .font('negrito').text(' Valor Desconto:', { continued: true }).font('normal').text(` ${Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(cobr.fat.vDesc))}`, { continued: true })
24
24
  .font('negrito').text(' Valor Líquido:', { continued: true }).font('normal').text(` ${Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(cobr.fat.vLiq))}.`, { continued: true });
25
25
  }
26
- cobr.dup.forEach((dup, index) => {
27
- doc.font('negrito').text(' Duplicata:', { continued: true }).font('normal').text(` ${dup.nDup}`, { continued: true });
28
- doc.font('negrito').text(' Valor:', { continued: true }).font('normal').text(` ${Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(dup.vDup))}`, { continued: true });
29
- doc.font('negrito').text(' Vencimento:', { continued: true }).font('normal').text(` ${(0, date_fns_1.format)((0, date_fns_1.parseISO)(dup.dVenc), 'dd/MM/yyyy')}`, { continued: true });
30
- if (index === cobr.dup.length - 1) {
31
- doc.text('');
32
- }
33
- });
26
+ if(cobr.dup !== undefined){
27
+ cobr.dup.forEach((dup, index) => {
28
+ doc.font('negrito').text(' Duplicata:', { continued: true }).font('normal').text(` ${dup.nDup}`, { continued: true });
29
+ doc.font('negrito').text(' Valor:', { continued: true }).font('normal').text(` ${Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(dup.vDup))}`, { continued: true });
30
+ doc.font('negrito').text(' Vencimento:', { continued: true }).font('normal').text(` ${(0, date_fns_1.format)((0, date_fns_1.parseISO)(dup.dVenc), 'dd/MM/yyyy')}`, { continued: true });
31
+ if (index === cobr.dup.length - 1) {
32
+ doc.text('');
33
+ }
34
+ });
35
+ }
34
36
  (0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 20, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
35
37
  (0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: doc.y + 6, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
36
38
  (0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexssmusica/node-pdf-nfe",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "Modulo que auxilia na geração de NFe e NFCe",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",