@go-labs-sg/bb 3.23.0 → 3.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/command-manifest.json +2 -2
- package/command-reference.md +2 -2
- package/dist/index.js +505 -557
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Roll out the API and maintained CLI together: `suppliers`/`pageCount` and offset
|
|
|
80
80
|
|
|
81
81
|
**Customer-invoice readiness and quotation list loading:** `customerInvoice.getInvoiceReadiness`, `getInvoiceAmountPreview`, `getEligibleBudgets` and `getProjectInvoiceReadiness` read the budget through one selected shape (only the budget, project, contact, invoice-settings, discount and item fields the readiness and amount helpers use) with Prisma's default join instead of forced per-relation queries. The quotation list page and metrics reads also use the default join. Their outputs are unchanged.
|
|
82
82
|
|
|
83
|
-
**Bill item, quotation download and invoice-candidate reads:** `bill.getBudgetItemsForBill` / `getBudgetItemsForProject` rows now carry only the budget-item fields the bill, claim, quotation and line-item screens use: `item { id, catalogueCode }`, `supplier { id, name, gstRegistered, lowerCaseName }` (plus `address` on the project list for supplier verification), `itemCategory { id, name }`, and, on the project list only, `actualSpendings[] { id, amount, supplier }` (the bill list has no spendings). Neither is called by the CLI. `bb quotation pdf download` / `download-quotation-pdf` (`quotation.getSignedDownloadUrl`) returns `attachment { id, name, size, supplierQuotationFileRole }` with the signed `url`, without the internal storage key and row bookkeeping. `bb customer-invoice existing list` / `list-available-qbo-customer-invoices` (`customerInvoice.getExistingInvoiceCandidates`) reads only the budget state and project access fields
|
|
83
|
+
**Bill item, quotation download and invoice-candidate reads:** `bill.getBudgetItemsForBill` / `getBudgetItemsForProject` rows now carry only the budget-item fields the bill, claim, quotation and line-item screens use: `item { id, catalogueCode }`, `supplier { id, name, gstRegistered, lowerCaseName }` (plus `address` on the project list for supplier verification), `itemCategory { id, name }`, and, on the project list only, `actualSpendings[] { id, amount, supplier }` (the bill list has no spendings). Neither is called by the CLI. `bb quotation pdf download` / `download-quotation-pdf` (`quotation.getSignedDownloadUrl`) returns `attachment { id, name, size, supplierQuotationFileRole }` with the signed `url`, without the internal storage key and row bookkeeping. `bb customer-invoice existing list` / `list-available-qbo-customer-invoices` (`customerInvoice.getExistingInvoiceCandidates`) reads only the budget state and project access fields. Each item also carries `requiresEstimateLineageConfirmation` (see [Link an existing QuickBooks invoice](#link-an-existing-quickbooks-invoice)).
|
|
84
84
|
|
|
85
85
|
**Project and item-category list read shapes:** `bb project list` / `bb list-projects` (`project.getAllProjects`) items keep every column the project table, cards and edit dialog use. They drop the deal-automation, calendar, win-override and lost-reason bookkeeping columns. Their relations narrow to `contactPerson { id, displayName, email }`, `company { id, name }`, `createdBy { id, name, email, image }` and `wonBy { id, name }`; `asanaProjectGid`/`asanaProjectUrl` are unchanged. Use `bb get-project <id>` for project details. `bb list-item-categories` rows carry `createdBy { id, name, email, image }` instead of the full user row.
|
|
86
86
|
|
|
@@ -669,6 +669,29 @@ Authenticate and run `bb auth whoami` first. Preview and import use the same pro
|
|
|
669
669
|
|
|
670
670
|
Use the **BB budget ID** whose existing estimate should receive the invoice, and the numeric **QBO invoice transaction ID**, not the displayed invoice number or an estimate number. Accepted and closed estimates are supported; linking does not reopen them. Fully invoiced means all estimate coverage has been billed; it does not mean the invoices are fully paid.
|
|
671
671
|
|
|
672
|
+
QuickBooks often drops the estimate link on invoices created directly in QBO. Such an unlinked invoice blocks readiness and billing on every budget of its project ("ambiguous estimate lineage") until it is linked to its budget. Budget Builder assigns it on its own only under the existing final-balance rule: an unlinked invoice that completes the estimate's coverage after its earlier invoices, on a project with one accepted estimate or after a native deposit, can still be linked without confirmation. `existing list` marks an unlinked invoice that matches the budget's estimate line by line (the same items, unit prices, tax and a uniform share of every line, discount, GST and total) with `requiresEstimateLineageConfirmation: true` (the final invoice that already completes coverage under the final-balance rule is listed without the mark). After checking which estimate it bills, pass `--confirmEstimateLineage true` (or a bare `--confirmEstimateLineage`) to both `preview-qbo` and `import-qbo`. The preview then reports `estimateLineage: "REVIEWER_CONFIRMED"` and lists:
|
|
673
|
+
|
|
674
|
+
- `alsoMatchesEstimates`: other estimates of the project the invoice also matches. Budget Builder cannot tell these apart; link only after confirming which one it bills.
|
|
675
|
+
- `unresolvedInvoices`: other unlinked invoices that match another estimate of the project line by line, but not this one. They do not stop this link unless one could complete this estimate's coverage (see below), but they keep new billing blocked until each is linked to its budget. They are not counted toward this estimate's allocation, so review them before relying on its coverage.
|
|
676
|
+
|
|
677
|
+
The confirmed preview is refused when:
|
|
678
|
+
|
|
679
|
+
- another estimate held by the budgets of this project or of any project mapped to the same QuickBooks project (archived ones included) has a QuickBooks link to the invoice, at estimate or line level;
|
|
680
|
+
- QuickBooks links an invoice to both this estimate and another one (resolve that in QuickBooks first);
|
|
681
|
+
- one of those estimates cannot be read. A budget whose QuickBooks estimate was deleted blocks reviewed links on its project until its estimate reference is corrected;
|
|
682
|
+
- the project's budgets hold more than 30 other estimates;
|
|
683
|
+
- another unlinked invoice of the project matches neither this estimate nor any other estimate of the project line by line (reconcile it first). This includes the last invoice of a split whose rounding differs from a uniform share of every line: such splits cannot be confirmed and still need manual reconciliation;
|
|
684
|
+
- QuickBooks already links the selected invoice to an estimate (preview it without the flag), or another budget already owns it;
|
|
685
|
+
- an invoice tied to this estimate (linked from either side, at estimate or line level, or carrying this budget's Budget Builder marker) cannot be counted toward its allocation, because it does not match the estimate line by line or belongs to another project, estimate or budget;
|
|
686
|
+
- another invoice could complete this estimate's coverage on its own or with the invoices already linked here, or an uncounted one would complete it together with the selection or with the other invoices counted toward the cap (reconcile that invoice first);
|
|
687
|
+
- the QuickBooks totals of the invoices counted for this estimate would exceed its total by more than one cent;
|
|
688
|
+
- a Budget Builder invoice creation is still in progress anywhere;
|
|
689
|
+
- the selected invoice carries a Budget Builder marker (resolve it through the budget it names, or in QuickBooks).
|
|
690
|
+
|
|
691
|
+
Re-running a link that already exists skips the last five checks.
|
|
692
|
+
|
|
693
|
+
Only a confirmed preview or import checks every estimate held by the project's budgets (an ordinary preview of a final balance still compares it with the other accepted estimates, as before). During a confirmed one, an invoice another estimate claims cannot be taken as this estimate's final balance, and other unlinked invoices that also match this estimate count toward its 100% allocation. Invoices whose own QuickBooks link names another estimate are skipped. Invoices linked only from another estimate's side are neither counted nor listed, but still block this budget's billing until they are linked to that estimate's budget. Previews and imports without the flag behave as before. Once linked, the project's other budgets skip the invoice. Estimates in the same QuickBooks project that no Budget Builder budget holds are not checked.
|
|
694
|
+
|
|
672
695
|
```bash
|
|
673
696
|
bb customer-invoice preview-qbo <budgetId> <qboInvoiceId>
|
|
674
697
|
bb customer-invoice import-qbo <budgetId> <qboInvoiceId> --token <previewToken>
|
package/command-manifest.json
CHANGED
|
@@ -4993,7 +4993,7 @@
|
|
|
4993
4993
|
"preview-qbo-customer-invoice",
|
|
4994
4994
|
"preview_qbo_customer_invoice"
|
|
4995
4995
|
],
|
|
4996
|
-
"summary": "Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId
|
|
4996
|
+
"summary": "Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId> [--confirmEstimateLineage true]. Use --confirmEstimateLineage only after confirming an invoice with no QuickBooks estimate link belongs to this budget's estimate.",
|
|
4997
4997
|
"globalOptions": [
|
|
4998
4998
|
{
|
|
4999
4999
|
"name": "--help",
|
|
@@ -5046,7 +5046,7 @@
|
|
|
5046
5046
|
"import-qbo-customer-invoice",
|
|
5047
5047
|
"import_qbo_customer_invoice"
|
|
5048
5048
|
],
|
|
5049
|
-
"summary": "Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken
|
|
5049
|
+
"summary": "Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken> [--confirmEstimateLineage true] (repeat the preview's flag). Supports closed estimates; no QBO writes or emails.",
|
|
5050
5050
|
"globalOptions": [
|
|
5051
5051
|
{
|
|
5052
5052
|
"name": "--help",
|
package/command-reference.md
CHANGED
|
@@ -831,7 +831,7 @@ Effects: none.
|
|
|
831
831
|
|
|
832
832
|
## `bb customer-invoice preview-qbo`
|
|
833
833
|
|
|
834
|
-
Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId
|
|
834
|
+
Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId> [--confirmEstimateLineage true]. Use --confirmEstimateLineage only after confirming an invoice with no QuickBooks estimate link belongs to this budget's estimate.
|
|
835
835
|
|
|
836
836
|
Legacy aliases: `preview-qbo-customer-invoice`, `preview_qbo_customer_invoice`.
|
|
837
837
|
|
|
@@ -839,7 +839,7 @@ Effects: none.
|
|
|
839
839
|
|
|
840
840
|
## `bb customer-invoice import-qbo`
|
|
841
841
|
|
|
842
|
-
Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken
|
|
842
|
+
Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken> [--confirmEstimateLineage true] (repeat the preview's flag). Supports closed estimates; no QBO writes or emails.
|
|
843
843
|
|
|
844
844
|
Legacy aliases: `import-qbo-customer-invoice`, `import_qbo_customer_invoice`.
|
|
845
845
|
|