arcli 2.1.0 → 2.2.1

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.
Files changed (539) hide show
  1. package/CHANGELOG.md +67 -1
  2. package/README.md +37 -2
  3. package/dist/cli/arca-runtime.js +0 -1
  4. package/dist/cli/commands/billing-family.command.js +36 -9
  5. package/dist/cli/commands/billing-shortcuts.command.js +8 -2
  6. package/dist/cli/commands/billing.command.batch.js +0 -1
  7. package/dist/cli/commands/billing.command.interactive-preview.js +9 -13
  8. package/dist/cli/commands/billing.command.options.js +83 -39
  9. package/dist/cli/commands/billing.command.output.js +0 -1
  10. package/dist/cli/commands/billing.command.parser.js +18 -17
  11. package/dist/cli/commands/billing.command.pdf.js +9 -6
  12. package/dist/cli/commands/billing.command.shared.js +2 -2
  13. package/dist/cli/commands/billing.command.shortcuts.js +3 -4
  14. package/dist/cli/commands/completion.command.js +140 -0
  15. package/dist/cli/commands/config.command.js +9 -10
  16. package/dist/cli/commands/cuit-argument.js +6 -6
  17. package/dist/cli/commands/examples.command.js +0 -1
  18. package/dist/cli/commands/export-shortcut.command.js +19 -0
  19. package/dist/cli/commands/export.command.js +106 -0
  20. package/dist/cli/commands/export.command.options.js +140 -0
  21. package/dist/cli/commands/export.command.parser.js +84 -0
  22. package/dist/cli/commands/export.command.pdf.js +61 -0
  23. package/dist/cli/commands/fce-obligation.command.js +2 -3
  24. package/dist/cli/commands/interactive.command.js +2 -3
  25. package/dist/cli/commands/padron.command.js +5 -6
  26. package/dist/cli/commands/parameters.command.js +5 -6
  27. package/dist/cli/commands/pdf.command.js +1 -2
  28. package/dist/cli/commands/storybook.command.js +4 -4
  29. package/dist/cli/commands/vouchers.command.js +9 -9
  30. package/dist/cli/error-output.js +21 -3
  31. package/dist/cli/global-options.js +2 -3
  32. package/dist/cli/help-argv.js +0 -1
  33. package/dist/cli/help.js +186 -380
  34. package/dist/cli/ignored-global-options.js +1 -2
  35. package/dist/cli/index.js +5 -3
  36. package/dist/cli/interactive/advanced-options.js +13 -14
  37. package/dist/cli/interactive/config.flow.js +55 -17
  38. package/dist/cli/interactive/export.flow.js +263 -0
  39. package/dist/cli/interactive/history.flow.js +2 -3
  40. package/dist/cli/interactive/interactive-mode.js +16 -17
  41. package/dist/cli/interactive/invoice-picker.js +7 -7
  42. package/dist/cli/interactive/invoice.flow.js +32 -11
  43. package/dist/cli/interactive/note.flow.js +12 -13
  44. package/dist/cli/interactive/pdf.flow.js +9 -7
  45. package/dist/cli/interactive/prompts.js +0 -1
  46. package/dist/cli/interactive/receiver-padron.js +3 -4
  47. package/dist/cli/interactive/repeat.flow.js +7 -8
  48. package/dist/cli/interactive/session.js +9 -7
  49. package/dist/cli/interactive/status.flow.js +0 -1
  50. package/dist/cli/interactive/update.flow.js +0 -1
  51. package/dist/cli/interactive/validators.js +7 -6
  52. package/dist/cli/option-parsers.js +14 -4
  53. package/dist/cli/program.js +6 -3
  54. package/dist/cli/skipped-options.js +14 -0
  55. package/dist/cli/spinner.js +0 -1
  56. package/dist/cli/types.js +0 -1
  57. package/dist/cli/version.js +1 -2
  58. package/dist/index.js +0 -1
  59. package/dist/lib/dates/arca-date.js +3 -4
  60. package/dist/lib/errors/app-error.js +0 -1
  61. package/dist/lib/files/read-json-file.js +2 -3
  62. package/dist/lib/files/restrict-to-owner.js +0 -1
  63. package/dist/lib/files/write-new-file.js +0 -1
  64. package/dist/lib/identity/cuit.js +26 -0
  65. package/dist/lib/identity/format-cuit.js +1 -2
  66. package/dist/lib/links.js +0 -1
  67. package/dist/lib/numbers/argentine-amount.js +3 -4
  68. package/dist/lib/numbers/strict-integer.js +0 -1
  69. package/dist/lib/paths/mask-path.js +0 -1
  70. package/dist/lib/security/certificate.js +0 -1
  71. package/dist/lib/security/pem.js +2 -3
  72. package/dist/modules/billing/billing-response.js +6 -7
  73. package/dist/modules/billing/billing.amounts.js +3 -4
  74. package/dist/modules/billing/billing.associated-period.js +7 -8
  75. package/dist/modules/billing/billing.associated-vouchers.js +5 -6
  76. package/dist/modules/billing/billing.batch.js +7 -6
  77. package/dist/modules/billing/billing.constants.js +0 -1
  78. package/dist/modules/billing/billing.currency.js +4 -5
  79. package/dist/modules/billing/billing.date-range.js +1 -2
  80. package/dist/modules/billing/billing.display.js +10 -8
  81. package/dist/modules/billing/billing.errors.js +2 -3
  82. package/dist/modules/billing/billing.fce.js +3 -4
  83. package/dist/modules/billing/billing.iva-receptor.js +2 -3
  84. package/dist/modules/billing/billing.json-format.js +0 -1
  85. package/dist/modules/billing/billing.json-input.js +5 -6
  86. package/dist/modules/billing/billing.labels.js +1 -2
  87. package/dist/modules/billing/billing.mappers.js +0 -1
  88. package/dist/modules/billing/billing.padron.js +9 -5
  89. package/dist/modules/billing/billing.presenter.js +0 -1
  90. package/dist/modules/billing/billing.schemas.js +14 -6
  91. package/dist/modules/billing/billing.serialize.js +6 -3
  92. package/dist/modules/billing/billing.service.js +4 -4
  93. package/dist/modules/billing/billing.text.js +0 -1
  94. package/dist/modules/billing/billing.types.internal.js +0 -1
  95. package/dist/modules/billing/billing.types.js +0 -1
  96. package/dist/modules/billing/billing.validation.js +13 -11
  97. package/dist/modules/billing/voucher-kind-map.js +15 -16
  98. package/dist/modules/completion/completion.js +53 -0
  99. package/dist/modules/completion/completion.presenter.js +35 -0
  100. package/dist/modules/completion/installer.js +92 -0
  101. package/dist/modules/completion/shell-scripts.js +46 -0
  102. package/dist/modules/config/certificate-expiry.js +3 -4
  103. package/dist/modules/config/config-doctor.js +36 -14
  104. package/dist/modules/config/config-value-parser.js +29 -16
  105. package/dist/modules/config/config.export-credentials.js +23 -0
  106. package/dist/modules/config/config.presenter.js +22 -6
  107. package/dist/modules/config/config.schemas.js +24 -12
  108. package/dist/modules/config/config.sections.js +26 -11
  109. package/dist/modules/config/config.service.js +6 -2
  110. package/dist/modules/examples/examples.js +44 -10
  111. package/dist/modules/export/export.items.js +149 -0
  112. package/dist/modules/export/export.json-input.js +91 -0
  113. package/dist/modules/export/export.mappers.js +293 -0
  114. package/dist/modules/export/export.presenter.js +2 -0
  115. package/dist/modules/export/export.response.js +86 -0
  116. package/dist/modules/export/export.serialize.js +70 -0
  117. package/dist/modules/export/export.service.js +146 -0
  118. package/dist/modules/export/export.text.js +177 -0
  119. package/dist/modules/export/export.types.js +36 -0
  120. package/dist/modules/fce/fce-obligation.js +3 -4
  121. package/dist/modules/fce/fce-obligation.presenter.js +2 -3
  122. package/dist/modules/interactive/amount-input.js +0 -1
  123. package/dist/modules/interactive/choices.js +10 -2
  124. package/dist/modules/interactive/config-fields.js +11 -3
  125. package/dist/modules/interactive/equivalent-command.js +4 -1
  126. package/dist/modules/interactive/export-equivalent-command.js +40 -0
  127. package/dist/modules/interactive/invoice-copy.js +1 -2
  128. package/dist/modules/interactive/periods.js +0 -1
  129. package/dist/modules/interactive/wizard.js +0 -1
  130. package/dist/modules/padron/padron.js +0 -1
  131. package/dist/modules/padron/padron.presenter.js +6 -7
  132. package/dist/modules/parameters/health.js +0 -1
  133. package/dist/modules/parameters/parameters.js +2 -3
  134. package/dist/modules/parameters/parameters.presenter.js +12 -13
  135. package/dist/modules/parameters/status.js +0 -1
  136. package/dist/modules/pdf/pdf-data.mapper.js +94 -3
  137. package/dist/modules/pdf/pdf-decision.js +0 -1
  138. package/dist/modules/pdf/pdf-file-name.js +0 -1
  139. package/dist/modules/pdf/pdf-issuer.js +3 -3
  140. package/dist/modules/pdf/pdf-legends.js +35 -0
  141. package/dist/modules/pdf/pdf.errors.js +0 -1
  142. package/dist/modules/pdf/pdf.types.js +0 -1
  143. package/dist/modules/storybook/showcase-theme.js +0 -1
  144. package/dist/modules/storybook/showcase.js +20 -21
  145. package/dist/modules/update-check/changelog.js +0 -1
  146. package/dist/modules/update-check/update-check.presenter.js +6 -7
  147. package/dist/modules/update-check/update-check.service.js +0 -1
  148. package/dist/modules/vouchers/voucher-history.js +0 -1
  149. package/dist/modules/vouchers/voucher-history.presenter.js +3 -4
  150. package/dist/services/arca/arca-billing.gateway.js +4 -5
  151. package/dist/services/arca/arca-client.factory.js +23 -2
  152. package/dist/services/arca/arca-context.resolver.js +5 -6
  153. package/dist/services/arca/arca-export.gateway.js +146 -0
  154. package/dist/services/arca/arca-fce-obligation.gateway.js +2 -3
  155. package/dist/services/arca/arca-padron.gateway.js +1 -2
  156. package/dist/services/arca/arca-parameters.gateway.js +2 -3
  157. package/dist/services/arca/arca-voucher-history.gateway.js +2 -3
  158. package/dist/services/arca/last-voucher.js +26 -0
  159. package/dist/services/clipboard/clipboard.js +0 -1
  160. package/dist/services/pdf/escape-html.js +0 -1
  161. package/dist/services/pdf/pdf-browser.js +0 -1
  162. package/dist/services/pdf/pdf-exporter.js +15 -2
  163. package/dist/services/pdf/pdf-plugin.js +45 -16
  164. package/dist/ui/components/certificateBanner.js +0 -1
  165. package/dist/ui/components/contentPanel.js +0 -1
  166. package/dist/ui/components/errorPanel.js +0 -1
  167. package/dist/ui/components/index.js +0 -1
  168. package/dist/ui/components/keyValuePanel.js +0 -1
  169. package/dist/ui/components/noticePanel.js +0 -1
  170. package/dist/ui/components/rawPanel.js +0 -1
  171. package/dist/ui/components/sectionHeading.js +0 -1
  172. package/dist/ui/components/statusBar.js +0 -1
  173. package/dist/ui/components/statusPanel.js +0 -1
  174. package/dist/ui/components/testingBanner.js +0 -1
  175. package/dist/ui/index.js +0 -1
  176. package/dist/ui/presenters/billing.presenter.js +0 -1
  177. package/dist/ui/presenters/config.presenter.js +0 -1
  178. package/dist/ui/presenters/errors.presenter.js +10 -11
  179. package/dist/ui/presenters/errors.zod-presenter.js +8 -9
  180. package/dist/ui/presenters/export.presenter.js +1 -0
  181. package/dist/ui/presenters/index.js +1 -1
  182. package/dist/ui/presenters/pdf.presenter.js +1 -2
  183. package/dist/ui/presenters/showcase.presenter.js +0 -1
  184. package/dist/ui/primitives/index.js +0 -1
  185. package/dist/ui/primitives/renderDivider.js +0 -1
  186. package/dist/ui/primitives/renderFooter.js +0 -1
  187. package/dist/ui/primitives/renderJson.js +0 -1
  188. package/dist/ui/primitives/renderKeyValue.js +0 -1
  189. package/dist/ui/primitives/renderLogo.js +0 -1
  190. package/dist/ui/primitives/renderObject.js +0 -1
  191. package/dist/ui/primitives/renderPanel.js +0 -1
  192. package/dist/ui/primitives/renderSubtitle.js +0 -1
  193. package/dist/ui/primitives/renderTable.js +0 -1
  194. package/dist/ui/primitives/terminalWidth.js +0 -1
  195. package/dist/ui/primitives/text.js +0 -1
  196. package/dist/ui/stream/index.js +0 -1
  197. package/dist/ui/stream/terminal-stream.js +0 -1
  198. package/dist/ui/theme/index.js +0 -1
  199. package/dist/ui/theme/theme.js +0 -1
  200. package/llms.txt +64 -5
  201. package/package.json +1 -2
  202. package/dist/cli/arca-runtime.d.ts +0 -20
  203. package/dist/cli/arca-runtime.js.map +0 -1
  204. package/dist/cli/commands/billing-family.command.d.ts +0 -2
  205. package/dist/cli/commands/billing-family.command.js.map +0 -1
  206. package/dist/cli/commands/billing-shortcuts.command.d.ts +0 -2
  207. package/dist/cli/commands/billing-shortcuts.command.js.map +0 -1
  208. package/dist/cli/commands/billing.command.batch.d.ts +0 -32
  209. package/dist/cli/commands/billing.command.batch.js.map +0 -1
  210. package/dist/cli/commands/billing.command.interactive-preview.d.ts +0 -18
  211. package/dist/cli/commands/billing.command.interactive-preview.js.map +0 -1
  212. package/dist/cli/commands/billing.command.options.d.ts +0 -2
  213. package/dist/cli/commands/billing.command.options.js.map +0 -1
  214. package/dist/cli/commands/billing.command.output.d.ts +0 -18
  215. package/dist/cli/commands/billing.command.output.js.map +0 -1
  216. package/dist/cli/commands/billing.command.parser.d.ts +0 -35
  217. package/dist/cli/commands/billing.command.parser.js.map +0 -1
  218. package/dist/cli/commands/billing.command.pdf.d.ts +0 -24
  219. package/dist/cli/commands/billing.command.pdf.js.map +0 -1
  220. package/dist/cli/commands/billing.command.shared.d.ts +0 -26
  221. package/dist/cli/commands/billing.command.shared.js.map +0 -1
  222. package/dist/cli/commands/billing.command.shortcuts.d.ts +0 -7
  223. package/dist/cli/commands/billing.command.shortcuts.js.map +0 -1
  224. package/dist/cli/commands/config.command.d.ts +0 -6
  225. package/dist/cli/commands/config.command.js.map +0 -1
  226. package/dist/cli/commands/cuit-argument.d.ts +0 -2
  227. package/dist/cli/commands/cuit-argument.js.map +0 -1
  228. package/dist/cli/commands/examples.command.d.ts +0 -2
  229. package/dist/cli/commands/examples.command.js.map +0 -1
  230. package/dist/cli/commands/fce-obligation.command.d.ts +0 -2
  231. package/dist/cli/commands/fce-obligation.command.js.map +0 -1
  232. package/dist/cli/commands/interactive.command.d.ts +0 -3
  233. package/dist/cli/commands/interactive.command.js.map +0 -1
  234. package/dist/cli/commands/padron.command.d.ts +0 -2
  235. package/dist/cli/commands/padron.command.js.map +0 -1
  236. package/dist/cli/commands/parameters.command.d.ts +0 -2
  237. package/dist/cli/commands/parameters.command.js.map +0 -1
  238. package/dist/cli/commands/pdf.command.d.ts +0 -2
  239. package/dist/cli/commands/pdf.command.js.map +0 -1
  240. package/dist/cli/commands/storybook.command.d.ts +0 -2
  241. package/dist/cli/commands/storybook.command.js.map +0 -1
  242. package/dist/cli/commands/vouchers.command.d.ts +0 -2
  243. package/dist/cli/commands/vouchers.command.js.map +0 -1
  244. package/dist/cli/error-output.d.ts +0 -25
  245. package/dist/cli/error-output.js.map +0 -1
  246. package/dist/cli/global-options.d.ts +0 -26
  247. package/dist/cli/global-options.js.map +0 -1
  248. package/dist/cli/help-argv.d.ts +0 -5
  249. package/dist/cli/help-argv.js.map +0 -1
  250. package/dist/cli/help.d.ts +0 -14
  251. package/dist/cli/help.js.map +0 -1
  252. package/dist/cli/ignored-global-options.d.ts +0 -6
  253. package/dist/cli/ignored-global-options.js.map +0 -1
  254. package/dist/cli/index.d.ts +0 -2
  255. package/dist/cli/index.js.map +0 -1
  256. package/dist/cli/interactive/advanced-options.d.ts +0 -21
  257. package/dist/cli/interactive/advanced-options.js.map +0 -1
  258. package/dist/cli/interactive/config.flow.d.ts +0 -4
  259. package/dist/cli/interactive/config.flow.js.map +0 -1
  260. package/dist/cli/interactive/history.flow.d.ts +0 -6
  261. package/dist/cli/interactive/history.flow.js.map +0 -1
  262. package/dist/cli/interactive/interactive-mode.d.ts +0 -3
  263. package/dist/cli/interactive/interactive-mode.js.map +0 -1
  264. package/dist/cli/interactive/invoice-picker.d.ts +0 -25
  265. package/dist/cli/interactive/invoice-picker.js.map +0 -1
  266. package/dist/cli/interactive/invoice.flow.d.ts +0 -22
  267. package/dist/cli/interactive/invoice.flow.js.map +0 -1
  268. package/dist/cli/interactive/note.flow.d.ts +0 -34
  269. package/dist/cli/interactive/note.flow.js.map +0 -1
  270. package/dist/cli/interactive/pdf.flow.d.ts +0 -5
  271. package/dist/cli/interactive/pdf.flow.js.map +0 -1
  272. package/dist/cli/interactive/prompts.d.ts +0 -57
  273. package/dist/cli/interactive/prompts.js.map +0 -1
  274. package/dist/cli/interactive/receiver-padron.d.ts +0 -29
  275. package/dist/cli/interactive/receiver-padron.js.map +0 -1
  276. package/dist/cli/interactive/repeat.flow.d.ts +0 -13
  277. package/dist/cli/interactive/repeat.flow.js.map +0 -1
  278. package/dist/cli/interactive/session.d.ts +0 -22
  279. package/dist/cli/interactive/session.js.map +0 -1
  280. package/dist/cli/interactive/status.flow.d.ts +0 -3
  281. package/dist/cli/interactive/status.flow.js.map +0 -1
  282. package/dist/cli/interactive/update.flow.d.ts +0 -6
  283. package/dist/cli/interactive/update.flow.js.map +0 -1
  284. package/dist/cli/interactive/validators.d.ts +0 -9
  285. package/dist/cli/interactive/validators.js.map +0 -1
  286. package/dist/cli/option-parsers.d.ts +0 -6
  287. package/dist/cli/option-parsers.js.map +0 -1
  288. package/dist/cli/program.d.ts +0 -6
  289. package/dist/cli/program.js.map +0 -1
  290. package/dist/cli/spinner.d.ts +0 -8
  291. package/dist/cli/spinner.js.map +0 -1
  292. package/dist/cli/types.d.ts +0 -6
  293. package/dist/cli/types.js.map +0 -1
  294. package/dist/cli/version.d.ts +0 -1
  295. package/dist/cli/version.js.map +0 -1
  296. package/dist/index.d.ts +0 -1
  297. package/dist/index.js.map +0 -1
  298. package/dist/lib/dates/arca-date.d.ts +0 -19
  299. package/dist/lib/dates/arca-date.js.map +0 -1
  300. package/dist/lib/errors/app-error.d.ts +0 -17
  301. package/dist/lib/errors/app-error.js.map +0 -1
  302. package/dist/lib/files/read-json-file.d.ts +0 -1
  303. package/dist/lib/files/read-json-file.js.map +0 -1
  304. package/dist/lib/files/restrict-to-owner.d.ts +0 -7
  305. package/dist/lib/files/restrict-to-owner.js.map +0 -1
  306. package/dist/lib/files/write-new-file.d.ts +0 -5
  307. package/dist/lib/files/write-new-file.js.map +0 -1
  308. package/dist/lib/identity/format-cuit.d.ts +0 -2
  309. package/dist/lib/identity/format-cuit.js.map +0 -1
  310. package/dist/lib/links.d.ts +0 -4
  311. package/dist/lib/links.js.map +0 -1
  312. package/dist/lib/numbers/argentine-amount.d.ts +0 -23
  313. package/dist/lib/numbers/argentine-amount.js.map +0 -1
  314. package/dist/lib/numbers/strict-integer.d.ts +0 -4
  315. package/dist/lib/numbers/strict-integer.js.map +0 -1
  316. package/dist/lib/paths/mask-path.d.ts +0 -1
  317. package/dist/lib/paths/mask-path.js.map +0 -1
  318. package/dist/lib/security/certificate.d.ts +0 -11
  319. package/dist/lib/security/certificate.js.map +0 -1
  320. package/dist/lib/security/pem.d.ts +0 -5
  321. package/dist/lib/security/pem.js.map +0 -1
  322. package/dist/modules/billing/billing-response.d.ts +0 -4
  323. package/dist/modules/billing/billing-response.js.map +0 -1
  324. package/dist/modules/billing/billing.amounts.d.ts +0 -21
  325. package/dist/modules/billing/billing.amounts.js.map +0 -1
  326. package/dist/modules/billing/billing.associated-period.d.ts +0 -8
  327. package/dist/modules/billing/billing.associated-period.js.map +0 -1
  328. package/dist/modules/billing/billing.associated-vouchers.d.ts +0 -12
  329. package/dist/modules/billing/billing.associated-vouchers.js.map +0 -1
  330. package/dist/modules/billing/billing.batch.d.ts +0 -23
  331. package/dist/modules/billing/billing.batch.js.map +0 -1
  332. package/dist/modules/billing/billing.constants.d.ts +0 -2
  333. package/dist/modules/billing/billing.constants.js.map +0 -1
  334. package/dist/modules/billing/billing.currency.d.ts +0 -18
  335. package/dist/modules/billing/billing.currency.js.map +0 -1
  336. package/dist/modules/billing/billing.date-range.d.ts +0 -9
  337. package/dist/modules/billing/billing.date-range.js.map +0 -1
  338. package/dist/modules/billing/billing.display.d.ts +0 -13
  339. package/dist/modules/billing/billing.display.js.map +0 -1
  340. package/dist/modules/billing/billing.errors.d.ts +0 -12
  341. package/dist/modules/billing/billing.errors.js.map +0 -1
  342. package/dist/modules/billing/billing.fce.d.ts +0 -21
  343. package/dist/modules/billing/billing.fce.js.map +0 -1
  344. package/dist/modules/billing/billing.iva-receptor.d.ts +0 -8
  345. package/dist/modules/billing/billing.iva-receptor.js.map +0 -1
  346. package/dist/modules/billing/billing.json-format.d.ts +0 -6
  347. package/dist/modules/billing/billing.json-format.js.map +0 -1
  348. package/dist/modules/billing/billing.json-input.d.ts +0 -58
  349. package/dist/modules/billing/billing.json-input.js.map +0 -1
  350. package/dist/modules/billing/billing.labels.d.ts +0 -9
  351. package/dist/modules/billing/billing.labels.js.map +0 -1
  352. package/dist/modules/billing/billing.mappers.d.ts +0 -8
  353. package/dist/modules/billing/billing.mappers.js.map +0 -1
  354. package/dist/modules/billing/billing.padron.d.ts +0 -14
  355. package/dist/modules/billing/billing.padron.js.map +0 -1
  356. package/dist/modules/billing/billing.presenter.d.ts +0 -7
  357. package/dist/modules/billing/billing.presenter.js.map +0 -1
  358. package/dist/modules/billing/billing.schemas.d.ts +0 -147
  359. package/dist/modules/billing/billing.schemas.js.map +0 -1
  360. package/dist/modules/billing/billing.serialize.d.ts +0 -9
  361. package/dist/modules/billing/billing.serialize.js.map +0 -1
  362. package/dist/modules/billing/billing.service.d.ts +0 -30
  363. package/dist/modules/billing/billing.service.js.map +0 -1
  364. package/dist/modules/billing/billing.text.d.ts +0 -8
  365. package/dist/modules/billing/billing.text.js.map +0 -1
  366. package/dist/modules/billing/billing.types.d.ts +0 -13
  367. package/dist/modules/billing/billing.types.internal.d.ts +0 -38
  368. package/dist/modules/billing/billing.types.internal.js.map +0 -1
  369. package/dist/modules/billing/billing.types.js.map +0 -1
  370. package/dist/modules/billing/billing.validation.d.ts +0 -7
  371. package/dist/modules/billing/billing.validation.js.map +0 -1
  372. package/dist/modules/billing/voucher-kind-map.d.ts +0 -9
  373. package/dist/modules/billing/voucher-kind-map.js.map +0 -1
  374. package/dist/modules/config/certificate-expiry.d.ts +0 -42
  375. package/dist/modules/config/certificate-expiry.js.map +0 -1
  376. package/dist/modules/config/config-doctor.d.ts +0 -16
  377. package/dist/modules/config/config-doctor.js.map +0 -1
  378. package/dist/modules/config/config-value-parser.d.ts +0 -2
  379. package/dist/modules/config/config-value-parser.js.map +0 -1
  380. package/dist/modules/config/config.presenter.d.ts +0 -17
  381. package/dist/modules/config/config.presenter.js.map +0 -1
  382. package/dist/modules/config/config.schemas.d.ts +0 -156
  383. package/dist/modules/config/config.schemas.js.map +0 -1
  384. package/dist/modules/config/config.sections.d.ts +0 -14
  385. package/dist/modules/config/config.sections.js.map +0 -1
  386. package/dist/modules/config/config.service.d.ts +0 -35
  387. package/dist/modules/config/config.service.js.map +0 -1
  388. package/dist/modules/examples/examples.d.ts +0 -6
  389. package/dist/modules/examples/examples.js.map +0 -1
  390. package/dist/modules/fce/fce-obligation.d.ts +0 -20
  391. package/dist/modules/fce/fce-obligation.js.map +0 -1
  392. package/dist/modules/fce/fce-obligation.presenter.d.ts +0 -9
  393. package/dist/modules/fce/fce-obligation.presenter.js.map +0 -1
  394. package/dist/modules/interactive/amount-input.d.ts +0 -4
  395. package/dist/modules/interactive/amount-input.js.map +0 -1
  396. package/dist/modules/interactive/choices.d.ts +0 -13
  397. package/dist/modules/interactive/choices.js.map +0 -1
  398. package/dist/modules/interactive/config-fields.d.ts +0 -20
  399. package/dist/modules/interactive/config-fields.js.map +0 -1
  400. package/dist/modules/interactive/equivalent-command.d.ts +0 -8
  401. package/dist/modules/interactive/equivalent-command.js.map +0 -1
  402. package/dist/modules/interactive/invoice-copy.d.ts +0 -19
  403. package/dist/modules/interactive/invoice-copy.js.map +0 -1
  404. package/dist/modules/interactive/periods.d.ts +0 -7
  405. package/dist/modules/interactive/periods.js.map +0 -1
  406. package/dist/modules/interactive/wizard.d.ts +0 -16
  407. package/dist/modules/interactive/wizard.js.map +0 -1
  408. package/dist/modules/padron/padron.d.ts +0 -46
  409. package/dist/modules/padron/padron.js.map +0 -1
  410. package/dist/modules/padron/padron.presenter.d.ts +0 -7
  411. package/dist/modules/padron/padron.presenter.js.map +0 -1
  412. package/dist/modules/parameters/health.d.ts +0 -17
  413. package/dist/modules/parameters/health.js.map +0 -1
  414. package/dist/modules/parameters/parameters.d.ts +0 -50
  415. package/dist/modules/parameters/parameters.js.map +0 -1
  416. package/dist/modules/parameters/parameters.presenter.d.ts +0 -12
  417. package/dist/modules/parameters/parameters.presenter.js.map +0 -1
  418. package/dist/modules/parameters/status.d.ts +0 -31
  419. package/dist/modules/parameters/status.js.map +0 -1
  420. package/dist/modules/pdf/pdf-data.mapper.d.ts +0 -4
  421. package/dist/modules/pdf/pdf-data.mapper.js.map +0 -1
  422. package/dist/modules/pdf/pdf-decision.d.ts +0 -14
  423. package/dist/modules/pdf/pdf-decision.js.map +0 -1
  424. package/dist/modules/pdf/pdf-file-name.d.ts +0 -3
  425. package/dist/modules/pdf/pdf-file-name.js.map +0 -1
  426. package/dist/modules/pdf/pdf-issuer.d.ts +0 -8
  427. package/dist/modules/pdf/pdf-issuer.js.map +0 -1
  428. package/dist/modules/pdf/pdf.errors.d.ts +0 -9
  429. package/dist/modules/pdf/pdf.errors.js.map +0 -1
  430. package/dist/modules/pdf/pdf.types.d.ts +0 -91
  431. package/dist/modules/pdf/pdf.types.js.map +0 -1
  432. package/dist/modules/storybook/showcase-theme.d.ts +0 -7
  433. package/dist/modules/storybook/showcase-theme.js.map +0 -1
  434. package/dist/modules/storybook/showcase.d.ts +0 -2
  435. package/dist/modules/storybook/showcase.js.map +0 -1
  436. package/dist/modules/update-check/changelog.d.ts +0 -23
  437. package/dist/modules/update-check/changelog.js.map +0 -1
  438. package/dist/modules/update-check/update-check.presenter.d.ts +0 -6
  439. package/dist/modules/update-check/update-check.presenter.js.map +0 -1
  440. package/dist/modules/update-check/update-check.service.d.ts +0 -11
  441. package/dist/modules/update-check/update-check.service.js.map +0 -1
  442. package/dist/modules/vouchers/voucher-history.d.ts +0 -39
  443. package/dist/modules/vouchers/voucher-history.js.map +0 -1
  444. package/dist/modules/vouchers/voucher-history.presenter.d.ts +0 -29
  445. package/dist/modules/vouchers/voucher-history.presenter.js.map +0 -1
  446. package/dist/services/arca/arca-billing.gateway.d.ts +0 -16
  447. package/dist/services/arca/arca-billing.gateway.js.map +0 -1
  448. package/dist/services/arca/arca-client.factory.d.ts +0 -6
  449. package/dist/services/arca/arca-client.factory.js.map +0 -1
  450. package/dist/services/arca/arca-context.resolver.d.ts +0 -55
  451. package/dist/services/arca/arca-context.resolver.js.map +0 -1
  452. package/dist/services/arca/arca-fce-obligation.gateway.d.ts +0 -7
  453. package/dist/services/arca/arca-fce-obligation.gateway.js.map +0 -1
  454. package/dist/services/arca/arca-padron.gateway.d.ts +0 -9
  455. package/dist/services/arca/arca-padron.gateway.js.map +0 -1
  456. package/dist/services/arca/arca-parameters.gateway.d.ts +0 -10
  457. package/dist/services/arca/arca-parameters.gateway.js.map +0 -1
  458. package/dist/services/arca/arca-voucher-history.gateway.d.ts +0 -8
  459. package/dist/services/arca/arca-voucher-history.gateway.js.map +0 -1
  460. package/dist/services/clipboard/clipboard.d.ts +0 -2
  461. package/dist/services/clipboard/clipboard.js.map +0 -1
  462. package/dist/services/pdf/escape-html.d.ts +0 -6
  463. package/dist/services/pdf/escape-html.js.map +0 -1
  464. package/dist/services/pdf/pdf-browser.d.ts +0 -5
  465. package/dist/services/pdf/pdf-browser.js.map +0 -1
  466. package/dist/services/pdf/pdf-exporter.d.ts +0 -22
  467. package/dist/services/pdf/pdf-exporter.js.map +0 -1
  468. package/dist/services/pdf/pdf-plugin.d.ts +0 -50
  469. package/dist/services/pdf/pdf-plugin.js.map +0 -1
  470. package/dist/ui/components/certificateBanner.d.ts +0 -11
  471. package/dist/ui/components/certificateBanner.js.map +0 -1
  472. package/dist/ui/components/contentPanel.d.ts +0 -5
  473. package/dist/ui/components/contentPanel.js.map +0 -1
  474. package/dist/ui/components/errorPanel.d.ts +0 -1
  475. package/dist/ui/components/errorPanel.js.map +0 -1
  476. package/dist/ui/components/index.d.ts +0 -10
  477. package/dist/ui/components/index.js.map +0 -1
  478. package/dist/ui/components/keyValuePanel.d.ts +0 -3
  479. package/dist/ui/components/keyValuePanel.js.map +0 -1
  480. package/dist/ui/components/noticePanel.d.ts +0 -3
  481. package/dist/ui/components/noticePanel.js.map +0 -1
  482. package/dist/ui/components/rawPanel.d.ts +0 -1
  483. package/dist/ui/components/rawPanel.js.map +0 -1
  484. package/dist/ui/components/sectionHeading.d.ts +0 -3
  485. package/dist/ui/components/sectionHeading.js.map +0 -1
  486. package/dist/ui/components/statusBar.d.ts +0 -19
  487. package/dist/ui/components/statusBar.js.map +0 -1
  488. package/dist/ui/components/statusPanel.d.ts +0 -3
  489. package/dist/ui/components/statusPanel.js.map +0 -1
  490. package/dist/ui/components/testingBanner.d.ts +0 -2
  491. package/dist/ui/components/testingBanner.js.map +0 -1
  492. package/dist/ui/index.d.ts +0 -5
  493. package/dist/ui/index.js.map +0 -1
  494. package/dist/ui/presenters/billing.presenter.d.ts +0 -2
  495. package/dist/ui/presenters/billing.presenter.js.map +0 -1
  496. package/dist/ui/presenters/config.presenter.d.ts +0 -1
  497. package/dist/ui/presenters/config.presenter.js.map +0 -1
  498. package/dist/ui/presenters/errors.presenter.d.ts +0 -1
  499. package/dist/ui/presenters/errors.presenter.js.map +0 -1
  500. package/dist/ui/presenters/errors.zod-presenter.d.ts +0 -4
  501. package/dist/ui/presenters/errors.zod-presenter.js.map +0 -1
  502. package/dist/ui/presenters/index.d.ts +0 -6
  503. package/dist/ui/presenters/index.js.map +0 -1
  504. package/dist/ui/presenters/pdf.presenter.d.ts +0 -13
  505. package/dist/ui/presenters/pdf.presenter.js.map +0 -1
  506. package/dist/ui/presenters/showcase.presenter.d.ts +0 -1
  507. package/dist/ui/presenters/showcase.presenter.js.map +0 -1
  508. package/dist/ui/primitives/index.d.ts +0 -10
  509. package/dist/ui/primitives/index.js.map +0 -1
  510. package/dist/ui/primitives/renderDivider.d.ts +0 -5
  511. package/dist/ui/primitives/renderDivider.js.map +0 -1
  512. package/dist/ui/primitives/renderFooter.d.ts +0 -7
  513. package/dist/ui/primitives/renderFooter.js.map +0 -1
  514. package/dist/ui/primitives/renderJson.d.ts +0 -3
  515. package/dist/ui/primitives/renderJson.js.map +0 -1
  516. package/dist/ui/primitives/renderKeyValue.d.ts +0 -14
  517. package/dist/ui/primitives/renderKeyValue.js.map +0 -1
  518. package/dist/ui/primitives/renderLogo.d.ts +0 -3
  519. package/dist/ui/primitives/renderLogo.js.map +0 -1
  520. package/dist/ui/primitives/renderObject.d.ts +0 -1
  521. package/dist/ui/primitives/renderObject.js.map +0 -1
  522. package/dist/ui/primitives/renderPanel.d.ts +0 -27
  523. package/dist/ui/primitives/renderPanel.js.map +0 -1
  524. package/dist/ui/primitives/renderSubtitle.d.ts +0 -7
  525. package/dist/ui/primitives/renderSubtitle.js.map +0 -1
  526. package/dist/ui/primitives/renderTable.d.ts +0 -6
  527. package/dist/ui/primitives/renderTable.js.map +0 -1
  528. package/dist/ui/primitives/terminalWidth.d.ts +0 -4
  529. package/dist/ui/primitives/terminalWidth.js.map +0 -1
  530. package/dist/ui/primitives/text.d.ts +0 -28
  531. package/dist/ui/primitives/text.js.map +0 -1
  532. package/dist/ui/stream/index.d.ts +0 -1
  533. package/dist/ui/stream/index.js.map +0 -1
  534. package/dist/ui/stream/terminal-stream.d.ts +0 -21
  535. package/dist/ui/stream/terminal-stream.js.map +0 -1
  536. package/dist/ui/theme/index.d.ts +0 -1
  537. package/dist/ui/theme/index.js.map +0 -1
  538. package/dist/ui/theme/theme.d.ts +0 -68
  539. package/dist/ui/theme/theme.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { toArgentineCalendarDate } from '../../lib/dates/arca-date.js';
