arcli 2.0.0 → 2.2.0
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/CHANGELOG.md +106 -1
- package/README.md +21 -14
- package/dist/cli/arca-runtime.js +41 -0
- package/dist/cli/commands/billing-family.command.js +36 -9
- package/dist/cli/commands/billing-shortcuts.command.js +8 -2
- package/dist/cli/commands/billing.command.batch.js +28 -12
- package/dist/cli/commands/billing.command.interactive-preview.js +12 -13
- package/dist/cli/commands/billing.command.options.js +83 -39
- package/dist/cli/commands/billing.command.output.js +3 -3
- package/dist/cli/commands/billing.command.parser.js +44 -30
- package/dist/cli/commands/billing.command.pdf.js +9 -6
- package/dist/cli/commands/billing.command.shared.js +86 -49
- package/dist/cli/commands/billing.command.shortcuts.js +3 -4
- package/dist/cli/commands/completion.command.js +140 -0
- package/dist/cli/commands/config.command.js +44 -45
- package/dist/cli/commands/cuit-argument.js +10 -0
- package/dist/cli/commands/examples.command.js +0 -1
- package/dist/cli/commands/export-shortcut.command.js +19 -0
- package/dist/cli/commands/export.command.js +106 -0
- package/dist/cli/commands/export.command.options.js +140 -0
- package/dist/cli/commands/export.command.parser.js +84 -0
- package/dist/cli/commands/export.command.pdf.js +61 -0
- package/dist/cli/commands/fce-obligation.command.js +8 -16
- package/dist/cli/commands/interactive.command.js +9 -8
- package/dist/cli/commands/padron.command.js +46 -0
- package/dist/cli/commands/parameters.command.js +13 -13
- package/dist/cli/commands/pdf.command.js +17 -31
- package/dist/cli/commands/storybook.command.js +4 -4
- package/dist/cli/commands/vouchers.command.js +14 -14
- package/dist/cli/error-output.js +89 -11
- package/dist/cli/global-options.js +55 -0
- package/dist/cli/help-argv.js +0 -1
- package/dist/cli/help.js +243 -391
- package/dist/cli/ignored-global-options.js +32 -0
- package/dist/cli/index.js +12 -14
- package/dist/cli/interactive/advanced-options.js +13 -14
- package/dist/cli/interactive/config.flow.js +59 -20
- package/dist/cli/interactive/export.flow.js +263 -0
- package/dist/cli/interactive/history.flow.js +2 -3
- package/dist/cli/interactive/interactive-mode.js +63 -33
- package/dist/cli/interactive/invoice-picker.js +7 -7
- package/dist/cli/interactive/invoice.flow.js +35 -13
- package/dist/cli/interactive/note.flow.js +16 -16
- package/dist/cli/interactive/pdf.flow.js +9 -7
- package/dist/cli/interactive/prompts.js +0 -1
- package/dist/cli/interactive/receiver-padron.js +52 -0
- package/dist/cli/interactive/repeat.flow.js +10 -11
- package/dist/cli/interactive/session.js +13 -8
- package/dist/cli/interactive/status.flow.js +0 -1
- package/dist/cli/interactive/update.flow.js +0 -1
- package/dist/cli/interactive/validators.js +7 -6
- package/dist/cli/option-parsers.js +14 -4
- package/dist/cli/program.js +14 -5
- package/dist/cli/skipped-options.js +14 -0
- package/dist/cli/spinner.js +0 -1
- package/dist/cli/types.js +0 -1
- package/dist/cli/version.js +1 -2
- package/dist/index.js +0 -1
- package/dist/lib/dates/arca-date.js +3 -4
- package/dist/lib/errors/app-error.js +2 -2
- package/dist/lib/files/read-json-file.js +2 -3
- package/dist/lib/files/restrict-to-owner.js +0 -1
- package/dist/lib/files/write-new-file.js +29 -0
- package/dist/lib/identity/cuit.js +26 -0
- package/dist/lib/identity/format-cuit.js +1 -2
- package/dist/lib/links.js +2 -1
- package/dist/lib/numbers/argentine-amount.js +3 -4
- package/dist/lib/numbers/strict-integer.js +0 -1
- package/dist/lib/paths/mask-path.js +0 -1
- package/dist/lib/security/certificate.js +10 -8
- package/dist/lib/security/pem.js +2 -3
- package/dist/modules/billing/billing-response.js +16 -5
- package/dist/modules/billing/billing.amounts.js +3 -4
- package/dist/modules/billing/billing.associated-period.js +7 -8
- package/dist/modules/billing/billing.associated-vouchers.js +5 -6
- package/dist/modules/billing/billing.batch.js +12 -5
- package/dist/modules/billing/billing.constants.js +0 -1
- package/dist/modules/billing/billing.currency.js +4 -5
- package/dist/modules/billing/billing.date-range.js +27 -11
- package/dist/modules/billing/billing.display.js +14 -8
- package/dist/modules/billing/billing.errors.js +2 -3
- package/dist/modules/billing/billing.fce.js +3 -4
- package/dist/modules/billing/billing.iva-receptor.js +2 -3
- package/dist/modules/billing/billing.json-format.js +0 -1
- package/dist/modules/billing/billing.json-input.js +278 -0
- package/dist/modules/billing/billing.labels.js +1 -2
- package/dist/modules/billing/billing.mappers.js +0 -1
- package/dist/modules/billing/billing.padron.js +59 -0
- package/dist/modules/billing/billing.presenter.js +0 -1
- package/dist/modules/billing/billing.schemas.js +20 -6
- package/dist/modules/billing/billing.serialize.js +11 -15
- package/dist/modules/billing/billing.service.js +25 -4
- package/dist/modules/billing/billing.text.js +4 -13
- package/dist/modules/billing/billing.types.internal.js +0 -1
- package/dist/modules/billing/billing.types.js +0 -1
- package/dist/modules/billing/billing.validation.js +13 -11
- package/dist/modules/billing/voucher-kind-map.js +15 -16
- package/dist/modules/completion/completion.js +53 -0
- package/dist/modules/completion/completion.presenter.js +35 -0
- package/dist/modules/completion/installer.js +92 -0
- package/dist/modules/completion/shell-scripts.js +46 -0
- package/dist/modules/config/certificate-expiry.js +90 -0
- package/dist/modules/config/config-doctor.js +42 -28
- package/dist/modules/config/config-value-parser.js +32 -17
- package/dist/modules/config/config.export-credentials.js +23 -0
- package/dist/modules/config/config.presenter.js +28 -6
- package/dist/modules/config/config.schemas.js +27 -12
- package/dist/modules/config/config.sections.js +31 -11
- package/dist/modules/config/config.service.js +38 -9
- package/dist/modules/examples/examples.js +72 -37
- package/dist/modules/export/export.items.js +149 -0
- package/dist/modules/export/export.json-input.js +91 -0
- package/dist/modules/export/export.mappers.js +293 -0
- package/dist/modules/export/export.presenter.js +2 -0
- package/dist/modules/export/export.response.js +86 -0
- package/dist/modules/export/export.serialize.js +70 -0
- package/dist/modules/export/export.service.js +146 -0
- package/dist/modules/export/export.text.js +177 -0
- package/dist/modules/export/export.types.js +36 -0
- package/dist/modules/fce/fce-obligation.js +3 -4
- package/dist/modules/fce/fce-obligation.presenter.js +2 -3
- package/dist/modules/interactive/amount-input.js +0 -1
- package/dist/modules/interactive/choices.js +10 -2
- package/dist/modules/interactive/config-fields.js +17 -3
- package/dist/modules/interactive/equivalent-command.js +6 -3
- package/dist/modules/interactive/export-equivalent-command.js +40 -0
- package/dist/modules/interactive/invoice-copy.js +1 -2
- package/dist/modules/interactive/periods.js +0 -1
- package/dist/modules/interactive/wizard.js +0 -1
- package/dist/modules/padron/padron.js +23 -0
- package/dist/modules/padron/padron.presenter.js +48 -0
- package/dist/modules/parameters/health.js +0 -1
- package/dist/modules/parameters/parameters.js +2 -3
- package/dist/modules/parameters/parameters.presenter.js +14 -12
- package/dist/modules/parameters/status.js +0 -1
- package/dist/modules/pdf/pdf-data.mapper.js +94 -3
- package/dist/modules/pdf/pdf-decision.js +0 -1
- package/dist/modules/pdf/pdf-file-name.js +0 -1
- package/dist/modules/pdf/pdf-issuer.js +3 -3
- package/dist/modules/pdf/pdf-legends.js +35 -0
- package/dist/modules/pdf/pdf.errors.js +0 -1
- package/dist/modules/pdf/pdf.types.js +0 -1
- package/dist/modules/storybook/showcase-theme.js +0 -1
- package/dist/modules/storybook/showcase.js +35 -23
- package/dist/modules/update-check/changelog.js +0 -1
- package/dist/modules/update-check/update-check.presenter.js +6 -7
- package/dist/modules/update-check/update-check.service.js +0 -1
- package/dist/modules/vouchers/voucher-history.js +0 -1
- package/dist/modules/vouchers/voucher-history.presenter.js +3 -4
- package/dist/services/arca/arca-billing.gateway.js +18 -4
- package/dist/services/arca/arca-client.factory.js +27 -1
- package/dist/services/arca/arca-context.resolver.js +17 -7
- package/dist/services/arca/arca-export.gateway.js +146 -0
- package/dist/services/arca/arca-fce-obligation.gateway.js +2 -3
- package/dist/services/arca/arca-padron.gateway.js +103 -0
- package/dist/services/arca/arca-parameters.gateway.js +2 -3
- package/dist/services/arca/arca-voucher-history.gateway.js +2 -3
- package/dist/services/arca/last-voucher.js +26 -0
- package/dist/services/clipboard/clipboard.js +0 -1
- package/dist/services/pdf/escape-html.js +0 -1
- package/dist/services/pdf/pdf-browser.js +0 -1
- package/dist/services/pdf/pdf-exporter.js +26 -11
- package/dist/services/pdf/pdf-plugin.js +41 -14
- package/dist/ui/components/certificateBanner.js +8 -0
- package/dist/ui/components/contentPanel.js +0 -1
- package/dist/ui/components/errorPanel.js +0 -1
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/keyValuePanel.js +0 -1
- package/dist/ui/components/noticePanel.js +0 -1
- package/dist/ui/components/rawPanel.js +0 -1
- package/dist/ui/components/sectionHeading.js +0 -1
- package/dist/ui/components/statusBar.js +0 -1
- package/dist/ui/components/statusPanel.js +0 -1
- package/dist/ui/components/testingBanner.js +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/presenters/billing.presenter.js +0 -1
- package/dist/ui/presenters/config.presenter.js +1 -2
- package/dist/ui/presenters/errors.presenter.js +14 -12
- package/dist/ui/presenters/errors.zod-presenter.js +13 -35
- package/dist/ui/presenters/export.presenter.js +1 -0
- package/dist/ui/presenters/index.js +1 -1
- package/dist/ui/presenters/pdf.presenter.js +1 -2
- package/dist/ui/presenters/showcase.presenter.js +0 -1
- package/dist/ui/primitives/index.js +0 -1
- package/dist/ui/primitives/renderDivider.js +0 -1
- package/dist/ui/primitives/renderFooter.js +0 -1
- package/dist/ui/primitives/renderJson.js +0 -1
- package/dist/ui/primitives/renderKeyValue.js +0 -1
- package/dist/ui/primitives/renderLogo.js +0 -1
- package/dist/ui/primitives/renderObject.js +0 -1
- package/dist/ui/primitives/renderPanel.js +0 -1
- package/dist/ui/primitives/renderSubtitle.js +0 -1
- package/dist/ui/primitives/renderTable.js +0 -1
- package/dist/ui/primitives/terminalWidth.js +0 -1
- package/dist/ui/primitives/text.js +0 -1
- package/dist/ui/stream/index.js +0 -1
- package/dist/ui/stream/terminal-stream.js +13 -2
- package/dist/ui/theme/index.js +0 -1
- package/dist/ui/theme/theme.js +0 -1
- package/llms.txt +122 -45
- package/package.json +1 -2
- package/dist/cli/commands/billing-family.command.d.ts +0 -2
- package/dist/cli/commands/billing-family.command.js.map +0 -1
- package/dist/cli/commands/billing-shortcuts.command.d.ts +0 -2
- package/dist/cli/commands/billing-shortcuts.command.js.map +0 -1
- package/dist/cli/commands/billing.command.batch.d.ts +0 -22
- package/dist/cli/commands/billing.command.batch.js.map +0 -1
- package/dist/cli/commands/billing.command.interactive-preview.d.ts +0 -18
- package/dist/cli/commands/billing.command.interactive-preview.js.map +0 -1
- package/dist/cli/commands/billing.command.options.d.ts +0 -2
- package/dist/cli/commands/billing.command.options.js.map +0 -1
- package/dist/cli/commands/billing.command.output.d.ts +0 -14
- package/dist/cli/commands/billing.command.output.js.map +0 -1
- package/dist/cli/commands/billing.command.parser.d.ts +0 -28
- package/dist/cli/commands/billing.command.parser.js.map +0 -1
- package/dist/cli/commands/billing.command.pdf.d.ts +0 -24
- package/dist/cli/commands/billing.command.pdf.js.map +0 -1
- package/dist/cli/commands/billing.command.shared.d.ts +0 -7
- package/dist/cli/commands/billing.command.shared.js.map +0 -1
- package/dist/cli/commands/billing.command.shortcuts.d.ts +0 -7
- package/dist/cli/commands/billing.command.shortcuts.js.map +0 -1
- package/dist/cli/commands/config.command.d.ts +0 -7
- package/dist/cli/commands/config.command.js.map +0 -1
- package/dist/cli/commands/examples.command.d.ts +0 -2
- package/dist/cli/commands/examples.command.js.map +0 -1
- package/dist/cli/commands/fce-obligation.command.d.ts +0 -2
- package/dist/cli/commands/fce-obligation.command.js.map +0 -1
- package/dist/cli/commands/interactive.command.d.ts +0 -3
- package/dist/cli/commands/interactive.command.js.map +0 -1
- package/dist/cli/commands/parameters.command.d.ts +0 -2
- package/dist/cli/commands/parameters.command.js.map +0 -1
- package/dist/cli/commands/pdf.command.d.ts +0 -2
- package/dist/cli/commands/pdf.command.js.map +0 -1
- package/dist/cli/commands/storybook.command.d.ts +0 -2
- package/dist/cli/commands/storybook.command.js.map +0 -1
- package/dist/cli/commands/vouchers.command.d.ts +0 -2
- package/dist/cli/commands/vouchers.command.js.map +0 -1
- package/dist/cli/error-output.d.ts +0 -7
- package/dist/cli/error-output.js.map +0 -1
- package/dist/cli/help-argv.d.ts +0 -5
- package/dist/cli/help-argv.js.map +0 -1
- package/dist/cli/help.d.ts +0 -12
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/interactive/advanced-options.d.ts +0 -21
- package/dist/cli/interactive/advanced-options.js.map +0 -1
- package/dist/cli/interactive/config.flow.d.ts +0 -5
- package/dist/cli/interactive/config.flow.js.map +0 -1
- package/dist/cli/interactive/history.flow.d.ts +0 -6
- package/dist/cli/interactive/history.flow.js.map +0 -1
- package/dist/cli/interactive/interactive-mode.d.ts +0 -3
- package/dist/cli/interactive/interactive-mode.js.map +0 -1
- package/dist/cli/interactive/invoice-picker.d.ts +0 -25
- package/dist/cli/interactive/invoice-picker.js.map +0 -1
- package/dist/cli/interactive/invoice.flow.d.ts +0 -20
- package/dist/cli/interactive/invoice.flow.js.map +0 -1
- package/dist/cli/interactive/note.flow.d.ts +0 -32
- package/dist/cli/interactive/note.flow.js.map +0 -1
- package/dist/cli/interactive/pdf.flow.d.ts +0 -5
- package/dist/cli/interactive/pdf.flow.js.map +0 -1
- package/dist/cli/interactive/prompts.d.ts +0 -57
- package/dist/cli/interactive/prompts.js.map +0 -1
- package/dist/cli/interactive/repeat.flow.d.ts +0 -13
- package/dist/cli/interactive/repeat.flow.js.map +0 -1
- package/dist/cli/interactive/session.d.ts +0 -22
- package/dist/cli/interactive/session.js.map +0 -1
- package/dist/cli/interactive/status.flow.d.ts +0 -3
- package/dist/cli/interactive/status.flow.js.map +0 -1
- package/dist/cli/interactive/update.flow.d.ts +0 -6
- package/dist/cli/interactive/update.flow.js.map +0 -1
- package/dist/cli/interactive/validators.d.ts +0 -9
- package/dist/cli/interactive/validators.js.map +0 -1
- package/dist/cli/option-parsers.d.ts +0 -6
- package/dist/cli/option-parsers.js.map +0 -1
- package/dist/cli/program.d.ts +0 -2
- package/dist/cli/program.js.map +0 -1
- package/dist/cli/spinner.d.ts +0 -8
- package/dist/cli/spinner.js.map +0 -1
- package/dist/cli/types.d.ts +0 -6
- package/dist/cli/types.js.map +0 -1
- package/dist/cli/version.d.ts +0 -1
- package/dist/cli/version.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/dates/arca-date.d.ts +0 -19
- package/dist/lib/dates/arca-date.js.map +0 -1
- package/dist/lib/errors/app-error.d.ts +0 -17
- package/dist/lib/errors/app-error.js.map +0 -1
- package/dist/lib/files/read-json-file.d.ts +0 -1
- package/dist/lib/files/read-json-file.js.map +0 -1
- package/dist/lib/files/restrict-to-owner.d.ts +0 -7
- package/dist/lib/files/restrict-to-owner.js.map +0 -1
- package/dist/lib/identity/format-cuit.d.ts +0 -2
- package/dist/lib/identity/format-cuit.js.map +0 -1
- package/dist/lib/links.d.ts +0 -2
- package/dist/lib/links.js.map +0 -1
- package/dist/lib/numbers/argentine-amount.d.ts +0 -23
- package/dist/lib/numbers/argentine-amount.js.map +0 -1
- package/dist/lib/numbers/strict-integer.d.ts +0 -4
- package/dist/lib/numbers/strict-integer.js.map +0 -1
- package/dist/lib/paths/mask-path.d.ts +0 -1
- package/dist/lib/paths/mask-path.js.map +0 -1
- package/dist/lib/security/certificate.d.ts +0 -7
- package/dist/lib/security/certificate.js.map +0 -1
- package/dist/lib/security/pem.d.ts +0 -5
- package/dist/lib/security/pem.js.map +0 -1
- package/dist/modules/billing/billing-response.d.ts +0 -4
- package/dist/modules/billing/billing-response.js.map +0 -1
- package/dist/modules/billing/billing.amounts.d.ts +0 -21
- package/dist/modules/billing/billing.amounts.js.map +0 -1
- package/dist/modules/billing/billing.associated-period.d.ts +0 -8
- package/dist/modules/billing/billing.associated-period.js.map +0 -1
- package/dist/modules/billing/billing.associated-vouchers.d.ts +0 -12
- package/dist/modules/billing/billing.associated-vouchers.js.map +0 -1
- package/dist/modules/billing/billing.batch.d.ts +0 -23
- package/dist/modules/billing/billing.batch.js.map +0 -1
- package/dist/modules/billing/billing.constants.d.ts +0 -2
- package/dist/modules/billing/billing.constants.js.map +0 -1
- package/dist/modules/billing/billing.currency.d.ts +0 -18
- package/dist/modules/billing/billing.currency.js.map +0 -1
- package/dist/modules/billing/billing.date-range.d.ts +0 -9
- package/dist/modules/billing/billing.date-range.js.map +0 -1
- package/dist/modules/billing/billing.display.d.ts +0 -13
- package/dist/modules/billing/billing.display.js.map +0 -1
- package/dist/modules/billing/billing.errors.d.ts +0 -12
- package/dist/modules/billing/billing.errors.js.map +0 -1
- package/dist/modules/billing/billing.fce.d.ts +0 -21
- package/dist/modules/billing/billing.fce.js.map +0 -1
- package/dist/modules/billing/billing.iva-receptor.d.ts +0 -8
- package/dist/modules/billing/billing.iva-receptor.js.map +0 -1
- package/dist/modules/billing/billing.json-format.d.ts +0 -6
- package/dist/modules/billing/billing.json-format.js.map +0 -1
- package/dist/modules/billing/billing.labels.d.ts +0 -9
- package/dist/modules/billing/billing.labels.js.map +0 -1
- package/dist/modules/billing/billing.mappers.d.ts +0 -8
- package/dist/modules/billing/billing.mappers.js.map +0 -1
- package/dist/modules/billing/billing.presenter.d.ts +0 -7
- package/dist/modules/billing/billing.presenter.js.map +0 -1
- package/dist/modules/billing/billing.schemas.d.ts +0 -142
- package/dist/modules/billing/billing.schemas.js.map +0 -1
- package/dist/modules/billing/billing.serialize.d.ts +0 -8
- package/dist/modules/billing/billing.serialize.js.map +0 -1
- package/dist/modules/billing/billing.service.d.ts +0 -27
- package/dist/modules/billing/billing.service.js.map +0 -1
- package/dist/modules/billing/billing.text.d.ts +0 -8
- package/dist/modules/billing/billing.text.js.map +0 -1
- package/dist/modules/billing/billing.types.d.ts +0 -13
- package/dist/modules/billing/billing.types.internal.d.ts +0 -30
- package/dist/modules/billing/billing.types.internal.js.map +0 -1
- package/dist/modules/billing/billing.types.js.map +0 -1
- package/dist/modules/billing/billing.validation.d.ts +0 -7
- package/dist/modules/billing/billing.validation.js.map +0 -1
- package/dist/modules/billing/voucher-kind-map.d.ts +0 -9
- package/dist/modules/billing/voucher-kind-map.js.map +0 -1
- package/dist/modules/config/config-doctor.d.ts +0 -15
- package/dist/modules/config/config-doctor.js.map +0 -1
- package/dist/modules/config/config-value-parser.d.ts +0 -2
- package/dist/modules/config/config-value-parser.js.map +0 -1
- package/dist/modules/config/config.presenter.d.ts +0 -15
- package/dist/modules/config/config.presenter.js.map +0 -1
- package/dist/modules/config/config.schemas.d.ts +0 -154
- package/dist/modules/config/config.schemas.js.map +0 -1
- package/dist/modules/config/config.sections.d.ts +0 -14
- package/dist/modules/config/config.sections.js.map +0 -1
- package/dist/modules/config/config.service.d.ts +0 -35
- package/dist/modules/config/config.service.js.map +0 -1
- package/dist/modules/examples/examples.d.ts +0 -1
- package/dist/modules/examples/examples.js.map +0 -1
- package/dist/modules/fce/fce-obligation.d.ts +0 -20
- package/dist/modules/fce/fce-obligation.js.map +0 -1
- package/dist/modules/fce/fce-obligation.presenter.d.ts +0 -9
- package/dist/modules/fce/fce-obligation.presenter.js.map +0 -1
- package/dist/modules/interactive/amount-input.d.ts +0 -4
- package/dist/modules/interactive/amount-input.js.map +0 -1
- package/dist/modules/interactive/choices.d.ts +0 -13
- package/dist/modules/interactive/choices.js.map +0 -1
- package/dist/modules/interactive/config-fields.d.ts +0 -20
- package/dist/modules/interactive/config-fields.js.map +0 -1
- package/dist/modules/interactive/equivalent-command.d.ts +0 -8
- package/dist/modules/interactive/equivalent-command.js.map +0 -1
- package/dist/modules/interactive/invoice-copy.d.ts +0 -19
- package/dist/modules/interactive/invoice-copy.js.map +0 -1
- package/dist/modules/interactive/periods.d.ts +0 -7
- package/dist/modules/interactive/periods.js.map +0 -1
- package/dist/modules/interactive/wizard.d.ts +0 -16
- package/dist/modules/interactive/wizard.js.map +0 -1
- package/dist/modules/parameters/health.d.ts +0 -17
- package/dist/modules/parameters/health.js.map +0 -1
- package/dist/modules/parameters/parameters.d.ts +0 -50
- package/dist/modules/parameters/parameters.js.map +0 -1
- package/dist/modules/parameters/parameters.presenter.d.ts +0 -12
- package/dist/modules/parameters/parameters.presenter.js.map +0 -1
- package/dist/modules/parameters/status.d.ts +0 -31
- package/dist/modules/parameters/status.js.map +0 -1
- package/dist/modules/pdf/pdf-data.mapper.d.ts +0 -4
- package/dist/modules/pdf/pdf-data.mapper.js.map +0 -1
- package/dist/modules/pdf/pdf-decision.d.ts +0 -14
- package/dist/modules/pdf/pdf-decision.js.map +0 -1
- package/dist/modules/pdf/pdf-file-name.d.ts +0 -3
- package/dist/modules/pdf/pdf-file-name.js.map +0 -1
- package/dist/modules/pdf/pdf-issuer.d.ts +0 -8
- package/dist/modules/pdf/pdf-issuer.js.map +0 -1
- package/dist/modules/pdf/pdf.errors.d.ts +0 -9
- package/dist/modules/pdf/pdf.errors.js.map +0 -1
- package/dist/modules/pdf/pdf.types.d.ts +0 -91
- package/dist/modules/pdf/pdf.types.js.map +0 -1
- package/dist/modules/storybook/showcase-theme.d.ts +0 -7
- package/dist/modules/storybook/showcase-theme.js.map +0 -1
- package/dist/modules/storybook/showcase.d.ts +0 -2
- package/dist/modules/storybook/showcase.js.map +0 -1
- package/dist/modules/update-check/changelog.d.ts +0 -23
- package/dist/modules/update-check/changelog.js.map +0 -1
- package/dist/modules/update-check/update-check.presenter.d.ts +0 -6
- package/dist/modules/update-check/update-check.presenter.js.map +0 -1
- package/dist/modules/update-check/update-check.service.d.ts +0 -11
- package/dist/modules/update-check/update-check.service.js.map +0 -1
- package/dist/modules/vouchers/voucher-history.d.ts +0 -39
- package/dist/modules/vouchers/voucher-history.js.map +0 -1
- package/dist/modules/vouchers/voucher-history.presenter.d.ts +0 -29
- package/dist/modules/vouchers/voucher-history.presenter.js.map +0 -1
- package/dist/services/arca/arca-billing.gateway.d.ts +0 -10
- package/dist/services/arca/arca-billing.gateway.js.map +0 -1
- package/dist/services/arca/arca-client.factory.d.ts +0 -5
- package/dist/services/arca/arca-client.factory.js.map +0 -1
- package/dist/services/arca/arca-context.resolver.d.ts +0 -44
- package/dist/services/arca/arca-context.resolver.js.map +0 -1
- package/dist/services/arca/arca-fce-obligation.gateway.d.ts +0 -7
- package/dist/services/arca/arca-fce-obligation.gateway.js.map +0 -1
- package/dist/services/arca/arca-parameters.gateway.d.ts +0 -10
- package/dist/services/arca/arca-parameters.gateway.js.map +0 -1
- package/dist/services/arca/arca-voucher-history.gateway.d.ts +0 -8
- package/dist/services/arca/arca-voucher-history.gateway.js.map +0 -1
- package/dist/services/clipboard/clipboard.d.ts +0 -2
- package/dist/services/clipboard/clipboard.js.map +0 -1
- package/dist/services/pdf/escape-html.d.ts +0 -6
- package/dist/services/pdf/escape-html.js.map +0 -1
- package/dist/services/pdf/pdf-browser.d.ts +0 -5
- package/dist/services/pdf/pdf-browser.js.map +0 -1
- package/dist/services/pdf/pdf-exporter.d.ts +0 -19
- package/dist/services/pdf/pdf-exporter.js.map +0 -1
- package/dist/services/pdf/pdf-plugin.d.ts +0 -50
- package/dist/services/pdf/pdf-plugin.js.map +0 -1
- package/dist/ui/components/contentPanel.d.ts +0 -5
- package/dist/ui/components/contentPanel.js.map +0 -1
- package/dist/ui/components/errorPanel.d.ts +0 -1
- package/dist/ui/components/errorPanel.js.map +0 -1
- package/dist/ui/components/index.d.ts +0 -9
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/components/keyValuePanel.d.ts +0 -3
- package/dist/ui/components/keyValuePanel.js.map +0 -1
- package/dist/ui/components/noticePanel.d.ts +0 -3
- package/dist/ui/components/noticePanel.js.map +0 -1
- package/dist/ui/components/rawPanel.d.ts +0 -1
- package/dist/ui/components/rawPanel.js.map +0 -1
- package/dist/ui/components/sectionHeading.d.ts +0 -3
- package/dist/ui/components/sectionHeading.js.map +0 -1
- package/dist/ui/components/statusBar.d.ts +0 -19
- package/dist/ui/components/statusBar.js.map +0 -1
- package/dist/ui/components/statusPanel.d.ts +0 -3
- package/dist/ui/components/statusPanel.js.map +0 -1
- package/dist/ui/components/testingBanner.d.ts +0 -2
- package/dist/ui/components/testingBanner.js.map +0 -1
- package/dist/ui/index.d.ts +0 -5
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/presenters/billing.presenter.d.ts +0 -2
- package/dist/ui/presenters/billing.presenter.js.map +0 -1
- package/dist/ui/presenters/config.presenter.d.ts +0 -1
- package/dist/ui/presenters/config.presenter.js.map +0 -1
- package/dist/ui/presenters/errors.presenter.d.ts +0 -1
- package/dist/ui/presenters/errors.presenter.js.map +0 -1
- package/dist/ui/presenters/errors.zod-presenter.d.ts +0 -4
- package/dist/ui/presenters/errors.zod-presenter.js.map +0 -1
- package/dist/ui/presenters/index.d.ts +0 -6
- package/dist/ui/presenters/index.js.map +0 -1
- package/dist/ui/presenters/pdf.presenter.d.ts +0 -13
- package/dist/ui/presenters/pdf.presenter.js.map +0 -1
- package/dist/ui/presenters/showcase.presenter.d.ts +0 -1
- package/dist/ui/presenters/showcase.presenter.js.map +0 -1
- package/dist/ui/primitives/index.d.ts +0 -10
- package/dist/ui/primitives/index.js.map +0 -1
- package/dist/ui/primitives/renderDivider.d.ts +0 -5
- package/dist/ui/primitives/renderDivider.js.map +0 -1
- package/dist/ui/primitives/renderFooter.d.ts +0 -7
- package/dist/ui/primitives/renderFooter.js.map +0 -1
- package/dist/ui/primitives/renderJson.d.ts +0 -3
- package/dist/ui/primitives/renderJson.js.map +0 -1
- package/dist/ui/primitives/renderKeyValue.d.ts +0 -14
- package/dist/ui/primitives/renderKeyValue.js.map +0 -1
- package/dist/ui/primitives/renderLogo.d.ts +0 -3
- package/dist/ui/primitives/renderLogo.js.map +0 -1
- package/dist/ui/primitives/renderObject.d.ts +0 -1
- package/dist/ui/primitives/renderObject.js.map +0 -1
- package/dist/ui/primitives/renderPanel.d.ts +0 -27
- package/dist/ui/primitives/renderPanel.js.map +0 -1
- package/dist/ui/primitives/renderSubtitle.d.ts +0 -7
- package/dist/ui/primitives/renderSubtitle.js.map +0 -1
- package/dist/ui/primitives/renderTable.d.ts +0 -6
- package/dist/ui/primitives/renderTable.js.map +0 -1
- package/dist/ui/primitives/terminalWidth.d.ts +0 -4
- package/dist/ui/primitives/terminalWidth.js.map +0 -1
- package/dist/ui/primitives/text.d.ts +0 -28
- package/dist/ui/primitives/text.js.map +0 -1
- package/dist/ui/stream/index.d.ts +0 -1
- package/dist/ui/stream/index.js.map +0 -1
- package/dist/ui/stream/terminal-stream.d.ts +0 -16
- package/dist/ui/stream/terminal-stream.js.map +0 -1
- package/dist/ui/theme/index.d.ts +0 -1
- package/dist/ui/theme/index.js.map +0 -1
- package/dist/ui/theme/theme.d.ts +0 -68
- package/dist/ui/theme/theme.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatMoneyLabel } from '../../modules/billing/billing.labels.js';
|
|
2
2
|
import { parseAmountInput } from '../../modules/interactive/amount-input.js';
|
|
3
|
-
import { invoiceKindChoices
|
|
3
|
+
import { invoiceKindChoices } from '../../modules/interactive/choices.js';
|
|
4
4
|
import { copyInvoiceAmounts } from '../../modules/interactive/invoice-copy.js';
|
|
5
5
|
import { currentMonthPeriod, previousMonthPeriod } from '../../modules/interactive/periods.js';
|
|
6
6
|
import { BACK, runWizard } from '../../modules/interactive/wizard.js';
|
|
@@ -10,6 +10,7 @@ import { askAdvancedOptions } from './advanced-options.js';
|
|
|
10
10
|
import { buildInvoiceInput } from './invoice.flow.js';
|
|
11
11
|
import { pickInvoice } from './invoice-picker.js';
|
|
12
12
|
import { askTextStep, chooseStep } from './prompts.js';
|
|
13
|
+
import { askReceiverIvaCondition } from './receiver-padron.js';
|
|
13
14
|
import { previewAndEmit, requirePointOfSale } from './session.js';
|
|
14
15
|
import { validateAmount, validateCbu, validateDate } from './validators.js';
|
|
15
16
|
const CONCEPTS_BY_CODE = {
|
|
@@ -31,7 +32,7 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
31
32
|
{
|
|
32
33
|
name: 'tipo',
|
|
33
34
|
run: async () => {
|
|
34
|
-
const voucherKind = await chooseStep('¿
|
|
35
|
+
const voucherKind = await chooseStep('¿Qué tipo de factura querés repetir?', invoiceKindChoices());
|
|
35
36
|
return voucherKind === BACK ? BACK : { voucherKind };
|
|
36
37
|
},
|
|
37
38
|
},
|
|
@@ -39,7 +40,7 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
39
40
|
name: 'factura',
|
|
40
41
|
run: async (state) => {
|
|
41
42
|
const voucherKind = state.voucherKind;
|
|
42
|
-
const picked = await pickInvoice(session, { message: '¿
|
|
43
|
+
const picked = await pickInvoice(session, { message: '¿Cuál repetimos?', pointOfSale, voucherKind });
|
|
43
44
|
if (picked === BACK) {
|
|
44
45
|
return BACK;
|
|
45
46
|
}
|
|
@@ -51,7 +52,7 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
51
52
|
}
|
|
52
53
|
const copy = copyInvoiceAmounts(original, voucherKind.letter);
|
|
53
54
|
if (copy.limitation) {
|
|
54
|
-
writeTerminalOutput(noticePanel(`${copy.limitation} Revisa la
|
|
55
|
+
writeTerminalOutput(noticePanel(`${copy.limitation} Revisa la alícuota y el monto antes de emitir.`, 'warning'));
|
|
55
56
|
}
|
|
56
57
|
return {
|
|
57
58
|
advanced: {
|
|
@@ -74,8 +75,7 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
74
75
|
name: 'iva-receptor',
|
|
75
76
|
// ARCA no devuelve la condicion IVA de la factura, asi que se pregunta.
|
|
76
77
|
run: async (state) => {
|
|
77
|
-
|
|
78
|
-
return ivaCondition === BACK ? BACK : { ivaCondition };
|
|
78
|
+
return askReceiverIvaCondition(session, state, state.voucherKind?.letter ?? 'c', config.ivaReceptorPorDefecto);
|
|
79
79
|
},
|
|
80
80
|
skip: (state) => state.documentType === 'consumidor-final',
|
|
81
81
|
},
|
|
@@ -87,7 +87,7 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
87
87
|
const reproducible = !copyInvoiceAmounts(original, state.voucherKind?.letter ?? 'c').limitation;
|
|
88
88
|
const scope = reproducible
|
|
89
89
|
? await chooseStep('¿Mismo monto?', [
|
|
90
|
-
{ name: `
|
|
90
|
+
{ name: `Sí, ${formatMoneyLabel(original.total)}`, value: 'mismo' },
|
|
91
91
|
{ name: 'No, ingresar otro monto', value: 'otro' },
|
|
92
92
|
])
|
|
93
93
|
: 'otro';
|
|
@@ -103,11 +103,11 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
103
103
|
run: async (state) => {
|
|
104
104
|
const current = currentMonthPeriod(today);
|
|
105
105
|
const previous = previousMonthPeriod(today);
|
|
106
|
-
const choice = await chooseStep('
|
|
106
|
+
const choice = await chooseStep('Período del servicio:', [
|
|
107
107
|
{ description: describePeriod(current), name: 'Este mes', value: current },
|
|
108
108
|
{ description: describePeriod(previous), name: 'El mes pasado', value: previous },
|
|
109
109
|
{ description: 'Desde y hasta hoy', name: 'Solo hoy', value: 'hoy' },
|
|
110
|
-
{ name: 'Otro
|
|
110
|
+
{ name: 'Otro período', value: 'otro' },
|
|
111
111
|
]);
|
|
112
112
|
if (choice === BACK) {
|
|
113
113
|
return BACK;
|
|
@@ -142,7 +142,7 @@ export function repeatSteps(session, pointOfSale, today = new Date()) {
|
|
|
142
142
|
// La cotizacion de la factura original ya no sirve: si era en moneda extranjera, arranca marcada.
|
|
143
143
|
const foreign = !LOCAL_CURRENCIES.has(state.original?.currency);
|
|
144
144
|
if (foreign) {
|
|
145
|
-
writeTerminalOutput(noticePanel('La factura original era en moneda extranjera: completa la moneda y la
|
|
145
|
+
writeTerminalOutput(noticePanel('La factura original era en moneda extranjera: completa la moneda y la cotización.', 'info'));
|
|
146
146
|
}
|
|
147
147
|
const advanced = await askAdvancedOptions(state.advanced, {
|
|
148
148
|
concept: state.concept ?? 'servicios',
|
|
@@ -172,4 +172,3 @@ export async function runRepeatFlow(session) {
|
|
|
172
172
|
}
|
|
173
173
|
await previewAndEmit(session, buildInvoiceInput(state, session));
|
|
174
174
|
}
|
|
175
|
-
//# sourceMappingURL=repeat.flow.js.map
|
|
@@ -11,7 +11,10 @@ import { startSpinner } from '../spinner.js';
|
|
|
11
11
|
import { offerPdf } from './pdf.flow.js';
|
|
12
12
|
import { confirm } from './prompts.js';
|
|
13
13
|
const PREVIEW_GATEWAY = {
|
|
14
|
-
|
|
14
|
+
createVoucher: async () => {
|
|
15
|
+
throw new Error('La vista previa no emite comprobantes.');
|
|
16
|
+
},
|
|
17
|
+
getNextVoucherNumber: async () => {
|
|
15
18
|
throw new Error('La vista previa no emite comprobantes.');
|
|
16
19
|
},
|
|
17
20
|
getQuotation: async () => {
|
|
@@ -36,7 +39,7 @@ export function requirePointOfSale(session) {
|
|
|
36
39
|
}
|
|
37
40
|
return session.runtime.pointOfSale;
|
|
38
41
|
}
|
|
39
|
-
function formatEquivalentCommand(command) {
|
|
42
|
+
export function formatEquivalentCommand(command) {
|
|
40
43
|
return renderPanel({
|
|
41
44
|
borderType: 'command',
|
|
42
45
|
content: [colorize('Esto equivale a:', 'muted'), '', colorize(command, 'info')],
|
|
@@ -58,16 +61,19 @@ export async function previewAndEmit(session, rawInput) {
|
|
|
58
61
|
: [];
|
|
59
62
|
const preview = await service.execute({ gateway: PREVIEW_GATEWAY, input, runtime, warnings });
|
|
60
63
|
writeTerminalOutput(formatBillingOutputs([preview], { environment: runtime.environment, raw: false }));
|
|
61
|
-
writeTerminalOutput(formatEquivalentCommand(buildEquivalentCommand(input, {
|
|
64
|
+
writeTerminalOutput(formatEquivalentCommand(buildEquivalentCommand(input, {
|
|
65
|
+
defaultCurrency: runtime.config.monedaPorDefecto,
|
|
66
|
+
environment: runtime.environment,
|
|
67
|
+
})));
|
|
62
68
|
const label = preview.voucherKind.displayName;
|
|
63
|
-
const environmentLabel = runtime.environment === 'produccion' ? '
|
|
69
|
+
const environmentLabel = runtime.environment === 'produccion' ? 'PRODUCCIÓN' : 'testing';
|
|
64
70
|
if (!(await confirm(`¿Emitimos la ${label} en ${environmentLabel}?`, 'Emitir ahora'))) {
|
|
65
|
-
writeTerminalOutput(noticePanel('No se
|
|
71
|
+
writeTerminalOutput(noticePanel('No se emitió nada.', 'muted'));
|
|
66
72
|
return;
|
|
67
73
|
}
|
|
68
74
|
if (runtime.environment === 'produccion' &&
|
|
69
|
-
!(await confirm('Vas a emitir un comprobante real en
|
|
70
|
-
writeTerminalOutput(noticePanel('No se
|
|
75
|
+
!(await confirm('Vas a emitir un comprobante real en PRODUCCIÓN. ¿Confirmás?', 'Sí, emitir en producción'))) {
|
|
76
|
+
writeTerminalOutput(noticePanel('No se emitió nada.', 'muted'));
|
|
71
77
|
return;
|
|
72
78
|
}
|
|
73
79
|
const spinner = startSpinner(`Emitiendo ${label} en ARCA...`);
|
|
@@ -87,4 +93,3 @@ export async function previewAndEmit(session, rawInput) {
|
|
|
87
93
|
throw error;
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
|
-
//# sourceMappingURL=session.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { parseArgentineDateInputAsArcaDate } from '../../lib/dates/arca-date.js';
|
|
2
|
+
import { parseCuit } from '../../lib/identity/cuit.js';
|
|
2
3
|
import { EXCHANGE_RATE_DECIMALS, parseArgentineAmount } from '../../lib/numbers/argentine-amount.js';
|
|
3
4
|
export function validateAmount(value) {
|
|
4
5
|
const result = parseArgentineAmount(value);
|
|
5
|
-
return result.ok ? true : `Monto
|
|
6
|
+
return result.ok ? true : `Monto inválido: ${result.reason}. Por ejemplo 150000, 150.000 o 1.500,50.`;
|
|
6
7
|
}
|
|
7
8
|
export function validateCuit(value) {
|
|
8
|
-
|
|
9
|
+
const result = parseCuit(value);
|
|
10
|
+
return result.ok ? true : `El CUIT ${result.reason}.`;
|
|
9
11
|
}
|
|
10
12
|
export function validateDni(value) {
|
|
11
13
|
return /^\d{7,8}$/.test(value.replace(/\./g, '')) ? true : 'El DNI tiene 7 u 8 digitos.';
|
|
@@ -22,7 +24,7 @@ export function validateDate(value) {
|
|
|
22
24
|
return true;
|
|
23
25
|
}
|
|
24
26
|
catch {
|
|
25
|
-
return 'Fecha
|
|
27
|
+
return 'Fecha inválida. Usa D/M/AAAA, D/M o solo el día (por ejemplo 15/10).';
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
/** Monto opcional: vacio es "no", si no tiene que ser un monto valido. */
|
|
@@ -32,8 +34,7 @@ export function validateOptionalAmount(value) {
|
|
|
32
34
|
export function validateExchangeRate(value) {
|
|
33
35
|
const result = parseArgentineAmount(value, { maxDecimals: EXCHANGE_RATE_DECIMALS });
|
|
34
36
|
if (!result.ok) {
|
|
35
|
-
return `
|
|
37
|
+
return `Cotización inválida: ${result.reason}. Por ejemplo 1200 o 1.185,50.`;
|
|
36
38
|
}
|
|
37
|
-
return result.value !== 1 ? true : 'Ingresa la
|
|
39
|
+
return result.value !== 1 ? true : 'Ingresa la cotización acordada, por ejemplo 1200 o 1.185,50.';
|
|
38
40
|
}
|
|
39
|
-
//# sourceMappingURL=validators.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputValidationError } from '../lib/errors/app-error.js';
|
|
2
|
+
import { parseCuit } from '../lib/identity/cuit.js';
|
|
2
3
|
import { parseArgentineAmount } from '../lib/numbers/argentine-amount.js';
|
|
3
4
|
import { parseDocumentNumber, parseStrictInteger } from '../lib/numbers/strict-integer.js';
|
|
4
5
|
/** Montos como en Argentina: punto para miles y coma para decimales. */
|
|
@@ -6,7 +7,7 @@ export function amountOption(flag, maxDecimals) {
|
|
|
6
7
|
return (value) => {
|
|
7
8
|
const result = parseArgentineAmount(value, { maxDecimals });
|
|
8
9
|
if (!result.ok) {
|
|
9
|
-
throw new InputValidationError(`${flag} "${value}" no es
|
|
10
|
+
throw new InputValidationError(`${flag} "${value}" no es válido: ${result.reason}.`);
|
|
10
11
|
}
|
|
11
12
|
return result.value;
|
|
12
13
|
};
|
|
@@ -16,19 +17,28 @@ export function integerOption(flag) {
|
|
|
16
17
|
return (value) => {
|
|
17
18
|
const parsed = parseStrictInteger(value);
|
|
18
19
|
if (parsed === undefined) {
|
|
19
|
-
throw new InputValidationError(`${flag} "${value}" no es
|
|
20
|
+
throw new InputValidationError(`${flag} "${value}" no es válido: tiene que ser un número entero.`);
|
|
20
21
|
}
|
|
21
22
|
return parsed;
|
|
22
23
|
};
|
|
23
24
|
}
|
|
25
|
+
/** CUIT o CUIL: acepta guiones y puntos (`20-33333333-4`) y chequea el digito verificador. */
|
|
26
|
+
export function cuitOption(flag) {
|
|
27
|
+
return (value) => {
|
|
28
|
+
const result = parseCuit(value);
|
|
29
|
+
if (!result.ok) {
|
|
30
|
+
throw new InputValidationError(`${flag} "${value}" no es válido: ${result.reason}.`);
|
|
31
|
+
}
|
|
32
|
+
return result.value;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
24
35
|
/** CUIT, CUIL o DNI: acepta guiones y puntos (`20-11111111-2`). */
|
|
25
36
|
export function documentNumberOption(flag) {
|
|
26
37
|
return (value) => {
|
|
27
38
|
const parsed = parseDocumentNumber(value);
|
|
28
39
|
if (parsed === undefined) {
|
|
29
|
-
throw new InputValidationError(`${flag} "${value}" no es
|
|
40
|
+
throw new InputValidationError(`${flag} "${value}" no es válido: usá solo números, con o sin guiones.`);
|
|
30
41
|
}
|
|
31
42
|
return parsed;
|
|
32
43
|
};
|
|
33
44
|
}
|
|
34
|
-
//# sourceMappingURL=option-parsers.js.map
|
package/dist/cli/program.js
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { registerGlobalOptions } from './commands/billing.command.shared.js';
|
|
3
2
|
import { registerBillingFamilyCommands } from './commands/billing-family.command.js';
|
|
4
3
|
import { registerBillingShortcutCommands } from './commands/billing-shortcuts.command.js';
|
|
4
|
+
import { registerCompletionCommands } from './commands/completion.command.js';
|
|
5
5
|
import { registerConfigCommand } from './commands/config.command.js';
|
|
6
6
|
import { registerExamplesCommand } from './commands/examples.command.js';
|
|
7
|
+
import { registerExportShortcutCommand } from './commands/export-shortcut.command.js';
|
|
7
8
|
import { registerFceObligationCommand } from './commands/fce-obligation.command.js';
|
|
8
9
|
import { registerInteractiveCommand } from './commands/interactive.command.js';
|
|
10
|
+
import { registerPadronCommand } from './commands/padron.command.js';
|
|
9
11
|
import { registerParametersCommands } from './commands/parameters.command.js';
|
|
10
12
|
import { registerPdfCommand } from './commands/pdf.command.js';
|
|
11
13
|
import { registerStorybookCommand } from './commands/storybook.command.js';
|
|
12
14
|
import { registerVoucherQueryCommands } from './commands/vouchers.command.js';
|
|
15
|
+
import { configureUsageErrors } from './error-output.js';
|
|
16
|
+
import { registerGlobalOptions } from './global-options.js';
|
|
13
17
|
import { configureSpanishHelp, createProgramHeader, createProgramHelp } from './help.js';
|
|
18
|
+
import { warnAboutIgnoredGlobalOptions } from './ignored-global-options.js';
|
|
14
19
|
import { CLI_VERSION } from './version.js';
|
|
15
|
-
export function createProgram() {
|
|
20
|
+
export function createProgram(options = {}) {
|
|
16
21
|
const program = new Command();
|
|
22
|
+
configureUsageErrors(program, options.errorsAsJson ?? (() => false));
|
|
17
23
|
program
|
|
18
24
|
.name('arcli')
|
|
19
|
-
.description('Emití y revisá comprobantes ARCA desde terminal con una UX
|
|
20
|
-
.version(CLI_VERSION)
|
|
25
|
+
.description('Emití y revisá comprobantes ARCA desde terminal con una UX más simple, validaciones claras y salida lista para automatizar.')
|
|
26
|
+
.version(CLI_VERSION, '-V, --version', 'mostrar la versión instalada')
|
|
21
27
|
.showHelpAfterError('(usa "ayuda" para ver comandos y ejemplos)');
|
|
22
28
|
configureSpanishHelp(program);
|
|
23
29
|
registerGlobalOptions(program);
|
|
30
|
+
warnAboutIgnoredGlobalOptions(program);
|
|
24
31
|
registerBillingShortcutCommands(program);
|
|
25
32
|
registerBillingFamilyCommands(program);
|
|
33
|
+
registerCompletionCommands(program);
|
|
26
34
|
registerConfigCommand(program);
|
|
27
35
|
registerExamplesCommand(program);
|
|
36
|
+
registerExportShortcutCommand(program);
|
|
28
37
|
registerFceObligationCommand(program);
|
|
29
38
|
registerInteractiveCommand(program);
|
|
39
|
+
registerPadronCommand(program);
|
|
30
40
|
registerPdfCommand(program);
|
|
31
41
|
registerParametersCommands(program);
|
|
32
42
|
registerVoucherQueryCommands(program);
|
|
@@ -35,4 +45,3 @@ export function createProgram() {
|
|
|
35
45
|
program.addHelpText('afterAll', ({ command }) => (command === program ? createProgramHelp() : ''));
|
|
36
46
|
return program;
|
|
37
47
|
}
|
|
38
|
-
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `arcli factura <letra>` comparte un solo comando para A, B, C y E, asi que acepta los flags de todas las letras.
|
|
3
|
+
* Los que se pasaron y no aplican a la letra elegida no cortan la ejecucion: se saltean con un aviso.
|
|
4
|
+
*/
|
|
5
|
+
export function findPassedOptions(command, options) {
|
|
6
|
+
return options
|
|
7
|
+
.filter((option) => command.getOptionValueSource(option.attributeName()) === 'cli')
|
|
8
|
+
.map((option) => option.long ?? option.short ?? option.flags);
|
|
9
|
+
}
|
|
10
|
+
export function formatSkippedOptionsWarning(flags, voucherLabel) {
|
|
11
|
+
return flags.length === 1
|
|
12
|
+
? `${flags[0]} no aplica a ${voucherLabel} y se salteó.`
|
|
13
|
+
: `Estos flags no aplican a ${voucherLabel} y se saltearon: ${flags.join(', ')}.`;
|
|
14
|
+
}
|
package/dist/cli/spinner.js
CHANGED
package/dist/cli/types.js
CHANGED
package/dist/cli/version.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '2.
|
|
2
|
-
//# sourceMappingURL=version.js.map
|
|
1
|
+
export const CLI_VERSION = '2.2.0';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputValidationError } from '../errors/app-error.js';
|
|
2
|
-
const ARGENTINE_DATE_FORMAT_HINT = '
|
|
2
|
+
const ARGENTINE_DATE_FORMAT_HINT = 'Usá D, DD, D-MM, D/MM, D-MM-YY, D/MM/YY, D-MM-YYYY o D/MM/YYYY.';
|
|
3
3
|
const ARGENTINE_DATE_PARTS = new Intl.DateTimeFormat('en-CA', {
|
|
4
4
|
day: '2-digit',
|
|
5
5
|
month: '2-digit',
|
|
@@ -38,7 +38,7 @@ export function parseArgentineDateInputAsArcaDate(value, referenceDate = new Dat
|
|
|
38
38
|
const normalizedValue = value.trim();
|
|
39
39
|
const dateMatch = /^(\d{1,2})(?:([-/])(\d{1,2})(?:\2(\d{2}|\d{4}))?)?$/.exec(normalizedValue);
|
|
40
40
|
if (!dateMatch) {
|
|
41
|
-
throw new InputValidationError(`La fecha "${value}" no es
|
|
41
|
+
throw new InputValidationError(`La fecha "${value}" no es válida. ${ARGENTINE_DATE_FORMAT_HINT}`);
|
|
42
42
|
}
|
|
43
43
|
const [, rawDay, , rawMonth, explicitYear] = dateMatch;
|
|
44
44
|
const today = toArgentineCalendarDate(referenceDate);
|
|
@@ -49,7 +49,7 @@ export function parseArgentineDateInputAsArcaDate(value, referenceDate = new Dat
|
|
|
49
49
|
if (date.getUTCFullYear() !== Number(year) ||
|
|
50
50
|
date.getUTCMonth() !== Number(month) - 1 ||
|
|
51
51
|
date.getUTCDate() !== Number(day)) {
|
|
52
|
-
throw new InputValidationError(`La fecha "${value}" no es
|
|
52
|
+
throw new InputValidationError(`La fecha "${value}" no es válida.`);
|
|
53
53
|
}
|
|
54
54
|
return `${year}${month}${day}`;
|
|
55
55
|
}
|
|
@@ -59,4 +59,3 @@ function resolveYear(explicitYear, today) {
|
|
|
59
59
|
}
|
|
60
60
|
return explicitYear.length === 2 ? `20${explicitYear}` : explicitYear;
|
|
61
61
|
}
|
|
62
|
-
//# sourceMappingURL=arca-date.js.map
|
|
@@ -12,10 +12,11 @@ export class AppError extends Error {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export class ConfigurationError extends AppError {
|
|
15
|
-
constructor(message, details) {
|
|
15
|
+
constructor(message, details, suggestion) {
|
|
16
16
|
super(message, {
|
|
17
17
|
code: 'CONFIGURATION_ERROR',
|
|
18
18
|
details,
|
|
19
|
+
suggestion,
|
|
19
20
|
});
|
|
20
21
|
this.name = 'ConfigurationError';
|
|
21
22
|
}
|
|
@@ -29,4 +30,3 @@ export class InputValidationError extends AppError {
|
|
|
29
30
|
this.name = 'InputValidationError';
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
//# sourceMappingURL=app-error.js.map
|
|
@@ -11,11 +11,10 @@ export function readJsonFile(filePath) {
|
|
|
11
11
|
return JSON.parse(rawContent);
|
|
12
12
|
}
|
|
13
13
|
catch (error) {
|
|
14
|
-
const message = error instanceof Error ? error.message : 'JSON
|
|
14
|
+
const message = error instanceof Error ? error.message : 'JSON inválido';
|
|
15
15
|
throw new InputValidationError(`No se pudo leer el archivo JSON "${filePath}": ${message}`, {
|
|
16
|
-
cause: error instanceof Error ? error.message : 'JSON
|
|
16
|
+
cause: error instanceof Error ? error.message : 'JSON inválido',
|
|
17
17
|
path: filePath,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=read-json-file.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { writeFileSync } from 'node:fs';
|
|
2
|
+
import { extname } from 'node:path';
|
|
3
|
+
const MAX_ATTEMPTS = 1000;
|
|
4
|
+
function withSuffix(path, attempt) {
|
|
5
|
+
if (attempt === 1) {
|
|
6
|
+
return path;
|
|
7
|
+
}
|
|
8
|
+
const extension = extname(path);
|
|
9
|
+
return `${path.slice(0, path.length - extension.length)}-${attempt}${extension}`;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Escribe sin pisar nunca un archivo existente: si `factura.pdf` ya esta, prueba `factura-2.pdf`, `factura-3.pdf`...
|
|
13
|
+
* Usa `wx`, asi que tampoco pisa un archivo creado entre el chequeo y la escritura. Devuelve la ruta usada.
|
|
14
|
+
*/
|
|
15
|
+
export function writeNewFile(path, data) {
|
|
16
|
+
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt += 1) {
|
|
17
|
+
const candidate = withSuffix(path, attempt);
|
|
18
|
+
try {
|
|
19
|
+
writeFileSync(candidate, data, { flag: 'wx' });
|
|
20
|
+
return candidate;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error.code !== 'EEXIST') {
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
throw new Error(`No se pudo guardar ${path}: ya existen ${MAX_ATTEMPTS} archivos con ese nombre.`);
|
|
29
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const CHECK_DIGIT_WEIGHTS = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2];
|
|
2
|
+
/** Digito verificador de los primeros 10 digitos (modulo 11). `undefined` si da 10: ARCA no asigna esos. */
|
|
3
|
+
function computeCheckDigit(firstTen) {
|
|
4
|
+
const sum = CHECK_DIGIT_WEIGHTS.reduce((total, weight, index) => total + weight * Number(firstTen[index]), 0);
|
|
5
|
+
const digit = 11 - (sum % 11);
|
|
6
|
+
if (digit === 11) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
return digit === 10 ? undefined : digit;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* CUIT o CUIL con o sin guiones, puntos o espacios (`20-33333333-4`, `20333333334`).
|
|
13
|
+
* Devuelve los 11 digitos si el formato y el digito verificador son validos, o el motivo si no.
|
|
14
|
+
*/
|
|
15
|
+
export function parseCuit(raw) {
|
|
16
|
+
const value = String(raw)
|
|
17
|
+
.trim()
|
|
18
|
+
.replace(/[-.\s]/g, '');
|
|
19
|
+
if (!/^\d{11}$/.test(value)) {
|
|
20
|
+
return { ok: false, reason: 'debe tener 11 digitos, con o sin guiones' };
|
|
21
|
+
}
|
|
22
|
+
if (computeCheckDigit(value.slice(0, 10)) !== Number(value[10])) {
|
|
23
|
+
return { ok: false, reason: 'el digito verificador no coincide; revisá que esté bien escrito' };
|
|
24
|
+
}
|
|
25
|
+
return { ok: true, value };
|
|
26
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** CUIT o CUIL con guiones, como lo muestra ARCA: `
|
|
1
|
+
/** CUIT o CUIL con guiones, como lo muestra ARCA: `20333333334` → `20-33333333-4`. Si no tiene 11 digitos, sin cambios. */
|
|
2
2
|
export function formatCuit(value) {
|
|
3
3
|
const digits = String(value);
|
|
4
4
|
return /^\d{11}$/.test(digits) ? `${digits.slice(0, 2)}-${digits.slice(2, 10)}-${digits.slice(10)}` : digits;
|
|
5
5
|
}
|
|
6
|
-
//# sourceMappingURL=format-cuit.js.map
|
package/dist/lib/links.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/** URL publica de la guia para sacar los certificados de ARCA (testing y produccion). */
|
|
2
2
|
export const CERTIFICATE_GUIDE_URL = 'https://github.com/LcsGrz/arcli/blob/main/docs/obtencion-certificados.md';
|
|
3
|
-
|
|
3
|
+
/** Seccion de la guia que explica como crear un punto de venta para web service. */
|
|
4
|
+
export const POINT_OF_SALE_GUIDE_URL = `${CERTIFICATE_GUIDE_URL}#punto-de-venta-para-web-service`;
|
|
@@ -3,7 +3,7 @@ import Big from 'big.js';
|
|
|
3
3
|
export const AMOUNT_DECIMALS = 2;
|
|
4
4
|
/** Decimales de una cotizacion en ARCA (MonCotiz). */
|
|
5
5
|
export const EXCHANGE_RATE_DECIMALS = 6;
|
|
6
|
-
const FORMAT_HINT = '
|
|
6
|
+
const FORMAT_HINT = 'usá punto para miles y coma para decimales, por ejemplo 15000, 15.000 o 1.500,50';
|
|
7
7
|
/**
|
|
8
8
|
* Interpreta un monto escrito como en Argentina: el punto separa miles y la coma separa decimales.
|
|
9
9
|
* `15000`, `15.000`, `1500,50` y `1.500,50` son validos; `1500.50` no, porque un grupo de miles
|
|
@@ -14,11 +14,11 @@ export function parseArgentineAmount(raw, options = {}) {
|
|
|
14
14
|
const value = raw.trim().replace(/^\$/, '').replace(/\s/g, '');
|
|
15
15
|
const match = /^(\d{1,3}(?:\.\d{3})+|\d+)(?:,(\d+))?$/.exec(value);
|
|
16
16
|
if (!match) {
|
|
17
|
-
return { ok: false, reason: /^\d+\.\d{1,2}$/.test(value) ? '
|
|
17
|
+
return { ok: false, reason: /^\d+\.\d{1,2}$/.test(value) ? 'usá coma para los decimales' : FORMAT_HINT };
|
|
18
18
|
}
|
|
19
19
|
const [, integerPart = '', decimalPart = ''] = match;
|
|
20
20
|
if (decimalPart.length > maxDecimals) {
|
|
21
|
-
return { ok: false, reason: `
|
|
21
|
+
return { ok: false, reason: `usá hasta ${maxDecimals} decimales` };
|
|
22
22
|
}
|
|
23
23
|
const amount = Number(`${integerPart.replace(/\./g, '')}.${decimalPart || '0'}`);
|
|
24
24
|
if (!Number.isFinite(amount) || amount <= 0) {
|
|
@@ -34,4 +34,3 @@ export function formatArgentineAmountInput(value) {
|
|
|
34
34
|
export function hasAtMostDecimals(value, decimals) {
|
|
35
35
|
return Number.isFinite(value) && new Big(value).round(decimals, Big.roundDown).eq(value);
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=argentine-amount.js.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { X509Certificate } from 'node:crypto';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const expiresAt = new Date(certificate.validTo);
|
|
6
|
-
const daysRemaining = Math.ceil((expiresAt.getTime() - Date.now()) / MS_PER_DAY);
|
|
2
|
+
import { diffArcaDatesInDays, formatDateAsArcaDate } from '../dates/arca-date.js';
|
|
3
|
+
/** Vencido desde el instante exacto de `notAfter`; los dias se cuentan en fechas argentinas, no en horas. */
|
|
4
|
+
export function computeCertificateExpiry(expiresAt, now = new Date()) {
|
|
7
5
|
return {
|
|
8
|
-
daysRemaining,
|
|
6
|
+
daysRemaining: diffArcaDatesInDays(formatDateAsArcaDate(now), formatDateAsArcaDate(expiresAt)),
|
|
9
7
|
expiresAt,
|
|
10
|
-
isExpired:
|
|
8
|
+
isExpired: expiresAt.getTime() <= now.getTime(),
|
|
11
9
|
};
|
|
12
10
|
}
|
|
11
|
+
/** Lee la fecha de vencimiento del PEM. Es local, sin red; tira si el contenido no es un certificado X.509. */
|
|
12
|
+
export function readCertificateExpiry(pemContent, now = new Date()) {
|
|
13
|
+
const certificate = new X509Certificate(pemContent);
|
|
14
|
+
return computeCertificateExpiry(new Date(certificate.validTo), now);
|
|
15
|
+
}
|
|
13
16
|
export function isCertificateExpiringSoon(expiry, thresholdDays) {
|
|
14
17
|
return !expiry.isExpired && expiry.daysRemaining <= thresholdDays;
|
|
15
18
|
}
|
|
16
|
-
//# sourceMappingURL=certificate.js.map
|
package/dist/lib/security/pem.js
CHANGED
|
@@ -12,7 +12,7 @@ function acceptedPemHeaders(kind) {
|
|
|
12
12
|
}
|
|
13
13
|
export function ensurePathExists(filePath, label) {
|
|
14
14
|
if (!existsSync(filePath)) {
|
|
15
|
-
throw new ConfigurationError(`La ruta
|
|
15
|
+
throw new ConfigurationError(`La ruta de ${label === 'certificado' ? 'el certificado' : 'la clave privada'} no existe: ${maskPath(filePath)}`, {
|
|
16
16
|
path: maskPath(filePath),
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -26,7 +26,7 @@ export function ensurePemFormat(content, filePath, label) {
|
|
|
26
26
|
const hasAcceptedHeader = acceptedPemHeaders(label).some((header) => normalizedContent.includes(`-----${header}-----`));
|
|
27
27
|
const hasAcceptedFooter = normalizedContent.includes('-----END');
|
|
28
28
|
if (!hasAcceptedHeader || !hasAcceptedFooter) {
|
|
29
|
-
throw new ConfigurationError(`La ${label === 'certificado' ? 'ruta del certificado' : 'ruta de la clave privada'} apunta a un archivo con formato PEM
|
|
29
|
+
throw new ConfigurationError(`La ${label === 'certificado' ? 'ruta del certificado' : 'ruta de la clave privada'} apunta a un archivo con formato PEM inválido: ${maskPath(filePath)}. Debe contener un bloque como ${expectedPemHeader(label)}.`, {
|
|
30
30
|
path: maskPath(filePath),
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -37,4 +37,3 @@ export function readPemFile(filePath, label) {
|
|
|
37
37
|
ensurePemFormat(content, filePath, label);
|
|
38
38
|
return content;
|
|
39
39
|
}
|
|
40
|
-
//# sourceMappingURL=pem.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { POINT_OF_SALE_GUIDE_URL } from '../../lib/links.js';
|
|
2
|
+
/**
|
|
3
|
+
* WSFEv1 10005: "El punto de venta informado debe estar dado de alta y ser del tipo RECE".
|
|
4
|
+
* Es el rechazo de un punto de venta de "Factura en línea" (Comprobantes en linea).
|
|
5
|
+
*/
|
|
6
|
+
const POINT_OF_SALE_NOT_RECE_CODE = 10005;
|
|
1
7
|
export function createDryRunResponse() {
|
|
2
8
|
return {
|
|
3
9
|
cae: null,
|
|
@@ -48,18 +54,24 @@ function buildResponseSuggestions(options) {
|
|
|
48
54
|
.map((error) => typeof error === 'object' && error && 'Msg' in error ? String(error.Msg ?? '') : '')
|
|
49
55
|
.filter(Boolean),
|
|
50
56
|
].join(' | ');
|
|
57
|
+
const codes = options.errors
|
|
58
|
+
.map((error) => typeof error === 'object' && error && 'Code' in error ? Number(error.Code) : NaN)
|
|
59
|
+
.filter((code) => Number.isInteger(code));
|
|
51
60
|
const suggestions = new Set();
|
|
52
61
|
if (/transacci[oó]n activa/i.test(messages) || /error interno de base de datos/i.test(messages)) {
|
|
53
|
-
suggestions.add('ARCA
|
|
62
|
+
suggestions.add('ARCA devolvió un error transitorio. Esperá unos segundos y volvé a intentar la emisión.');
|
|
54
63
|
}
|
|
55
64
|
if (/cuit receptora.*no existe/i.test(messages)) {
|
|
56
|
-
suggestions.add('
|
|
65
|
+
suggestions.add('Revisá el CUIT del receptor o emití con un receptor válido del padrón para testing.');
|
|
57
66
|
}
|
|
58
67
|
if (/objeto IVA es obligatorio/i.test(messages)) {
|
|
59
|
-
suggestions.add('
|
|
68
|
+
suggestions.add('Revisá IVA receptor y el calculo de IVA del comprobante antes de reintentar.');
|
|
69
|
+
}
|
|
70
|
+
if (codes.includes(POINT_OF_SALE_NOT_RECE_CODE) || /punto de venta.*tipo RECE/i.test(messages)) {
|
|
71
|
+
suggestions.add(`El punto de venta no está habilitado para web service (los de "Factura en línea" no sirven). Revisá los habilitados con arcli parametros puntos-venta o creá uno para web service: ${POINT_OF_SALE_GUIDE_URL}`);
|
|
60
72
|
}
|
|
61
73
|
if (options.resultado === 'R' && suggestions.size === 0) {
|
|
62
|
-
suggestions.add('
|
|
74
|
+
suggestions.add('Revisá observaciones y errores de ARCA antes de volver a emitir.');
|
|
63
75
|
}
|
|
64
76
|
return [...suggestions];
|
|
65
77
|
}
|
|
@@ -72,4 +84,3 @@ function resolveBillingStatus(options) {
|
|
|
72
84
|
}
|
|
73
85
|
return 'observado';
|
|
74
86
|
}
|
|
75
|
-
//# sourceMappingURL=billing-response.js.map
|
|
@@ -22,7 +22,7 @@ function validateLetterCAmounts(input, voucherKind) {
|
|
|
22
22
|
input.untaxedAmount ? '--nogravado' : undefined,
|
|
23
23
|
].filter((flag) => Boolean(flag));
|
|
24
24
|
if (flags.length > 0) {
|
|
25
|
-
throw new InputValidationError(`La ${formatVoucherLabel(voucherKind)} no discrimina IVA ni importes exentos o no gravados.
|
|
25
|
+
throw new InputValidationError(`La ${formatVoucherLabel(voucherKind)} no discrimina IVA ni importes exentos o no gravados. Sacá ${flags.join(', ')}.`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -43,7 +43,7 @@ export function resolveTaxAmounts(input, voucherKind) {
|
|
|
43
43
|
const untaxedAmount = input.untaxedAmount ?? 0;
|
|
44
44
|
const taxedTotal = new Big(input.totalAmount).minus(exemptAmount).minus(untaxedAmount);
|
|
45
45
|
if (taxedTotal.lt(0)) {
|
|
46
|
-
throw new InputValidationError('El importe exento
|
|
46
|
+
throw new InputValidationError('El importe exento más el no gravado no puede superar el monto total.');
|
|
47
47
|
}
|
|
48
48
|
if (taxedTotal.eq(0)) {
|
|
49
49
|
return { exemptAmount, ivaAmount: 0, netAmount: 0, untaxedAmount };
|
|
@@ -79,7 +79,7 @@ function resolveTaxedParts(input, taxedTotal) {
|
|
|
79
79
|
const sum = [...byRate.values()].reduce((total, amount) => total.plus(amount), new Big(0));
|
|
80
80
|
// Los importes tienen 2 decimales como maximo, asi que la suma tiene que dar exacta.
|
|
81
81
|
if (!sum.eq(taxedTotal)) {
|
|
82
|
-
throw new InputValidationError(`La suma de las
|
|
82
|
+
throw new InputValidationError(`La suma de las alícuotas (${formatPlain(sum)}) no coincide con lo gravado del monto total (${formatPlain(taxedTotal)}). Revisá --monto, --alicuota, --exento y --nogravado.`);
|
|
83
83
|
}
|
|
84
84
|
return [...byRate.entries()].map(([rate, amount]) => ({ amount, rate }));
|
|
85
85
|
}
|
|
@@ -93,4 +93,3 @@ function roundAmount(value) {
|
|
|
93
93
|
export function sumTaxAmounts(amounts) {
|
|
94
94
|
return roundAmount(new Big(amounts.untaxedAmount).plus(amounts.exemptAmount).plus(amounts.netAmount).plus(amounts.ivaAmount));
|
|
95
95
|
}
|
|
96
|
-
//# sourceMappingURL=billing.amounts.js.map
|