arcli 2.1.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 +52 -1
- package/README.md +6 -0
- package/dist/cli/arca-runtime.js +0 -1
- 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 +0 -1
- package/dist/cli/commands/billing.command.interactive-preview.js +9 -13
- package/dist/cli/commands/billing.command.options.js +83 -39
- package/dist/cli/commands/billing.command.output.js +0 -1
- package/dist/cli/commands/billing.command.parser.js +18 -17
- package/dist/cli/commands/billing.command.pdf.js +9 -6
- package/dist/cli/commands/billing.command.shared.js +2 -2
- 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 +9 -10
- package/dist/cli/commands/cuit-argument.js +6 -6
- 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 +2 -3
- package/dist/cli/commands/interactive.command.js +2 -3
- package/dist/cli/commands/padron.command.js +5 -6
- package/dist/cli/commands/parameters.command.js +5 -6
- package/dist/cli/commands/pdf.command.js +1 -2
- package/dist/cli/commands/storybook.command.js +4 -4
- package/dist/cli/commands/vouchers.command.js +9 -9
- package/dist/cli/error-output.js +21 -3
- package/dist/cli/global-options.js +2 -3
- package/dist/cli/help-argv.js +0 -1
- package/dist/cli/help.js +186 -380
- package/dist/cli/ignored-global-options.js +1 -2
- package/dist/cli/index.js +5 -3
- package/dist/cli/interactive/advanced-options.js +13 -14
- package/dist/cli/interactive/config.flow.js +55 -17
- 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 +16 -17
- package/dist/cli/interactive/invoice-picker.js +7 -7
- package/dist/cli/interactive/invoice.flow.js +32 -11
- package/dist/cli/interactive/note.flow.js +12 -13
- package/dist/cli/interactive/pdf.flow.js +9 -7
- package/dist/cli/interactive/prompts.js +0 -1
- package/dist/cli/interactive/receiver-padron.js +3 -4
- package/dist/cli/interactive/repeat.flow.js +7 -8
- package/dist/cli/interactive/session.js +9 -7
- 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 +6 -3
- 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 +0 -1
- 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 +0 -1
- package/dist/lib/identity/cuit.js +26 -0
- package/dist/lib/identity/format-cuit.js +1 -2
- package/dist/lib/links.js +0 -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 +0 -1
- package/dist/lib/security/pem.js +2 -3
- package/dist/modules/billing/billing-response.js +6 -7
- 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 +7 -6
- 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 +1 -2
- package/dist/modules/billing/billing.display.js +10 -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 +5 -6
- 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 +9 -5
- package/dist/modules/billing/billing.presenter.js +0 -1
- package/dist/modules/billing/billing.schemas.js +14 -6
- package/dist/modules/billing/billing.serialize.js +6 -3
- package/dist/modules/billing/billing.service.js +4 -4
- package/dist/modules/billing/billing.text.js +0 -1
- 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 +3 -4
- package/dist/modules/config/config-doctor.js +36 -14
- package/dist/modules/config/config-value-parser.js +29 -16
- package/dist/modules/config/config.export-credentials.js +23 -0
- package/dist/modules/config/config.presenter.js +22 -6
- package/dist/modules/config/config.schemas.js +24 -12
- package/dist/modules/config/config.sections.js +26 -11
- package/dist/modules/config/config.service.js +6 -2
- package/dist/modules/examples/examples.js +44 -10
- 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 +11 -3
- package/dist/modules/interactive/equivalent-command.js +4 -1
- 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 +0 -1
- package/dist/modules/padron/padron.presenter.js +6 -7
- package/dist/modules/parameters/health.js +0 -1
- package/dist/modules/parameters/parameters.js +2 -3
- package/dist/modules/parameters/parameters.presenter.js +12 -13
- 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 +20 -21
- 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 +4 -5
- package/dist/services/arca/arca-client.factory.js +23 -2
- package/dist/services/arca/arca-context.resolver.js +5 -6
- 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 +1 -2
- 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 +15 -2
- package/dist/services/pdf/pdf-plugin.js +41 -14
- package/dist/ui/components/certificateBanner.js +0 -1
- package/dist/ui/components/contentPanel.js +0 -1
- package/dist/ui/components/errorPanel.js +0 -1
- package/dist/ui/components/index.js +0 -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 +0 -1
- package/dist/ui/presenters/errors.presenter.js +10 -11
- package/dist/ui/presenters/errors.zod-presenter.js +8 -9
- 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 +0 -1
- package/dist/ui/theme/index.js +0 -1
- package/dist/ui/theme/theme.js +0 -1
- package/llms.txt +64 -5
- package/package.json +1 -2
- package/dist/cli/arca-runtime.d.ts +0 -20
- package/dist/cli/arca-runtime.js.map +0 -1
- 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 -32
- 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 -18
- package/dist/cli/commands/billing.command.output.js.map +0 -1
- package/dist/cli/commands/billing.command.parser.d.ts +0 -35
- 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 -26
- 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 -6
- package/dist/cli/commands/config.command.js.map +0 -1
- package/dist/cli/commands/cuit-argument.d.ts +0 -2
- package/dist/cli/commands/cuit-argument.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/padron.command.d.ts +0 -2
- package/dist/cli/commands/padron.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 -25
- package/dist/cli/error-output.js.map +0 -1
- package/dist/cli/global-options.d.ts +0 -26
- package/dist/cli/global-options.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 -14
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/ignored-global-options.d.ts +0 -6
- package/dist/cli/ignored-global-options.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 -4
- 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 -22
- package/dist/cli/interactive/invoice.flow.js.map +0 -1
- package/dist/cli/interactive/note.flow.d.ts +0 -34
- 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/receiver-padron.d.ts +0 -29
- package/dist/cli/interactive/receiver-padron.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 -6
- 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/files/write-new-file.d.ts +0 -5
- package/dist/lib/files/write-new-file.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 -4
- 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 -11
- 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.json-input.d.ts +0 -58
- package/dist/modules/billing/billing.json-input.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.padron.d.ts +0 -14
- package/dist/modules/billing/billing.padron.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 -147
- package/dist/modules/billing/billing.schemas.js.map +0 -1
- package/dist/modules/billing/billing.serialize.d.ts +0 -9
- package/dist/modules/billing/billing.serialize.js.map +0 -1
- package/dist/modules/billing/billing.service.d.ts +0 -30
- 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 -38
- 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/certificate-expiry.d.ts +0 -42
- package/dist/modules/config/certificate-expiry.js.map +0 -1
- package/dist/modules/config/config-doctor.d.ts +0 -16
- 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 -17
- package/dist/modules/config/config.presenter.js.map +0 -1
- package/dist/modules/config/config.schemas.d.ts +0 -156
- 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 -6
- 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/padron/padron.d.ts +0 -46
- package/dist/modules/padron/padron.js.map +0 -1
- package/dist/modules/padron/padron.presenter.d.ts +0 -7
- package/dist/modules/padron/padron.presenter.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 -16
- package/dist/services/arca/arca-billing.gateway.js.map +0 -1
- package/dist/services/arca/arca-client.factory.d.ts +0 -6
- package/dist/services/arca/arca-client.factory.js.map +0 -1
- package/dist/services/arca/arca-context.resolver.d.ts +0 -55
- 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-padron.gateway.d.ts +0 -9
- package/dist/services/arca/arca-padron.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 -22
- 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/certificateBanner.d.ts +0 -11
- package/dist/ui/components/certificateBanner.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 -10
- 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 -21
- 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
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,56 @@ El formato sigue [Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/) y e
|
|
|
8
8
|
|
|
9
9
|
## [Sin publicar]
|
|
10
10
|
|
|
11
|
+
## [2.2.0] - 2026-11-02
|
|
12
|
+
|
|
13
|
+
Trae la factura de exportación `E` (`arcli fe`) sobre WSFEX: items, país de destino, incoterm y permisos de embarque, con credenciales propias para `wsfex`, PDF con el diseño de exportación y modo interactivo. Es todo agregado: los comandos y flags de A, B, C y FCE siguen igual. Gracias a [Manuel Aller](https://github.com/itManuel), que la trajo en [#67](https://github.com/LcsGrz/arcli/pull/67).
|
|
14
|
+
|
|
15
|
+
Además suma el autocompletado con Tab, el número del comprobante en el JSON, la validación del dígito verificador de todo CUIT y una ayuda más corta y en español, y corrige varios errores de la revisión del repo.
|
|
16
|
+
|
|
17
|
+
Dos cambios pueden afectar scripts: los mensajes ahora usan voseo y tildes (si comparás el texto de un error en lugar de `codigo`), y un `montoTotal` con más de 2 decimales en el JSON da error en lugar de redondearse. Ver "Cambiado" y "Corregido".
|
|
18
|
+
|
|
19
|
+
### Agregado
|
|
20
|
+
|
|
21
|
+
- **`arcli fe` y `arcli factura e`:** emiten o previsualizan la Factura de exportación `E` (tipo 19) con WSFEX. Obligatorios: `--monto`, `--cliente`, `--domicilio-cliente`, `--pais-destino` (código o nombre), `--numero` y la actividad. Opcionales: `--id-impositivo`, `--cuit-pais`, `--tipo-expo` (`1` bienes, `2` servicios, `4` otros), `--incoterm`, `--incoterms-desc`, `--idioma`, `--forma-pago`, `--permiso` con `--permiso-existente`, `--id-solicitud`, `--fecha-pago`, `--observaciones` y `--obs-comerciales`. No lleva concepto, IVA ni receptor con CUIT/CUIL/DNI. `fe` va en la tabla de atajos de `arcli --ayuda` y en `arcli ejemplos`, y Tab completa la letra `e` en `arcli factura`.
|
|
22
|
+
- **`--numero` obligatorio en la `E`:** WSFEX numera por punto de venta y tipo, pero `@arcasdk/core` todavía no permite consultar el último comprobante E. Pasá el siguiente al último que emitiste (`1` si es el primero).
|
|
23
|
+
- **Actividad de la `E`:** `--actividad` o la clave nueva `exportacion.actividad` (sección "Factura de exportación (E)" de `arcli config`), con un código de la tabla de actividades de WSFEX, que no es la del padrón. No hay default; un código que no está en la tabla es error de validación con los que empiezan igual.
|
|
24
|
+
- **Flags de otra letra en `arcli factura <letra>`:** como `factura` comparte el comando para A, B, C y E, los flags que no aplican a la letra elegida se saltean con un aviso en "Avisos" y en `avisos` del JSON (`factura a --incoterm`, `factura e --alicuota`). Los atajos (`fa`, `fe`…) siguen rechazándolos como opción desconocida.
|
|
25
|
+
- **`--item` con detalle real:** `codigo|descripcion|cantidad|precio|unidad`, repetible; el código y la unidad son opcionales y la unidad puede ser el código de ARCA o su nombre. La suma de los items tiene que dar `--monto` y se valida antes de autenticar en WSAA, porque WSFEX no lo controla.
|
|
26
|
+
- **`--cargar` para `E`:** un objeto, con claves propias (`cliente`, `domicilioCliente`, `paisDestino`, `monto`, `numero`, `actividad`, `items`, `tipoExpo`…). El lote no está soportado: un array es error de entrada.
|
|
27
|
+
- **`exportacion.cert.testing`, `exportacion.cert.produccion`, `exportacion.key.testing`, `exportacion.key.produccion`:** credenciales del servicio `wsfex`, para cuando el certificado general no está autorizado a exportación. Si no están las dos de un entorno, se usan `cert.*`/`key.*`; con la mitad del par configurada el comando corta antes de ir a ARCA. Se muestran en la sección **Certificados** de `arcli config` (también en el modo interactivo), se validan como PEM al guardarlas y `arcli config revisar` las revisa con el resto. Sin autorización a `wsfex`, el error es `WSFEX_SERVICE_NOT_AUTHORIZED`.
|
|
28
|
+
- **Defaults de la `E`:** sin flags, la exportación sale de servicios (`Tipo_expo` `2`), en dólares (`Moneda_Id` `DOL`), con la cotización de aduana que publica ARCA (si la del día todavía no salió, la última, con un aviso) y con forma de pago `Transferencia Internacional`. Las claves `moneda` y `cotizacion` de la config no aplican a exportación.
|
|
29
|
+
- **Salida JSON de exportación:** el mismo resumen que A, B y C (`atajo: "fe"`, `tipoArca: 19`, `comprobante: "Factura de exportación E"`) más un bloque `exportacion` con cliente, destino, domicilio, actividad, incoterm, items y permisos; `solicitud` es el `Cmp` de WSFEX, con los nombres de ARCA. Forma exacta en [entrada y salida](docs/input-output.md#factura-de-exportación-e).
|
|
30
|
+
- **PDF de exportación:** se guarda como `factura-e_<pv>-<numero>.pdf` con el diseño de exportación de `@arcasdk/pdf` y los mismos datos que la E de Comprobantes en línea: título `FACTURA DE EXPORTACIÓN`, items de WSFEX, país de destino, CUIT del país con su tipo de entidad, ID impositivo, divisa con su código ISO (`USD - Dólar Estadounidense`), forma y fecha de pago, incoterm y la leyenda `IVA EXENTO OPERACIÓN DE EXPORTACIÓN`, sin discriminar IVA.
|
|
31
|
+
- **Factura E en el modo interactivo:** se elige en el mismo selector que A, B y C y tiene su propio asistente (cliente, país, tipo, monto, moneda, incoterm en bienes, pago, actividad y número), con vista previa, comando equivalente y PDF. Ver [modo interactivo](docs/modo-interactivo.md#factura-de-exportación-e).
|
|
32
|
+
- **CUIT con dígito verificador y con o sin guiones en todos lados:** `arcli padron`, `arcli fce-obligado`, `--cuit`, `--cuil`, `--acuit`, `comprobanteAsociado.cuit` en el JSON, `config establecer cuit` y el modo interactivo aceptan `20-33333333-4` o `20333333334`, y rechazan un CUIT mal tipeado antes de llegar a ARCA. Antes `arcli padron 20-20179706-4` fallaba y nadie chequeaba el dígito verificador.
|
|
33
|
+
- **Error `ARCA_LAST_VOUCHER_ERROR`:** si ARCA rechaza el pedido del último número (por ejemplo, con un punto de venta no habilitado para web service), la facturación y `arcli ultimos` cortan ahí con el mensaje de ARCA y una sugerencia. No se emite nada.
|
|
34
|
+
- **Esc en las preguntas del CLI:** "¿Querés emitir … ahora?", que aparece sin `--emitir` en una terminal, ahora se cierra con Esc como un "no", igual que en el modo interactivo y en las preguntas del PDF.
|
|
35
|
+
- **`numero` en el JSON de facturación:** el número que le tocó al comprobante emitido (`null` en una previsualización), y `solicitud` lo trae en `CbteDesde`/`CbteHasta`. El panel de texto muestra `Número: 00003-00000125`. Antes el número solo se veía con `--bruto`.
|
|
36
|
+
- **Autocompletado con Tab** para bash, zsh y fish. Se instala con `arcli completado instalar`, que agrega una línea al archivo de inicio del shell (`~/.zshrc`, `~/.bashrc`…), y se saca con `arcli completado desinstalar`; también desde el modo interactivo, en Configuración → Autocompletado. Completa comandos y atajos, flags, valores (`--iva-receptor`, `--concepto`, `--alicuota`, `--moneda`, `--transferencia`, `--ac`), claves de config y sus valores, tablas de `parametros` y letras de las familias; donde va una ruta, archivos. No hay que reinstalarlo al actualizar arcli. Ver [Autocompletado](docs/cli-reference.md#autocompletado).
|
|
37
|
+
|
|
38
|
+
### Cambiado
|
|
39
|
+
|
|
40
|
+
- **Ayuda más corta y toda en español.** `arcli --ayuda` pasa de unas 145 líneas a 57: los 18 atajos van en una tabla familia × letra y `storybook` (herramienta de desarrollo) ya no aparece, aunque sigue funcionando. La ayuda de cada comprobante (`arcli fc --ayuda`) pasa de 177 a 79 líneas: muestra solo los flags que aplican a ese comprobante, menciona los alias en la opción principal (`punto de venta (alias: --pv)`) y ya no repite la tabla de parámetros. Los flags ocultos se siguen aceptando igual. "Usage", "Options", `[options]`, `<number>` y la descripción de `--version` ahora están en español.
|
|
41
|
+
- **Errores de uso en español:** opción o comando desconocido, valor faltante y argumentos de más (`opción desconocida '--montoo' (¿quisiste decir --monto?)`). También en el `error` del JSON con `--json`; el `codigo` sigue siendo `INPUT_VALIDATION_ERROR`.
|
|
42
|
+
- **Voseo y tildes en toda la salida:** mensajes, ayuda, modo interactivo y PDF ("Usá", "Revisá", "número", "configuración"). Los flags, claves de config, valores (`produccion`, `cotizacion`) y claves JSON no cambian. Si un script compara el texto de un mensaje de error en lugar de `codigo`, puede necesitar un ajuste.
|
|
43
|
+
|
|
44
|
+
### Corregido
|
|
45
|
+
|
|
46
|
+
- **Punto de venta inválido:** la facturación seguía con el número 1 y recién fallaba al emitir con un error confuso, y `arcli ultimos` mostraba que no había comprobantes. Ahora cortan con `ARCA_LAST_VOUCHER_ERROR`.
|
|
47
|
+
- **Lote cortado antes de emitir:** si el lote se cortaba en el login o en el pedido del último número, el comprobante que falló no figuraba en `detalles.sinProcesar` de `BATCH_EMISSION_ERROR`, y reintentar solo esa lista lo perdía. Ahora figura. Si la emisión quedó sin confirmar, sigue en `sinConfirmar` y no en `sinProcesar`, como antes.
|
|
48
|
+
- **IIBB en el PDF:** sin `emisor.iibb`, el PDF decía "Exento"; ahora muestra "-". Si sos exento, configuralo con `arcli config establecer emisor.iibb Exento`. La configuración guiada del modo interactivo ahora lo pregunta junto a los otros datos del emisor.
|
|
49
|
+
- **Números con letras o notación científica:** `config establecer puntoVenta 3a` guardaba `3`, y `arcli consultar fc 1e3` buscaba el 1000. Ahora dan error, igual que en el modo interactivo.
|
|
50
|
+
- **`arcli pdf instalar` colgado:** con un proxy que no responde, npm o la descarga del navegador no terminaban nunca. Ahora se cortan a los 5 y 15 minutos con `PDF_PLUGIN_INSTALL_ERROR`.
|
|
51
|
+
- **`montoTotal` del JSON nunca se redondea:** con más de 2 decimales se redondeaba en silencio antes de validar (`1.005` se emitía por `$1`). Ahora da `INPUT_VALIDATION_ERROR` ("Use hasta 2 decimales"), igual que `--monto` y el resto de los importes.
|
|
52
|
+
- **`consultarPadron false` se respeta siempre:** con un `ivaReceptor` en la config, facturar con `--cuit` igual consultaba el padrón y su condición IVA pisaba la de la config.
|
|
53
|
+
- **Aviso falso en `avisos`:** "--descripcion, --receptor-nombre y --receptor-domicilio solo se usan en el PDF" salía sin haber pasado esos flags, cuando el nombre o el domicilio los había completado el padrón.
|
|
54
|
+
- **Modo interactivo:** al generar el PDF, apretar Enter en el nombre o el domicilio del receptor borraba lo que había traído el padrón; ahora lo propone y Enter lo deja. En una FCE se informa el `aliasCbu` de la config, como con flags. Y si la config tiene una moneda extranjera, el comando equivalente de un comprobante en pesos lleva `--moneda ARS`, así al pegarlo hace lo mismo.
|
|
55
|
+
- **Leyendas obligatorias en el PDF:** los comprobantes B ahora traen el bloque del Régimen de Transparencia Fiscal al Consumidor (Ley 27.743, RG 5614), con el IVA contenido, y los comprobantes A a un monotributista la leyenda de la RG 5003 sobre el crédito fiscal. Salen debajo del CAE. Ver [PDF](docs/pdf.md#leyendas-obligatorias).
|
|
56
|
+
|
|
57
|
+
### Documentación
|
|
58
|
+
|
|
59
|
+
- Nueva sección de la `E` en [referencia del CLI](docs/cli-reference.md#factura-de-exportación-e-wsfex) y en [reglas de validación](docs/validation-rules.md#factura-de-exportación-e); credenciales de WSFEX en [configuración](docs/configuration.md#certificados-de-exportación-wsfex); items, JSON y limitaciones (`--numero` obligatorio, sin notas E, sin lote) en [entrada y salida](docs/input-output.md), [PDF](docs/pdf.md) y [limitaciones](docs/limitations.md); el asistente de la `E` en [modo interactivo](docs/modo-interactivo.md) y sus problemas comunes en [troubleshooting](docs/troubleshooting.md).
|
|
60
|
+
|
|
11
61
|
## [2.1.0] - 2026-10-23
|
|
12
62
|
|
|
13
63
|
Trae `arcli padron` y el IVA receptor desde el padrón al facturar con `--cuit`, el aviso de vencimiento del certificado y una guía para el punto de venta de web service. Además corrige un montón de cosas que salen de una revisión del repo: el JSON de `--cargar` se valida clave por clave, los errores con `--json` tienen siempre la misma forma, y los ejemplos de la ayuda y de los docs se pueden copiar y andan.
|
|
@@ -338,7 +388,8 @@ Primera versión publicada en npm.
|
|
|
338
388
|
- `llms.txt`: referencia condensada para que un agente de IA con acceso a terminal ejecute el CLI.
|
|
339
389
|
- Publicación con npm Trusted Publishers (OIDC).
|
|
340
390
|
|
|
341
|
-
[Sin publicar]: https://github.com/LcsGrz/arcli/compare/v2.
|
|
391
|
+
[Sin publicar]: https://github.com/LcsGrz/arcli/compare/v2.2.0...HEAD
|
|
392
|
+
[2.2.0]: https://github.com/LcsGrz/arcli/compare/v2.1.0...v2.2.0
|
|
342
393
|
[2.1.0]: https://github.com/LcsGrz/arcli/compare/v2.0.0...v2.1.0
|
|
343
394
|
[2.0.0]: https://github.com/LcsGrz/arcli/compare/v1.8.0...v2.0.0
|
|
344
395
|
[1.8.0]: https://github.com/LcsGrz/arcli/compare/v1.7.1...v1.8.0
|
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ CLI para previsualizar y emitir comprobantes electrónicos de ARCA (ex AFIP) des
|
|
|
17
17
|
- **Modo interactivo:** `arcli` sin argumentos abre un asistente que guía la emisión, repite facturas anteriores, arma notas de crédito y débito, consulta comprobantes y configura el CLI. Cada paso muestra el comando equivalente.
|
|
18
18
|
- **Vista previa por defecto:** sin `--emitir`, muestra la solicitud y, en una terminal, pregunta antes de emitir.
|
|
19
19
|
- **Comprobantes:** Factura, Nota de Crédito y Nota de Débito A, B y C, y sus versiones de Factura de Crédito Electrónica (FCE), con CBU, transferencia, anulación y consulta del régimen del receptor.
|
|
20
|
+
- **Factura de exportación E:** `arcli fe` emite con WSFEX, con cliente y país de destino, incoterm, items detallados y permisos de embarque; acepta certificado propio con `exportacion.cert.*` / `exportacion.key.*`.
|
|
20
21
|
- **Entrada y salida flexibles:** flags o JSON (incluso lotes); salida legible, `--json` o respuesta bruta de ARCA.
|
|
21
22
|
- **Validaciones locales** basadas en el manual de ARCA, para detectar errores antes de llamar al servicio.
|
|
22
23
|
- **Consultas sin emitir:** últimos comprobantes, detalle de uno, estado de los servidores, tablas de parámetros, cotización oficial y padrón de un CUIT.
|
|
@@ -31,6 +32,8 @@ Requiere Node.js 22.22.1 o superior.
|
|
|
31
32
|
npm install -g arcli
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
Opcional: autocompletado con Tab de comandos, flags y valores, en bash, zsh o fish. Se instala con `arcli completado instalar` y se saca con `arcli completado desinstalar` ([detalle](docs/cli-reference.md#autocompletado)).
|
|
36
|
+
|
|
34
37
|
## Configuración
|
|
35
38
|
|
|
36
39
|
Necesitás tu CUIT, un punto de venta y un certificado con su clave privada de ARCA. Si todavía no los tenés, seguí [Cómo obtener los certificados](https://github.com/LcsGrz/arcli/blob/main/docs/obtencion-certificados.md).
|
|
@@ -54,6 +57,8 @@ arcli fc -m 15000 --cs --consumidor-final --ir-cf # vista previa de u
|
|
|
54
57
|
arcli fc -m 15000 --cs --consumidor-final --ir-cf --emitir # emitir
|
|
55
58
|
arcli fc --cargar ./facturas.json --emitir --json # lote desde JSON, salida JSON
|
|
56
59
|
arcli fc -m 15000 --cs --consumidor-final --ir-cf --emitir --exportar-pdf
|
|
60
|
+
arcli fe -m 1500 --cliente "ACME LLC" --domicilio-cliente "123 Main St" --pais-destino 203 \
|
|
61
|
+
--numero 1 --actividad 620100 --previsualizar # Factura de exportación E
|
|
57
62
|
```
|
|
58
63
|
|
|
59
64
|
Otras consultas: `arcli ultimos`, `arcli consultar`, `arcli estado`, `arcli parametros`, `arcli fce-obligado`, `arcli padron`. Para ver todos los comprobantes y ejemplos: `arcli --ayuda` y `arcli ejemplos`.
|
|
@@ -98,6 +103,7 @@ Leé [CONTRIBUTING.md](https://github.com/LcsGrz/arcli/blob/main/CONTRIBUTING.md
|
|
|
98
103
|
|
|
99
104
|
- [`@arcasdk/core`](https://github.com/ralcorta/arcasdk) y [`@arcasdk/pdf`](https://www.afipts.com/packages/pdf), de [Rodrigo Alcorta](https://github.com/ralcorta).
|
|
100
105
|
- [Arpit Bhayani](https://github.com/arpitbbhayani), por ceder el nombre `arcli` en npm.
|
|
106
|
+
- [Manuel Aller](https://github.com/itManuel), por la factura de exportación E.
|
|
101
107
|
|
|
102
108
|
Si el proyecto te resulta útil, podés dejar una estrella o invitarme un [Cafecito](https://cafecito.app/lcsgrz).
|
|
103
109
|
|
package/dist/cli/arca-runtime.js
CHANGED
|
@@ -1,30 +1,57 @@
|
|
|
1
1
|
import { InputValidationError } from '../../lib/errors/app-error.js';
|
|
2
2
|
import { getVoucherKindByFamilyAndLetter, VOUCHER_FAMILIES, VOUCHER_KIND_MAP, VOUCHER_LETTERS, } from '../../modules/billing/voucher-kind-map.js';
|
|
3
|
+
import { EXPORT_VOUCHER_KIND } from '../../modules/export/export.types.js';
|
|
3
4
|
import { configureSpanishHelp, createFamilyHelp } from '../help.js';
|
|
5
|
+
import { GLOBAL_OPTION_FLAGS } from '../ignored-global-options.js';
|
|
6
|
+
import { findPassedOptions, formatSkippedOptionsWarning } from '../skipped-options.js';
|
|
7
|
+
import { hideInapplicableBillingOptions } from './billing.command.options.js';
|
|
4
8
|
import { executeBillingCommand, registerBillingCommandOptions } from './billing.command.shared.js';
|
|
9
|
+
import { executeExportCommand } from './export.command.js';
|
|
10
|
+
import { EXPORT_OPTION_FLAGS, registerExportOptions } from './export.command.options.js';
|
|
11
|
+
function skippedWarnings(command, options, voucherLabel) {
|
|
12
|
+
const flags = findPassedOptions(command, options);
|
|
13
|
+
return flags.length > 0 ? [formatSkippedOptionsWarning(flags, voucherLabel)] : [];
|
|
14
|
+
}
|
|
5
15
|
export function registerBillingFamilyCommands(program) {
|
|
6
16
|
for (const family of VOUCHER_FAMILIES) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
const definitions = Object.values(VOUCHER_KIND_MAP).filter((definition) => definition.family === family);
|
|
18
|
+
const familyShortcuts = definitions.map((definition) => definition.shortcut).join(', ');
|
|
19
|
+
// La familia `factura` tambien acepta la letra E, que se emite por WSFEX.
|
|
20
|
+
const supportsExport = family === EXPORT_VOUCHER_KIND.family;
|
|
21
|
+
const shortcuts = supportsExport ? `${familyShortcuts}, ${EXPORT_VOUCHER_KIND.shortcut}` : familyShortcuts;
|
|
11
22
|
const command = program
|
|
12
|
-
.command(family)
|
|
13
|
-
.description(`usar ${family} por letra A, B o C con ejemplos y atajos${
|
|
23
|
+
.command(family, { hidden: true })
|
|
24
|
+
.description(`usar ${family} por letra A, B${supportsExport ? ', C o E' : ' o C'} con ejemplos y atajos${shortcuts ? ` (${shortcuts})` : ''}`)
|
|
14
25
|
.argument('<letra>', 'letra del comprobante', (value) => value.toLowerCase());
|
|
15
26
|
configureSpanishHelp(command);
|
|
16
27
|
registerBillingCommandOptions(command);
|
|
28
|
+
hideInapplicableBillingOptions(command, {
|
|
29
|
+
isElectronicCredit: definitions.some((definition) => definition.isElectronicCredit),
|
|
30
|
+
isNote: definitions.some((definition) => definition.requiresAssociatedVoucher),
|
|
31
|
+
letters: definitions.map((definition) => definition.letter),
|
|
32
|
+
});
|
|
33
|
+
// Un solo comando para A, B, C y E: acepta los flags de todas y saltea con un aviso los que no aplican a la letra.
|
|
34
|
+
const billingOnlyOptions = command.options.filter((option) => !EXPORT_OPTION_FLAGS.has(option.long ?? '') &&
|
|
35
|
+
!GLOBAL_OPTION_FLAGS.includes(option.long ?? ''));
|
|
36
|
+
const exportOnlyOptions = supportsExport ? registerExportOptions(command, { hidden: true }) : [];
|
|
17
37
|
command.action(async (letter) => {
|
|
38
|
+
if (supportsExport && letter === EXPORT_VOUCHER_KIND.letter) {
|
|
39
|
+
await executeExportCommand(command, {
|
|
40
|
+
extraWarnings: skippedWarnings(command, billingOnlyOptions, EXPORT_VOUCHER_KIND.displayName),
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
18
44
|
if (!VOUCHER_LETTERS.includes(letter)) {
|
|
19
|
-
throw new InputValidationError(`La letra "${letter}" no es
|
|
45
|
+
throw new InputValidationError(`La letra "${letter}" no es válida. Usá a, b${supportsExport ? ', c o e' : ' o c'}.`);
|
|
20
46
|
}
|
|
21
47
|
const definition = getVoucherKindByFamilyAndLetter(family, letter);
|
|
22
48
|
if (!definition) {
|
|
23
49
|
throw new InputValidationError(`No existe un comprobante para la familia "${family}" y letra "${letter}".`);
|
|
24
50
|
}
|
|
25
|
-
await executeBillingCommand(command, definition.shortcut
|
|
51
|
+
await executeBillingCommand(command, definition.shortcut, {
|
|
52
|
+
extraWarnings: skippedWarnings(command, exportOnlyOptions, definition.displayName),
|
|
53
|
+
});
|
|
26
54
|
});
|
|
27
55
|
command.addHelpText('after', createFamilyHelp(family));
|
|
28
56
|
}
|
|
29
57
|
}
|
|
30
|
-
//# sourceMappingURL=billing-family.command.js.map
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { VOUCHER_KIND_MAP, VOUCHER_SHORTCUTS } from '../../modules/billing/voucher-kind-map.js';
|
|
2
2
|
import { configureSpanishHelp, createShortcutHelp } from '../help.js';
|
|
3
|
+
import { hideInapplicableBillingOptions } from './billing.command.options.js';
|
|
3
4
|
import { executeBillingCommand, registerBillingCommandOptions } from './billing.command.shared.js';
|
|
4
5
|
export function registerBillingShortcutCommands(program) {
|
|
5
6
|
for (const shortcut of VOUCHER_SHORTCUTS) {
|
|
6
7
|
const definition = VOUCHER_KIND_MAP[shortcut];
|
|
8
|
+
// Ocultos en la lista de comandos: la ayuda principal los muestra en una tabla por familia y letra.
|
|
7
9
|
const command = program
|
|
8
|
-
.command(shortcut)
|
|
10
|
+
.command(shortcut, { hidden: true })
|
|
9
11
|
.description(`${definition.displayName} por shortcut, con ayuda guiada para previsualizar o emitir`);
|
|
10
12
|
configureSpanishHelp(command);
|
|
11
13
|
registerBillingCommandOptions(command);
|
|
14
|
+
hideInapplicableBillingOptions(command, {
|
|
15
|
+
isElectronicCredit: definition.isElectronicCredit,
|
|
16
|
+
isNote: definition.requiresAssociatedVoucher,
|
|
17
|
+
letters: [definition.letter],
|
|
18
|
+
});
|
|
12
19
|
command.action(async () => {
|
|
13
20
|
await executeBillingCommand(command, shortcut);
|
|
14
21
|
});
|
|
15
22
|
command.addHelpText('after', createShortcutHelp(shortcut));
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
|
-
//# sourceMappingURL=billing-shortcuts.command.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import select from '@inquirer/select';
|
|
2
1
|
import { writeTerminalOutput } from '../../ui/index.js';
|
|
2
|
+
import { chooseOne } from '../interactive/prompts.js';
|
|
3
3
|
import { formatBillingOutputs } from './billing.command.output.js';
|
|
4
|
+
/** Esc cuenta como no, igual que en el modo interactivo. */
|
|
4
5
|
async function promptForEmission(count, voucherLabel) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
default: true,
|
|
11
|
-
message: count > 1 ? `¿Desea emitir los ${count} comprobantes ahora?` : `¿Desea emitir ${voucherLabel} ahora?`,
|
|
12
|
-
});
|
|
6
|
+
return chooseOne(count > 1 ? `¿Querés emitir los ${count} comprobantes ahora?` : `¿Querés emitir ${voucherLabel} ahora?`, [
|
|
7
|
+
{ name: 'Sí, emitir ahora', value: true },
|
|
8
|
+
{ name: 'No, dejar sin emitir', value: false },
|
|
9
|
+
], true, { escapeLabel: 'no emitir', escapeValue: false });
|
|
13
10
|
}
|
|
14
11
|
function applyEmitDecision(inputs, shouldEmit) {
|
|
15
12
|
return inputs.map((input) => ({
|
|
@@ -34,13 +31,13 @@ export async function runInteractiveBillingPreview(options) {
|
|
|
34
31
|
}
|
|
35
32
|
const previewGateway = {
|
|
36
33
|
createVoucher: async () => {
|
|
37
|
-
throw new Error('No
|
|
34
|
+
throw new Error('No debería ejecutarse la emisión real durante la vista previa.');
|
|
38
35
|
},
|
|
39
36
|
getNextVoucherNumber: async () => {
|
|
40
|
-
throw new Error('No
|
|
37
|
+
throw new Error('No debería ejecutarse la emisión real durante la vista previa.');
|
|
41
38
|
},
|
|
42
39
|
getQuotation: async () => {
|
|
43
|
-
throw new Error('La
|
|
40
|
+
throw new Error('La cotización se resuelve antes de la vista previa.');
|
|
44
41
|
},
|
|
45
42
|
};
|
|
46
43
|
const previewResults = [];
|
|
@@ -69,4 +66,3 @@ export async function runInteractiveBillingPreview(options) {
|
|
|
69
66
|
proceed: true,
|
|
70
67
|
};
|
|
71
68
|
}
|
|
72
|
-
//# sourceMappingURL=billing.command.interactive-preview.js.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
2
|
import { EXCHANGE_RATE_DECIMALS } from '../../lib/numbers/argentine-amount.js';
|
|
3
|
-
import { amountOption, documentNumberOption, integerOption } from '../option-parsers.js';
|
|
3
|
+
import { amountOption, cuitOption, documentNumberOption, integerOption } from '../option-parsers.js';
|
|
4
4
|
export function registerBillingOptions(command) {
|
|
5
5
|
command
|
|
6
|
-
.option('-m, --monto <
|
|
7
|
-
.option('--alicuota <tasa>', '
|
|
8
|
-
.option('--exento <
|
|
6
|
+
.option('-m, --monto <numero>', 'importe total del comprobante, por ejemplo 15000 o 1.500,50', amountOption('--monto'))
|
|
7
|
+
.option('--alicuota <tasa>', 'alícuota de IVA para A y B: general (21), reducida (10.5), incrementada (27), cero (0), 5 o 2.5. Repetible como TASA:MONTO para varias alícuotas', (value, previous) => [...(previous ?? []), value])
|
|
8
|
+
.option('--exento <numero>', 'parte exenta del monto total (A y B)', amountOption('--exento'))
|
|
9
9
|
// No puede llamarse --no-gravado: commander interpreta --no-* como negacion de un flag booleano.
|
|
10
|
-
.option('--nogravado <
|
|
11
|
-
.option('-d, --dia <
|
|
12
|
-
.option('--punto-venta <
|
|
13
|
-
.option('--pv <
|
|
14
|
-
.option('--cargar <
|
|
10
|
+
.option('--nogravado <numero>', 'parte no gravada del monto total (A y B)', amountOption('--nogravado'))
|
|
11
|
+
.option('-d, --dia <numero>', 'día de vencimiento o referencia del servicio', integerOption('--dia'))
|
|
12
|
+
.option('--punto-venta <numero>', 'punto de venta (alias: --pv)', integerOption('--punto-venta'))
|
|
13
|
+
.option('--pv <numero>', 'alias de punto de venta', integerOption('--pv'))
|
|
14
|
+
.option('--cargar <ruta>', 'cargar datos base desde un archivo JSON')
|
|
15
15
|
.option('-f, --fecha <fecha>', 'fecha del comprobante; acepta D, D/M, D/M/YY o D/M/YYYY con - o /')
|
|
16
16
|
.option('-c, --concepto <tipo>', 'productos, servicios o productos y servicios (alias: cs, cp, csp)')
|
|
17
17
|
.option('--cs', 'usar concepto servicios')
|
|
18
18
|
.option('--cp', 'usar concepto productos')
|
|
19
19
|
.option('--csp', 'usar concepto productos y servicios')
|
|
20
|
-
.option('--moneda <codigo>', '
|
|
20
|
+
.option('--moneda <codigo>', 'código de moneda, por ejemplo ARS o USD (alias: --mda)')
|
|
21
21
|
.option('--mda <codigo>', 'alias de moneda, por ejemplo ARS o USD')
|
|
22
|
-
.option('--cm <
|
|
23
|
-
.option('--cotizacion-moneda <
|
|
24
|
-
.option('--misma-moneda', 'el pago se cancela en la misma moneda extranjera; usa la
|
|
25
|
-
.option('--cuit <
|
|
26
|
-
.option('--cuil <
|
|
27
|
-
.option('--dni <
|
|
28
|
-
.option('--consumidor-final', 'usar consumidor final con documento 0')
|
|
22
|
+
.option('--cm <numero>', 'alias de cotización de la moneda', amountOption('--cm', EXCHANGE_RATE_DECIMALS))
|
|
23
|
+
.option('--cotizacion-moneda <numero>', 'cotización de la moneda, por ejemplo 1.452,50 (alias: --cm)', amountOption('--cotizacion-moneda', EXCHANGE_RATE_DECIMALS))
|
|
24
|
+
.option('--misma-moneda', 'el pago se cancela en la misma moneda extranjera; usa la cotización oficial de ARCA')
|
|
25
|
+
.option('--cuit <numero>', 'usar CUIT del receptor', documentNumberOption('--cuit'))
|
|
26
|
+
.option('--cuil <numero>', 'usar CUIL del receptor', documentNumberOption('--cuil'))
|
|
27
|
+
.option('--dni <numero>', 'usar DNI del receptor', documentNumberOption('--dni'))
|
|
28
|
+
.option('--consumidor-final', 'usar consumidor final con documento 0 (alias: --cfinal)')
|
|
29
29
|
.option('--cfinal', 'alias de consumidor final con documento 0')
|
|
30
|
-
.option('--iva-receptor <tipo>', '
|
|
31
|
-
.option('--ir <tipo>', 'alias
|
|
30
|
+
.option('--iva-receptor <tipo>', 'condición IVA del receptor; con --cuit, sin este flag, se toma del padrón (alias: --ir)')
|
|
31
|
+
.option('--ir <tipo>', 'alias rápido de condición IVA del receptor')
|
|
32
32
|
.option('--ir-ce', 'IVA receptor: cliente del exterior')
|
|
33
33
|
.option('--ir-cf', 'IVA receptor: consumidor final')
|
|
34
34
|
.option('--ir-il', 'IVA receptor: IVA liberado')
|
|
@@ -40,34 +40,78 @@ export function registerBillingOptions(command) {
|
|
|
40
40
|
.option('--ir-rm', 'IVA receptor: responsable monotributo')
|
|
41
41
|
.option('--ir-se', 'IVA receptor: sujeto exento')
|
|
42
42
|
.option('--ir-snc', 'IVA receptor: sujeto no categorizado')
|
|
43
|
-
.option('--sd <fecha>', 'alias
|
|
44
|
-
.option('--servicio-desde <fecha>', 'fecha de inicio de servicio')
|
|
45
|
-
.option('--sh <fecha>', 'alias
|
|
46
|
-
.option('--servicio-hasta <fecha>', 'fecha de fin de servicio')
|
|
47
|
-
.option('--vencimiento <fecha>', 'fecha de vencimiento del pago; por defecto el fin del servicio')
|
|
43
|
+
.option('--sd <fecha>', 'alias rápido de fecha de inicio de servicio')
|
|
44
|
+
.option('--servicio-desde <fecha>', 'fecha de inicio de servicio (alias: --sd)')
|
|
45
|
+
.option('--sh <fecha>', 'alias rápido de fecha de fin de servicio')
|
|
46
|
+
.option('--servicio-hasta <fecha>', 'fecha de fin de servicio (alias: --sh)')
|
|
47
|
+
.option('--vencimiento <fecha>', 'fecha de vencimiento del pago; por defecto el fin del servicio (alias: --vto)')
|
|
48
48
|
.option('--vto <fecha>', 'alias de fecha de vencimiento del pago')
|
|
49
|
-
.option('--at <
|
|
50
|
-
.option('--apv <
|
|
51
|
-
.option('--asociado-punto-venta <
|
|
52
|
-
.option('--ar <
|
|
53
|
-
.option('--ac <
|
|
54
|
-
.option('--acuit <
|
|
55
|
-
.option('--periodo-desde <fecha>', 'inicio del
|
|
56
|
-
.option('--pd <fecha>', 'alias de inicio del
|
|
57
|
-
.option('--periodo-hasta <fecha>', 'fin del
|
|
58
|
-
.option('--ph <fecha>', 'alias de fin del
|
|
49
|
+
.option('--at <numero>', 'tipo ARCA del comprobante asociado', integerOption('--at'))
|
|
50
|
+
.option('--apv <numero>', 'punto de venta del comprobante asociado (alias: --asociado-punto-venta)', integerOption('--apv'))
|
|
51
|
+
.option('--asociado-punto-venta <numero>', 'punto de venta del comprobante asociado', integerOption('--asociado-punto-venta'))
|
|
52
|
+
.option('--ar <numero>', 'número del comprobante asociado', integerOption('--ar'))
|
|
53
|
+
.option('--ac <atajo>', 'atajo del comprobante asociado, por ejemplo fc o fa')
|
|
54
|
+
.option('--acuit <numero>', 'CUIT del comprobante asociado; en NC/ND FCE por defecto el CUIT emisor', cuitOption('--acuit'))
|
|
55
|
+
.option('--periodo-desde <fecha>', 'inicio del período asociado; alternativa a --ac en notas comunes (alias: --pd)')
|
|
56
|
+
.option('--pd <fecha>', 'alias de inicio del período asociado')
|
|
57
|
+
.option('--periodo-hasta <fecha>', 'fin del período asociado; alternativa a --ac en notas comunes (alias: --ph)')
|
|
58
|
+
.option('--ph <fecha>', 'alias de fin del período asociado')
|
|
59
59
|
.option('--afecha <fecha>', 'fecha del comprobante asociado; obligatoria en NC/ND FCE')
|
|
60
60
|
.option('--cbu <cbu>', 'CBU del emisor para facturas FCE (22 digitos)')
|
|
61
61
|
.option('--alias <alias>', 'alias del CBU del emisor para facturas FCE')
|
|
62
62
|
.option('--transferencia <modalidad>', 'modalidad de transferencia FCE: sca o adc (por defecto sca)')
|
|
63
|
-
.option('--anulacion', 'NC/ND FCE de
|
|
64
|
-
.option('--exportar-pdf', 'generar el PDF del comprobante emitido, aunque la config diga otra cosa')
|
|
63
|
+
.option('--anulacion', 'NC/ND FCE de anulación (la factura asociada fue rechazada por el comprador)')
|
|
64
|
+
.option('--exportar-pdf', 'generar el PDF del comprobante emitido, aunque la config diga otra cosa (alias: --pdf)')
|
|
65
65
|
.option('--pdf', 'alias de --exportar-pdf')
|
|
66
66
|
.option('--sin-pdf', 'no generar el PDF, aunque la config diga otra cosa')
|
|
67
|
-
.option('--descripcion <texto>', 'detalle del comprobante en el PDF; por defecto "
|
|
68
|
-
.option('--receptor-nombre <texto>', 'nombre o
|
|
67
|
+
.option('--descripcion <texto>', 'detalle del comprobante en el PDF; por defecto "Según detalle"')
|
|
68
|
+
.option('--receptor-nombre <texto>', 'nombre o razón social del receptor en el PDF')
|
|
69
69
|
.option('--receptor-domicilio <texto>', 'domicilio del receptor en el PDF')
|
|
70
70
|
.option('--previsualizar', 'mostrar el payload antes de emitir en ARCA')
|
|
71
71
|
.addOption(new Option('--emitir', 'emitir realmente en ARCA'));
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
/** Alias de otra opcion: se mencionan en la descripcion de la principal y no ocupan un renglon propio. */
|
|
74
|
+
const ALIAS_FLAGS = new Set([
|
|
75
|
+
'--asociado-punto-venta',
|
|
76
|
+
'--cfinal',
|
|
77
|
+
'--cm',
|
|
78
|
+
'--ir',
|
|
79
|
+
'--mda',
|
|
80
|
+
'--pd',
|
|
81
|
+
'--pdf',
|
|
82
|
+
'--ph',
|
|
83
|
+
'--pv',
|
|
84
|
+
'--sd',
|
|
85
|
+
'--sh',
|
|
86
|
+
'--vto',
|
|
87
|
+
]);
|
|
88
|
+
const OPTION_APPLIES = {
|
|
89
|
+
'--alicuota': (scope) => scope.letters.some((letter) => letter !== 'c'),
|
|
90
|
+
'--exento': (scope) => scope.letters.some((letter) => letter !== 'c'),
|
|
91
|
+
'--nogravado': (scope) => scope.letters.some((letter) => letter !== 'c'),
|
|
92
|
+
'--at': (scope) => scope.isNote,
|
|
93
|
+
'--apv': (scope) => scope.isNote,
|
|
94
|
+
'--ar': (scope) => scope.isNote,
|
|
95
|
+
'--ac': (scope) => scope.isNote,
|
|
96
|
+
'--acuit': (scope) => scope.isNote,
|
|
97
|
+
'--afecha': (scope) => scope.isNote,
|
|
98
|
+
'--periodo-desde': (scope) => scope.isNote && !scope.isElectronicCredit,
|
|
99
|
+
'--periodo-hasta': (scope) => scope.isNote && !scope.isElectronicCredit,
|
|
100
|
+
'--cbu': (scope) => scope.isElectronicCredit && !scope.isNote,
|
|
101
|
+
'--alias': (scope) => scope.isElectronicCredit && !scope.isNote,
|
|
102
|
+
'--transferencia': (scope) => scope.isElectronicCredit && !scope.isNote,
|
|
103
|
+
'--anulacion': (scope) => scope.isElectronicCredit && scope.isNote,
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Saca de la ayuda los alias y lo que no aplica a estos comprobantes. Solo se ocultan: siguen aceptandose y,
|
|
107
|
+
* si no aplican, la validacion de siempre explica por que.
|
|
108
|
+
*/
|
|
109
|
+
export function hideInapplicableBillingOptions(command, scope) {
|
|
110
|
+
for (const option of command.options) {
|
|
111
|
+
const flag = option.long ?? '';
|
|
112
|
+
const applies = OPTION_APPLIES[flag];
|
|
113
|
+
if (ALIAS_FLAGS.has(flag) || (applies && !applies(scope))) {
|
|
114
|
+
option.hideHelp();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -18,7 +18,7 @@ function pickNumber(...values) {
|
|
|
18
18
|
function parseRateAmount(flagValue, raw) {
|
|
19
19
|
const result = parseArgentineAmount(raw);
|
|
20
20
|
if (!result.ok) {
|
|
21
|
-
throw new InputValidationError(`--alicuota "${flagValue}": el monto no es
|
|
21
|
+
throw new InputValidationError(`--alicuota "${flagValue}": el monto no es válido: ${result.reason}.`);
|
|
22
22
|
}
|
|
23
23
|
return result.value;
|
|
24
24
|
}
|
|
@@ -33,12 +33,12 @@ function parseIvaRateFlags(values) {
|
|
|
33
33
|
const withAmount = values.filter((value) => value.includes(':'));
|
|
34
34
|
if (withAmount.length === 0) {
|
|
35
35
|
if (values.length > 1) {
|
|
36
|
-
throw new InputValidationError('Para varias
|
|
36
|
+
throw new InputValidationError('Para varias alícuotas usá --alicuota TASA:MONTO en cada una, por ejemplo --alicuota general:1210 --alicuota reducida:552,50.');
|
|
37
37
|
}
|
|
38
38
|
return { ivaRate: values[0] };
|
|
39
39
|
}
|
|
40
40
|
if (withAmount.length !== values.length) {
|
|
41
|
-
throw new InputValidationError('No
|
|
41
|
+
throw new InputValidationError('No mezcles --alicuota TASA con --alicuota TASA:MONTO: usá una sola forma.');
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
ivaRateAmounts: values.map((value) => {
|
|
@@ -61,13 +61,13 @@ function sumRateAmounts(rateAmounts, exemptAmount, untaxedAmount) {
|
|
|
61
61
|
*/
|
|
62
62
|
function resolveShouldEmit(options) {
|
|
63
63
|
if (options.cliEmit && options.cliPreview) {
|
|
64
|
-
throw new InputValidationError('
|
|
64
|
+
throw new InputValidationError('Usá --emitir o --previsualizar, pero no ambos a la vez.');
|
|
65
65
|
}
|
|
66
66
|
if (options.cliEmit !== undefined || options.cliPreview !== undefined) {
|
|
67
67
|
return options.cliEmit === true;
|
|
68
68
|
}
|
|
69
69
|
if (options.fileEmit === true && options.filePreview === true) {
|
|
70
|
-
throw new InputValidationError('En el archivo
|
|
70
|
+
throw new InputValidationError('En el archivo usá "emitir" o "previsualizar", pero no ambos en true.');
|
|
71
71
|
}
|
|
72
72
|
if (typeof options.fileEmit === 'boolean') {
|
|
73
73
|
return options.fileEmit;
|
|
@@ -81,7 +81,7 @@ function resolveShouldEmit(options) {
|
|
|
81
81
|
function resolvePdfFlag(commandOptions, fileInput) {
|
|
82
82
|
const exportPdf = commandOptions.exportarPdf === true || commandOptions.pdf === true;
|
|
83
83
|
if (exportPdf && commandOptions.sinPdf === true) {
|
|
84
|
-
throw new InputValidationError('
|
|
84
|
+
throw new InputValidationError('Usá --exportar-pdf o --sin-pdf, pero no ambos a la vez.');
|
|
85
85
|
}
|
|
86
86
|
if (exportPdf) {
|
|
87
87
|
return true;
|
|
@@ -95,7 +95,7 @@ function parseBillingCommandInputFromSource(command, shortcut, fileInput, defaul
|
|
|
95
95
|
const hasAssociatedShortcut = typeof commandOptions.ac === 'string';
|
|
96
96
|
const hasAssociatedType = typeof commandOptions.at === 'number';
|
|
97
97
|
if (hasAssociatedShortcut && hasAssociatedType) {
|
|
98
|
-
throw new InputValidationError('
|
|
98
|
+
throw new InputValidationError('Usá --ac o --at para identificar el comprobante asociado, pero no ambos a la vez.');
|
|
99
99
|
}
|
|
100
100
|
const associatedVoucherFromFlags = commandOptions.ar ||
|
|
101
101
|
commandOptions.apv ||
|
|
@@ -133,26 +133,27 @@ function parseBillingCommandInputFromSource(command, shortcut, fileInput, defaul
|
|
|
133
133
|
const documentType = documentIdentity.documentType ?? fileInput?.tipoDocumento;
|
|
134
134
|
const willLookupPadron = !explicitIvaCondition && defaults.lookupIvaConditionInPadron === true && documentType === 'cuit';
|
|
135
135
|
const resolvedIvaCondition = explicitIvaCondition ?? defaults.defaultIvaCondition;
|
|
136
|
-
// Sin definir es explicito: asi la entrada que arma el parser es igual a la del modo interactivo.
|
|
137
|
-
|
|
136
|
+
// Sin definir es explicito: asi la entrada que arma el parser es igual a la del modo interactivo. Con
|
|
137
|
+
// consultarPadron=false el IVA de la config tambien es definitivo: 'default' haria consultar el padron igual.
|
|
138
|
+
const ivaConditionSource = explicitIvaCondition || (resolvedIvaCondition && defaults.lookupIvaConditionInPadron !== true)
|
|
138
139
|
? undefined
|
|
139
140
|
: resolvedIvaCondition
|
|
140
141
|
? 'default'
|
|
141
142
|
: 'missing';
|
|
142
143
|
if (typeof commandOptions.concepto === 'string' && conceptShortcut) {
|
|
143
|
-
throw new InputValidationError('
|
|
144
|
+
throw new InputValidationError('Usá --concepto o un flag corto de concepto (--cs, --cp, --csp), pero no ambos.');
|
|
144
145
|
}
|
|
145
146
|
if (typeof commandOptions.ivaReceptor === 'string' && typeof commandOptions.ir === 'string') {
|
|
146
|
-
throw new InputValidationError('
|
|
147
|
+
throw new InputValidationError('Usá --iva-receptor o --ir para indicar IVA receptor, pero no ambos.');
|
|
147
148
|
}
|
|
148
149
|
if ((typeof commandOptions.ivaReceptor === 'string' || typeof commandOptions.ir === 'string') && ivaShortcut) {
|
|
149
|
-
throw new InputValidationError('
|
|
150
|
+
throw new InputValidationError('Usá --iva-receptor, --ir o un flag corto --ir-*, pero no varios a la vez.');
|
|
150
151
|
}
|
|
151
152
|
if (!resolvedConcept) {
|
|
152
|
-
throw new InputValidationError('Falta el concepto.
|
|
153
|
+
throw new InputValidationError('Falta el concepto. Usá --concepto <tipo>, o bien --cs/--cp/--csp, o configurá uno por defecto con "arcli config establecer concepto servicios".');
|
|
153
154
|
}
|
|
154
155
|
if (!resolvedIvaCondition && !willLookupPadron) {
|
|
155
|
-
throw new InputValidationError('Falta IVA receptor.
|
|
156
|
+
throw new InputValidationError('Falta IVA receptor. Usá --iva-receptor <tipo>, --ir <tipo>, un flag --ir-*, o configurá uno por defecto con "arcli config establecer ivaReceptor consumidor-final".');
|
|
156
157
|
}
|
|
157
158
|
const associatedVoucherFromFile = fileInput?.comprobanteAsociado
|
|
158
159
|
? {
|
|
@@ -171,7 +172,7 @@ function parseBillingCommandInputFromSource(command, shortcut, fileInput, defaul
|
|
|
171
172
|
const sameCurrency = flagSameCurrency || (flagExchangeRate === undefined && fileInput?.mismaMoneda === true);
|
|
172
173
|
const explicitExchangeRate = flagExchangeRate ?? (flagSameCurrency ? undefined : fileInput?.cotizacionMoneda);
|
|
173
174
|
if (sameCurrency && typeof explicitExchangeRate === 'number') {
|
|
174
|
-
throw new InputValidationError('Con --misma-moneda la
|
|
175
|
+
throw new InputValidationError('Con --misma-moneda la cotización se toma de ARCA. Sacá --cotizacion-moneda o --cm.');
|
|
175
176
|
}
|
|
176
177
|
// La cotizacion por defecto de la config solo aplica a moneda extranjera sin --misma-moneda.
|
|
177
178
|
const exchangeRate = explicitExchangeRate ??
|
|
@@ -227,7 +228,8 @@ function parseBillingCommandInputFromSource(command, shortcut, fileInput, defaul
|
|
|
227
228
|
serviceEndDate: pickString(commandOptions.servicioHasta, commandOptions.sh, fileInput?.servicioHasta),
|
|
228
229
|
serviceStartDate: pickString(commandOptions.servicioDesde, commandOptions.sd, fileInput?.servicioDesde),
|
|
229
230
|
shortcut,
|
|
230
|
-
|
|
231
|
+
// Sin redondear: un monto con mas de 2 decimales es un error del schema, no se ajusta en silencio.
|
|
232
|
+
totalAmount,
|
|
231
233
|
transferMode: pickString(commandOptions.transferencia, fileInput?.transferencia),
|
|
232
234
|
untaxedAmount,
|
|
233
235
|
}),
|
|
@@ -294,4 +296,3 @@ export function parseBillingCommandInputs(command, shortcut, defaults = {}) {
|
|
|
294
296
|
export function parseBillingCommandInput(command, shortcut, defaults = {}) {
|
|
295
297
|
return parseBillingCommandInputs(command, shortcut, defaults)[0];
|
|
296
298
|
}
|
|
297
|
-
//# sourceMappingURL=billing.command.parser.js.map
|
|
@@ -29,8 +29,12 @@ export const defaultPdfStepDependencies = {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
|
+
/** Datos que solo van en el PDF y pasó quien factura; lo que completó el padrón no cuenta. */
|
|
32
33
|
function hasPdfOnlyData(input) {
|
|
33
|
-
|
|
34
|
+
const fromPadron = input?.receiverFromPadron ?? [];
|
|
35
|
+
return Boolean(input?.pdfDescription ||
|
|
36
|
+
(input?.receiverName && !fromPadron.includes('name')) ||
|
|
37
|
+
(input?.receiverAddress && !fromPadron.includes('address')));
|
|
34
38
|
}
|
|
35
39
|
async function resolveDecisions(options, deps) {
|
|
36
40
|
const decisions = options.results.map((result, index) => canHavePdf(result)
|
|
@@ -44,13 +48,13 @@ async function resolveDecisions(options, deps) {
|
|
|
44
48
|
if (pending === 0) {
|
|
45
49
|
return decisions;
|
|
46
50
|
}
|
|
47
|
-
const answer = await deps.confirm(pending === 1 ? '¿Generamos el PDF del comprobante?' : `¿Generamos los PDFs de los ${pending} comprobantes?`, pending === 1 ? '
|
|
51
|
+
const answer = await deps.confirm(pending === 1 ? '¿Generamos el PDF del comprobante?' : `¿Generamos los PDFs de los ${pending} comprobantes?`, pending === 1 ? 'Sí, generar el PDF' : 'Sí, generar los PDFs', 'No');
|
|
48
52
|
return decisions.map((decision) => (decision === 'preguntar' ? (answer ? 'generar' : 'omitir') : decision));
|
|
49
53
|
}
|
|
50
54
|
/** Si falta el plugin, en una terminal se ofrece instalarlo; sin terminal nunca se descarga solo. */
|
|
51
|
-
async function
|
|
55
|
+
export async function loadPdfRenderer(plugin, interactive, deps) {
|
|
52
56
|
if (!plugin.getStatus().installed && interactive) {
|
|
53
|
-
const install = await deps.confirm('Para generar PDFs hay que descargar un componente (~160 MB, o ~360 MB si no
|
|
57
|
+
const install = await deps.confirm('Para generar PDFs hay que descargar un componente (~160 MB, o ~360 MB si no tenés Chrome). ¿Instalarlo ahora?', 'Sí, instalar', 'No');
|
|
54
58
|
if (!install) {
|
|
55
59
|
throw new PdfError('PDF_PLUGIN_MISSING', 'No se instalo el plugin de PDF.', {
|
|
56
60
|
suggestion: PDF_INSTALL_SUGGESTION,
|
|
@@ -97,7 +101,7 @@ export async function attachPdfs(options, defaultDeps = defaultPdfStepDependenci
|
|
|
97
101
|
try {
|
|
98
102
|
// Antes de descargar nada: sin los datos del emisor no se puede armar ningun PDF.
|
|
99
103
|
resolvePdfIssuer(options.config, options.results[targets[0]].voucherKind.letter);
|
|
100
|
-
const renderer = await
|
|
104
|
+
const renderer = await loadPdfRenderer(deps.createPlugin(options.config), options.interactive, deps);
|
|
101
105
|
const folder = deps.resolveFolder(options.config);
|
|
102
106
|
for (const index of targets) {
|
|
103
107
|
const spinner = startSpinner('Generando PDF...');
|
|
@@ -142,4 +146,3 @@ export async function attachPdfs(options, defaultDeps = defaultPdfStepDependenci
|
|
|
142
146
|
return result;
|
|
143
147
|
});
|
|
144
148
|
}
|
|
145
|
-
//# sourceMappingURL=billing.command.pdf.js.map
|
|
@@ -65,7 +65,7 @@ async function resolveFceWarnings(inputs, service, gateway) {
|
|
|
65
65
|
}
|
|
66
66
|
return warnings;
|
|
67
67
|
}
|
|
68
|
-
export async function executeBillingCommand(command, shortcut) {
|
|
68
|
+
export async function executeBillingCommand(command, shortcut, options = {}) {
|
|
69
69
|
const globalOptions = getGlobalOptions(command);
|
|
70
70
|
let spinner = null;
|
|
71
71
|
const voucherKind = getVoucherKindByShortcut(shortcut);
|
|
@@ -99,6 +99,7 @@ export async function executeBillingCommand(command, shortcut) {
|
|
|
99
99
|
: [];
|
|
100
100
|
const warnings = plannedInputs.map((_input, position) => [
|
|
101
101
|
...certificateWarnings(runtime),
|
|
102
|
+
...(options.extraWarnings ?? []),
|
|
102
103
|
...(padronWarnings[position] ?? []),
|
|
103
104
|
...(fceWarnings[position] ?? []),
|
|
104
105
|
]);
|
|
@@ -149,4 +150,3 @@ export async function executeBillingCommand(command, shortcut) {
|
|
|
149
150
|
throw error;
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
//# sourceMappingURL=billing.command.shared.js.map
|