@hisaabo/cli 0.5.0 → 0.6.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.
- package/dist/bin/{audit-trail-5LOCJ7XZ.js → audit-trail-4AMEFQGB.js} +1 -1
- package/dist/bin/{categories-64WWZTND.js → categories-CLCBRNWC.js} +1 -1
- package/dist/bin/{check-slug-FLHHUDYS.js → check-slug-OKW7KDYG.js} +1 -1
- package/dist/bin/{chunk-4MEL44QX.js → chunk-GXRLFDZW.js} +234 -0
- package/dist/bin/{client-5NZ23GML.js → client-2ZKMLWI6.js} +1 -1
- package/dist/bin/{collection-efficiency-U56XNVEE.js → collection-efficiency-TECE6PVQ.js} +1 -1
- package/dist/bin/{create-RPDEORDD.js → create-AS2YVGRA.js} +1 -1
- package/dist/bin/{default-account-AE6EXZZR.js → default-account-3RVSU7RF.js} +1 -1
- package/dist/bin/{expenses-5N2QSG54.js → expenses-KXFQJKD6.js} +1 -1
- package/dist/bin/{export-QICOQK34.js → export-UHZISG7H.js} +1 -1
- package/dist/bin/{factory-KOCW2AQM.js → factory-OBESY2LG.js} +1 -1
- package/dist/bin/{get-GWH6S5SJ.js → get-GTL556HL.js} +1 -1
- package/dist/bin/{get-A43QCI2S.js → get-WUSYEMG4.js} +1 -1
- package/dist/bin/hisaabo.js +892 -55
- package/dist/bin/{invitations-P3EEN5WI.js → invitations-U4ZNYWY7.js} +1 -1
- package/dist/bin/{invite-T3CKX53E.js → invite-5S4GJKRF.js} +1 -1
- package/dist/bin/{invoice-breakdown-FN5BEFJD.js → invoice-breakdown-PP3BZQLG.js} +1 -1
- package/dist/bin/{items-2OOCQKVF.js → items-CHEFLI7C.js} +1 -1
- package/dist/bin/{items-toggle-SKZWCGJH.js → items-toggle-ETVCDCU6.js} +1 -1
- package/dist/bin/{list-A2RKI3ZG.js → list-3FO4UJKC.js} +1 -1
- package/dist/bin/{list-NRMBMKMI.js → list-LQJGTZB4.js} +1 -1
- package/dist/bin/{list-T74SN6IR.js → list-RJ34MFPR.js} +1 -1
- package/dist/bin/{members-W2GW3ODT.js → members-TE5K5NQC.js} +1 -1
- package/dist/bin/{monthly-comparison-T34ZFOHL.js → monthly-comparison-Q6KPMTPS.js} +1 -1
- package/dist/bin/{order-cancel-TI27JYYD.js → order-cancel-NOQDBL2N.js} +1 -1
- package/dist/bin/{order-confirm-VMRAMNTD.js → order-confirm-6WMKTGPV.js} +1 -1
- package/dist/bin/{order-get-C2RBUR4O.js → order-get-ONWR4GTW.js} +1 -1
- package/dist/bin/{order-update-RE3HATNF.js → order-update-IVO4AFGV.js} +1 -1
- package/dist/bin/{payment-modes-WOOT22I7.js → payment-modes-FXB2G6WP.js} +1 -1
- package/dist/bin/{profit-loss-T4RESJ32.js → profit-loss-XPYELDTH.js} +1 -1
- package/dist/bin/{receivables-aging-6XMENEWS.js → receivables-aging-MU6Q3DZ4.js} +1 -1
- package/dist/bin/{remove-6QZI4JCY.js → remove-DJBOOOR4.js} +1 -1
- package/dist/bin/{revoke-AVEMPAC7.js → revoke-5L5GZ4ZZ.js} +1 -1
- package/dist/bin/{revoke-YUCFZFNR.js → revoke-WRIK7HLY.js} +1 -1
- package/dist/bin/{revoke-all-LFW5WBHO.js → revoke-all-QARW2G6R.js} +1 -1
- package/dist/bin/{revoke-invitation-DTGQRJR4.js → revoke-invitation-ZGLJHYNB.js} +1 -1
- package/dist/bin/{sales-trend-ZYBRUDUU.js → sales-trend-P5HOZJSX.js} +1 -1
- package/dist/bin/{sequence-FPOJTI2P.js → sequence-LK6QLSI5.js} +1 -1
- package/dist/bin/{store-IOB4Y67C.js → store-FU7CEILC.js} +1 -1
- package/dist/bin/{summary-5KYBA4ZO.js → summary-XONLN72I.js} +1 -1
- package/dist/bin/{top-customers-WSQ2UEJL.js → top-customers-U6HQW2GH.js} +1 -1
- package/dist/bin/{top-items-RWQPDGLN.js → top-items-EAOIVZ4P.js} +1 -1
- package/dist/bin/{top-outstanding-QAMO2E7Y.js → top-outstanding-4546FJDH.js} +1 -1
- package/dist/bin/{unpaid-invoices-WB3TK5B4.js → unpaid-invoices-AED55PLC.js} +1 -1
- package/dist/bin/{untracked-H733MYJL.js → untracked-ZEM2CDHC.js} +1 -1
- package/dist/bin/{update-TLBUIC5J.js → update-FO7AAXF5.js} +1 -1
- package/dist/bin/{update-H6LPO2Z4.js → update-OZPBIBME.js} +1 -1
- package/dist/bin/{update-JU2X3XU5.js → update-QCK32XAG.js} +1 -1
- package/dist/bin/{update-role-QST7BVFX.js → update-role-RB35QIA5.js} +1 -1
- package/dist/bin/{update-settings-Q2EGRLKZ.js → update-settings-EUC2FJQJ.js} +1 -1
- package/package.json +1 -1
- package/src/bin/hisaabo.ts +10 -0
- package/src/bin/registrars/bank-recon.ts +34 -0
- package/src/bin/registrars/einvoice.ts +46 -0
- package/src/bin/registrars/ewb.ts +37 -0
- package/src/bin/registrars/gst.ts +17 -1
- package/src/bin/registrars/itc.ts +56 -0
- package/src/bin/registrars/journal.ts +47 -0
- package/src/bin/registrars/report.ts +44 -0
- package/src/client.ts +248 -0
- package/src/commands/bank-recon/index.ts +127 -0
- package/src/commands/einvoice/index.ts +109 -0
- package/src/commands/ewb/index.ts +108 -0
- package/src/commands/gst/index.ts +79 -1
- package/src/commands/itc/index.ts +163 -0
- package/src/commands/journal/index.ts +156 -0
- package/src/commands/report/index.ts +171 -0
package/dist/bin/hisaabo.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
HisaaboApiError,
|
|
17
17
|
HisaaboClient
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GXRLFDZW.js";
|
|
19
19
|
import {
|
|
20
20
|
clearConfig,
|
|
21
21
|
getConfig,
|
|
@@ -390,19 +390,19 @@ function registerAuthCommands(program2) {
|
|
|
390
390
|
function registerDashboardCommands(program2) {
|
|
391
391
|
const dash = program2.command("dashboard").alias("dash").description("Business dashboard & analytics");
|
|
392
392
|
dash.command("summary").description("Financial summary overview (FY to date)").option("--json", "JSON output").action(async (opts) => {
|
|
393
|
-
const { dashboardCommand } = await import("./summary-
|
|
393
|
+
const { dashboardCommand } = await import("./summary-XONLN72I.js");
|
|
394
394
|
await dashboardCommand({ json: opts.json });
|
|
395
395
|
});
|
|
396
396
|
dash.command("sales-trend").description("Sales trend over time").option("--months <n>", "Number of months to show", (v) => parseInt(v, 10)).option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--granularity <g>", "daily | weekly | monthly").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
397
|
-
const { dashboardSalesTrendCommand } = await import("./sales-trend-
|
|
397
|
+
const { dashboardSalesTrendCommand } = await import("./sales-trend-P5HOZJSX.js");
|
|
398
398
|
await dashboardSalesTrendCommand(opts);
|
|
399
399
|
});
|
|
400
400
|
dash.command("top-outstanding").description("Parties with highest outstanding balances").option("--limit <n>", "Max rows to show", (v) => parseInt(v, 10)).option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
401
|
-
const { dashboardTopOutstandingCommand } = await import("./top-outstanding-
|
|
401
|
+
const { dashboardTopOutstandingCommand } = await import("./top-outstanding-4546FJDH.js");
|
|
402
402
|
await dashboardTopOutstandingCommand(opts);
|
|
403
403
|
});
|
|
404
404
|
dash.command("top-customers").description("Top customers by revenue").option("--limit <n>", "Max rows to show", (v) => parseInt(v, 10)).option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Filter to current calendar month").option("--this-fy", "Filter to current financial year").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
405
|
-
const { dashboardTopCustomersCommand } = await import("./top-customers-
|
|
405
|
+
const { dashboardTopCustomersCommand } = await import("./top-customers-U6HQW2GH.js");
|
|
406
406
|
await dashboardTopCustomersCommand({
|
|
407
407
|
limit: opts.limit,
|
|
408
408
|
from: opts.from,
|
|
@@ -414,7 +414,7 @@ function registerDashboardCommands(program2) {
|
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
dash.command("top-items").description("Top selling items by revenue and quantity").option("--limit <n>", "Max rows to show", (v) => parseInt(v, 10)).option("--type <type>", "Item type filter (product | service)").option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Filter to current calendar month").option("--this-fy", "Filter to current financial year").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
417
|
-
const { dashboardTopItemsCommand } = await import("./top-items-
|
|
417
|
+
const { dashboardTopItemsCommand } = await import("./top-items-EAOIVZ4P.js");
|
|
418
418
|
await dashboardTopItemsCommand({
|
|
419
419
|
limit: opts.limit,
|
|
420
420
|
type: opts.type,
|
|
@@ -427,7 +427,7 @@ function registerDashboardCommands(program2) {
|
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
const expensesCmd = dash.command("expenses").description("Expenses broken down by category").option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Filter to current calendar month").option("--this-fy", "Filter to current financial year").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
430
|
-
const { dashboardExpensesCommand } = await import("./expenses-
|
|
430
|
+
const { dashboardExpensesCommand } = await import("./expenses-KXFQJKD6.js");
|
|
431
431
|
await dashboardExpensesCommand({
|
|
432
432
|
from: opts.from,
|
|
433
433
|
to: opts.to,
|
|
@@ -439,7 +439,7 @@ function registerDashboardCommands(program2) {
|
|
|
439
439
|
});
|
|
440
440
|
expensesCmd.alias("expenses-by-category");
|
|
441
441
|
dash.command("invoice-breakdown").description("Invoice count and amounts by status").option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Filter to current calendar month").option("--this-fy", "Filter to current financial year").option("--json", "JSON output").action(async (opts) => {
|
|
442
|
-
const { dashboardInvoiceBreakdownCommand } = await import("./invoice-breakdown-
|
|
442
|
+
const { dashboardInvoiceBreakdownCommand } = await import("./invoice-breakdown-PP3BZQLG.js");
|
|
443
443
|
await dashboardInvoiceBreakdownCommand({
|
|
444
444
|
from: opts.from,
|
|
445
445
|
to: opts.to,
|
|
@@ -449,7 +449,7 @@ function registerDashboardCommands(program2) {
|
|
|
449
449
|
});
|
|
450
450
|
});
|
|
451
451
|
const plCmd = dash.command("profit-loss").description("Profit & Loss statement").option("--from <date>", "Start date (YYYY-MM-DD, default: FY start)").option("--to <date>", "End date (YYYY-MM-DD, default: today)").option("--this-month", "Scope to current calendar month").option("--this-fy", "Scope to current financial year").option("--json", "JSON output").action(async (opts) => {
|
|
452
|
-
const { dashboardProfitLossCommand } = await import("./profit-loss-
|
|
452
|
+
const { dashboardProfitLossCommand } = await import("./profit-loss-XPYELDTH.js");
|
|
453
453
|
await dashboardProfitLossCommand({
|
|
454
454
|
from: opts.from,
|
|
455
455
|
to: opts.to,
|
|
@@ -460,11 +460,11 @@ function registerDashboardCommands(program2) {
|
|
|
460
460
|
});
|
|
461
461
|
plCmd.alias("pl");
|
|
462
462
|
dash.command("receivables-aging").description("Receivables aging buckets (current / 1-30 / 31-60 / 61-90 / 90+)").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
463
|
-
const { dashboardReceivablesAgingCommand } = await import("./receivables-aging-
|
|
463
|
+
const { dashboardReceivablesAgingCommand } = await import("./receivables-aging-MU6Q3DZ4.js");
|
|
464
464
|
await dashboardReceivablesAgingCommand({ json: opts.json, format: opts.format });
|
|
465
465
|
});
|
|
466
466
|
dash.command("payment-modes").description("Payment mode breakdown (cash / UPI / bank transfer / etc.)").option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Filter to current calendar month").option("--this-fy", "Filter to current financial year").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
467
|
-
const { dashboardPaymentModesCommand } = await import("./payment-modes-
|
|
467
|
+
const { dashboardPaymentModesCommand } = await import("./payment-modes-FXB2G6WP.js");
|
|
468
468
|
await dashboardPaymentModesCommand({
|
|
469
469
|
from: opts.from,
|
|
470
470
|
to: opts.to,
|
|
@@ -475,7 +475,7 @@ function registerDashboardCommands(program2) {
|
|
|
475
475
|
});
|
|
476
476
|
});
|
|
477
477
|
dash.command("collection-efficiency").description("Collection rate, DSO, and aging breakdown").option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Filter to current calendar month").option("--this-fy", "Filter to current financial year").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
478
|
-
const { dashboardCollectionEfficiencyCommand } = await import("./collection-efficiency-
|
|
478
|
+
const { dashboardCollectionEfficiencyCommand } = await import("./collection-efficiency-TECE6PVQ.js");
|
|
479
479
|
await dashboardCollectionEfficiencyCommand({
|
|
480
480
|
from: opts.from,
|
|
481
481
|
to: opts.to,
|
|
@@ -486,7 +486,7 @@ function registerDashboardCommands(program2) {
|
|
|
486
486
|
});
|
|
487
487
|
});
|
|
488
488
|
dash.command("monthly-comparison").description("Month-over-month comparison of sales, expenses, profit, and collections").option("--json", "JSON output").option("--format <format>", "table | tsv | csv").action(async (opts) => {
|
|
489
|
-
const { dashboardMonthlyComparisonCommand } = await import("./monthly-comparison-
|
|
489
|
+
const { dashboardMonthlyComparisonCommand } = await import("./monthly-comparison-Q6KPMTPS.js");
|
|
490
490
|
await dashboardMonthlyComparisonCommand({ json: opts.json, format: opts.format });
|
|
491
491
|
});
|
|
492
492
|
}
|
|
@@ -1813,11 +1813,11 @@ function registerPaymentCommands(program2) {
|
|
|
1813
1813
|
await paymentDeleteCommand(id, { yes: opts.yes, json: opts.json });
|
|
1814
1814
|
});
|
|
1815
1815
|
payment.command("get <id>").description("Get payment details").option("--json", "JSON output").action(async (id, opts) => {
|
|
1816
|
-
const { paymentGetCommand } = await import("./get-
|
|
1816
|
+
const { paymentGetCommand } = await import("./get-GTL556HL.js");
|
|
1817
1817
|
await paymentGetCommand(id, { json: opts.json });
|
|
1818
1818
|
});
|
|
1819
1819
|
payment.command("update <id>").description("Update a payment").option("--amount <amount>", "New amount").option("--mode <mode>", "Payment mode: cash, upi, bank, cheque, other").option("--date <YYYY-MM-DD>", "Payment date").option("--reference <ref>", "Reference number (empty string to clear)").option("--notes <text>", "Notes (empty string to clear)").option("--json", "JSON output").action(async (id, opts) => {
|
|
1820
|
-
const { paymentUpdateCommand } = await import("./update-
|
|
1820
|
+
const { paymentUpdateCommand } = await import("./update-QCK32XAG.js");
|
|
1821
1821
|
await paymentUpdateCommand(id, {
|
|
1822
1822
|
json: opts.json,
|
|
1823
1823
|
amount: opts.amount,
|
|
@@ -1828,11 +1828,11 @@ function registerPaymentCommands(program2) {
|
|
|
1828
1828
|
});
|
|
1829
1829
|
});
|
|
1830
1830
|
payment.command("unpaid-invoices <partyId>").description("List unpaid invoices for a party").option("--json", "JSON output").option("--format <format>", "Output format: table, tsv, csv").action(async (partyId, opts) => {
|
|
1831
|
-
const { paymentUnpaidInvoicesCommand } = await import("./unpaid-invoices-
|
|
1831
|
+
const { paymentUnpaidInvoicesCommand } = await import("./unpaid-invoices-AED55PLC.js");
|
|
1832
1832
|
await paymentUnpaidInvoicesCommand(partyId, { json: opts.json, format: opts.format });
|
|
1833
1833
|
});
|
|
1834
1834
|
payment.command("untracked").description("List payments not linked to a bank account").option("--page <n>", "Page number", parseInt).option("--limit <n>", "Items per page", parseInt).option("--json", "JSON output").option("--format <format>", "Output format: table, tsv, csv").action(async (opts) => {
|
|
1835
|
-
const { paymentUntrackedCommand } = await import("./untracked-
|
|
1835
|
+
const { paymentUntrackedCommand } = await import("./untracked-ZEM2CDHC.js");
|
|
1836
1836
|
await paymentUntrackedCommand({
|
|
1837
1837
|
json: opts.json,
|
|
1838
1838
|
format: opts.format,
|
|
@@ -1841,7 +1841,7 @@ function registerPaymentCommands(program2) {
|
|
|
1841
1841
|
});
|
|
1842
1842
|
});
|
|
1843
1843
|
payment.command("default-account").description("Show recommended bank account for payments").option("--party-id <id>", "Party UUID to scope recommendation").option("--json", "JSON output").action(async (opts) => {
|
|
1844
|
-
const { paymentDefaultAccountCommand } = await import("./default-account-
|
|
1844
|
+
const { paymentDefaultAccountCommand } = await import("./default-account-3RVSU7RF.js");
|
|
1845
1845
|
await paymentDefaultAccountCommand({ json: opts.json, partyId: opts.partyId });
|
|
1846
1846
|
});
|
|
1847
1847
|
}
|
|
@@ -1980,7 +1980,7 @@ function registerExpenseCommands(program2) {
|
|
|
1980
1980
|
await expenseDeleteCommand(id, { yes: opts.yes, json: opts.json });
|
|
1981
1981
|
});
|
|
1982
1982
|
expense.command("update <id>").description("Update an expense").option("--amount <amount>", "New amount").option("--category <cat>", "Expense category").option("--date <YYYY-MM-DD>", "Expense date").option("--description <text>", "Description").option("--payment-mode <mode>", "Payment mode: cash, upi, bank, cheque, other").option("--reference <ref>", "Reference number").option("--json", "JSON output").action(async (id, opts) => {
|
|
1983
|
-
const { expenseUpdateCommand } = await import("./update-
|
|
1983
|
+
const { expenseUpdateCommand } = await import("./update-FO7AAXF5.js");
|
|
1984
1984
|
await expenseUpdateCommand(id, {
|
|
1985
1985
|
json: opts.json,
|
|
1986
1986
|
amount: opts.amount,
|
|
@@ -1992,7 +1992,7 @@ function registerExpenseCommands(program2) {
|
|
|
1992
1992
|
});
|
|
1993
1993
|
});
|
|
1994
1994
|
expense.command("categories").description("List all expense categories").option("--json", "JSON output").action(async (opts) => {
|
|
1995
|
-
const { expenseCategoriesCommand } = await import("./categories-
|
|
1995
|
+
const { expenseCategoriesCommand } = await import("./categories-CLCBRNWC.js");
|
|
1996
1996
|
await expenseCategoriesCommand({ json: opts.json });
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
@@ -2091,6 +2091,71 @@ async function gstR1CsvCommand(opts) {
|
|
|
2091
2091
|
fatalError(String(e instanceof Error ? e.message : e));
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
|
+
async function gstR9Command(financialYear, opts) {
|
|
2095
|
+
const cfg = requireAuth();
|
|
2096
|
+
const client = new HisaaboClient(cfg);
|
|
2097
|
+
try {
|
|
2098
|
+
const report = await client.gst.gstr9({ financialYear });
|
|
2099
|
+
if (opts.json) {
|
|
2100
|
+
outputJSON(report);
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
console.log(`
|
|
2104
|
+
GSTR-9 Annual Return \u2014 FY ${financialYear}`);
|
|
2105
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
2106
|
+
`);
|
|
2107
|
+
const r = report;
|
|
2108
|
+
if (r["summary"] && typeof r["summary"] === "object") {
|
|
2109
|
+
const s = r["summary"];
|
|
2110
|
+
if (s["totalTurnover"]) console.log(` Total Turnover: ${formatAmount(String(s["totalTurnover"]))}`);
|
|
2111
|
+
if (s["totalTax"]) console.log(` Total Tax: ${formatAmount(String(s["totalTax"]))}`);
|
|
2112
|
+
if (s["totalITC"]) console.log(` Total ITC: ${formatAmount(String(s["totalITC"]))}`);
|
|
2113
|
+
}
|
|
2114
|
+
console.log();
|
|
2115
|
+
console.log(" Use --json for full GSTR-9 data.\n");
|
|
2116
|
+
} catch (e) {
|
|
2117
|
+
if (e instanceof HisaaboApiError) {
|
|
2118
|
+
const err = e.hisaaboError;
|
|
2119
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
2120
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
2121
|
+
}
|
|
2122
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
async function gstr2bUploadsCommand(opts) {
|
|
2126
|
+
const cfg = requireAuth();
|
|
2127
|
+
const client = new HisaaboClient(cfg);
|
|
2128
|
+
try {
|
|
2129
|
+
const result = await client.gst.gstr2bUploads();
|
|
2130
|
+
if (opts.json) {
|
|
2131
|
+
outputJSON(result);
|
|
2132
|
+
return;
|
|
2133
|
+
}
|
|
2134
|
+
const uploads = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : [];
|
|
2135
|
+
console.log("\n GSTR-2B Uploads\n");
|
|
2136
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
2137
|
+
`);
|
|
2138
|
+
if (uploads.length === 0) {
|
|
2139
|
+
console.log(" No uploads found.\n");
|
|
2140
|
+
return;
|
|
2141
|
+
}
|
|
2142
|
+
for (const up of uploads) {
|
|
2143
|
+
const id = String(up["id"] ?? "-").slice(0, 8);
|
|
2144
|
+
const period = String(up["period"] ?? up["returnPeriod"] ?? "-").padEnd(10);
|
|
2145
|
+
const date = formatDate(String(up["uploadedAt"] ?? up["createdAt"] ?? ""));
|
|
2146
|
+
const records = String(up["totalRecords"] ?? up["records"] ?? "-").padStart(8);
|
|
2147
|
+
console.log(` ${id} ${period} ${date.padEnd(13)} Records: ${records}`);
|
|
2148
|
+
}
|
|
2149
|
+
console.log();
|
|
2150
|
+
} catch (e) {
|
|
2151
|
+
if (e instanceof HisaaboApiError) {
|
|
2152
|
+
const err = e.hisaaboError;
|
|
2153
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
2154
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
2155
|
+
}
|
|
2156
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2094
2159
|
|
|
2095
2160
|
// src/bin/registrars/gst.ts
|
|
2096
2161
|
function registerGstCommands(program2) {
|
|
@@ -2104,6 +2169,12 @@ function registerGstCommands(program2) {
|
|
|
2104
2169
|
gst.command("r1-csv").description("Download GSTR-1 as GSTN-compatible CSV").option("--quarter <q>", "Quarter").option("--month <n>", "Month", parseInt).option("--year <n>", "Year", parseInt).option("--output <path>", "Output file path").action(async (opts) => {
|
|
2105
2170
|
await gstR1CsvCommand({ quarter: opts.quarter, month: opts.month, year: opts.year, output: opts.output });
|
|
2106
2171
|
});
|
|
2172
|
+
gst.command("gstr9 <fy>").description("GSTR-9 annual return (e.g. 2023-24)").option("--json", "JSON output").action(async (fy, opts) => {
|
|
2173
|
+
await gstR9Command(fy, { json: opts.json });
|
|
2174
|
+
});
|
|
2175
|
+
gst.command("gstr2b-uploads").description("List GSTR-2B uploaded periods").option("--json", "JSON output").action(async (opts) => {
|
|
2176
|
+
await gstr2bUploadsCommand({ json: opts.json });
|
|
2177
|
+
});
|
|
2107
2178
|
}
|
|
2108
2179
|
|
|
2109
2180
|
// src/commands/report/index.ts
|
|
@@ -2514,6 +2585,149 @@ async function reportCashFlowCommand(opts) {
|
|
|
2514
2585
|
fatalError(String(e instanceof Error ? e.message : e));
|
|
2515
2586
|
}
|
|
2516
2587
|
}
|
|
2588
|
+
async function reportTrialBalanceCommand(opts) {
|
|
2589
|
+
const cfg = requireAuth();
|
|
2590
|
+
const client = new HisaaboClient(cfg);
|
|
2591
|
+
const { from: _from, to } = resolveRange(opts);
|
|
2592
|
+
try {
|
|
2593
|
+
const result = await client.reports.trialBalance({ asOfDate: to });
|
|
2594
|
+
if (opts.json) {
|
|
2595
|
+
outputJSON(result);
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
console.log(`
|
|
2599
|
+
Trial Balance as of ${to}
|
|
2600
|
+
`);
|
|
2601
|
+
console.log(` ${"\u2550".repeat(70)}
|
|
2602
|
+
`);
|
|
2603
|
+
const rows = Array.isArray(result?.accounts) ? result.accounts : Array.isArray(result?.rows) ? result.rows : Array.isArray(result) ? result : [];
|
|
2604
|
+
for (const row of rows) {
|
|
2605
|
+
const name = String(row["accountName"] ?? row["name"] ?? "-").padEnd(30);
|
|
2606
|
+
const debit = String(row["debit"] ?? "0");
|
|
2607
|
+
const credit = String(row["credit"] ?? "0");
|
|
2608
|
+
const dr = parseFloat(debit) !== 0 ? formatAmount(debit) : "-";
|
|
2609
|
+
const cr = parseFloat(credit) !== 0 ? formatAmount(credit) : "-";
|
|
2610
|
+
console.log(` ${name} ${dr.padStart(14)} ${cr.padStart(14)}`);
|
|
2611
|
+
}
|
|
2612
|
+
console.log();
|
|
2613
|
+
} catch (e) {
|
|
2614
|
+
if (e instanceof HisaaboApiError) {
|
|
2615
|
+
const err = e.hisaaboError;
|
|
2616
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
2617
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
2618
|
+
}
|
|
2619
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
async function reportBalanceSheetCommand(opts) {
|
|
2623
|
+
const cfg = requireAuth();
|
|
2624
|
+
const client = new HisaaboClient(cfg);
|
|
2625
|
+
const { to } = resolveRange(opts);
|
|
2626
|
+
try {
|
|
2627
|
+
const result = await client.reports.balanceSheet({ asOfDate: to });
|
|
2628
|
+
if (opts.json) {
|
|
2629
|
+
outputJSON(result);
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
const r = result;
|
|
2633
|
+
console.log(`
|
|
2634
|
+
Balance Sheet as of ${to}
|
|
2635
|
+
`);
|
|
2636
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
2637
|
+
`);
|
|
2638
|
+
const assets = String(r["totalAssets"] ?? r["assets"] ?? "0");
|
|
2639
|
+
const liabilities = String(r["totalLiabilities"] ?? r["liabilities"] ?? "0");
|
|
2640
|
+
const equity = String(r["totalEquity"] ?? r["equity"] ?? "0");
|
|
2641
|
+
console.log(` Total Assets: ${formatAmount(assets).padStart(14)}`);
|
|
2642
|
+
console.log(` Total Liabilities: ${formatAmount(liabilities).padStart(14)}`);
|
|
2643
|
+
console.log(` Total Equity: ${formatAmount(equity).padStart(14)}`);
|
|
2644
|
+
console.log();
|
|
2645
|
+
console.log(" Use --json for full balance sheet breakdown.\n");
|
|
2646
|
+
} catch (e) {
|
|
2647
|
+
if (e instanceof HisaaboApiError) {
|
|
2648
|
+
const err = e.hisaaboError;
|
|
2649
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
2650
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
2651
|
+
}
|
|
2652
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
async function reportCashFlowStatementCommand(opts) {
|
|
2656
|
+
const cfg = requireAuth();
|
|
2657
|
+
const client = new HisaaboClient(cfg);
|
|
2658
|
+
const { from, to } = resolveRange(opts);
|
|
2659
|
+
try {
|
|
2660
|
+
const result = await client.reports.cashFlowStatement({ fromDate: from, toDate: to });
|
|
2661
|
+
if (opts.json) {
|
|
2662
|
+
outputJSON(result);
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
const r = result;
|
|
2666
|
+
console.log(`
|
|
2667
|
+
Cash Flow Statement ${from} \u2192 ${to}
|
|
2668
|
+
`);
|
|
2669
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
2670
|
+
`);
|
|
2671
|
+
const operating = String(r["operatingActivities"] ?? r["operations"] ?? "0");
|
|
2672
|
+
const investing = String(r["investingActivities"] ?? r["investing"] ?? "0");
|
|
2673
|
+
const financing = String(r["financingActivities"] ?? r["financing"] ?? "0");
|
|
2674
|
+
const net = String(r["netCashFlow"] ?? r["net"] ?? "0");
|
|
2675
|
+
console.log(` Operating Activities: ${formatAmount(operating).padStart(14)}`);
|
|
2676
|
+
console.log(` Investing Activities: ${formatAmount(investing).padStart(14)}`);
|
|
2677
|
+
console.log(` Financing Activities: ${formatAmount(financing).padStart(14)}`);
|
|
2678
|
+
console.log(` Net Cash Flow: ${formatAmount(net).padStart(14)}`);
|
|
2679
|
+
console.log();
|
|
2680
|
+
} catch (e) {
|
|
2681
|
+
if (e instanceof HisaaboApiError) {
|
|
2682
|
+
const err = e.hisaaboError;
|
|
2683
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
2684
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
2685
|
+
}
|
|
2686
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
async function reportGeneralLedgerCommand(accountId, opts) {
|
|
2690
|
+
const cfg = requireAuth();
|
|
2691
|
+
const client = new HisaaboClient(cfg);
|
|
2692
|
+
const { from, to } = resolveRange(opts);
|
|
2693
|
+
try {
|
|
2694
|
+
const result = await client.reports.generalLedger({ accountId, fromDate: from, toDate: to });
|
|
2695
|
+
if (opts.json) {
|
|
2696
|
+
outputJSON(result);
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
const r = result;
|
|
2700
|
+
const accountName = String(r["accountName"] ?? r["account"] ?? accountId);
|
|
2701
|
+
console.log(`
|
|
2702
|
+
General Ledger \u2014 ${accountName} ${from} \u2192 ${to}
|
|
2703
|
+
`);
|
|
2704
|
+
console.log(` ${"\u2550".repeat(75)}
|
|
2705
|
+
`);
|
|
2706
|
+
const opening = String(r["openingBalance"] ?? "0");
|
|
2707
|
+
console.log(` Opening Balance: ${formatAmount(opening).padStart(14)}
|
|
2708
|
+
`);
|
|
2709
|
+
const entries = Array.isArray(r["entries"]) ? r["entries"] : Array.isArray(r["rows"]) ? r["rows"] : [];
|
|
2710
|
+
for (const entry of entries) {
|
|
2711
|
+
const date = formatDate(String(entry["date"] ?? "")).padEnd(13);
|
|
2712
|
+
const narration = String(entry["narration"] ?? entry["description"] ?? "-").slice(0, 25).padEnd(25);
|
|
2713
|
+
const debit = parseFloat(String(entry["debit"] ?? "0")) !== 0 ? formatAmount(String(entry["debit"])) : "-";
|
|
2714
|
+
const credit = parseFloat(String(entry["credit"] ?? "0")) !== 0 ? formatAmount(String(entry["credit"])) : "-";
|
|
2715
|
+
const balance = formatAmount(String(entry["balance"] ?? "0"));
|
|
2716
|
+
console.log(` ${date} ${narration} ${debit.padStart(12)} ${credit.padStart(12)} ${balance.padStart(14)}`);
|
|
2717
|
+
}
|
|
2718
|
+
const closing = String(r["closingBalance"] ?? r["balance"] ?? "0");
|
|
2719
|
+
console.log(`
|
|
2720
|
+
Closing Balance: ${formatAmount(closing).padStart(14)}
|
|
2721
|
+
`);
|
|
2722
|
+
} catch (e) {
|
|
2723
|
+
if (e instanceof HisaaboApiError) {
|
|
2724
|
+
const err = e.hisaaboError;
|
|
2725
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
2726
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
2727
|
+
}
|
|
2728
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2517
2731
|
async function reportCollectionEfficiencyCommand(opts) {
|
|
2518
2732
|
const cfg = requireAuth();
|
|
2519
2733
|
const client = new HisaaboClient(cfg);
|
|
@@ -2586,6 +2800,18 @@ function registerReportCommands(program2) {
|
|
|
2586
2800
|
report.command("collection-efficiency").description("Collection efficiency metrics").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").option("--this-month", "Current month").option("--this-fy", "Current financial year").action(async (opts) => {
|
|
2587
2801
|
await reportCollectionEfficiencyCommand(opts);
|
|
2588
2802
|
});
|
|
2803
|
+
report.command("trial-balance").description("Trial balance report").option("--json", "JSON output").option("--to <date>", "As of date").option("--this-fy", "Current financial year").action(async (opts) => {
|
|
2804
|
+
await reportTrialBalanceCommand(opts);
|
|
2805
|
+
});
|
|
2806
|
+
report.command("balance-sheet").description("Balance sheet").option("--json", "JSON output").option("--to <date>", "As of date").option("--this-fy", "Current financial year").action(async (opts) => {
|
|
2807
|
+
await reportBalanceSheetCommand(opts);
|
|
2808
|
+
});
|
|
2809
|
+
report.command("cash-flow-statement").description("Cash flow statement (operating/investing/financing)").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").option("--this-fy", "Current financial year").action(async (opts) => {
|
|
2810
|
+
await reportCashFlowStatementCommand(opts);
|
|
2811
|
+
});
|
|
2812
|
+
report.command("general-ledger <accountId>").description("General ledger for a specific account").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").option("--this-fy", "Current financial year").action(async (accountId, opts) => {
|
|
2813
|
+
await reportGeneralLedgerCommand(accountId, opts);
|
|
2814
|
+
});
|
|
2589
2815
|
}
|
|
2590
2816
|
|
|
2591
2817
|
// src/commands/bank/index.ts
|
|
@@ -3221,11 +3447,11 @@ function registerTargetCommands(program2) {
|
|
|
3221
3447
|
function registerStoreCommands(program2) {
|
|
3222
3448
|
const store = program2.command("store").description("Online store management");
|
|
3223
3449
|
store.command("settings").description("Show store settings").option("--json", "JSON output").action(async (opts) => {
|
|
3224
|
-
const { storeSettingsCommand } = await import("./store-
|
|
3450
|
+
const { storeSettingsCommand } = await import("./store-FU7CEILC.js");
|
|
3225
3451
|
await storeSettingsCommand({ json: opts.json });
|
|
3226
3452
|
});
|
|
3227
3453
|
store.command("update-settings").description("Update store settings").option("--slug <slug>", "Store URL slug").option("--tagline <text>", "Store tagline / description").option("--enabled <bool>", "Enable or disable store (true/false)").option("--json", "JSON output").action(async (opts) => {
|
|
3228
|
-
const { storeUpdateSettingsCommand } = await import("./update-settings-
|
|
3454
|
+
const { storeUpdateSettingsCommand } = await import("./update-settings-EUC2FJQJ.js");
|
|
3229
3455
|
await storeUpdateSettingsCommand({
|
|
3230
3456
|
slug: opts.slug,
|
|
3231
3457
|
tagline: opts.tagline,
|
|
@@ -3234,11 +3460,11 @@ function registerStoreCommands(program2) {
|
|
|
3234
3460
|
});
|
|
3235
3461
|
});
|
|
3236
3462
|
store.command("items").description("List items available in the store").option("--json", "JSON output").option("--format <format>", "Output format: table, tsv, csv").action(async (opts) => {
|
|
3237
|
-
const { storeItemsCommand } = await import("./items-
|
|
3463
|
+
const { storeItemsCommand } = await import("./items-CHEFLI7C.js");
|
|
3238
3464
|
await storeItemsCommand({ json: opts.json, format: opts.format });
|
|
3239
3465
|
});
|
|
3240
3466
|
store.command("items-toggle").description("Bulk enable / disable store items").option("--enable <ids>", "Comma-separated item IDs to enable").option("--disable <ids>", "Comma-separated item IDs to disable").option("--json", "JSON output").action(async (opts) => {
|
|
3241
|
-
const { storeItemsToggleCommand } = await import("./items-toggle-
|
|
3467
|
+
const { storeItemsToggleCommand } = await import("./items-toggle-ETVCDCU6.js");
|
|
3242
3468
|
await storeItemsToggleCommand({
|
|
3243
3469
|
enable: opts.enable,
|
|
3244
3470
|
disable: opts.disable,
|
|
@@ -3246,7 +3472,7 @@ function registerStoreCommands(program2) {
|
|
|
3246
3472
|
});
|
|
3247
3473
|
});
|
|
3248
3474
|
store.command("orders").description("List store orders").option("--json", "JSON output").option("--status <status>", "Filter by order status").option("--page <n>", "Page number", parseInt).option("--limit <n>", "Items per page", parseInt).action(async (opts) => {
|
|
3249
|
-
const { storeOrdersCommand } = await import("./store-
|
|
3475
|
+
const { storeOrdersCommand } = await import("./store-FU7CEILC.js");
|
|
3250
3476
|
await storeOrdersCommand({
|
|
3251
3477
|
json: opts.json,
|
|
3252
3478
|
status: opts.status,
|
|
@@ -3255,15 +3481,15 @@ function registerStoreCommands(program2) {
|
|
|
3255
3481
|
});
|
|
3256
3482
|
});
|
|
3257
3483
|
store.command("order-get <id>").description("Get order details").option("--json", "JSON output").action(async (id, opts) => {
|
|
3258
|
-
const { storeOrderGetCommand } = await import("./order-get-
|
|
3484
|
+
const { storeOrderGetCommand } = await import("./order-get-ONWR4GTW.js");
|
|
3259
3485
|
await storeOrderGetCommand(id, { json: opts.json });
|
|
3260
3486
|
});
|
|
3261
3487
|
store.command("order-confirm <id>").description("Confirm a pending order").option("-y, --yes", "Skip confirmation prompt").option("--json", "JSON output").action(async (id, opts) => {
|
|
3262
|
-
const { storeOrderConfirmCommand } = await import("./order-confirm-
|
|
3488
|
+
const { storeOrderConfirmCommand } = await import("./order-confirm-6WMKTGPV.js");
|
|
3263
3489
|
await storeOrderConfirmCommand(id, { json: opts.json, yes: opts.yes });
|
|
3264
3490
|
});
|
|
3265
3491
|
store.command("order-cancel <id>").description("Cancel an order").option("-y, --yes", "Skip confirmation prompt").option("--reason <text>", "Cancellation reason").option("--json", "JSON output").action(async (id, opts) => {
|
|
3266
|
-
const { storeOrderCancelCommand } = await import("./order-cancel-
|
|
3492
|
+
const { storeOrderCancelCommand } = await import("./order-cancel-NOQDBL2N.js");
|
|
3267
3493
|
await storeOrderCancelCommand(id, {
|
|
3268
3494
|
json: opts.json,
|
|
3269
3495
|
yes: opts.yes,
|
|
@@ -3271,11 +3497,11 @@ function registerStoreCommands(program2) {
|
|
|
3271
3497
|
});
|
|
3272
3498
|
});
|
|
3273
3499
|
store.command("order-update <id>").description("Update order status").option("--status <status>", "New status: preparing, ready, delivered").option("--json", "JSON output").action(async (id, opts) => {
|
|
3274
|
-
const { storeOrderUpdateCommand } = await import("./order-update-
|
|
3500
|
+
const { storeOrderUpdateCommand } = await import("./order-update-IVO4AFGV.js");
|
|
3275
3501
|
await storeOrderUpdateCommand(id, { json: opts.json, status: opts.status });
|
|
3276
3502
|
});
|
|
3277
3503
|
store.command("check-slug <slug>").description("Check store slug availability").option("--json", "JSON output").action(async (slug, opts) => {
|
|
3278
|
-
const { storeCheckSlugCommand } = await import("./check-slug-
|
|
3504
|
+
const { storeCheckSlugCommand } = await import("./check-slug-OKW7KDYG.js");
|
|
3279
3505
|
await storeCheckSlugCommand(slug, { json: opts.json });
|
|
3280
3506
|
});
|
|
3281
3507
|
}
|
|
@@ -4042,23 +4268,23 @@ function registerBusinessCommands(program2) {
|
|
|
4042
4268
|
}
|
|
4043
4269
|
});
|
|
4044
4270
|
business.command("get").description("Show current business details").option("--json", "JSON output").action(async (opts) => {
|
|
4045
|
-
const { businessGetCommand } = await import("./get-
|
|
4271
|
+
const { businessGetCommand } = await import("./get-WUSYEMG4.js");
|
|
4046
4272
|
await businessGetCommand(opts);
|
|
4047
4273
|
});
|
|
4048
4274
|
business.command("update").description("Update business settings").option("--name <name>", "Business name").option("--gstin <gstin>", "GSTIN").option("--address <address>", "Address").option("--state <state>", "State").option("--phone <phone>", "Phone number").option("--email <email>", "Email address").option("--financial-year-start <month>", "Financial year start month (1\u201312)").option("--json", "JSON output").action(async (opts) => {
|
|
4049
|
-
const { businessUpdateCommand } = await import("./update-
|
|
4275
|
+
const { businessUpdateCommand } = await import("./update-OZPBIBME.js");
|
|
4050
4276
|
await businessUpdateCommand(opts);
|
|
4051
4277
|
});
|
|
4052
4278
|
business.command("sequence").description("Update invoice sequence number / prefix").requiredOption("--type <type>", "Document type: sale or purchase").option("--prefix <prefix>", "Invoice prefix (e.g. INV-)").option("--next-number <n>", "Next sequence number").option("--json", "JSON output").action(async (opts) => {
|
|
4053
|
-
const { businessSequenceCommand } = await import("./sequence-
|
|
4279
|
+
const { businessSequenceCommand } = await import("./sequence-LK6QLSI5.js");
|
|
4054
4280
|
await businessSequenceCommand(opts);
|
|
4055
4281
|
});
|
|
4056
4282
|
business.command("audit-trail").description("View audit log for this business").option("--page <n>", "Page number", "1").option("--limit <n>", "Results per page", "25").option("--json", "JSON output").option("--format <fmt>", "Output format: table, tsv, csv").action(async (opts) => {
|
|
4057
|
-
const { businessAuditTrailCommand } = await import("./audit-trail-
|
|
4283
|
+
const { businessAuditTrailCommand } = await import("./audit-trail-4AMEFQGB.js");
|
|
4058
4284
|
await businessAuditTrailCommand(opts);
|
|
4059
4285
|
});
|
|
4060
4286
|
business.command("export").description("Export all business data").option("--yes", "Skip confirmation prompt").option("--json", "JSON output").action(async (opts) => {
|
|
4061
|
-
const { businessExportCommand } = await import("./export-
|
|
4287
|
+
const { businessExportCommand } = await import("./export-UHZISG7H.js");
|
|
4062
4288
|
await businessExportCommand(opts);
|
|
4063
4289
|
});
|
|
4064
4290
|
business.command("switch").description("Switch active business").option("--json", "JSON output").action(async (opts) => {
|
|
@@ -4140,28 +4366,28 @@ function registerDocumentCommands(program2) {
|
|
|
4140
4366
|
for (const dt of DOC_TYPES) {
|
|
4141
4367
|
const parent = program2.command(dt.cmd).description(`${dt.label} management`);
|
|
4142
4368
|
parent.command("list").description(`List ${dt.label.toLowerCase()}s`).option("--json", "JSON output").option("--format <format>", "Output format: table, tsv, csv, ids").option("--status <status>", `Filter by status: ${dt.statuses.join(", ")}`).option("--party <search>", "Filter by party name").option("--from <date>", "Start date (YYYY-MM-DD)").option("--to <date>", "End date (YYYY-MM-DD)").option("--this-month", "Current month").option("--this-fy", "Current financial year").option("--page <n>", "Page number", parseInt).option("--limit <n>", "Items per page", parseInt).action(async (opts) => {
|
|
4143
|
-
const { docListCommand } = await import("./factory-
|
|
4369
|
+
const { docListCommand } = await import("./factory-OBESY2LG.js");
|
|
4144
4370
|
await docListCommand(dt, opts);
|
|
4145
4371
|
});
|
|
4146
4372
|
parent.command("get <id>").description(`Get ${dt.label.toLowerCase()} details`).option("--json", "JSON output").action(async (id, opts) => {
|
|
4147
|
-
const { docGetCommand } = await import("./factory-
|
|
4373
|
+
const { docGetCommand } = await import("./factory-OBESY2LG.js");
|
|
4148
4374
|
await docGetCommand(dt, id, opts);
|
|
4149
4375
|
});
|
|
4150
4376
|
parent.command("create").description(`Create a new ${dt.label.toLowerCase()}`).option("--json", "JSON output").option("--party-id <id>", "Party UUID").option("--party <name>", "Party search name").option("--date <date>", "Document date (YYYY-MM-DD)").option("--due-date <date>", "Due date (YYYY-MM-DD)").option("--item <desc>", "Item description (repeatable)", (v, a) => [...a, v], []).option("--qty <n>", "Quantity per item (repeatable)", (v, a) => [...a, v], []).option("--rate <n>", "Rate per item (repeatable)", (v, a) => [...a, v], []).option("--notes <text>", "Notes").option("--discount <pct>", "Discount percent").option("-y, --yes", "Skip confirmation").action(async (opts) => {
|
|
4151
|
-
const { docCreateCommand } = await import("./factory-
|
|
4377
|
+
const { docCreateCommand } = await import("./factory-OBESY2LG.js");
|
|
4152
4378
|
await docCreateCommand(dt, opts);
|
|
4153
4379
|
});
|
|
4154
4380
|
parent.command("update-status <id> <status>").description(`Update ${dt.label.toLowerCase()} status (${dt.statuses.join(", ")})`).option("--json", "JSON output").action(async (id, status, opts) => {
|
|
4155
|
-
const { docStatusCommand } = await import("./factory-
|
|
4381
|
+
const { docStatusCommand } = await import("./factory-OBESY2LG.js");
|
|
4156
4382
|
await docStatusCommand(dt, id, status, opts);
|
|
4157
4383
|
});
|
|
4158
4384
|
parent.command("delete <id>").description(`Delete a ${dt.label.toLowerCase()}`).option("-y, --yes", "Skip confirmation").option("--json", "JSON output").action(async (id, opts) => {
|
|
4159
|
-
const { docDeleteCommand } = await import("./factory-
|
|
4385
|
+
const { docDeleteCommand } = await import("./factory-OBESY2LG.js");
|
|
4160
4386
|
await docDeleteCommand(dt, id, opts);
|
|
4161
4387
|
});
|
|
4162
4388
|
}
|
|
4163
4389
|
program2.command("document").description("Document conversion operations").command("convert").description("Convert one document type to another").requiredOption("--from-type <type>", "Source type (quotation, proforma, delivery-challan, etc.)").requiredOption("--from-id <id>", "Source document ID").requiredOption("--to-type <type>", "Target type (invoice, credit-note, etc.)").option("--json", "JSON output").option("-y, --yes", "Skip confirmation").action(async (opts) => {
|
|
4164
|
-
const { HisaaboClient: HisaaboClient2, HisaaboApiError: HisaaboApiError2 } = await import("./client-
|
|
4390
|
+
const { HisaaboClient: HisaaboClient2, HisaaboApiError: HisaaboApiError2 } = await import("./client-2ZKMLWI6.js");
|
|
4165
4391
|
const { requireAuth: requireAuth2 } = await import("./config-335MN4I7.js");
|
|
4166
4392
|
const { fatalError: fatalError2, outputJSON: outputJSON2, success: success2, EXIT: EXIT2 } = await import("./output-NUOL7KJW.js");
|
|
4167
4393
|
const cfg = requireAuth2();
|
|
@@ -4214,31 +4440,31 @@ function registerDocumentCommands(program2) {
|
|
|
4214
4440
|
function registerTenantCommands(program2) {
|
|
4215
4441
|
const tenant = program2.command("tenant").description("Tenant / workspace management");
|
|
4216
4442
|
tenant.command("list").description("List tenants / organizations you belong to").option("--json", "JSON output").action(async (opts) => {
|
|
4217
|
-
const { tenantListCommand } = await import("./list-
|
|
4443
|
+
const { tenantListCommand } = await import("./list-RJ34MFPR.js");
|
|
4218
4444
|
await tenantListCommand({ json: opts.json });
|
|
4219
4445
|
});
|
|
4220
4446
|
tenant.command("members").description("List members of the current tenant").option("--json", "JSON output").option("--format <format>", "Output format: table, tsv, csv").action(async (opts) => {
|
|
4221
|
-
const { tenantMembersCommand } = await import("./members-
|
|
4447
|
+
const { tenantMembersCommand } = await import("./members-TE5K5NQC.js");
|
|
4222
4448
|
await tenantMembersCommand({ json: opts.json, format: opts.format });
|
|
4223
4449
|
});
|
|
4224
4450
|
tenant.command("invite <email>").description("Invite a user to the tenant").option("--role <role>", "Role: admin, seller_manager, seller, accountant (default: seller)").option("--json", "JSON output").action(async (email, opts) => {
|
|
4225
|
-
const { tenantInviteCommand } = await import("./invite-
|
|
4451
|
+
const { tenantInviteCommand } = await import("./invite-5S4GJKRF.js");
|
|
4226
4452
|
await tenantInviteCommand(email, { role: opts.role, json: opts.json });
|
|
4227
4453
|
});
|
|
4228
4454
|
tenant.command("remove <userId>").description("Remove a member from the tenant").option("-y, --yes", "Skip confirmation").option("--json", "JSON output").action(async (userId, opts) => {
|
|
4229
|
-
const { tenantRemoveCommand } = await import("./remove-
|
|
4455
|
+
const { tenantRemoveCommand } = await import("./remove-DJBOOOR4.js");
|
|
4230
4456
|
await tenantRemoveCommand(userId, { yes: opts.yes, json: opts.json });
|
|
4231
4457
|
});
|
|
4232
4458
|
tenant.command("update-role <userId> <role>").description("Update a member's role (admin, seller_manager, seller, accountant)").option("--json", "JSON output").action(async (userId, role, opts) => {
|
|
4233
|
-
const { tenantUpdateRoleCommand } = await import("./update-role-
|
|
4459
|
+
const { tenantUpdateRoleCommand } = await import("./update-role-RB35QIA5.js");
|
|
4234
4460
|
await tenantUpdateRoleCommand(userId, role, { json: opts.json });
|
|
4235
4461
|
});
|
|
4236
4462
|
tenant.command("invitations").description("List pending invitations").option("--json", "JSON output").action(async (opts) => {
|
|
4237
|
-
const { listInvitationsCommand } = await import("./invitations-
|
|
4463
|
+
const { listInvitationsCommand } = await import("./invitations-U4ZNYWY7.js");
|
|
4238
4464
|
await listInvitationsCommand(opts);
|
|
4239
4465
|
});
|
|
4240
4466
|
tenant.command("revoke-invitation <invitationId>").description("Revoke a pending invitation").option("--json", "JSON output").action(async (invitationId, opts) => {
|
|
4241
|
-
const { revokeInvitationCommand } = await import("./revoke-invitation-
|
|
4467
|
+
const { revokeInvitationCommand } = await import("./revoke-invitation-ZGLJHYNB.js");
|
|
4242
4468
|
await revokeInvitationCommand(invitationId, opts);
|
|
4243
4469
|
});
|
|
4244
4470
|
}
|
|
@@ -4247,15 +4473,15 @@ function registerTenantCommands(program2) {
|
|
|
4247
4473
|
function registerApiKeyCommands(program2) {
|
|
4248
4474
|
const apiKey = program2.command("api-key").alias("key").description("API key management");
|
|
4249
4475
|
apiKey.command("list").description("List all API keys").option("--json", "JSON output").option("--format <fmt>", "Output format: table, tsv, csv").action(async (opts) => {
|
|
4250
|
-
const { apiKeyListCommand } = await import("./list-
|
|
4476
|
+
const { apiKeyListCommand } = await import("./list-3FO4UJKC.js");
|
|
4251
4477
|
await apiKeyListCommand(opts);
|
|
4252
4478
|
});
|
|
4253
4479
|
apiKey.command("create").description("Create a new API key").requiredOption("--name <name>", "Name / label for this key").option("--json", "JSON output").action(async (opts) => {
|
|
4254
|
-
const { apiKeyCreateCommand } = await import("./create-
|
|
4480
|
+
const { apiKeyCreateCommand } = await import("./create-AS2YVGRA.js");
|
|
4255
4481
|
await apiKeyCreateCommand(opts);
|
|
4256
4482
|
});
|
|
4257
4483
|
apiKey.command("revoke <id>").description("Revoke an API key by ID").option("--yes", "Skip confirmation prompt").option("--json", "JSON output").action(async (id, opts) => {
|
|
4258
|
-
const { apiKeyRevokeCommand } = await import("./revoke-
|
|
4484
|
+
const { apiKeyRevokeCommand } = await import("./revoke-WRIK7HLY.js");
|
|
4259
4485
|
await apiKeyRevokeCommand(id, opts);
|
|
4260
4486
|
});
|
|
4261
4487
|
}
|
|
@@ -4264,22 +4490,628 @@ function registerApiKeyCommands(program2) {
|
|
|
4264
4490
|
function registerSessionCommands(program2) {
|
|
4265
4491
|
const session = program2.command("session").description("Manage active sessions");
|
|
4266
4492
|
session.command("list").description("List active sessions").option("--expired", "Show expired sessions instead").option("--json", "JSON output").action(async (opts) => {
|
|
4267
|
-
const { listSessionsCommand } = await import("./list-
|
|
4493
|
+
const { listSessionsCommand } = await import("./list-LQJGTZB4.js");
|
|
4268
4494
|
await listSessionsCommand(opts);
|
|
4269
4495
|
});
|
|
4270
4496
|
session.command("revoke <sessionId>").description("Revoke a specific session").option("--json", "JSON output").action(async (sessionId, opts) => {
|
|
4271
|
-
const { revokeSessionCommand } = await import("./revoke-
|
|
4497
|
+
const { revokeSessionCommand } = await import("./revoke-5L5GZ4ZZ.js");
|
|
4272
4498
|
await revokeSessionCommand(sessionId, opts);
|
|
4273
4499
|
});
|
|
4274
4500
|
session.command("revoke-all").description("Sign out from all devices").action(async () => {
|
|
4275
|
-
const { revokeAllSessionsCommand } = await import("./revoke-all-
|
|
4501
|
+
const { revokeAllSessionsCommand } = await import("./revoke-all-QARW2G6R.js");
|
|
4276
4502
|
await revokeAllSessionsCommand();
|
|
4277
4503
|
});
|
|
4278
4504
|
}
|
|
4279
4505
|
|
|
4506
|
+
// src/commands/journal/index.ts
|
|
4507
|
+
function handleError(e) {
|
|
4508
|
+
if (e instanceof HisaaboApiError) {
|
|
4509
|
+
const err = e.hisaaboError;
|
|
4510
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
4511
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
4512
|
+
}
|
|
4513
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
4514
|
+
}
|
|
4515
|
+
async function journalListCommand(opts) {
|
|
4516
|
+
const cfg = requireAuth();
|
|
4517
|
+
const client = new HisaaboClient(cfg);
|
|
4518
|
+
try {
|
|
4519
|
+
const result = await client.journal.list({
|
|
4520
|
+
page: opts.page ?? 1,
|
|
4521
|
+
limit: opts.limit ?? 25,
|
|
4522
|
+
fromDate: opts.from,
|
|
4523
|
+
toDate: opts.to
|
|
4524
|
+
});
|
|
4525
|
+
if (opts.json) {
|
|
4526
|
+
outputJSON(result);
|
|
4527
|
+
return;
|
|
4528
|
+
}
|
|
4529
|
+
const entries = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : [];
|
|
4530
|
+
console.log(`
|
|
4531
|
+
Journal Entries
|
|
4532
|
+
`);
|
|
4533
|
+
console.log(` ${"\u2550".repeat(70)}
|
|
4534
|
+
`);
|
|
4535
|
+
if (entries.length === 0) {
|
|
4536
|
+
console.log(" No journal entries found.\n");
|
|
4537
|
+
return;
|
|
4538
|
+
}
|
|
4539
|
+
for (const entry of entries) {
|
|
4540
|
+
const date = formatDate(String(entry["date"] ?? entry["journalDate"] ?? ""));
|
|
4541
|
+
const number = String(entry["number"] ?? entry["voucherNumber"] ?? "-");
|
|
4542
|
+
const narration = String(entry["narration"] ?? entry["description"] ?? "").slice(0, 40);
|
|
4543
|
+
const status = String(entry["status"] ?? "").padEnd(8);
|
|
4544
|
+
console.log(` ${date.padEnd(13)} ${number.padEnd(14)} ${status} ${narration}`);
|
|
4545
|
+
}
|
|
4546
|
+
console.log();
|
|
4547
|
+
} catch (e) {
|
|
4548
|
+
handleError(e);
|
|
4549
|
+
}
|
|
4550
|
+
}
|
|
4551
|
+
async function journalGetCommand(id, opts) {
|
|
4552
|
+
const cfg = requireAuth();
|
|
4553
|
+
const client = new HisaaboClient(cfg);
|
|
4554
|
+
try {
|
|
4555
|
+
const result = await client.journal.getById(id);
|
|
4556
|
+
if (opts.json) {
|
|
4557
|
+
outputJSON(result);
|
|
4558
|
+
return;
|
|
4559
|
+
}
|
|
4560
|
+
const r = result;
|
|
4561
|
+
console.log(`
|
|
4562
|
+
Journal Entry \u2014 ${String(r["number"] ?? r["voucherNumber"] ?? id)}
|
|
4563
|
+
`);
|
|
4564
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
4565
|
+
`);
|
|
4566
|
+
console.log(` Date: ${formatDate(String(r["date"] ?? r["journalDate"] ?? ""))}`);
|
|
4567
|
+
console.log(` Narration: ${String(r["narration"] ?? r["description"] ?? "-")}`);
|
|
4568
|
+
console.log(` Status: ${String(r["status"] ?? "-")}`);
|
|
4569
|
+
console.log();
|
|
4570
|
+
const lines = r["lines"] ?? r["entries"] ?? r["lineItems"];
|
|
4571
|
+
if (lines && Array.isArray(lines)) {
|
|
4572
|
+
console.log(" Lines:\n");
|
|
4573
|
+
for (const line of lines) {
|
|
4574
|
+
const account = String(line["accountName"] ?? line["account"] ?? "-").padEnd(28);
|
|
4575
|
+
const debit = String(line["debit"] ?? "0");
|
|
4576
|
+
const credit = String(line["credit"] ?? "0");
|
|
4577
|
+
console.log(` ${account} Dr: ${debit.padStart(12)} Cr: ${credit.padStart(12)}`);
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
console.log();
|
|
4581
|
+
} catch (e) {
|
|
4582
|
+
handleError(e);
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
async function journalVoidCommand(id, opts) {
|
|
4586
|
+
const cfg = requireAuth();
|
|
4587
|
+
const client = new HisaaboClient(cfg);
|
|
4588
|
+
try {
|
|
4589
|
+
const result = await client.journal.void(id);
|
|
4590
|
+
if (opts.json) {
|
|
4591
|
+
outputJSON(result);
|
|
4592
|
+
return;
|
|
4593
|
+
}
|
|
4594
|
+
console.log(` Journal entry ${id} voided.
|
|
4595
|
+
`);
|
|
4596
|
+
} catch (e) {
|
|
4597
|
+
handleError(e);
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
async function journalTemplatesCommand(opts) {
|
|
4601
|
+
const cfg = requireAuth();
|
|
4602
|
+
const client = new HisaaboClient(cfg);
|
|
4603
|
+
try {
|
|
4604
|
+
const result = await client.journal.templateList();
|
|
4605
|
+
if (opts.json) {
|
|
4606
|
+
outputJSON(result);
|
|
4607
|
+
return;
|
|
4608
|
+
}
|
|
4609
|
+
const templates = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : [];
|
|
4610
|
+
console.log(`
|
|
4611
|
+
Journal Templates
|
|
4612
|
+
`);
|
|
4613
|
+
console.log(` ${"\u2550".repeat(50)}
|
|
4614
|
+
`);
|
|
4615
|
+
if (templates.length === 0) {
|
|
4616
|
+
console.log(" No templates found.\n");
|
|
4617
|
+
return;
|
|
4618
|
+
}
|
|
4619
|
+
for (const t of templates) {
|
|
4620
|
+
const id = String(t["id"] ?? "-").slice(0, 8);
|
|
4621
|
+
const name = String(t["name"] ?? "-").padEnd(30);
|
|
4622
|
+
console.log(` ${id} ${name}`);
|
|
4623
|
+
}
|
|
4624
|
+
console.log();
|
|
4625
|
+
} catch (e) {
|
|
4626
|
+
handleError(e);
|
|
4627
|
+
}
|
|
4628
|
+
}
|
|
4629
|
+
|
|
4630
|
+
// src/bin/registrars/journal.ts
|
|
4631
|
+
function registerJournalCommands(program2) {
|
|
4632
|
+
const journal = program2.command("journal").description("Journal entries and templates");
|
|
4633
|
+
journal.command("list").description("List journal entries").option("--json", "JSON output").option("--page <n>", "Page number", parseInt).option("--limit <n>", "Results per page", parseInt).option("--from <date>", "From date").option("--to <date>", "To date").action(async (opts) => {
|
|
4634
|
+
await journalListCommand(opts);
|
|
4635
|
+
});
|
|
4636
|
+
journal.command("get <id>").description("Get journal entry details").option("--json", "JSON output").action(async (id, opts) => {
|
|
4637
|
+
await journalGetCommand(id, { json: opts.json });
|
|
4638
|
+
});
|
|
4639
|
+
journal.command("void <id>").description("Void a journal entry").option("--json", "JSON output").action(async (id, opts) => {
|
|
4640
|
+
await journalVoidCommand(id, { json: opts.json });
|
|
4641
|
+
});
|
|
4642
|
+
journal.command("templates").description("List journal entry templates").option("--json", "JSON output").action(async (opts) => {
|
|
4643
|
+
await journalTemplatesCommand({ json: opts.json });
|
|
4644
|
+
});
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
// src/commands/itc/index.ts
|
|
4648
|
+
function handleError2(e) {
|
|
4649
|
+
if (e instanceof HisaaboApiError) {
|
|
4650
|
+
const err = e.hisaaboError;
|
|
4651
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
4652
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
4653
|
+
}
|
|
4654
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
4655
|
+
}
|
|
4656
|
+
async function itcDashboardCommand(opts) {
|
|
4657
|
+
const cfg = requireAuth();
|
|
4658
|
+
const client = new HisaaboClient(cfg);
|
|
4659
|
+
try {
|
|
4660
|
+
const result = await client.itc.dashboard({ fromDate: opts.from, toDate: opts.to });
|
|
4661
|
+
if (opts.json) {
|
|
4662
|
+
outputJSON(result);
|
|
4663
|
+
return;
|
|
4664
|
+
}
|
|
4665
|
+
const r = result;
|
|
4666
|
+
console.log("\n ITC Dashboard\n");
|
|
4667
|
+
console.log(` ${"\u2550".repeat(50)}
|
|
4668
|
+
`);
|
|
4669
|
+
const eligible = String(r["totalEligible"] ?? r["eligible"] ?? "0");
|
|
4670
|
+
const blocked = String(r["totalBlocked"] ?? r["blocked"] ?? "0");
|
|
4671
|
+
const utilized = String(r["totalUtilized"] ?? r["utilized"] ?? "0");
|
|
4672
|
+
const available = String(r["availableBalance"] ?? r["available"] ?? "0");
|
|
4673
|
+
console.log(` Eligible ITC: ${formatAmount(eligible).padStart(14)}`);
|
|
4674
|
+
console.log(` Blocked ITC: ${formatAmount(blocked).padStart(14)}`);
|
|
4675
|
+
console.log(` Utilized ITC: ${formatAmount(utilized).padStart(14)}`);
|
|
4676
|
+
console.log(` Available Balance:${formatAmount(available).padStart(14)}`);
|
|
4677
|
+
console.log();
|
|
4678
|
+
} catch (e) {
|
|
4679
|
+
handleError2(e);
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
async function itcLedgerCommand(opts) {
|
|
4683
|
+
const cfg = requireAuth();
|
|
4684
|
+
const client = new HisaaboClient(cfg);
|
|
4685
|
+
try {
|
|
4686
|
+
const result = await client.itc.ledger({ fromDate: opts.from, toDate: opts.to });
|
|
4687
|
+
if (opts.json) {
|
|
4688
|
+
outputJSON(result);
|
|
4689
|
+
return;
|
|
4690
|
+
}
|
|
4691
|
+
const entries = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : Array.isArray(result?.entries) ? result.entries : [];
|
|
4692
|
+
console.log("\n ITC Ledger\n");
|
|
4693
|
+
console.log(` ${"\u2550".repeat(70)}
|
|
4694
|
+
`);
|
|
4695
|
+
for (const entry of entries) {
|
|
4696
|
+
const date = String(entry["date"] ?? "-").slice(0, 10);
|
|
4697
|
+
const supplier = String(entry["supplierName"] ?? entry["supplier"] ?? "-").padEnd(22);
|
|
4698
|
+
const gstin = String(entry["gstin"] ?? "-").padEnd(16);
|
|
4699
|
+
const igst = formatAmount(String(entry["igst"] ?? "0")).padStart(12);
|
|
4700
|
+
const cgst = formatAmount(String(entry["cgst"] ?? "0")).padStart(12);
|
|
4701
|
+
const sgst = formatAmount(String(entry["sgst"] ?? "0")).padStart(12);
|
|
4702
|
+
console.log(` ${date.padEnd(12)} ${supplier} ${gstin} IGST:${igst} CGST:${cgst} SGST:${sgst}`);
|
|
4703
|
+
}
|
|
4704
|
+
console.log();
|
|
4705
|
+
} catch (e) {
|
|
4706
|
+
handleError2(e);
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
async function itcAgingCommand(opts) {
|
|
4710
|
+
const cfg = requireAuth();
|
|
4711
|
+
const client = new HisaaboClient(cfg);
|
|
4712
|
+
try {
|
|
4713
|
+
const result = await client.itc.agingAlerts();
|
|
4714
|
+
if (opts.json) {
|
|
4715
|
+
outputJSON(result);
|
|
4716
|
+
return;
|
|
4717
|
+
}
|
|
4718
|
+
const alerts = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : Array.isArray(result?.alerts) ? result.alerts : [];
|
|
4719
|
+
console.log("\n ITC Aging Alerts\n");
|
|
4720
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
4721
|
+
`);
|
|
4722
|
+
if (alerts.length === 0) {
|
|
4723
|
+
console.log(" No aging alerts.\n");
|
|
4724
|
+
return;
|
|
4725
|
+
}
|
|
4726
|
+
for (const alert of alerts) {
|
|
4727
|
+
const supplier = String(alert["supplierName"] ?? alert["supplier"] ?? "-").padEnd(25);
|
|
4728
|
+
const amount = formatAmount(String(alert["amount"] ?? "0")).padStart(14);
|
|
4729
|
+
const days = String(alert["daysOld"] ?? alert["age"] ?? "-").padStart(6);
|
|
4730
|
+
console.log(` ${supplier} ${amount} ${days} days`);
|
|
4731
|
+
}
|
|
4732
|
+
console.log();
|
|
4733
|
+
} catch (e) {
|
|
4734
|
+
handleError2(e);
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4737
|
+
async function itcBlockCommand(invoiceId, opts) {
|
|
4738
|
+
const cfg = requireAuth();
|
|
4739
|
+
const client = new HisaaboClient(cfg);
|
|
4740
|
+
try {
|
|
4741
|
+
const result = await client.itc.markBlocked({ invoiceId });
|
|
4742
|
+
if (opts.json) {
|
|
4743
|
+
outputJSON(result);
|
|
4744
|
+
return;
|
|
4745
|
+
}
|
|
4746
|
+
console.log(` ITC for invoice ${invoiceId} marked as blocked.
|
|
4747
|
+
`);
|
|
4748
|
+
} catch (e) {
|
|
4749
|
+
handleError2(e);
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
async function itcUnblockCommand(invoiceId, opts) {
|
|
4753
|
+
const cfg = requireAuth();
|
|
4754
|
+
const client = new HisaaboClient(cfg);
|
|
4755
|
+
try {
|
|
4756
|
+
const result = await client.itc.markEligible({ invoiceId });
|
|
4757
|
+
if (opts.json) {
|
|
4758
|
+
outputJSON(result);
|
|
4759
|
+
return;
|
|
4760
|
+
}
|
|
4761
|
+
console.log(` ITC for invoice ${invoiceId} marked as eligible.
|
|
4762
|
+
`);
|
|
4763
|
+
} catch (e) {
|
|
4764
|
+
handleError2(e);
|
|
4765
|
+
}
|
|
4766
|
+
}
|
|
4767
|
+
|
|
4768
|
+
// src/bin/registrars/itc.ts
|
|
4769
|
+
function registerItcCommands(program2) {
|
|
4770
|
+
const itc = program2.command("itc").description("Input Tax Credit tracking");
|
|
4771
|
+
itc.command("dashboard").description("ITC summary dashboard").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").action(async (opts) => {
|
|
4772
|
+
await itcDashboardCommand(opts);
|
|
4773
|
+
});
|
|
4774
|
+
itc.command("ledger").description("ITC ledger \u2014 all eligible purchase credits").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").action(async (opts) => {
|
|
4775
|
+
await itcLedgerCommand(opts);
|
|
4776
|
+
});
|
|
4777
|
+
itc.command("aging").description("ITC aging alerts \u2014 credits at risk of reversal").option("--json", "JSON output").action(async (opts) => {
|
|
4778
|
+
await itcAgingCommand({ json: opts.json });
|
|
4779
|
+
});
|
|
4780
|
+
itc.command("block <invoiceId>").description("Mark ITC for an invoice as blocked").option("--json", "JSON output").action(async (invoiceId, opts) => {
|
|
4781
|
+
await itcBlockCommand(invoiceId, { json: opts.json });
|
|
4782
|
+
});
|
|
4783
|
+
itc.command("unblock <invoiceId>").description("Mark ITC for an invoice as eligible").option("--json", "JSON output").action(async (invoiceId, opts) => {
|
|
4784
|
+
await itcUnblockCommand(invoiceId, { json: opts.json });
|
|
4785
|
+
});
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
// src/commands/bank-recon/index.ts
|
|
4789
|
+
function handleError3(e) {
|
|
4790
|
+
if (e instanceof HisaaboApiError) {
|
|
4791
|
+
const err = e.hisaaboError;
|
|
4792
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
4793
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
4794
|
+
}
|
|
4795
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
4796
|
+
}
|
|
4797
|
+
async function bankReconImportsCommand(opts) {
|
|
4798
|
+
const cfg = requireAuth();
|
|
4799
|
+
const client = new HisaaboClient(cfg);
|
|
4800
|
+
try {
|
|
4801
|
+
const result = await client.bankRecon.importList();
|
|
4802
|
+
if (opts.json) {
|
|
4803
|
+
outputJSON(result);
|
|
4804
|
+
return;
|
|
4805
|
+
}
|
|
4806
|
+
const imports = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : [];
|
|
4807
|
+
console.log("\n Bank Reconciliation Imports\n");
|
|
4808
|
+
console.log(` ${"\u2550".repeat(65)}
|
|
4809
|
+
`);
|
|
4810
|
+
if (imports.length === 0) {
|
|
4811
|
+
console.log(" No imports found.\n");
|
|
4812
|
+
return;
|
|
4813
|
+
}
|
|
4814
|
+
for (const imp of imports) {
|
|
4815
|
+
const id = String(imp["id"] ?? "-").slice(0, 8);
|
|
4816
|
+
const date = formatDate(String(imp["createdAt"] ?? imp["importDate"] ?? ""));
|
|
4817
|
+
const account = String(imp["accountName"] ?? imp["bankAccount"] ?? "-").padEnd(20);
|
|
4818
|
+
const lines = String(imp["totalLines"] ?? imp["lineCount"] ?? "-").padStart(6);
|
|
4819
|
+
const matched = String(imp["matchedLines"] ?? imp["matched"] ?? "-").padStart(8);
|
|
4820
|
+
const status = String(imp["status"] ?? "-").padEnd(10);
|
|
4821
|
+
console.log(` ${id} ${date.padEnd(13)} ${account} Lines:${lines} Matched:${matched} ${status}`);
|
|
4822
|
+
}
|
|
4823
|
+
console.log();
|
|
4824
|
+
} catch (e) {
|
|
4825
|
+
handleError3(e);
|
|
4826
|
+
}
|
|
4827
|
+
}
|
|
4828
|
+
async function bankReconSummaryCommand(importId, opts) {
|
|
4829
|
+
const cfg = requireAuth();
|
|
4830
|
+
const client = new HisaaboClient(cfg);
|
|
4831
|
+
try {
|
|
4832
|
+
const result = await client.bankRecon.summary(importId);
|
|
4833
|
+
if (opts.json) {
|
|
4834
|
+
outputJSON(result);
|
|
4835
|
+
return;
|
|
4836
|
+
}
|
|
4837
|
+
const r = result;
|
|
4838
|
+
console.log(`
|
|
4839
|
+
Bank Recon Summary \u2014 ${importId}
|
|
4840
|
+
`);
|
|
4841
|
+
console.log(` ${"\u2550".repeat(55)}
|
|
4842
|
+
`);
|
|
4843
|
+
const total = String(r["totalLines"] ?? r["total"] ?? "0");
|
|
4844
|
+
const matched = String(r["matchedLines"] ?? r["matched"] ?? "0");
|
|
4845
|
+
const unmatched = String(r["unmatchedLines"] ?? r["unmatched"] ?? "0");
|
|
4846
|
+
const ignored = String(r["ignoredLines"] ?? r["ignored"] ?? "0");
|
|
4847
|
+
const openingBalance = String(r["openingBalance"] ?? "0");
|
|
4848
|
+
const closingBalance = String(r["closingBalance"] ?? "0");
|
|
4849
|
+
console.log(` Total Lines: ${total.padStart(8)}`);
|
|
4850
|
+
console.log(` Matched: ${matched.padStart(8)}`);
|
|
4851
|
+
console.log(` Unmatched: ${unmatched.padStart(8)}`);
|
|
4852
|
+
console.log(` Ignored: ${ignored.padStart(8)}`);
|
|
4853
|
+
console.log(` Opening Balance: ${formatAmount(openingBalance).padStart(14)}`);
|
|
4854
|
+
console.log(` Closing Balance: ${formatAmount(closingBalance).padStart(14)}`);
|
|
4855
|
+
console.log();
|
|
4856
|
+
} catch (e) {
|
|
4857
|
+
handleError3(e);
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
async function bankReconRulesCommand(opts) {
|
|
4861
|
+
const cfg = requireAuth();
|
|
4862
|
+
const client = new HisaaboClient(cfg);
|
|
4863
|
+
try {
|
|
4864
|
+
const result = await client.bankRecon.ruleList();
|
|
4865
|
+
if (opts.json) {
|
|
4866
|
+
outputJSON(result);
|
|
4867
|
+
return;
|
|
4868
|
+
}
|
|
4869
|
+
const rules = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : [];
|
|
4870
|
+
console.log("\n Bank Recon Rules\n");
|
|
4871
|
+
console.log(` ${"\u2550".repeat(60)}
|
|
4872
|
+
`);
|
|
4873
|
+
if (rules.length === 0) {
|
|
4874
|
+
console.log(" No rules configured.\n");
|
|
4875
|
+
return;
|
|
4876
|
+
}
|
|
4877
|
+
for (const rule of rules) {
|
|
4878
|
+
const id = String(rule["id"] ?? "-").slice(0, 8);
|
|
4879
|
+
const name = String(rule["name"] ?? "-").padEnd(25);
|
|
4880
|
+
const condition = String(rule["condition"] ?? rule["matchPattern"] ?? "-").padEnd(20);
|
|
4881
|
+
const action = String(rule["action"] ?? "-").padEnd(12);
|
|
4882
|
+
console.log(` ${id} ${name} ${condition} ${action}`);
|
|
4883
|
+
}
|
|
4884
|
+
console.log();
|
|
4885
|
+
} catch (e) {
|
|
4886
|
+
handleError3(e);
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
// src/bin/registrars/bank-recon.ts
|
|
4891
|
+
function registerBankReconCommands(program2) {
|
|
4892
|
+
const bankRecon = program2.command("bank-recon").description("Bank reconciliation");
|
|
4893
|
+
bankRecon.command("imports").description("List bank statement imports").option("--json", "JSON output").action(async (opts) => {
|
|
4894
|
+
await bankReconImportsCommand({ json: opts.json });
|
|
4895
|
+
});
|
|
4896
|
+
bankRecon.command("summary <importId>").description("Summary for a bank statement import").option("--json", "JSON output").action(async (importId, opts) => {
|
|
4897
|
+
await bankReconSummaryCommand(importId, { json: opts.json });
|
|
4898
|
+
});
|
|
4899
|
+
bankRecon.command("rules").description("List auto-matching rules").option("--json", "JSON output").action(async (opts) => {
|
|
4900
|
+
await bankReconRulesCommand({ json: opts.json });
|
|
4901
|
+
});
|
|
4902
|
+
}
|
|
4903
|
+
|
|
4904
|
+
// src/commands/einvoice/index.ts
|
|
4905
|
+
function handleError4(e) {
|
|
4906
|
+
if (e instanceof HisaaboApiError) {
|
|
4907
|
+
const err = e.hisaaboError;
|
|
4908
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
4909
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
4910
|
+
}
|
|
4911
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
4912
|
+
}
|
|
4913
|
+
async function eInvoiceDashboardCommand(opts) {
|
|
4914
|
+
const cfg = requireAuth();
|
|
4915
|
+
const client = new HisaaboClient(cfg);
|
|
4916
|
+
try {
|
|
4917
|
+
const result = await client.eInvoice.dashboard({ fromDate: opts.from, toDate: opts.to });
|
|
4918
|
+
if (opts.json) {
|
|
4919
|
+
outputJSON(result);
|
|
4920
|
+
return;
|
|
4921
|
+
}
|
|
4922
|
+
const r = result;
|
|
4923
|
+
console.log("\n E-Invoice Dashboard\n");
|
|
4924
|
+
console.log(` ${"\u2550".repeat(50)}
|
|
4925
|
+
`);
|
|
4926
|
+
const generated = String(r["totalGenerated"] ?? r["generated"] ?? "0");
|
|
4927
|
+
const cancelled = String(r["totalCancelled"] ?? r["cancelled"] ?? "0");
|
|
4928
|
+
const failed = String(r["totalFailed"] ?? r["failed"] ?? "0");
|
|
4929
|
+
const pending = String(r["pending"] ?? "0");
|
|
4930
|
+
console.log(` Generated: ${generated.padStart(8)}`);
|
|
4931
|
+
console.log(` Cancelled: ${cancelled.padStart(8)}`);
|
|
4932
|
+
console.log(` Failed: ${failed.padStart(8)}`);
|
|
4933
|
+
console.log(` Pending: ${pending.padStart(8)}`);
|
|
4934
|
+
console.log();
|
|
4935
|
+
} catch (e) {
|
|
4936
|
+
handleError4(e);
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
async function eInvoiceGenerateCommand(invoiceId, opts) {
|
|
4940
|
+
const cfg = requireAuth();
|
|
4941
|
+
const client = new HisaaboClient(cfg);
|
|
4942
|
+
try {
|
|
4943
|
+
const result = await client.eInvoice.generate({ invoiceId });
|
|
4944
|
+
if (opts.json) {
|
|
4945
|
+
outputJSON(result);
|
|
4946
|
+
return;
|
|
4947
|
+
}
|
|
4948
|
+
const r = result;
|
|
4949
|
+
const irn = String(r["irn"] ?? r["invoiceReferenceNumber"] ?? "-");
|
|
4950
|
+
const ackNo = String(r["ackNo"] ?? r["acknowledgementNumber"] ?? "-");
|
|
4951
|
+
console.log(` E-Invoice generated.
|
|
4952
|
+
`);
|
|
4953
|
+
console.log(` IRN: ${irn}`);
|
|
4954
|
+
console.log(` ACK: ${ackNo}`);
|
|
4955
|
+
console.log();
|
|
4956
|
+
} catch (e) {
|
|
4957
|
+
handleError4(e);
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
async function eInvoiceCancelCommand(invoiceId, opts) {
|
|
4961
|
+
const cfg = requireAuth();
|
|
4962
|
+
const client = new HisaaboClient(cfg);
|
|
4963
|
+
try {
|
|
4964
|
+
const result = await client.eInvoice.cancel({ invoiceId, cancelReason: opts.reason ?? "1" });
|
|
4965
|
+
if (opts.json) {
|
|
4966
|
+
outputJSON(result);
|
|
4967
|
+
return;
|
|
4968
|
+
}
|
|
4969
|
+
console.log(` E-Invoice for ${invoiceId} cancelled.
|
|
4970
|
+
`);
|
|
4971
|
+
} catch (e) {
|
|
4972
|
+
handleError4(e);
|
|
4973
|
+
}
|
|
4974
|
+
}
|
|
4975
|
+
async function eInvoiceRetryCommand(invoiceId, opts) {
|
|
4976
|
+
const cfg = requireAuth();
|
|
4977
|
+
const client = new HisaaboClient(cfg);
|
|
4978
|
+
try {
|
|
4979
|
+
const result = await client.eInvoice.retryFailed({ invoiceId });
|
|
4980
|
+
if (opts.json) {
|
|
4981
|
+
outputJSON(result);
|
|
4982
|
+
return;
|
|
4983
|
+
}
|
|
4984
|
+
const r = result;
|
|
4985
|
+
const status = String(r["status"] ?? "queued");
|
|
4986
|
+
console.log(` Retry queued for invoice ${invoiceId}. Status: ${status}
|
|
4987
|
+
`);
|
|
4988
|
+
} catch (e) {
|
|
4989
|
+
handleError4(e);
|
|
4990
|
+
}
|
|
4991
|
+
}
|
|
4992
|
+
|
|
4993
|
+
// src/bin/registrars/einvoice.ts
|
|
4994
|
+
function registerEInvoiceCommands(program2) {
|
|
4995
|
+
const einvoice = program2.command("einvoice").description("E-Invoice (IRP) management");
|
|
4996
|
+
einvoice.command("dashboard").description("E-invoice generation summary").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").action(async (opts) => {
|
|
4997
|
+
await eInvoiceDashboardCommand(opts);
|
|
4998
|
+
});
|
|
4999
|
+
einvoice.command("generate <invoiceId>").description("Generate an e-invoice (get IRN from IRP)").option("--json", "JSON output").action(async (invoiceId, opts) => {
|
|
5000
|
+
await eInvoiceGenerateCommand(invoiceId, { json: opts.json });
|
|
5001
|
+
});
|
|
5002
|
+
einvoice.command("cancel <invoiceId>").description("Cancel an e-invoice").option("--json", "JSON output").option("--reason <code>", "Cancel reason code (1-4)").action(async (invoiceId, opts) => {
|
|
5003
|
+
await eInvoiceCancelCommand(invoiceId, { json: opts.json, reason: opts.reason });
|
|
5004
|
+
});
|
|
5005
|
+
einvoice.command("retry <invoiceId>").description("Retry a failed e-invoice generation").option("--json", "JSON output").action(async (invoiceId, opts) => {
|
|
5006
|
+
await eInvoiceRetryCommand(invoiceId, { json: opts.json });
|
|
5007
|
+
});
|
|
5008
|
+
}
|
|
5009
|
+
|
|
5010
|
+
// src/commands/ewb/index.ts
|
|
5011
|
+
function handleError5(e) {
|
|
5012
|
+
if (e instanceof HisaaboApiError) {
|
|
5013
|
+
const err = e.hisaaboError;
|
|
5014
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
5015
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
5016
|
+
}
|
|
5017
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
5018
|
+
}
|
|
5019
|
+
async function ewbDashboardCommand(opts) {
|
|
5020
|
+
const cfg = requireAuth();
|
|
5021
|
+
const client = new HisaaboClient(cfg);
|
|
5022
|
+
try {
|
|
5023
|
+
const result = await client.ewayBill.dashboard({ fromDate: opts.from, toDate: opts.to });
|
|
5024
|
+
if (opts.json) {
|
|
5025
|
+
outputJSON(result);
|
|
5026
|
+
return;
|
|
5027
|
+
}
|
|
5028
|
+
const r = result;
|
|
5029
|
+
console.log("\n E-Way Bill Dashboard\n");
|
|
5030
|
+
console.log(` ${"\u2550".repeat(50)}
|
|
5031
|
+
`);
|
|
5032
|
+
const generated = String(r["totalGenerated"] ?? r["generated"] ?? "0");
|
|
5033
|
+
const cancelled = String(r["totalCancelled"] ?? r["cancelled"] ?? "0");
|
|
5034
|
+
const expired = String(r["totalExpired"] ?? r["expired"] ?? "0");
|
|
5035
|
+
const active = String(r["active"] ?? "0");
|
|
5036
|
+
console.log(` Generated: ${generated.padStart(8)}`);
|
|
5037
|
+
console.log(` Active: ${active.padStart(8)}`);
|
|
5038
|
+
console.log(` Cancelled: ${cancelled.padStart(8)}`);
|
|
5039
|
+
console.log(` Expired: ${expired.padStart(8)}`);
|
|
5040
|
+
console.log();
|
|
5041
|
+
} catch (e) {
|
|
5042
|
+
handleError5(e);
|
|
5043
|
+
}
|
|
5044
|
+
}
|
|
5045
|
+
async function ewbGenerateCommand(invoiceId, opts) {
|
|
5046
|
+
const cfg = requireAuth();
|
|
5047
|
+
const client = new HisaaboClient(cfg);
|
|
5048
|
+
try {
|
|
5049
|
+
const result = await client.ewayBill.generate({ invoiceId });
|
|
5050
|
+
if (opts.json) {
|
|
5051
|
+
outputJSON(result);
|
|
5052
|
+
return;
|
|
5053
|
+
}
|
|
5054
|
+
const r = result;
|
|
5055
|
+
const ewbNo = String(r["eWayBillNo"] ?? r["ewbNumber"] ?? r["ewbNo"] ?? "-");
|
|
5056
|
+
const validUpto = String(r["validUpto"] ?? r["validTill"] ?? "-");
|
|
5057
|
+
console.log(` E-Way Bill generated.
|
|
5058
|
+
`);
|
|
5059
|
+
console.log(` EWB No: ${ewbNo}`);
|
|
5060
|
+
console.log(` Valid Upto: ${validUpto}`);
|
|
5061
|
+
console.log();
|
|
5062
|
+
} catch (e) {
|
|
5063
|
+
handleError5(e);
|
|
5064
|
+
}
|
|
5065
|
+
}
|
|
5066
|
+
async function ewbExpiringCommand(opts) {
|
|
5067
|
+
const cfg = requireAuth();
|
|
5068
|
+
const client = new HisaaboClient(cfg);
|
|
5069
|
+
try {
|
|
5070
|
+
const result = await client.ewayBill.expiringList({ withinDays: opts.days ?? 3 });
|
|
5071
|
+
if (opts.json) {
|
|
5072
|
+
outputJSON(result);
|
|
5073
|
+
return;
|
|
5074
|
+
}
|
|
5075
|
+
const bills = Array.isArray(result) ? result : Array.isArray(result?.data) ? result.data : [];
|
|
5076
|
+
console.log(`
|
|
5077
|
+
Expiring E-Way Bills (within ${opts.days ?? 3} days)
|
|
5078
|
+
`);
|
|
5079
|
+
console.log(` ${"\u2550".repeat(65)}
|
|
5080
|
+
`);
|
|
5081
|
+
if (bills.length === 0) {
|
|
5082
|
+
console.log(" No expiring e-way bills.\n");
|
|
5083
|
+
return;
|
|
5084
|
+
}
|
|
5085
|
+
for (const bill of bills) {
|
|
5086
|
+
const ewbNo = String(bill["eWayBillNo"] ?? bill["ewbNumber"] ?? "-").padEnd(14);
|
|
5087
|
+
const invoiceNo = String(bill["invoiceNumber"] ?? bill["invoice"] ?? "-").padEnd(14);
|
|
5088
|
+
const party = String(bill["partyName"] ?? bill["party"] ?? "-").padEnd(22);
|
|
5089
|
+
const validUpto = formatDate(String(bill["validUpto"] ?? bill["validTill"] ?? ""));
|
|
5090
|
+
console.log(` ${ewbNo} ${invoiceNo} ${party} Expires: ${validUpto}`);
|
|
5091
|
+
}
|
|
5092
|
+
console.log();
|
|
5093
|
+
} catch (e) {
|
|
5094
|
+
handleError5(e);
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
|
|
5098
|
+
// src/bin/registrars/ewb.ts
|
|
5099
|
+
function registerEwbCommands(program2) {
|
|
5100
|
+
const ewb = program2.command("ewb").description("E-Way Bill management");
|
|
5101
|
+
ewb.command("dashboard").description("E-way bill summary dashboard").option("--json", "JSON output").option("--from <date>", "From date").option("--to <date>", "To date").action(async (opts) => {
|
|
5102
|
+
await ewbDashboardCommand(opts);
|
|
5103
|
+
});
|
|
5104
|
+
ewb.command("generate <invoiceId>").description("Generate an e-way bill for an invoice").option("--json", "JSON output").action(async (invoiceId, opts) => {
|
|
5105
|
+
await ewbGenerateCommand(invoiceId, { json: opts.json });
|
|
5106
|
+
});
|
|
5107
|
+
ewb.command("expiring").description("List e-way bills expiring soon").option("--json", "JSON output").option("--days <n>", "Within N days (default: 3)", parseInt).action(async (opts) => {
|
|
5108
|
+
await ewbExpiringCommand({ json: opts.json, days: opts.days });
|
|
5109
|
+
});
|
|
5110
|
+
}
|
|
5111
|
+
|
|
4280
5112
|
// src/bin/hisaabo.ts
|
|
4281
5113
|
var program = new Command();
|
|
4282
|
-
var cliVersion = true ? "0.
|
|
5114
|
+
var cliVersion = true ? "0.6.1" : "dev";
|
|
4283
5115
|
program.name("hisaabo").description("Hisaabo CLI \u2014 Invoicing and business management").version(cliVersion);
|
|
4284
5116
|
registerAuthCommands(program);
|
|
4285
5117
|
registerDashboardCommands(program);
|
|
@@ -4301,6 +5133,11 @@ registerDocumentCommands(program);
|
|
|
4301
5133
|
registerTenantCommands(program);
|
|
4302
5134
|
registerApiKeyCommands(program);
|
|
4303
5135
|
registerSessionCommands(program);
|
|
5136
|
+
registerJournalCommands(program);
|
|
5137
|
+
registerItcCommands(program);
|
|
5138
|
+
registerBankReconCommands(program);
|
|
5139
|
+
registerEInvoiceCommands(program);
|
|
5140
|
+
registerEwbCommands(program);
|
|
4304
5141
|
program.parseAsync(process.argv).catch((err) => {
|
|
4305
5142
|
fatalError(String(err instanceof Error ? err.message : err));
|
|
4306
5143
|
});
|