@mj-biz-apps/orders-core-entities-server 0.0.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +183 -0
- package/README.md +141 -2
- package/dist/AccountingBridge.d.ts +65 -0
- package/dist/AccountingBridge.d.ts.map +1 -0
- package/dist/AccountingBridge.js +102 -0
- package/dist/AccountingBridge.js.map +1 -0
- package/dist/AdvanceOrderStateOperation.d.ts +80 -0
- package/dist/AdvanceOrderStateOperation.d.ts.map +1 -0
- package/dist/AdvanceOrderStateOperation.js +267 -0
- package/dist/AdvanceOrderStateOperation.js.map +1 -0
- package/dist/ApplyAccountCreditOperation.d.ts +97 -0
- package/dist/ApplyAccountCreditOperation.d.ts.map +1 -0
- package/dist/ApplyAccountCreditOperation.js +275 -0
- package/dist/ApplyAccountCreditOperation.js.map +1 -0
- package/dist/BaseDeliveryChannel.d.ts +106 -0
- package/dist/BaseDeliveryChannel.d.ts.map +1 -0
- package/dist/BaseDeliveryChannel.js +36 -0
- package/dist/BaseDeliveryChannel.js.map +1 -0
- package/dist/BasePaymentProvider.d.ts +239 -0
- package/dist/BasePaymentProvider.d.ts.map +1 -0
- package/dist/BasePaymentProvider.js +91 -0
- package/dist/BasePaymentProvider.js.map +1 -0
- package/dist/BundleBehavior.d.ts +139 -0
- package/dist/BundleBehavior.d.ts.map +1 -0
- package/dist/BundleBehavior.js +173 -0
- package/dist/BundleBehavior.js.map +1 -0
- package/dist/BundleEngine.d.ts +60 -0
- package/dist/BundleEngine.d.ts.map +1 -0
- package/dist/BundleEngine.js +197 -0
- package/dist/BundleEngine.js.map +1 -0
- package/dist/CancelSubscriptionOperation.d.ts +98 -0
- package/dist/CancelSubscriptionOperation.d.ts.map +1 -0
- package/dist/CancelSubscriptionOperation.js +317 -0
- package/dist/CancelSubscriptionOperation.js.map +1 -0
- package/dist/CapturePaymentOperation.d.ts +62 -0
- package/dist/CapturePaymentOperation.d.ts.map +1 -0
- package/dist/CapturePaymentOperation.js +463 -0
- package/dist/CapturePaymentOperation.js.map +1 -0
- package/dist/CheckEntitlementOperation.d.ts +27 -0
- package/dist/CheckEntitlementOperation.d.ts.map +1 -0
- package/dist/CheckEntitlementOperation.js +45 -0
- package/dist/CheckEntitlementOperation.js.map +1 -0
- package/dist/CheckoutSessionService.d.ts +258 -0
- package/dist/CheckoutSessionService.d.ts.map +1 -0
- package/dist/CheckoutSessionService.js +1557 -0
- package/dist/CheckoutSessionService.js.map +1 -0
- package/dist/DeliveryBehavior.d.ts +121 -0
- package/dist/DeliveryBehavior.d.ts.map +1 -0
- package/dist/DeliveryBehavior.js +145 -0
- package/dist/DeliveryBehavior.js.map +1 -0
- package/dist/DeliveryRecipientResolver.d.ts +38 -0
- package/dist/DeliveryRecipientResolver.d.ts.map +1 -0
- package/dist/DeliveryRecipientResolver.js +93 -0
- package/dist/DeliveryRecipientResolver.js.map +1 -0
- package/dist/DeliveryResolver.d.ts +14 -0
- package/dist/DeliveryResolver.d.ts.map +1 -0
- package/dist/DeliveryResolver.js +45 -0
- package/dist/DeliveryResolver.js.map +1 -0
- package/dist/EmailDeliveryChannel.d.ts +31 -0
- package/dist/EmailDeliveryChannel.d.ts.map +1 -0
- package/dist/EmailDeliveryChannel.js +158 -0
- package/dist/EmailDeliveryChannel.js.map +1 -0
- package/dist/EntitlementBehavior.d.ts +235 -0
- package/dist/EntitlementBehavior.d.ts.map +1 -0
- package/dist/EntitlementBehavior.js +330 -0
- package/dist/EntitlementBehavior.js.map +1 -0
- package/dist/EntitlementEngine.d.ts +97 -0
- package/dist/EntitlementEngine.d.ts.map +1 -0
- package/dist/EntitlementEngine.js +338 -0
- package/dist/EntitlementEngine.js.map +1 -0
- package/dist/EntitlementGrantClaimDriver.d.ts +42 -0
- package/dist/EntitlementGrantClaimDriver.d.ts.map +1 -0
- package/dist/EntitlementGrantClaimDriver.js +158 -0
- package/dist/EntitlementGrantClaimDriver.js.map +1 -0
- package/dist/EntitlementRead.d.ts +82 -0
- package/dist/EntitlementRead.d.ts.map +1 -0
- package/dist/EntitlementRead.js +368 -0
- package/dist/EntitlementRead.js.map +1 -0
- package/dist/FulfillOrderLinesOperation.d.ts +34 -0
- package/dist/FulfillOrderLinesOperation.d.ts.map +1 -0
- package/dist/FulfillOrderLinesOperation.js +208 -0
- package/dist/FulfillOrderLinesOperation.js.map +1 -0
- package/dist/FulfillmentBehavior.d.ts +101 -0
- package/dist/FulfillmentBehavior.d.ts.map +1 -0
- package/dist/FulfillmentBehavior.js +145 -0
- package/dist/FulfillmentBehavior.js.map +1 -0
- package/dist/GLAccountResolver.d.ts +123 -0
- package/dist/GLAccountResolver.d.ts.map +1 -0
- package/dist/GLAccountResolver.js +175 -0
- package/dist/GLAccountResolver.js.map +1 -0
- package/dist/GetFulfillmentQueueOperation.d.ts +35 -0
- package/dist/GetFulfillmentQueueOperation.d.ts.map +1 -0
- package/dist/GetFulfillmentQueueOperation.js +221 -0
- package/dist/GetFulfillmentQueueOperation.js.map +1 -0
- package/dist/GetOverdueWorklistOperation.d.ts +41 -0
- package/dist/GetOverdueWorklistOperation.d.ts.map +1 -0
- package/dist/GetOverdueWorklistOperation.js +210 -0
- package/dist/GetOverdueWorklistOperation.js.map +1 -0
- package/dist/GiftCardBehavior.d.ts +97 -0
- package/dist/GiftCardBehavior.d.ts.map +1 -0
- package/dist/GiftCardBehavior.js +121 -0
- package/dist/GiftCardBehavior.js.map +1 -0
- package/dist/GiftCardEngine.d.ts +59 -0
- package/dist/GiftCardEngine.d.ts.map +1 -0
- package/dist/GiftCardEngine.js +197 -0
- package/dist/GiftCardEngine.js.map +1 -0
- package/dist/GuestOrderClaimDriver.d.ts +36 -0
- package/dist/GuestOrderClaimDriver.d.ts.map +1 -0
- package/dist/GuestOrderClaimDriver.js +161 -0
- package/dist/GuestOrderClaimDriver.js.map +1 -0
- package/dist/InvoiceBehavior.d.ts +394 -0
- package/dist/InvoiceBehavior.d.ts.map +1 -0
- package/dist/InvoiceBehavior.js +496 -0
- package/dist/InvoiceBehavior.js.map +1 -0
- package/dist/InvoiceBuilder.d.ts +48 -0
- package/dist/InvoiceBuilder.d.ts.map +1 -0
- package/dist/InvoiceBuilder.js +352 -0
- package/dist/InvoiceBuilder.js.map +1 -0
- package/dist/InvoiceDisplay.d.ts +96 -0
- package/dist/InvoiceDisplay.d.ts.map +1 -0
- package/dist/InvoiceDisplay.js +121 -0
- package/dist/InvoiceDisplay.js.map +1 -0
- package/dist/ListEntitlementsOperation.d.ts +21 -0
- package/dist/ListEntitlementsOperation.d.ts.map +1 -0
- package/dist/ListEntitlementsOperation.js +39 -0
- package/dist/ListEntitlementsOperation.js.map +1 -0
- package/dist/ManualPaymentProvider.d.ts +19 -0
- package/dist/ManualPaymentProvider.d.ts.map +1 -0
- package/dist/ManualPaymentProvider.js +92 -0
- package/dist/ManualPaymentProvider.js.map +1 -0
- package/dist/OrderEntityServer.d.ts +542 -0
- package/dist/OrderEntityServer.d.ts.map +1 -0
- package/dist/OrderEntityServer.js +2100 -0
- package/dist/OrderEntityServer.js.map +1 -0
- package/dist/OrderJournalEntryFactory.d.ts +140 -0
- package/dist/OrderJournalEntryFactory.d.ts.map +1 -0
- package/dist/OrderJournalEntryFactory.js +466 -0
- package/dist/OrderJournalEntryFactory.js.map +1 -0
- package/dist/OrderLineEntityServer.d.ts +90 -0
- package/dist/OrderLineEntityServer.d.ts.map +1 -0
- package/dist/OrderLineEntityServer.js +260 -0
- package/dist/OrderLineEntityServer.js.map +1 -0
- package/dist/OrdersSettings.d.ts +36 -0
- package/dist/OrdersSettings.d.ts.map +1 -0
- package/dist/OrdersSettings.js +147 -0
- package/dist/OrdersSettings.js.map +1 -0
- package/dist/PaymentAllocationFactory.d.ts +128 -0
- package/dist/PaymentAllocationFactory.d.ts.map +1 -0
- package/dist/PaymentAllocationFactory.js +235 -0
- package/dist/PaymentAllocationFactory.js.map +1 -0
- package/dist/PaymentHeaderEntityServer.d.ts +180 -0
- package/dist/PaymentHeaderEntityServer.d.ts.map +1 -0
- package/dist/PaymentHeaderEntityServer.js +656 -0
- package/dist/PaymentHeaderEntityServer.js.map +1 -0
- package/dist/PaymentIntentService.d.ts +101 -0
- package/dist/PaymentIntentService.d.ts.map +1 -0
- package/dist/PaymentIntentService.js +150 -0
- package/dist/PaymentIntentService.js.map +1 -0
- package/dist/PaymentJournalEntryFactory.d.ts +99 -0
- package/dist/PaymentJournalEntryFactory.d.ts.map +1 -0
- package/dist/PaymentJournalEntryFactory.js +127 -0
- package/dist/PaymentJournalEntryFactory.js.map +1 -0
- package/dist/PaymentLineEntityServer.d.ts +73 -0
- package/dist/PaymentLineEntityServer.d.ts.map +1 -0
- package/dist/PaymentLineEntityServer.js +303 -0
- package/dist/PaymentLineEntityServer.js.map +1 -0
- package/dist/PaymentProviderBehavior.d.ts +222 -0
- package/dist/PaymentProviderBehavior.d.ts.map +1 -0
- package/dist/PaymentProviderBehavior.js +368 -0
- package/dist/PaymentProviderBehavior.js.map +1 -0
- package/dist/PaymentProviderResolver.d.ts +84 -0
- package/dist/PaymentProviderResolver.d.ts.map +1 -0
- package/dist/PaymentProviderResolver.js +220 -0
- package/dist/PaymentProviderResolver.js.map +1 -0
- package/dist/PaymentReversalFactory.d.ts +107 -0
- package/dist/PaymentReversalFactory.d.ts.map +1 -0
- package/dist/PaymentReversalFactory.js +174 -0
- package/dist/PaymentReversalFactory.js.map +1 -0
- package/dist/PaymentSettlement.d.ts +56 -0
- package/dist/PaymentSettlement.d.ts.map +1 -0
- package/dist/PaymentSettlement.js +243 -0
- package/dist/PaymentSettlement.js.map +1 -0
- package/dist/PaymentTermsBehavior.d.ts +109 -0
- package/dist/PaymentTermsBehavior.d.ts.map +1 -0
- package/dist/PaymentTermsBehavior.js +172 -0
- package/dist/PaymentTermsBehavior.js.map +1 -0
- package/dist/PaymentWebhookHandler.d.ts +103 -0
- package/dist/PaymentWebhookHandler.d.ts.map +1 -0
- package/dist/PaymentWebhookHandler.js +246 -0
- package/dist/PaymentWebhookHandler.js.map +1 -0
- package/dist/PreviewPriceOperation.d.ts +62 -0
- package/dist/PreviewPriceOperation.d.ts.map +1 -0
- package/dist/PreviewPriceOperation.js +161 -0
- package/dist/PreviewPriceOperation.js.map +1 -0
- package/dist/PriceOrderOperation.d.ts +93 -0
- package/dist/PriceOrderOperation.d.ts.map +1 -0
- package/dist/PriceOrderOperation.js +146 -0
- package/dist/PriceOrderOperation.js.map +1 -0
- package/dist/ProductPriceEntityServer.d.ts +34 -0
- package/dist/ProductPriceEntityServer.d.ts.map +1 -0
- package/dist/ProductPriceEntityServer.js +97 -0
- package/dist/ProductPriceEntityServer.js.map +1 -0
- package/dist/RefundPaymentOperation.d.ts +61 -0
- package/dist/RefundPaymentOperation.d.ts.map +1 -0
- package/dist/RefundPaymentOperation.js +177 -0
- package/dist/RefundPaymentOperation.js.map +1 -0
- package/dist/RevenueRecognition.d.ts +76 -0
- package/dist/RevenueRecognition.d.ts.map +1 -0
- package/dist/RevenueRecognition.js +133 -0
- package/dist/RevenueRecognition.js.map +1 -0
- package/dist/ReversalBehavior.d.ts +82 -0
- package/dist/ReversalBehavior.d.ts.map +1 -0
- package/dist/ReversalBehavior.js +100 -0
- package/dist/ReversalBehavior.js.map +1 -0
- package/dist/ReversalResolver.d.ts +37 -0
- package/dist/ReversalResolver.d.ts.map +1 -0
- package/dist/ReversalResolver.js +96 -0
- package/dist/ReversalResolver.js.map +1 -0
- package/dist/SpawnRenewalsOperation.d.ts +109 -0
- package/dist/SpawnRenewalsOperation.d.ts.map +1 -0
- package/dist/SpawnRenewalsOperation.js +295 -0
- package/dist/SpawnRenewalsOperation.js.map +1 -0
- package/dist/StoredValuePaymentProvider.d.ts +52 -0
- package/dist/StoredValuePaymentProvider.d.ts.map +1 -0
- package/dist/StoredValuePaymentProvider.js +205 -0
- package/dist/StoredValuePaymentProvider.js.map +1 -0
- package/dist/StripeACHPaymentProvider.d.ts +50 -0
- package/dist/StripeACHPaymentProvider.d.ts.map +1 -0
- package/dist/StripeACHPaymentProvider.js +211 -0
- package/dist/StripeACHPaymentProvider.js.map +1 -0
- package/dist/StripePaymentProvider.d.ts +83 -0
- package/dist/StripePaymentProvider.d.ts.map +1 -0
- package/dist/StripePaymentProvider.js +442 -0
- package/dist/StripePaymentProvider.js.map +1 -0
- package/dist/SubscriptionBehavior.d.ts +197 -0
- package/dist/SubscriptionBehavior.d.ts.map +1 -0
- package/dist/SubscriptionBehavior.js +415 -0
- package/dist/SubscriptionBehavior.js.map +1 -0
- package/dist/checkoutCaptureAlert.d.ts +16 -0
- package/dist/checkoutCaptureAlert.d.ts.map +1 -0
- package/dist/checkoutCaptureAlert.js +55 -0
- package/dist/checkoutCaptureAlert.js.map +1 -0
- package/dist/checkoutCaptureRetry.d.ts +27 -0
- package/dist/checkoutCaptureRetry.d.ts.map +1 -0
- package/dist/checkoutCaptureRetry.js +50 -0
- package/dist/checkoutCaptureRetry.js.map +1 -0
- package/dist/claimDriverHelpers.d.ts +15 -0
- package/dist/claimDriverHelpers.d.ts.map +1 -0
- package/dist/claimDriverHelpers.js +34 -0
- package/dist/claimDriverHelpers.js.map +1 -0
- package/dist/entity-names.d.ts +15 -0
- package/dist/entity-names.d.ts.map +1 -0
- package/dist/entity-names.js +15 -0
- package/dist/entity-names.js.map +1 -0
- package/dist/identityClaimContracts.d.ts +118 -0
- package/dist/identityClaimContracts.d.ts.map +1 -0
- package/dist/identityClaimContracts.js +58 -0
- package/dist/identityClaimContracts.js.map +1 -0
- package/dist/index.d.ts +126 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -0
- package/dist/sql-guards.d.ts +78 -0
- package/dist/sql-guards.d.ts.map +1 -0
- package/dist/sql-guards.js +115 -0
- package/dist/sql-guards.js.map +1 -0
- package/package.json +50 -5
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Turning an order into the document you send a customer — the decisions, with no
|
|
3
|
+
* database and no HTML anywhere near them.
|
|
4
|
+
*
|
|
5
|
+
* THERE IS NO INVOICE RECORD, AND THAT IS THE POINT. The confirmed order IS the receivable: it is
|
|
6
|
+
* what the ledger booked, what the aging report ages, and what the customer quotes on the phone. An
|
|
7
|
+
* invoice is that order RENDERED. Storing a second row called `Invoice` would create a number that
|
|
8
|
+
* can disagree with the order it came from, and the day it does, nothing in the system can tell you
|
|
9
|
+
* which one is right. So this module derives; it never writes.
|
|
10
|
+
*
|
|
11
|
+
* (Statements are the opposite case and are deliberately NOT built on this: a statement is a
|
|
12
|
+
* point-in-time snapshot of a customer's position, so re-deriving it later gives you a DIFFERENT
|
|
13
|
+
* document with the same date on it. That one needs storage. This one must not have it.)
|
|
14
|
+
*
|
|
15
|
+
* WHY THE SPLIT BY SELLING COMPANY IS THE LOAD-BEARING DECISION HERE. An order's lines can be sold
|
|
16
|
+
* by more than one company — 14 of the 75 orders in the review seed are — and each company carries
|
|
17
|
+
* its own receivable, its own tax registration and its own remit-to address. One document covering
|
|
18
|
+
* two companies would name one of them as the payee for money the other is owed. So an order
|
|
19
|
+
* produces one document PER SELLING COMPANY, and the invariant that matters is that the documents
|
|
20
|
+
* sum back to the order: `Σ documents.Gross === OrderHeader.TotalGross`. Everything below exists to
|
|
21
|
+
* keep that true, which is why unattributable amounts are pushed onto the header company rather
|
|
22
|
+
* than dropped. A dropped charge produces an invoice that is internally consistent, adds up
|
|
23
|
+
* perfectly, and undercharges the customer.
|
|
24
|
+
*
|
|
25
|
+
* THE LADDER MUST TIE. `ListSubtotal − Discounts + Charges + Tax === Gross`, always. The named
|
|
26
|
+
* discount rows are a BREAKDOWN of the line-level discount, not a second source of it — promotions
|
|
27
|
+
* are already baked into `OrderLine.LineTotalNet` by the time an order is confirmed. If the named
|
|
28
|
+
* rows do not account for the whole discount, {@link BuildDocument} emits the difference as an
|
|
29
|
+
* explicit residual row instead of letting the ladder quietly fail to add up.
|
|
30
|
+
*
|
|
31
|
+
* @module @mj-biz-apps/orders-core-entities-server
|
|
32
|
+
*/
|
|
33
|
+
/** The order header, as far as the document is concerned. */
|
|
34
|
+
export interface InvoiceOrderFacts {
|
|
35
|
+
ID: string;
|
|
36
|
+
OrderNumber: string;
|
|
37
|
+
OrderType: string | null;
|
|
38
|
+
OrderDate: string;
|
|
39
|
+
Status: string;
|
|
40
|
+
/** The company on the header — the fallback owner of anything not attributable to a line. */
|
|
41
|
+
CompanyID: string;
|
|
42
|
+
CompanyName: string;
|
|
43
|
+
TotalGross: number;
|
|
44
|
+
AmountPaid: number;
|
|
45
|
+
Balance: number;
|
|
46
|
+
DueDate: string | null;
|
|
47
|
+
PaymentStatus: string | null;
|
|
48
|
+
/** The customer's own PO/reference, printed so their AP department can match it. */
|
|
49
|
+
ExternalDocumentNumber: string | null;
|
|
50
|
+
/** Set when this order reverses another — the document is then a credit memo. */
|
|
51
|
+
ReversesOrderHeaderID: string | null;
|
|
52
|
+
ReversesOrderNumber: string | null;
|
|
53
|
+
ReversalReason: string | null;
|
|
54
|
+
Description: string | null;
|
|
55
|
+
/** Net days from the terms record, used only when the header carries no due date. */
|
|
56
|
+
PaymentTermsName: string | null;
|
|
57
|
+
PaymentTermsNetDays: number | null;
|
|
58
|
+
}
|
|
59
|
+
/** One order line. Amounts are the engine's, already discounted and already taxed. */
|
|
60
|
+
export interface InvoiceLineFacts {
|
|
61
|
+
ID: string;
|
|
62
|
+
LineNumber: number;
|
|
63
|
+
ProductID: string | null;
|
|
64
|
+
ProductName: string;
|
|
65
|
+
ProductSKU: string | null;
|
|
66
|
+
Description: string | null;
|
|
67
|
+
CompanyID: string;
|
|
68
|
+
CompanyName: string;
|
|
69
|
+
Quantity: number;
|
|
70
|
+
UnitPrice: number;
|
|
71
|
+
DiscountAmount: number;
|
|
72
|
+
LineTotalNet: number;
|
|
73
|
+
ChargeAmount: number;
|
|
74
|
+
LineTax: number;
|
|
75
|
+
LineTotalGross: number;
|
|
76
|
+
ServicePeriodStart: string | null;
|
|
77
|
+
ServicePeriodEnd: string | null;
|
|
78
|
+
ParentOrderLineID: string | null;
|
|
79
|
+
IsRollupParent: boolean;
|
|
80
|
+
ReversesOrderLineID: string | null;
|
|
81
|
+
}
|
|
82
|
+
/** A header-level charge (shipping, handling, surcharge — and tax, which is a charge like any other). */
|
|
83
|
+
export interface InvoiceChargeFacts {
|
|
84
|
+
ID: string;
|
|
85
|
+
Name: string;
|
|
86
|
+
/** `Tax` separates the tax rows from the fee rows on the ladder; nothing else keys off it. */
|
|
87
|
+
Category: string;
|
|
88
|
+
Amount: number;
|
|
89
|
+
Rate: number | null;
|
|
90
|
+
Sequence: number;
|
|
91
|
+
/** Line-level allocations of this charge. Empty means it was never allocated. */
|
|
92
|
+
Allocations: Array<{
|
|
93
|
+
OrderLineID: string;
|
|
94
|
+
Amount: number;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
/** A discount that was applied — a promotion, or a manual adjustment somebody authorised. */
|
|
98
|
+
export interface InvoiceAdjustmentFacts {
|
|
99
|
+
ID: string;
|
|
100
|
+
/** Set when the adjustment targets a single line; null when it is order-wide. */
|
|
101
|
+
OrderLineID: string | null;
|
|
102
|
+
PromotionName: string | null;
|
|
103
|
+
PromotionCode: string | null;
|
|
104
|
+
Reason: string | null;
|
|
105
|
+
/** Stored as a positive magnitude of discount. */
|
|
106
|
+
Amount: number;
|
|
107
|
+
Allocations: Array<{
|
|
108
|
+
OrderLineID: string;
|
|
109
|
+
Amount: number;
|
|
110
|
+
}>;
|
|
111
|
+
}
|
|
112
|
+
/** Money received against this order. */
|
|
113
|
+
export interface InvoicePaymentFacts {
|
|
114
|
+
PaymentHeaderID: string;
|
|
115
|
+
PaymentNumber: string;
|
|
116
|
+
PaymentDate: string;
|
|
117
|
+
PaymentTypeName: string | null;
|
|
118
|
+
/** The amount of this payment allocated to THIS order (not the payment's full amount). */
|
|
119
|
+
Amount: number;
|
|
120
|
+
/** Per-line allocations; a null `OrderLineID` means it landed on the order as a whole. */
|
|
121
|
+
Allocations: Array<{
|
|
122
|
+
OrderLineID: string | null;
|
|
123
|
+
Amount: number;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
/** Somewhere to send it and somewhere to send the money back to. */
|
|
127
|
+
export interface InvoicePartyFacts {
|
|
128
|
+
Name: string | null;
|
|
129
|
+
AttentionOf: string | null;
|
|
130
|
+
AddressLines: string[];
|
|
131
|
+
Email: string | null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Who is asking to be paid.
|
|
135
|
+
*
|
|
136
|
+
* One per selling company, because on a split order they are genuinely different businesses with
|
|
137
|
+
* different registrations. `CurrencyCode` belongs here rather than on the order: it is the selling
|
|
138
|
+
* company's functional currency, which is a property of the seller and not of the sale.
|
|
139
|
+
*/
|
|
140
|
+
export interface InvoiceIssuerFacts {
|
|
141
|
+
CompanyID: string;
|
|
142
|
+
Name: string;
|
|
143
|
+
AddressLines: string[];
|
|
144
|
+
Email: string | null;
|
|
145
|
+
Phone: string | null;
|
|
146
|
+
Website: string | null;
|
|
147
|
+
/** Printed as the registration line — a tax number a buyer's AP department can quote. */
|
|
148
|
+
TaxID: string | null;
|
|
149
|
+
CurrencyCode: string | null;
|
|
150
|
+
}
|
|
151
|
+
export type DocumentKind = 'Invoice' | 'Quote' | 'Credit Memo';
|
|
152
|
+
/** One row on the printed line table. Children of a bundle hang off their parent. */
|
|
153
|
+
export interface InvoiceRow {
|
|
154
|
+
LineID: string;
|
|
155
|
+
LineNumber: number;
|
|
156
|
+
ProductName: string;
|
|
157
|
+
ProductSKU: string | null;
|
|
158
|
+
Description: string | null;
|
|
159
|
+
Quantity: number;
|
|
160
|
+
UnitPrice: number;
|
|
161
|
+
DiscountAmount: number;
|
|
162
|
+
/**
|
|
163
|
+
* What prints in the amount column. For a rollup parent this is the sum of its children in THIS
|
|
164
|
+
* document — the children then print without amounts, because printing both would show the
|
|
165
|
+
* customer a bundle charged twice.
|
|
166
|
+
*/
|
|
167
|
+
Amount: number;
|
|
168
|
+
/** True when the amount belongs to the parent above, so the renderer suppresses the column. */
|
|
169
|
+
IncludedInParent: boolean;
|
|
170
|
+
ServicePeriodStart: string | null;
|
|
171
|
+
ServicePeriodEnd: string | null;
|
|
172
|
+
ReversesOrderLineID: string | null;
|
|
173
|
+
Children: InvoiceRow[];
|
|
174
|
+
}
|
|
175
|
+
/** A row on the totals ladder, in print order. */
|
|
176
|
+
export interface LadderRow {
|
|
177
|
+
Label: string;
|
|
178
|
+
/** Shown after the label in muted type — a promo code, a tax rate. */
|
|
179
|
+
Note: string | null;
|
|
180
|
+
Amount: number;
|
|
181
|
+
Kind: 'Subtotal' | 'Discount' | 'Charge' | 'Tax' | 'Total' | 'Payment' | 'Due';
|
|
182
|
+
}
|
|
183
|
+
/** One sendable document: an order, restricted to what one selling company is owed for. */
|
|
184
|
+
export interface InvoiceDocument {
|
|
185
|
+
Kind: DocumentKind;
|
|
186
|
+
/** `ORD-1005` when the order is single-company, `ORD-1005-A` when it had to be split. */
|
|
187
|
+
DocumentNumber: string;
|
|
188
|
+
OrderNumber: string;
|
|
189
|
+
OrderHeaderID: string;
|
|
190
|
+
OrderDate: string;
|
|
191
|
+
DueDate: string | null;
|
|
192
|
+
/** Negative once overdue. Null when nothing is owed or no due date applies. */
|
|
193
|
+
DaysUntilDue: number | null;
|
|
194
|
+
Status: string;
|
|
195
|
+
PaymentStatusLabel: string;
|
|
196
|
+
CompanyID: string;
|
|
197
|
+
CompanyName: string;
|
|
198
|
+
Issuer: InvoiceIssuerFacts;
|
|
199
|
+
BillTo: InvoicePartyFacts;
|
|
200
|
+
ShipTo: InvoicePartyFacts | null;
|
|
201
|
+
TermsLabel: string;
|
|
202
|
+
ExternalDocumentNumber: string | null;
|
|
203
|
+
ReversesOrderNumber: string | null;
|
|
204
|
+
ReversalReason: string | null;
|
|
205
|
+
Description: string | null;
|
|
206
|
+
Rows: InvoiceRow[];
|
|
207
|
+
Ladder: LadderRow[];
|
|
208
|
+
ListSubtotal: number;
|
|
209
|
+
DiscountTotal: number;
|
|
210
|
+
NetTotal: number;
|
|
211
|
+
ChargeTotal: number;
|
|
212
|
+
TaxTotal: number;
|
|
213
|
+
Gross: number;
|
|
214
|
+
AmountPaid: number;
|
|
215
|
+
AmountDue: number;
|
|
216
|
+
Payments: Array<{
|
|
217
|
+
PaymentNumber: string;
|
|
218
|
+
PaymentDate: string;
|
|
219
|
+
TypeName: string | null;
|
|
220
|
+
Amount: number;
|
|
221
|
+
}>;
|
|
222
|
+
/**
|
|
223
|
+
* Anything the reader had to decide rather than read. Money that could not be attributed to a
|
|
224
|
+
* line, a discount breakdown that did not reconcile — surfaced so it can be asserted against,
|
|
225
|
+
* because each of these produces a document that looks perfectly ordinary.
|
|
226
|
+
*/
|
|
227
|
+
Notes: string[];
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Whether an order can be rendered as a customer-facing document at all, and what it is if so.
|
|
231
|
+
*
|
|
232
|
+
* A VOIDED ORDER IS REFUSED. Not because rendering it is hard, but because the resulting page is a
|
|
233
|
+
* bill for money nobody owes, indistinguishable from a real one once it is a PDF in an inbox. If
|
|
234
|
+
* somebody needs to see a voided order they can look at the order.
|
|
235
|
+
*/
|
|
236
|
+
export declare function CanRender(status: string): {
|
|
237
|
+
OK: boolean;
|
|
238
|
+
Reason?: string;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* What kind of document this order is.
|
|
242
|
+
*
|
|
243
|
+
* A reversal is a credit memo even if its total happens to be zero, and a negative total is a credit
|
|
244
|
+
* memo even when nothing was formally reversed — either way the customer is owed, and calling it an
|
|
245
|
+
* invoice would ask them to pay a negative number.
|
|
246
|
+
*/
|
|
247
|
+
export declare function DeriveDocumentKind(facts: Pick<InvoiceOrderFacts, 'Status' | 'ReversesOrderHeaderID' | 'TotalGross'>): DocumentKind;
|
|
248
|
+
/** Whole days from `from` to `to`; negative when `to` is in the past. */
|
|
249
|
+
export declare function DaysBetween(from: string, to: string): number;
|
|
250
|
+
/**
|
|
251
|
+
* The date payment is due.
|
|
252
|
+
*
|
|
253
|
+
* The header's own `DueDate` wins whenever it is set — it is what the ledger and the aging report
|
|
254
|
+
* use, and a document that computes its own would eventually print a different date than the one
|
|
255
|
+
* the collector is chasing against.
|
|
256
|
+
*/
|
|
257
|
+
export declare function DueDateFor(order: Pick<InvoiceOrderFacts, 'DueDate' | 'OrderDate' | 'PaymentTermsNetDays'>): string | null;
|
|
258
|
+
/** `Net 30`, or `Due on receipt` when there are no terms — never a blank line on a bill. */
|
|
259
|
+
export declare function TermsLabel(order: Pick<InvoiceOrderFacts, 'PaymentTermsName' | 'PaymentTermsNetDays'>): string;
|
|
260
|
+
/**
|
|
261
|
+
* How the payment position reads at a glance.
|
|
262
|
+
*
|
|
263
|
+
* Derived from the two amounts rather than copied from `OrderHeader.PaymentStatus`, because this
|
|
264
|
+
* document may cover ONE company of several and the header's status describes the whole order —
|
|
265
|
+
* printing "Paid" on the unpaid half of a split order is exactly the kind of wrong that never gets
|
|
266
|
+
* reported, it just never gets paid.
|
|
267
|
+
*/
|
|
268
|
+
export declare function PaymentStatusLabel(gross: number, paid: number): string;
|
|
269
|
+
/**
|
|
270
|
+
* The document number.
|
|
271
|
+
*
|
|
272
|
+
* A single-company order prints the ORDER number, unchanged: the customer, the ledger, the aging
|
|
273
|
+
* report and the person answering the phone all say the same string. Only when one order has to
|
|
274
|
+
* become several documents does a suffix appear, and then it is stable — companies are ordered by
|
|
275
|
+
* ID, so re-rendering the same order tomorrow produces the same `-A` and `-B`.
|
|
276
|
+
*/
|
|
277
|
+
export declare function DocumentNumber(orderNumber: string, index: number, total: number): string;
|
|
278
|
+
/**
|
|
279
|
+
* Spread an amount over companies, in proportion to what each is owed.
|
|
280
|
+
*
|
|
281
|
+
* Used for money that arrived against the ORDER rather than against a line — an order-level payment
|
|
282
|
+
* allocation has no company to belong to. Largest-remainder via {@link SplitExactly}, so the parts
|
|
283
|
+
* sum to the whole exactly: a pro-rata split that loses a cent leaves a document that can never be
|
|
284
|
+
* marked paid.
|
|
285
|
+
*/
|
|
286
|
+
export declare function SpreadAcrossCompanies(amount: number, companyGross: Array<{
|
|
287
|
+
CompanyID: string;
|
|
288
|
+
Gross: number;
|
|
289
|
+
}>): Map<string, number>;
|
|
290
|
+
/**
|
|
291
|
+
* Attribute a header-level amount to companies via its line allocations.
|
|
292
|
+
*
|
|
293
|
+
* ANY UNALLOCATED REMAINDER GOES TO THE HEADER COMPANY, and the caller is told. The alternative —
|
|
294
|
+
* ignoring it — produces documents that are each internally consistent and together bill less than
|
|
295
|
+
* the order. That is the failure this whole module is arranged to prevent, so it cannot be silent.
|
|
296
|
+
*
|
|
297
|
+
* @param lineCompany Line ID -> selling company. Allocations to unknown lines fall through to the
|
|
298
|
+
* header company too, on the same reasoning.
|
|
299
|
+
*/
|
|
300
|
+
export declare function AttributeByLine(total: number, allocations: Array<{
|
|
301
|
+
OrderLineID: string | null;
|
|
302
|
+
Amount: number;
|
|
303
|
+
}>, lineCompany: Map<string, string>, headerCompanyID: string): {
|
|
304
|
+
ByCompany: Map<string, number>;
|
|
305
|
+
Unattributed: number;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Build the printed line rows for one company's document, nesting bundle components under the
|
|
309
|
+
* bundle they came from.
|
|
310
|
+
*
|
|
311
|
+
* A ROLLUP PARENT CARRIES NO MONEY OF ITS OWN — the pricing engine zeroes it so the order does not
|
|
312
|
+
* double — so its printed amount is the sum of the children present HERE, and those children print
|
|
313
|
+
* without amounts. A bundle whose components were sold by two companies therefore appears on both
|
|
314
|
+
* documents, each showing only its own share. That looks odd on the page and is the only version
|
|
315
|
+
* that adds up.
|
|
316
|
+
*
|
|
317
|
+
* A child whose parent is not in this document is promoted to the top level rather than dropped,
|
|
318
|
+
* with its own amount intact.
|
|
319
|
+
*/
|
|
320
|
+
export declare function BuildRows(lines: InvoiceLineFacts[]): InvoiceRow[];
|
|
321
|
+
/**
|
|
322
|
+
* What one line lists at, before discount.
|
|
323
|
+
*
|
|
324
|
+
* ROLLUP PARENTS LIST AT NOTHING. The parent of a bundle carries a unit price but is deliberately
|
|
325
|
+
* priced to zero — the components carry the money — so counting `Quantity × UnitPrice` on it as
|
|
326
|
+
* well inflates the subtotal by a whole bundle. The discount line below would then absorb the
|
|
327
|
+
* difference and the ladder would still reach the right total, while showing the customer a
|
|
328
|
+
* fictional list price and a fictional saving.
|
|
329
|
+
*/
|
|
330
|
+
export declare function ListAmountOf(line: InvoiceLineFacts): number;
|
|
331
|
+
/**
|
|
332
|
+
* What one line was discounted by — DERIVED, not read.
|
|
333
|
+
*
|
|
334
|
+
* `OrderLine.DiscountAmount` IS NOT THE DISCOUNT. A discount can be recorded as an amount or as a
|
|
335
|
+
* percentage, and when it is a percentage the amount column stays zero: in the review seed, 15
|
|
336
|
+
* orders carry a discount and 16 lines have a `LineTotalNet` below list with `DiscountAmount = 0`.
|
|
337
|
+
* Trusting the column prints "Subtotal 600.00 / Total 540.00" with no discount row between them —
|
|
338
|
+
* a bill that is off by sixty dollars and looks completely ordinary.
|
|
339
|
+
*
|
|
340
|
+
* List minus net is the discount by definition, whichever way it was entered, and it carries the
|
|
341
|
+
* right sign on a return line without a special case: a credit of −300 discounted by 10.72 has a
|
|
342
|
+
* net of −289.28, so the derived discount is −10.72 and the ladder walks back UP to it.
|
|
343
|
+
*/
|
|
344
|
+
export declare function LineDiscountOf(line: InvoiceLineFacts): number;
|
|
345
|
+
/** The list subtotal, before any discount. */
|
|
346
|
+
export declare function ListSubtotalOf(lines: InvoiceLineFacts[]): number;
|
|
347
|
+
/** The whole discount on this set of lines. */
|
|
348
|
+
export declare function DiscountTotalOf(lines: InvoiceLineFacts[]): number;
|
|
349
|
+
/** Assemble the totals ladder in print order, with a residual row when the named discounts fall short. */
|
|
350
|
+
export declare function BuildLadder(input: {
|
|
351
|
+
ListSubtotal: number;
|
|
352
|
+
Discounts: Array<{
|
|
353
|
+
Label: string;
|
|
354
|
+
Note: string | null;
|
|
355
|
+
Amount: number;
|
|
356
|
+
}>;
|
|
357
|
+
DiscountTotal: number;
|
|
358
|
+
Charges: Array<{
|
|
359
|
+
Label: string;
|
|
360
|
+
Note: string | null;
|
|
361
|
+
Amount: number;
|
|
362
|
+
IsTax: boolean;
|
|
363
|
+
}>;
|
|
364
|
+
Gross: number;
|
|
365
|
+
Payments: Array<{
|
|
366
|
+
Label: string;
|
|
367
|
+
Amount: number;
|
|
368
|
+
}>;
|
|
369
|
+
AmountDue: number;
|
|
370
|
+
DueLabel: string;
|
|
371
|
+
}): LadderRow[];
|
|
372
|
+
/**
|
|
373
|
+
* Everything above, in the right order: an order and its satellites become one document per selling
|
|
374
|
+
* company.
|
|
375
|
+
*
|
|
376
|
+
* @param asOf The date the document is being produced, used only for the days-until-due countdown.
|
|
377
|
+
*/
|
|
378
|
+
export declare function BuildDocuments(input: {
|
|
379
|
+
Order: InvoiceOrderFacts;
|
|
380
|
+
Lines: InvoiceLineFacts[];
|
|
381
|
+
Charges: InvoiceChargeFacts[];
|
|
382
|
+
Adjustments: InvoiceAdjustmentFacts[];
|
|
383
|
+
Payments: InvoicePaymentFacts[];
|
|
384
|
+
BillTo: InvoicePartyFacts;
|
|
385
|
+
ShipTo: InvoicePartyFacts | null;
|
|
386
|
+
/** Company ID -> the trading name to print as the issuer. Falls back to the line's own copy. */
|
|
387
|
+
CompanyNames?: Map<string, string>;
|
|
388
|
+
/** Company ID -> issuer block. A company with no entry still gets a document, with just a name. */
|
|
389
|
+
Issuers?: Map<string, InvoiceIssuerFacts>;
|
|
390
|
+
AsOf: string;
|
|
391
|
+
/** Render only this company's document. Omit for all of them. */
|
|
392
|
+
OnlyCompanyID?: string | null;
|
|
393
|
+
}): InvoiceDocument[];
|
|
394
|
+
//# sourceMappingURL=InvoiceBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvoiceBehavior.d.ts","sourceRoot":"","sources":["../src/InvoiceBehavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AA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