2
2
  import { badge, renderLogo, sectionHeading, toneText } from '../../ui/index.js';
3
3
  import { VOUCHER_FAMILIES, VOUCHER_KIND_MAP, VOUCHER_SHORTCUTS } from '../billing/voucher-kind-map.js';
4
- const ISSUER_HINT = 'Estos ejemplos asumen que ya resolviste cuit emisor, credenciales y, en la version minima, tambien punto de venta por config.';
4
+ import { EXPORT_VOUCHER_KIND } from '../export/export.types.js';
5
+ const ISSUER_HINT = 'Estos ejemplos asumen que ya resolviste cuit emisor, credenciales y, en la versión mínima, también punto de venta por config.';
5
6
  function resolveAmount(definition) {
6
7
  if (definition.letter === 'a') {
7
8
  return 1;
@@ -37,7 +38,7 @@ function resolveAssociatedFlags(definition, form) {
37
38
  `--ac ${resolveAssociatedShortcut(definition)}`,
38
39
  form === 'long' ? '--asociado-punto-venta 3' : '--apv 3',
39
40
  '--ar 120',
40
- ...(definition.isElectronicCredit ? [] : ['--acuit 20409509763']),
41
+ ...(definition.isElectronicCredit ? [] : ['--acuit 20333333334']),
41
42
  ];
42
43
  }
43
44
  function formatExampleDate(value) {
@@ -134,10 +135,10 @@ function formatVoucherExample(definition, dates) {
134
135
  return [
135
136
  sectionHeading(definition.displayName),
136
137
  '',
137
- `${badge('MINIMA LARGA', 'info')}`,
138
+ `${badge('MÍNIMA LARGA', 'info')}`,
138
139
  `${buildMinimalLong(definition, dates)} --previsualizar`,
139
140
  '',
140
- `${badge('MINIMA CORTA', 'success')}`,
141
+ `${badge('MÍNIMA CORTA', 'success')}`,
141
142
  `${buildMinimalShort(definition, dates)} --previsualizar`,
142
143
  '',
143
144
  `${badge('FULL LARGA', 'warning')}`,
@@ -153,6 +154,36 @@ function renderFamilyExamples(family, dates) {
153
154
  .map((definition) => formatVoucherExample(definition, dates))
154
155
  .join('\n\n\n');
155
156
  }
157
+ const EXPORT_CLIENT = '--cliente "ACME LLC" --domicilio-cliente "123 Main St" --pais-destino 212 --numero 1';
158
+ /** El comando minimo de la factura E por shortcut, sin modo de ejecucion. Lo usa tambien la ayuda de `fe`. */
159
+ export const EXPORT_MINIMAL_EXAMPLE = `arcli ${EXPORT_VOUCHER_KIND.shortcut} -m 1500 ${EXPORT_CLIENT} --actividad 620100`;
160
+ /** La E no comparte flags de receptor ni de IVA con A, B y C: sus ejemplos se arman aparte. */
161
+ function formatExportExample() {
162
+ const { family, letter, shortcut } = EXPORT_VOUCHER_KIND;
163
+ const fullFlags = [
164
+ '--id-impositivo "12-3456789"',
165
+ '--tipo-expo 2',
166
+ '--item "001|Servicios de consultoría|10|150|unidades"',
167
+ '--fecha-pago 15/11',
168
+ '--forma-pago "Transferencia Internacional"',
169
+ '--obs-comerciales "Orden de compra 778"',
170
+ ];
171
+ return [
172
+ sectionHeading(EXPORT_VOUCHER_KIND.displayName),
173
+ '',
174
+ `${badge('MÍNIMA LARGA', 'info')}`,
175
+ `arcli ${family} ${letter} --monto 1500 ${EXPORT_CLIENT} --actividad 620100 --previsualizar`,
176
+ '',
177
+ `${badge('MÍNIMA CORTA', 'success')}`,
178
+ `${EXPORT_MINIMAL_EXAMPLE} --previsualizar`,
179
+ '',
180
+ `${badge('FULL LARGA', 'warning')}`,
181
+ `arcli ${family} ${letter} --monto 1500 ${EXPORT_CLIENT} --actividad 620100 ${fullFlags.join(' ')} --moneda USD --misma-moneda --previsualizar`,
182
+ '',
183
+ `${badge('FULL CORTA', 'debug')}`,
184
+ `arcli ${shortcut} -m 1500 ${EXPORT_CLIENT} --actividad 620100 ${fullFlags.join(' ')} --mda USD --misma-moneda --previsualizar`,
185
+ ].join('\n');
186
+ }
156
187
  /** El comando minimo por shortcut (`arcli nca -m 1 --cs ...`), sin modo de ejecucion. Lo usa tambien la ayuda. */
157
188
  export function buildMinimalShortcutExample(definition, today = new Date()) {
158
189
  return buildMinimalShort(definition, resolveExampleDates(today));
@@ -166,21 +197,24 @@ export function renderExamples(today = new Date()) {
166
197
  return [
167
198
  renderLogo().trim(),
168
199
  '',
169
- `${badge('MINIMA', 'info')} datos esenciales`,
170
- `${badge('FULL', 'warning')} mas campos explicitados`,
200
+ `${badge('MÍNIMA', 'info')} datos esenciales`,
201
+ `${badge('FULL', 'warning')} más campos explicitados`,
171
202
  `${badge('LARGA', 'success')} comando largo`,
172
203
  `${badge('CORTA', 'debug')} shortcut y aliases`,
173
204
  '',
174
205
  toneText('SEGURIDAD', 'warning'),
175
206
  'Todos usan --previsualizar para evitar emisiones reales por error.',
176
- 'Si queres emitir de verdad, reemplaza --previsualizar por --emitir.',
177
- 'Para emitir en produccion necesitas --produccion junto con --emitir.',
207
+ 'Si querés emitir de verdad, reemplaza --previsualizar por --emitir.',
208
+ 'Para emitir en producción necesitas --produccion junto con --emitir.',
178
209
  'Para guardar el PDF con el QR, agrega --exportar-pdf al emitir (ver docs/pdf.md).',
179
210
  '',
180
211
  ISSUER_HINT,
181
212
  '',
182
- ...VOUCHER_FAMILIES.flatMap((family) => [renderFamilyExamples(family, dates), '']),
213
+ ...VOUCHER_FAMILIES.flatMap((family) => [
214
+ renderFamilyExamples(family, dates),
215
+ ...(family === EXPORT_VOUCHER_KIND.family ? ['', '', formatExportExample()] : []),
216
+ '',
217
+ ]),
183
218
  '',
184
219
  ].join('\n');
185
220
  }
186
- //# sourceMappingURL=examples.js.map
@@ -0,0 +1,149 @@
1
+ import Big from 'big.js';
2
+ import { InputValidationError } from '../../lib/errors/app-error.js';
3
+ import { parseArgentineAmount } from '../../lib/numbers/argentine-amount.js';
4
+ import { DEFAULT_EXPORT_UNIT_CODE, } from './export.types.js';
5
+ export const DEFAULT_EXPORT_ITEM_DESCRIPTION = 'Según detalle';
6
+ const ITEM_FORMAT_HINT = 'Usá --item "codigo|descripcion|cantidad|precio|unidad" (el código y la unidad son opcionales).';
7
+ function parseItemAmount(part, field, raw) {
8
+ const parsed = parseArgentineAmount(part, { maxDecimals: 6 });
9
+ if (!parsed.ok) {
10
+ throw new InputValidationError(`El ${field} del item "${raw}" no es válido: ${parsed.reason}.`);
11
+ }
12
+ return parsed.value;
13
+ }
14
+ /**
15
+ * Un item por flag. Se separa con `|` para no pelear con las comas de los importes:
16
+ * `001|Servicio de consultoria|1|1000|unidad`. Con cuatro partes se omite el codigo y con tres la unidad.
17
+ */
18
+ export function parseExportItemArgument(raw) {
19
+ const parts = raw.split('|').map((part) => part.trim());
20
+ if (parts.length < 3 || parts.length > 5) {
21
+ throw new InputValidationError(`El item "${raw}" no es válido. ${ITEM_FORMAT_HINT}`);
22
+ }
23
+ const [codeOrDescription, ...rest] = parts;
24
+ const description = parts.length === 5 ? rest.shift() : codeOrDescription;
25
+ const [quantityPart, pricePart, unitPart] = rest;
26
+ if (!description || !quantityPart || !pricePart) {
27
+ throw new InputValidationError(`El item "${raw}" no es válido: falta la descripción, la cantidad o el precio.`);
28
+ }
29
+ return {
30
+ code: parts.length === 5 ? codeOrDescription : undefined,
31
+ description,
32
+ quantity: parseItemAmount(quantityPart, 'la cantidad', raw),
33
+ unit: unitPart ? resolveExportItemUnit(unitPart) : DEFAULT_EXPORT_UNIT_CODE,
34
+ unitPrice: parseItemAmount(pricePart, 'el precio', raw),
35
+ };
36
+ }
37
+ /** La unidad del item puede ser el codigo de ARCA (`7`) o el nombre de la tabla (`unidad`). */
38
+ export function resolveExportItemUnit(unit) {
39
+ if (typeof unit === 'number') {
40
+ return unit;
41
+ }
42
+ const trimmed = unit.trim();
43
+ if (!trimmed) {
44
+ throw new InputValidationError('La unidad del item no puede estar vacía. Usá --item sin la última parte para usar "unidad".');
45
+ }
46
+ return /^\d+$/.test(trimmed) ? Number(trimmed) : trimmed;
47
+ }
48
+ /**
49
+ * La tabla de ARCA escribe las unidades en plural ("unidades", "kilogramos") y los ejemplos del CLI en singular
50
+ * ("unidad"): se aceptan las dos formas, sin inventar codigos para nombres que no estan en la tabla.
51
+ */
52
+ function singularUnitName(value) {
53
+ if (/[dlrnz]es$/.test(value)) {
54
+ return value.slice(0, -2);
55
+ }
56
+ return value.endsWith('s') ? value.slice(0, -1) : value;
57
+ }
58
+ function findUnitByName(units, normalized) {
59
+ const exact = units.find((entry) => entry.name.trim().toLowerCase() === normalized);
60
+ if (exact) {
61
+ return exact;
62
+ }
63
+ const singular = singularUnitName(normalized);
64
+ const matches = units.filter((entry) => singularUnitName(entry.name.trim().toLowerCase()) === singular);
65
+ return matches.length === 1 ? matches[0] : undefined;
66
+ }
67
+ /**
68
+ * Codigo de ARCA de la unidad: si viene un nombre se busca en la tabla de WSFEX. Un nombre desconocido
69
+ * es un error, no un default silencioso.
70
+ */
71
+ export function resolveUnitCode(unit, units) {
72
+ if (typeof unit === 'number') {
73
+ const known = units.find((entry) => entry.id === unit);
74
+ if (units.length > 0 && !known) {
75
+ throw new InputValidationError(`La unidad ${unit} no existe en la tabla de ARCA.`);
76
+ }
77
+ return unit;
78
+ }
79
+ if (typeof unit === 'string') {
80
+ const match = findUnitByName(units, unit.trim().toLowerCase());
81
+ if (match) {
82
+ return match.id;
83
+ }
84
+ throw new InputValidationError(`La unidad "${unit}" no existe en la tabla de ARCA. Usá el nombre tal como lo informa ARCA o el código numérico.`);
85
+ }
86
+ return DEFAULT_EXPORT_UNIT_CODE;
87
+ }
88
+ function roundAmount(value) {
89
+ return value.round(2, Big.roundHalfUp).toNumber();
90
+ }
91
+ function assertSameTotal(total, amount) {
92
+ if (!total.eq(new Big(amount).round(2, Big.roundHalfUp))) {
93
+ throw new InputValidationError(`La suma de los items (${roundAmount(total).toFixed(2)}) no coincide con --monto (${amount.toFixed(2)}).`);
94
+ }
95
+ }
96
+ /** Se valida antes de consultar ARCA: un total que no cierra no tiene por que autenticar en WSAA. */
97
+ export function assertExportItemsTotal(inputs, amount) {
98
+ if (!inputs || inputs.length === 0) {
99
+ return;
100
+ }
101
+ const total = inputs.reduce((sum, item) => sum.plus(new Big(item.quantity).times(item.unitPrice).round(2, Big.roundHalfUp)), new Big(0));
102
+ assertSameTotal(total, amount);
103
+ }
104
+ /**
105
+ * Un item sin `--item` resume el comprobante en un renglon con el total. Con items, la suma tiene que dar
106
+ * el monto: ARCA no valida `Imp_total` contra los items, asi que se valida aca.
107
+ */
108
+ export function buildExportItems(inputs, amount, units, defaultDescription) {
109
+ if (!inputs || inputs.length === 0) {
110
+ return {
111
+ items: [
112
+ {
113
+ Pro_bonificacion: 0,
114
+ Pro_codigo: '',
115
+ Pro_ds: defaultDescription,
116
+ Pro_precio_uni: amount,
117
+ Pro_qty: 1,
118
+ Pro_total_item: roundAmount(new Big(amount)),
119
+ Pro_umed: DEFAULT_EXPORT_UNIT_CODE,
120
+ },
121
+ ],
122
+ total: roundAmount(new Big(amount)),
123
+ };
124
+ }
125
+ const items = inputs.map((item) => {
126
+ if (!item.description.trim()) {
127
+ throw new InputValidationError('Cada item necesita una descripción.');
128
+ }
129
+ const quantity = new Big(item.quantity);
130
+ if (quantity.lte(0)) {
131
+ throw new InputValidationError(`La cantidad del item "${item.description}" tiene que ser mayor a 0.`);
132
+ }
133
+ if (!(item.unitPrice > 0)) {
134
+ throw new InputValidationError(`El precio del item "${item.description}" tiene que ser mayor a 0.`);
135
+ }
136
+ return {
137
+ Pro_bonificacion: 0,
138
+ Pro_codigo: item.code?.trim() ?? '',
139
+ Pro_ds: item.description.trim(),
140
+ Pro_precio_uni: item.unitPrice,
141
+ Pro_qty: quantity.toNumber(),
142
+ Pro_total_item: roundAmount(quantity.times(item.unitPrice)),
143
+ Pro_umed: resolveUnitCode(item.unit, units),
144
+ };
145
+ });
146
+ const total = items.reduce((sum, item) => sum.plus(item.Pro_total_item), new Big(0));
147
+ assertSameTotal(total, amount);
148
+ return { items, total: roundAmount(total) };
149
+ }
@@ -0,0 +1,91 @@
1
+ import { z } from 'zod';
2
+ import { InputValidationError } from '../../lib/errors/app-error.js';
3
+ const itemJsonSchema = z
4
+ .object({
5
+ cantidad: z.number(),
6
+ codigo: z.string().optional(),
7
+ descripcion: z.string(),
8
+ precioUnitario: z.number(),
9
+ unidad: z.union([z.string(), z.number()]).optional(),
10
+ })
11
+ .strict();
12
+ /**
13
+ * Forma del JSON de `--cargar`: solo tipos y claves. Los valores (importes, pais, incoterm) los valida el
14
+ * servicio igual que si vinieran por flags. Es `.strict()` para que un typo no se ignore en silencio.
15
+ */
16
+ export const exportJsonInputSchema = z
17
+ .object({
18
+ actividad: z.number().optional(),
19
+ cliente: z.string().optional(),
20
+ codigoMoneda: z.string().optional(),
21
+ cotizacionMoneda: z.number().optional(),
22
+ cuitPais: z.number().optional(),
23
+ descripcion: z.string().optional(),
24
+ descripcionIncoterm: z.string().optional(),
25
+ domicilioCliente: z.string().optional(),
26
+ emitir: z.boolean().optional(),
27
+ fechaComprobante: z.string().optional(),
28
+ fechaPago: z.string().optional(),
29
+ formaPago: z.string().optional(),
30
+ idImpositivo: z.string().optional(),
31
+ idSolicitud: z.number().optional(),
32
+ idioma: z.number().optional(),
33
+ incoterm: z.string().optional(),
34
+ items: z.array(itemJsonSchema).optional(),
35
+ mismaMoneda: z.boolean().optional(),
36
+ monto: z.number().optional(),
37
+ numero: z.number().optional(),
38
+ observaciones: z.string().optional(),
39
+ observacionesComerciales: z.string().optional(),
40
+ paisDestino: z.union([z.string(), z.number()]).optional(),
41
+ pdf: z.boolean().optional(),
42
+ permisoExistente: z.boolean().optional(),
43
+ permisos: z.array(z.string()).optional(),
44
+ puntoVenta: z.number().optional(),
45
+ previsualizar: z.boolean().optional(),
46
+ tipoExpo: z.union([z.literal(1), z.literal(2), z.literal(4)]).optional(),
47
+ })
48
+ .strict();
49
+ const TYPE_LABELS = {
50
+ array: 'un array',
51
+ boolean: 'true o false',
52
+ number: 'un número',
53
+ object: 'un objeto',
54
+ string: 'un texto',
55
+ };
56
+ function describeIssue(issue) {
57
+ const path = issue.path.map(String).join('.');
58
+ if (issue.code === 'unrecognized_keys') {
59
+ return `La clave "${issue.keys.join('", "')}" no existe en el JSON de --cargar.`;
60
+ }
61
+ if (issue.code === 'invalid_type' && issue.input === undefined) {
62
+ return `Falta "${path}".`;
63
+ }
64
+ if (issue.code === 'invalid_type') {
65
+ return `"${path}" tiene que ser ${TYPE_LABELS[issue.expected] ?? issue.expected}.`;
66
+ }
67
+ return path ? `"${path}": ${issue.message}.` : `${issue.message}.`;
68
+ }
69
+ export function parseExportJsonInput(value) {
70
+ const result = exportJsonInputSchema.safeParse(value, { reportInput: true });
71
+ if (result.success) {
72
+ return result.data;
73
+ }
74
+ throw new InputValidationError(`En el JSON de --cargar: ${result.error.issues.map((issue) => describeIssue(issue)).join(' ')}`);
75
+ }
76
+ /** `--cargar` toma un solo comprobante; el lote de exportacion queda para mas adelante. */
77
+ export function readExportJsonInput(source) {
78
+ if (Array.isArray(source)) {
79
+ throw new InputValidationError('El JSON de --cargar de la factura E tiene que ser un objeto con un comprobante, no un array.');
80
+ }
81
+ return parseExportJsonInput(source);
82
+ }
83
+ export function mapExportJsonItems(items) {
84
+ return items?.map((item) => ({
85
+ code: item.codigo,
86
+ description: item.descripcion,
87
+ quantity: item.cantidad,
88
+ unit: item.unidad,
89
+ unitPrice: item.precioUnitario,
90
+ }));
91
+ }
@@ -0,0 +1,293 @@
1
+ import { formatArcaDateAsArgentineDate, formatDateAsArcaDate, parseArgentineDateInputAsArcaDate, } from '../../lib/dates/arca-date.js';
2
+ import { AppError, InputValidationError } from '../../lib/errors/app-error.js';
3
+ import { resolveBillingCurrencyCode } from '../billing/billing.mappers.js';
4
+ import { DEFAULT_EXPORT_CURRENCY_CODE, DEFAULT_EXPORT_LANGUAGE, DEFAULT_EXPORT_TYPE, EXPORT_TYPE_VALUES, EXPORT_TYPES, EXPORT_TYPES_WITHOUT_PERMITS, EXPORT_VOUCHER_KIND, MAX_EXPORT_VOUCHER_NUMBER, } from './export.types.js';
5
+ /** Codigo de pais de Argentina en la tabla DST_pais: no es un destino de exportacion. */
6
+ export const ARGENTINA_COUNTRY_CODE = 200;
7
+ /** Forma de pago por defecto: WSFEX la exige y casi todas las exportaciones se cobran por transferencia internacional. */
8
+ export const DEFAULT_EXPORT_PAYMENT_TERMS = 'Transferencia Internacional';
9
+ /** ARCA no acepta cotizaciones en pesos distintas de 1. */
10
+ const LOCAL_EXCHANGE_RATE = 1;
11
+ function requireText(value, description, flag) {
12
+ const trimmed = value?.trim();
13
+ if (!trimmed) {
14
+ throw new InputValidationError(`Falta ${description}. Usá ${flag}.`);
15
+ }
16
+ return trimmed;
17
+ }
18
+ function roundAmount(value) {
19
+ return Math.round(value * 100) / 100;
20
+ }
21
+ /** La fecha del comprobante, en formato ARCA: por defecto hoy en Argentina. */
22
+ export function resolveExportVoucherDate(value, now = new Date()) {
23
+ return value?.trim() ? parseArgentineDateInputAsArcaDate(value) : formatDateAsArcaDate(now);
24
+ }
25
+ /**
26
+ * Acepta `ARS`, `USD` o los codigos de ARCA (`PES`, `DOL`). Sin `--moneda` la exportacion va en dolares; la moneda
27
+ * de la config es la de los comprobantes locales. Sin `--cotizacion-moneda` se usa la de aduana que publica ARCA
28
+ * (WSFEX no acepta `Moneda_ctz` en 0): la clave `cotizacion` de la config no aplica, porque una cotizacion guardada
29
+ * queda vieja en dias (REV-35).
30
+ */
31
+ export function resolveExportCurrency(input) {
32
+ const requested = input.currencyCode?.trim() || DEFAULT_EXPORT_CURRENCY_CODE;
33
+ const currencyCode = resolveBillingCurrencyCode(requested);
34
+ const displayCode = requested.toUpperCase();
35
+ if (currencyCode === 'PES') {
36
+ if (input.sameCurrency) {
37
+ throw new InputValidationError('--misma-moneda solo aplica a comprobantes en moneda extranjera.');
38
+ }
39
+ if (typeof input.exchangeRate === 'number' && input.exchangeRate !== LOCAL_EXCHANGE_RATE) {
40
+ throw new InputValidationError('En pesos la cotización tiene que ser 1. Quitá --cotizacion-moneda o usá --cm 1.');
41
+ }
42
+ return {
43
+ fields: { CanMisMonExt: 'N', Moneda_ctz: LOCAL_EXCHANGE_RATE, Moneda_Id: currencyCode },
44
+ needsQuotation: false,
45
+ };
46
+ }
47
+ const rate = input.exchangeRate;
48
+ if (rate !== undefined && rate <= LOCAL_EXCHANGE_RATE) {
49
+ throw new InputValidationError(`La cotización de ${displayCode} tiene que ser mayor a 1.`);
50
+ }
51
+ return {
52
+ fields: {
53
+ CanMisMonExt: input.sameCurrency ? 'S' : 'N',
54
+ Moneda_ctz: rate ?? 0,
55
+ Moneda_Id: currencyCode,
56
+ },
57
+ needsQuotation: rate === undefined,
58
+ };
59
+ }
60
+ /**
61
+ * La cotizacion de aduana de la fecha del comprobante. WSFEX devuelve por moneda la ultima publicada, asi que el
62
+ * dia en curso —que todavia no tiene— o un fin de semana traen la anterior. Sin fila para la moneda no hay
63
+ * cotizacion que usar: es error, salvo que el usuario la informe con `--cotizacion-moneda`.
64
+ */
65
+ export function resolveExportQuotation(currencyCode, quotations, voucherDate) {
66
+ const code = currencyCode.trim().toUpperCase();
67
+ const quotation = quotations.find((entry) => entry.code.trim().toUpperCase() === code);
68
+ if (quotation) {
69
+ return quotation;
70
+ }
71
+ const available = quotations.map((entry) => entry.code).join(', ');
72
+ throw new AppError(`ARCA no informó la cotización de ${code} para el ${formatArcaDateAsArgentineDate(voucherDate)}.${available ? ` Las monedas con cotización son ${available}.` : ''} Informá la cotización con --cotizacion-moneda.`, { code: 'ARCA_QUOTATION_ERROR' });
73
+ }
74
+ /**
75
+ * WSFEX exige una `Actividad` (error 2100) y solo acepta los codigos de su propia tabla, que no es la del padron y
76
+ * es mas chica (error 2105 al emitir). Cada emisor tiene la suya, asi que no hay default: sale de `--actividad` o de
77
+ * `exportacion.actividad`. Los nombres de la tabla llegan con la codificacion rota, por eso los mensajes solo dan codigos.
78
+ */
79
+ export function resolveExportActivity(value, activities = []) {
80
+ if (!Number.isInteger(value) || value < 1) {
81
+ throw new InputValidationError('La actividad tiene que ser un número entero positivo. Usá --actividad.');
82
+ }
83
+ if (activities.length === 0 || activities.some((activity) => activity.id === value)) {
84
+ return value;
85
+ }
86
+ const prefix = String(value).slice(0, 3);
87
+ const family = activities.filter((activity) => String(activity.id).startsWith(prefix)).slice(0, 5);
88
+ const candidates = family.length > 0 ? ` Las que empiezan con ${prefix} son ${family.map((activity) => activity.id).join(', ')}.` : '';
89
+ throw new InputValidationError(`La actividad ${value} no está en la tabla de actividades de WSFEX y ARCA la rechaza (error 2105).${candidates} Indicá la que corresponda con --actividad.`);
90
+ }
91
+ export function resolveExportType(value) {
92
+ if (value === undefined) {
93
+ return DEFAULT_EXPORT_TYPE;
94
+ }
95
+ if (!EXPORT_TYPE_VALUES.includes(value)) {
96
+ throw new InputValidationError('--tipo-expo tiene que ser 1 (exportación definitiva de bienes), 2 (servicios) o 4 (otros).');
97
+ }
98
+ return value;
99
+ }
100
+ export function resolveExportLanguage(value, languages) {
101
+ if (value === undefined) {
102
+ return DEFAULT_EXPORT_LANGUAGE;
103
+ }
104
+ if (languages.length > 0 && !languages.some((language) => language.id === value)) {
105
+ throw new InputValidationError(`El idioma ${value} no existe en la tabla de ARCA.`);
106
+ }
107
+ return value;
108
+ }
109
+ /**
110
+ * El pais se puede escribir por codigo (`203`) o por nombre (`Brasil`). Se valida contra la tabla de ARCA y
111
+ * se rechaza Argentina: WSFEX es solo para exportaciones.
112
+ */
113
+ export function resolveExportDestinationCountry(value, countries) {
114
+ const trimmed = requireText(value, 'el país de destino', '--pais-destino');
115
+ const numeric = /^\d+$/.test(trimmed) ? Number(trimmed) : undefined;
116
+ const country = numeric
117
+ ? countries.find((entry) => entry.code === numeric)
118
+ : countries.find((entry) => entry.name.trim().toLowerCase() === trimmed.toLowerCase());
119
+ if (!country) {
120
+ throw new InputValidationError(`El país de destino "${trimmed}" no existe en la tabla de ARCA. Usá el código o el nombre que informa ARCA.`);
121
+ }
122
+ if (country.code === ARGENTINA_COUNTRY_CODE) {
123
+ throw new InputValidationError('Argentina no es un destino de exportación: usá `arcli factura a` o `arcli factura b`.');
124
+ }
125
+ return country;
126
+ }
127
+ /**
128
+ * DST_CUIT repite cada pais tres veces, con el tipo de entidad pegado al nombre: "BRASIL - Persona Jurídica".
129
+ * DST_pais trae solo "BRASIL", asi que el sufijo no sirve para comparar ni para mostrar el pais.
130
+ */
131
+ const COUNTRY_CUIT_ENTITY_SUFFIX = /\s*-\s*(?:persona\s+f[ií]sica|persona\s+jur[ií]dica|otro\s+tipo\s+de\s+entidad)\s*$/i;
132
+ /** Cuando el pais tiene las tres filas, gana la de persona juridica: el cliente de una exportacion suele ser una empresa. */
133
+ const COUNTRY_CUIT_ENTITY_PREFERENCE = [
134
+ /\bpersona\s+jur[ií]dica\s*$/i,
135
+ /\botro\s+tipo\s+de\s+entidad\s*$/i,
136
+ /\bpersona\s+f[ií]sica\s*$/i,
137
+ ];
138
+ /** Para comparar nombres de las dos tablas: sin tipo de entidad, sin acentos, sin mayusculas y con un solo espacio. */
139
+ function normalizeCountryName(value) {
140
+ return value
141
+ .normalize('NFD')
142
+ .replace(/[\u0300-\u036f]/g, '')
143
+ .replace(/\s+/g, ' ')
144
+ .trim()
145
+ .toLowerCase();
146
+ }
147
+ function countryNameWithoutEntity(value) {
148
+ return value.replace(COUNTRY_CUIT_ENTITY_SUFFIX, '').trim();
149
+ }
150
+ function pickCountryCuit(entries) {
151
+ for (const preference of COUNTRY_CUIT_ENTITY_PREFERENCE) {
152
+ const preferred = entries.find((entry) => preference.test(entry.countryName));
153
+ if (preferred) {
154
+ return preferred;
155
+ }
156
+ }
157
+ return entries[0];
158
+ }
159
+ /**
160
+ * WSFEX pide el CUIT del pais del cliente. Se resuelve con la tabla DST_CUIT, que nombra cada pais con el tipo de
161
+ * entidad ("ESTADOS UNIDOS - Persona Jurídica"), mientras que la tabla de destinos dice solo "ESTADOS UNIDOS": por
162
+ * eso se compara sin el sufijo. Si el CUIT viene por flag se valida contra la tabla, salvo para los paises cuyo
163
+ * nombre no coincide entre las dos tablas ("CHINA" y "CHINA REP.POPULAR"), donde solo se acepta que exista.
164
+ */
165
+ export function resolveExportClientCountryCuit(options) {
166
+ const destination = normalizeCountryName(options.country.name);
167
+ const forDestination = options.countries.filter((entry) => normalizeCountryName(countryNameWithoutEntity(entry.countryName)) === destination);
168
+ if (options.cuit === undefined) {
169
+ const resolved = pickCountryCuit(forDestination);
170
+ if (!resolved) {
171
+ throw new InputValidationError(`La tabla de ARCA no tiene CUIT para "${options.country.name}". Indicalo con --cuit-pais.`);
172
+ }
173
+ return resolved.cuit;
174
+ }
175
+ const match = options.countries.find((entry) => entry.cuit === options.cuit);
176
+ if (!match) {
177
+ throw new InputValidationError(`El CUIT de país ${options.cuit} no existe en la tabla de ARCA.`);
178
+ }
179
+ const expected = pickCountryCuit(forDestination);
180
+ if (expected && normalizeCountryName(countryNameWithoutEntity(match.countryName)) !== destination) {
181
+ throw new InputValidationError(`El CUIT de país ${options.cuit} corresponde a "${countryNameWithoutEntity(match.countryName)}" y el destino es "${options.country.name}". Para "${options.country.name}" la tabla de ARCA trae ${expected.cuit}.`);
182
+ }
183
+ return options.cuit;
184
+ }
185
+ /** `--incoterm` se compara contra la tabla de ARCA, sin importar mayusculas. */
186
+ export function resolveExportIncoterm(value, incoterms) {
187
+ const trimmed = value?.trim();
188
+ if (!trimmed) {
189
+ return undefined;
190
+ }
191
+ const incoterm = incoterms.find((entry) => entry.code.trim().toUpperCase() === trimmed.toUpperCase());
192
+ if (!incoterm) {
193
+ throw new InputValidationError(`El incoterm "${trimmed}" no existe en la tabla de ARCA. Consultá los válidos con arcli parametros.`);
194
+ }
195
+ return incoterm;
196
+ }
197
+ export function resolveExportPointOfSale(value, config) {
198
+ const pointOfSale = value ?? config.puntoVentaPorDefecto;
199
+ if (pointOfSale === undefined) {
200
+ throw new InputValidationError('Falta el punto de venta. Usá --punto-venta o configurá puntoVentaPorDefecto.');
201
+ }
202
+ if (!Number.isInteger(pointOfSale) || pointOfSale < 1) {
203
+ throw new InputValidationError('El punto de venta tiene que ser un número entero positivo.');
204
+ }
205
+ return pointOfSale;
206
+ }
207
+ /** Numero del comprobante o de la solicitud: el indicado por el usuario o el que sigue al ultimo de ARCA. */
208
+ export function resolveExportNumber(options) {
209
+ if (options.provided !== undefined) {
210
+ if (!Number.isInteger(options.provided) || options.provided < 1) {
211
+ throw new InputValidationError(`${options.label} tiene que ser un número entero positivo.`);
212
+ }
213
+ return options.provided;
214
+ }
215
+ const next = (Number.isFinite(options.last) ? options.last : 0) + 1;
216
+ if (next > MAX_EXPORT_VOUCHER_NUMBER) {
217
+ throw new InputValidationError(`${options.label} supera el máximo de ARCA (${MAX_EXPORT_VOUCHER_NUMBER}).`);
218
+ }
219
+ return next;
220
+ }
221
+ /** En los tipos 2 (servicios) y 4 (otros) ARCA exige `Permiso_existente` vacio, no `N` (error 1550). */
222
+ function requiresEmptyPermitsExisting(exportType) {
223
+ return EXPORT_TYPES_WITHOUT_PERMITS.includes(exportType);
224
+ }
225
+ /**
226
+ * Con `Permiso_existente = N` ARCA rechaza el campo `Permisos` (error 1720), y en los tipos 2 y 4 pide el campo
227
+ * vacio y no admite permisos (error 1550): sin permisos no se manda.
228
+ */
229
+ function resolvePermits(input, destinationCountry, exportType) {
230
+ const permits = (input.permits ?? []).map((permit) => permit.trim()).filter(Boolean);
231
+ if (permits.length === 0) {
232
+ if (input.permitsExisting) {
233
+ throw new InputValidationError('--permiso-existente pide al menos un permiso de embarque. Usá --permiso.');
234
+ }
235
+ return undefined;
236
+ }
237
+ if (requiresEmptyPermitsExisting(exportType)) {
238
+ throw new InputValidationError(`El tipo de exportación ${exportType} (${EXPORT_TYPES[exportType]}) no lleva permisos de embarque: ARCA exige Permiso_existente vacío (error 1550). Quitá --permiso.`);
239
+ }
240
+ if (!input.permitsExisting) {
241
+ throw new InputValidationError('Los permisos de embarque van con --permiso-existente: ARCA necesita saber que el permiso ya existe.');
242
+ }
243
+ return { Permiso: [...new Set(permits)].map((id) => ({ Dst_merc: destinationCountry, Id_permiso: id })) };
244
+ }
245
+ /**
246
+ * Arma el `Cmp` de `FEXAuthorize` con los datos ya resueltos contra las tablas de ARCA.
247
+ *
248
+ * Los bloques vacios no van: `Permisos` sin permisos (error 1720), `Cmps_asoc` y `Opcionales` sin filas (error 1820
249
+ * el primero). `Actividades`, en cambio, siempre lleva una `Actividad` (error 2100).
250
+ */
251
+ export function buildExportPayload(input, resolution) {
252
+ const clientName = requireText(input.clientName, 'el nombre del cliente', '--cliente');
253
+ const clientAddress = requireText(input.clientAddress, 'el domicilio del cliente', '--domicilio-cliente');
254
+ if (typeof input.amount !== 'number' || !(input.amount > 0)) {
255
+ throw new InputValidationError('Falta el importe total o no es válido. Usá --monto.');
256
+ }
257
+ const permits = resolvePermits(input, resolution.destinationCountry.code, resolution.exportType);
258
+ /** En servicios y otros ARCA pide el campo vacio; en el resto, `N` sin permisos y `S` con permisos. */
259
+ const permitsExisting = requiresEmptyPermitsExisting(resolution.exportType)
260
+ ? ''
261
+ : input.permitsExisting
262
+ ? 'S'
263
+ : 'N';
264
+ return {
265
+ // Actividades va siempre con una: con el bloque vacio ARCA contesta 2100.
266
+ Actividades: { Actividad: [{ Id: resolution.activity }] },
267
+ CanMisMonExt: resolution.currency.CanMisMonExt,
268
+ Cbte_nro: resolution.voucherNumber,
269
+ Cbte_Tipo: EXPORT_VOUCHER_KIND.arcaType,
270
+ Cliente: clientName,
271
+ Cuit_pais_cliente: resolution.clientCountryCuit,
272
+ Domicilio_cliente: clientAddress,
273
+ Dst_cmp: resolution.destinationCountry.code,
274
+ Fecha_cbte: resolution.voucherDate,
275
+ Fecha_pago: resolution.paymentDate,
276
+ Forma_pago: input.paymentTerms?.trim() || DEFAULT_EXPORT_PAYMENT_TERMS,
277
+ Id: resolution.requestId,
278
+ Id_impositivo: input.clientTaxId?.trim() ?? '',
279
+ Idioma_cbte: resolution.languageId,
280
+ Imp_total: roundAmount(input.amount),
281
+ Incoterms: resolution.incoterm?.code ?? '',
282
+ Incoterms_Ds: input.incotermDescription?.trim() || resolution.incoterm?.name || '',
283
+ Items: { Item: [...resolution.items] },
284
+ Moneda_ctz: resolution.currency.Moneda_ctz,
285
+ Moneda_Id: resolution.currency.Moneda_Id,
286
+ Obs: input.observations?.trim() ?? '',
287
+ Obs_comerciales: input.commercialObservations?.trim() ?? '',
288
+ Permiso_existente: permitsExisting,
289
+ ...(permits ? { Permisos: permits } : {}),
290
+ Punto_vta: resolution.pointOfSale,
291
+ Tipo_expo: resolution.exportType,
292
+ };
293
+ }
@@ -0,0 +1,2 @@
1
+ export { formatExportResultAsJson } from './export.serialize.js';
2
+ export { formatExportResultAsText } from './export.text.js';