@mj-biz-apps/orders-core-entities-server 5.32.0 → 5.33.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/dist/AmendArrangementOperation.d.ts +28 -2
- package/dist/AmendArrangementOperation.d.ts.map +1 -1
- package/dist/AmendArrangementOperation.js +288 -20
- package/dist/AmendArrangementOperation.js.map +1 -1
- package/dist/AmountChange.d.ts +140 -0
- package/dist/AmountChange.d.ts.map +1 -0
- package/dist/AmountChange.js +576 -0
- package/dist/AmountChange.js.map +1 -0
- package/dist/AmountChangePlan.d.ts +214 -0
- package/dist/AmountChangePlan.d.ts.map +1 -0
- package/dist/AmountChangePlan.js +337 -0
- package/dist/AmountChangePlan.js.map +1 -0
- package/dist/AttendeeRequirement.d.ts +57 -0
- package/dist/AttendeeRequirement.d.ts.map +1 -0
- package/dist/AttendeeRequirement.js +96 -0
- package/dist/AttendeeRequirement.js.map +1 -0
- package/dist/BaseInvoiceRail.d.ts +17 -0
- package/dist/BaseInvoiceRail.d.ts.map +1 -1
- package/dist/BaseInvoiceRail.js.map +1 -1
- package/dist/BasePaymentProvider.d.ts +52 -0
- package/dist/BasePaymentProvider.d.ts.map +1 -1
- package/dist/BasePaymentProvider.js +8 -0
- package/dist/BasePaymentProvider.js.map +1 -1
- package/dist/BillComGateway.d.ts +2 -0
- package/dist/BillComGateway.d.ts.map +1 -1
- package/dist/BillComGateway.js +7 -6
- package/dist/BillComGateway.js.map +1 -1
- package/dist/BundleBehavior.d.ts +60 -0
- package/dist/BundleBehavior.d.ts.map +1 -1
- package/dist/BundleBehavior.js +78 -0
- package/dist/BundleBehavior.js.map +1 -1
- package/dist/BundleEngine.d.ts.map +1 -1
- package/dist/BundleEngine.js +110 -6
- package/dist/BundleEngine.js.map +1 -1
- package/dist/CancelSubscriptionOperation.d.ts +6 -0
- package/dist/CancelSubscriptionOperation.d.ts.map +1 -1
- package/dist/CancelSubscriptionOperation.js +45 -10
- package/dist/CancelSubscriptionOperation.js.map +1 -1
- package/dist/ChargeExceptionResolution.d.ts +81 -0
- package/dist/ChargeExceptionResolution.d.ts.map +1 -0
- package/dist/ChargeExceptionResolution.js +83 -0
- package/dist/ChargeExceptionResolution.js.map +1 -0
- package/dist/CheckoutRenewalPayment.d.ts +162 -0
- package/dist/CheckoutRenewalPayment.d.ts.map +1 -0
- package/dist/CheckoutRenewalPayment.js +318 -0
- package/dist/CheckoutRenewalPayment.js.map +1 -0
- package/dist/CheckoutSavedInstrument.d.ts +11 -0
- package/dist/CheckoutSavedInstrument.d.ts.map +1 -1
- package/dist/CheckoutSavedInstrument.js +44 -18
- package/dist/CheckoutSavedInstrument.js.map +1 -1
- package/dist/CheckoutSessionService.d.ts +87 -7
- package/dist/CheckoutSessionService.d.ts.map +1 -1
- package/dist/CheckoutSessionService.js +457 -47
- package/dist/CheckoutSessionService.js.map +1 -1
- package/dist/ConcessionAcknowledgment.d.ts +25 -0
- package/dist/ConcessionAcknowledgment.d.ts.map +1 -0
- package/dist/ConcessionAcknowledgment.js +100 -0
- package/dist/ConcessionAcknowledgment.js.map +1 -0
- package/dist/ConcessionApprovalTask.d.ts +13 -8
- package/dist/ConcessionApprovalTask.d.ts.map +1 -1
- package/dist/ConcessionApprovalTask.js +23 -16
- package/dist/ConcessionApprovalTask.js.map +1 -1
- package/dist/ConcessionGate.d.ts +20 -7
- package/dist/ConcessionGate.d.ts.map +1 -1
- package/dist/ConcessionGate.js +139 -15
- package/dist/ConcessionGate.js.map +1 -1
- package/dist/CreateOrderFromProviderPaymentOperation.d.ts +60 -0
- package/dist/CreateOrderFromProviderPaymentOperation.d.ts.map +1 -0
- package/dist/CreateOrderFromProviderPaymentOperation.js +308 -0
- package/dist/CreateOrderFromProviderPaymentOperation.js.map +1 -0
- package/dist/EntitlementBehavior.d.ts +6 -5
- package/dist/EntitlementBehavior.d.ts.map +1 -1
- package/dist/EntitlementBehavior.js +6 -5
- package/dist/EntitlementBehavior.js.map +1 -1
- package/dist/EntitlementEngine.d.ts +16 -0
- package/dist/EntitlementEngine.d.ts.map +1 -1
- package/dist/EntitlementEngine.js +90 -11
- package/dist/EntitlementEngine.js.map +1 -1
- package/dist/GiftCardBehavior.d.ts +3 -1
- package/dist/GiftCardBehavior.d.ts.map +1 -1
- package/dist/GiftCardBehavior.js +6 -6
- package/dist/GiftCardBehavior.js.map +1 -1
- package/dist/GuestOrderClaimDriver.d.ts.map +1 -1
- package/dist/GuestOrderClaimDriver.js +2 -3
- package/dist/GuestOrderClaimDriver.js.map +1 -1
- package/dist/HubSpotPaymentsGateway.d.ts +37 -0
- package/dist/HubSpotPaymentsGateway.d.ts.map +1 -0
- package/dist/HubSpotPaymentsGateway.js +54 -0
- package/dist/HubSpotPaymentsGateway.js.map +1 -0
- package/dist/HubSpotPaymentsProvider.d.ts +13 -0
- package/dist/HubSpotPaymentsProvider.d.ts.map +1 -0
- package/dist/HubSpotPaymentsProvider.js +49 -0
- package/dist/HubSpotPaymentsProvider.js.map +1 -0
- package/dist/HubSpotPaymentsRail.d.ts +20 -0
- package/dist/HubSpotPaymentsRail.d.ts.map +1 -0
- package/dist/HubSpotPaymentsRail.js +164 -0
- package/dist/HubSpotPaymentsRail.js.map +1 -0
- package/dist/InstalmentBilledSoFar.d.ts +52 -0
- package/dist/InstalmentBilledSoFar.d.ts.map +1 -0
- package/dist/InstalmentBilledSoFar.js +133 -0
- package/dist/InstalmentBilledSoFar.js.map +1 -0
- package/dist/InstalmentInvoiceEntry.d.ts +53 -5
- package/dist/InstalmentInvoiceEntry.d.ts.map +1 -1
- package/dist/InstalmentInvoiceEntry.js +59 -22
- package/dist/InstalmentInvoiceEntry.js.map +1 -1
- package/dist/InvoiceBehavior.d.ts +72 -1
- package/dist/InvoiceBehavior.d.ts.map +1 -1
- package/dist/InvoiceBehavior.js +129 -11
- package/dist/InvoiceBehavior.js.map +1 -1
- package/dist/InvoiceBuilder.d.ts +28 -1
- package/dist/InvoiceBuilder.d.ts.map +1 -1
- package/dist/InvoiceBuilder.js +155 -6
- package/dist/InvoiceBuilder.js.map +1 -1
- package/dist/InvoiceRailResolver.d.ts +13 -1
- package/dist/InvoiceRailResolver.d.ts.map +1 -1
- package/dist/InvoiceRailResolver.js +16 -2
- package/dist/InvoiceRailResolver.js.map +1 -1
- package/dist/IssueInstalmentInvoiceOperation.d.ts.map +1 -1
- package/dist/IssueInstalmentInvoiceOperation.js +34 -7
- package/dist/IssueInstalmentInvoiceOperation.js.map +1 -1
- package/dist/LineParty.d.ts +34 -0
- package/dist/LineParty.d.ts.map +1 -0
- package/dist/LineParty.js +23 -0
- package/dist/LineParty.js.map +1 -0
- package/dist/OrderConcessionEntityServer.d.ts +124 -5
- package/dist/OrderConcessionEntityServer.d.ts.map +1 -1
- package/dist/OrderConcessionEntityServer.js +502 -54
- package/dist/OrderConcessionEntityServer.js.map +1 -1
- package/dist/OrderEntityServer.d.ts +78 -6
- package/dist/OrderEntityServer.d.ts.map +1 -1
- package/dist/OrderEntityServer.js +366 -30
- package/dist/OrderEntityServer.js.map +1 -1
- package/dist/OrderHeaderPaymentScheduleEntityServer.d.ts +12 -1
- package/dist/OrderHeaderPaymentScheduleEntityServer.d.ts.map +1 -1
- package/dist/OrderHeaderPaymentScheduleEntityServer.js +25 -1
- package/dist/OrderHeaderPaymentScheduleEntityServer.js.map +1 -1
- package/dist/OrderJournalEntryFactory.d.ts +7 -0
- package/dist/OrderJournalEntryFactory.d.ts.map +1 -1
- package/dist/OrderJournalEntryFactory.js +20 -5
- package/dist/OrderJournalEntryFactory.js.map +1 -1
- package/dist/OrderLineEntityServer.d.ts +1 -15
- package/dist/OrderLineEntityServer.d.ts.map +1 -1
- package/dist/OrderLineEntityServer.js +9 -17
- package/dist/OrderLineEntityServer.js.map +1 -1
- package/dist/OrdersSettings.d.ts +25 -0
- package/dist/OrdersSettings.d.ts.map +1 -1
- package/dist/OrdersSettings.js +54 -0
- package/dist/OrdersSettings.js.map +1 -1
- package/dist/PaymentAllocationInputs.d.ts.map +1 -1
- package/dist/PaymentAllocationInputs.js +2 -1
- package/dist/PaymentAllocationInputs.js.map +1 -1
- package/dist/PaymentIntentService.d.ts +6 -0
- package/dist/PaymentIntentService.d.ts.map +1 -1
- package/dist/PaymentIntentService.js +43 -12
- package/dist/PaymentIntentService.js.map +1 -1
- package/dist/PaymentScheduleBehavior.d.ts +12 -3
- package/dist/PaymentScheduleBehavior.d.ts.map +1 -1
- package/dist/PaymentScheduleBehavior.js +26 -7
- package/dist/PaymentScheduleBehavior.js.map +1 -1
- package/dist/PollExternalPaymentsOperation.d.ts +2 -1
- package/dist/PollExternalPaymentsOperation.d.ts.map +1 -1
- package/dist/PollExternalPaymentsOperation.js +42 -17
- package/dist/PollExternalPaymentsOperation.js.map +1 -1
- package/dist/ProviderPaymentOrder.d.ts +56 -0
- package/dist/ProviderPaymentOrder.d.ts.map +1 -0
- package/dist/ProviderPaymentOrder.js +78 -0
- package/dist/ProviderPaymentOrder.js.map +1 -0
- package/dist/ReconcilePaymentProviderChargesOperation.d.ts +12 -0
- package/dist/ReconcilePaymentProviderChargesOperation.d.ts.map +1 -1
- package/dist/ReconcilePaymentProviderChargesOperation.js +68 -4
- package/dist/ReconcilePaymentProviderChargesOperation.js.map +1 -1
- package/dist/ReferralProgram.d.ts +25 -0
- package/dist/ReferralProgram.d.ts.map +1 -0
- package/dist/ReferralProgram.js +59 -0
- package/dist/ReferralProgram.js.map +1 -0
- package/dist/RenewalCharging.d.ts +222 -0
- package/dist/RenewalCharging.d.ts.map +1 -0
- package/dist/RenewalCharging.js +718 -0
- package/dist/RenewalCharging.js.map +1 -0
- package/dist/RenewalPromotions.d.ts +58 -0
- package/dist/RenewalPromotions.d.ts.map +1 -0
- package/dist/RenewalPromotions.js +81 -0
- package/dist/RenewalPromotions.js.map +1 -0
- package/dist/ResolveChargeExceptionOperation.d.ts +66 -0
- package/dist/ResolveChargeExceptionOperation.d.ts.map +1 -0
- package/dist/ResolveChargeExceptionOperation.js +198 -0
- package/dist/ResolveChargeExceptionOperation.js.map +1 -0
- package/dist/ReversalBehavior.d.ts +55 -1
- package/dist/ReversalBehavior.d.ts.map +1 -1
- package/dist/ReversalBehavior.js +79 -15
- package/dist/ReversalBehavior.js.map +1 -1
- package/dist/ReversalResolver.d.ts.map +1 -1
- package/dist/ReversalResolver.js +1 -0
- package/dist/ReversalResolver.js.map +1 -1
- package/dist/ReversalScheduleReduction.d.ts +61 -0
- package/dist/ReversalScheduleReduction.d.ts.map +1 -0
- package/dist/ReversalScheduleReduction.js +180 -0
- package/dist/ReversalScheduleReduction.js.map +1 -0
- package/dist/SeatAddition.d.ts +16 -0
- package/dist/SeatAddition.d.ts.map +1 -0
- package/dist/SeatAddition.js +62 -0
- package/dist/SeatAddition.js.map +1 -0
- package/dist/SpawnRenewalsOperation.d.ts +50 -7
- package/dist/SpawnRenewalsOperation.d.ts.map +1 -1
- package/dist/SpawnRenewalsOperation.js +161 -21
- package/dist/SpawnRenewalsOperation.js.map +1 -1
- package/dist/StripePaymentProvider.d.ts +33 -1
- package/dist/StripePaymentProvider.d.ts.map +1 -1
- package/dist/StripePaymentProvider.js +142 -3
- package/dist/StripePaymentProvider.js.map +1 -1
- package/dist/SubscriptionBehavior.d.ts +34 -4
- package/dist/SubscriptionBehavior.d.ts.map +1 -1
- package/dist/SubscriptionBehavior.js +41 -6
- package/dist/SubscriptionBehavior.js.map +1 -1
- package/dist/TermExtension.d.ts +78 -1
- package/dist/TermExtension.d.ts.map +1 -1
- package/dist/TermExtension.js +63 -46
- package/dist/TermExtension.js.map +1 -1
- package/dist/TermExtensionPlan.d.ts +6 -3
- package/dist/TermExtensionPlan.d.ts.map +1 -1
- package/dist/TermExtensionPlan.js +6 -4
- package/dist/TermExtensionPlan.js.map +1 -1
- package/dist/TermShift.d.ts +65 -0
- package/dist/TermShift.d.ts.map +1 -0
- package/dist/TermShift.js +342 -0
- package/dist/TermShift.js.map +1 -0
- package/dist/TermShiftPlan.d.ts +71 -0
- package/dist/TermShiftPlan.d.ts.map +1 -0
- package/dist/TermShiftPlan.js +127 -0
- package/dist/TermShiftPlan.js.map +1 -0
- package/dist/UnmatchedChargeOrders.d.ts +49 -0
- package/dist/UnmatchedChargeOrders.d.ts.map +1 -0
- package/dist/UnmatchedChargeOrders.js +122 -0
- package/dist/UnmatchedChargeOrders.js.map +1 -0
- package/dist/UnmatchedChargeRules.d.ts +73 -0
- package/dist/UnmatchedChargeRules.d.ts.map +1 -0
- package/dist/UnmatchedChargeRules.js +92 -0
- package/dist/UnmatchedChargeRules.js.map +1 -0
- package/dist/VatLocationEvidence.d.ts +21 -0
- package/dist/VatLocationEvidence.d.ts.map +1 -0
- package/dist/VatLocationEvidence.js +31 -0
- package/dist/VatLocationEvidence.js.map +1 -0
- package/dist/claimDriverHelpers.d.ts.map +1 -1
- package/dist/claimDriverHelpers.js +1 -2
- package/dist/claimDriverHelpers.js.map +1 -1
- package/dist/entity-names.d.ts +6 -0
- package/dist/entity-names.d.ts.map +1 -1
- package/dist/entity-names.js +6 -0
- package/dist/entity-names.js.map +1 -1
- package/dist/index.d.ts +33 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/person-user-link.d.ts +59 -0
- package/dist/person-user-link.d.ts.map +1 -0
- package/dist/person-user-link.js +174 -0
- package/dist/person-user-link.js.map +1 -0
- package/dist/sql-guards.d.ts +2 -36
- package/dist/sql-guards.d.ts.map +1 -1
- package/dist/sql-guards.js +7 -59
- package/dist/sql-guards.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AmountChange — lower a booked term's amount (#506, golive #221 case A).
|
|
3
|
+
*
|
|
4
|
+
* CHECK: read everything the change depends on and plan it, writing nothing. `Orders.AmendArrangement` with
|
|
5
|
+
* `NewAmount` and `Preview: true` returns this plan: the reduction and its tax, the catch-up, the staged entries
|
|
6
|
+
* offset and the new schedule, the instalments reduced or cancelled, and any credit memo.
|
|
7
|
+
*
|
|
8
|
+
* APPLY: an approved Price concession carrying `NewAmount` is applied in the approval's own transaction:
|
|
9
|
+
* - the catch-up, the offsets and the new schedule are posted through Accounting.CreateJournalEntries;
|
|
10
|
+
* - the term's amount becomes the new amount;
|
|
11
|
+
* - the instalments not yet invoiced are lowered, or cancelled when lowered to nothing;
|
|
12
|
+
* - what they cannot absorb is credited on a credit memo (#662): see below;
|
|
13
|
+
* - an `AmountChanged` subscription event records it, and accounting's acknowledgment task is raised.
|
|
14
|
+
* The concession's `ScheduleReduction` and `CreditMemoAmount` (set by the concession itself) are what the order's
|
|
15
|
+
* balance takes off the booked lines; the schedule check takes off only `ScheduleReduction`.
|
|
16
|
+
*
|
|
17
|
+
* THE CREDIT MEMO IS THE APPROVED CHANGE ITSELF (#662). A reduction the uninvoiced instalments cannot absorb in full
|
|
18
|
+
* (part of it lands on an invoice already sent, the order is billed as a whole, or a refund is asked for) is
|
|
19
|
+
* credited on a memo the concession carries: its amount and document number. Applying it
|
|
20
|
+
* - posts the memo's entry, dated the effective day: deferred revenue and tax debited, the receivable credited;
|
|
21
|
+
* - credits the invoiced instalment it names, up to that invoice's open amount (`AmountCredited`), or, when the
|
|
22
|
+
* customer asked for a paid invoice's credit back, records it there for finance to refund;
|
|
23
|
+
* - lowers the line's `BilledToDate` by the memo's net, as a return's memo does.
|
|
24
|
+
* Whatever no invoice takes is the customer's credit: the order's balance falls by the memo, so a paid order goes
|
|
25
|
+
* negative, which is how an account credit is held (D68). A refund is not paid here; finance refunds it from the
|
|
26
|
+
* order's payments with `Orders.RefundPayment`, and the acknowledgment task says so.
|
|
27
|
+
*
|
|
28
|
+
* WHEN IT IS REFUSED:
|
|
29
|
+
* - the term is not Scheduled or Active, or its renewal is already placed (reverse that first);
|
|
30
|
+
* - the line that bought the term has had a return against it, so the term's amount no longer describes what
|
|
31
|
+
* the customer was billed for it;
|
|
32
|
+
* - the new amount is not lower than the current one, or is zero (that is a cancellation);
|
|
33
|
+
* - a staged entry that would need an offset is already in a journal-entry batch;
|
|
34
|
+
* - the staged entries do not add up to the term's amount, so the share already earned cannot be read;
|
|
35
|
+
* - "applies to invoice" names something that is not an invoiced instalment of this order's covering company;
|
|
36
|
+
* - an instalment would be lowered below what has already been paid on it;
|
|
37
|
+
* - the line would stay billed for more than its new amount;
|
|
38
|
+
* - a credit memo is needed and the line carries a charge other than tax, whose share nothing can say;
|
|
39
|
+
* - no one other than the requester holds the acknowledgment role, so accounting could not be told.
|
|
40
|
+
*
|
|
41
|
+
* CONNECTS TO:
|
|
42
|
+
* PLAN: ./AmountChangePlan.ts
|
|
43
|
+
* SHARES: ./TermExtension.ts (renewal check, acknowledgers, the term's driver, its staged entries, the task)
|
|
44
|
+
* ./ReversalBehavior.ts + ./ReversalResolver.ts (the tax the line was charged, mirrored)
|
|
45
|
+
* ./PaymentScheduleBehavior.ts (which rows bill the line's company)
|
|
46
|
+
* CALLER: AmendArrangementOperation (preview) · OrderConcessionEntityServer (value, apply)
|
|
47
|
+
* WRITES: Accounting.CreateJournalEntries · Subscription Terms · Order Header Payment Schedules ·
|
|
48
|
+
* Order Lines (BilledToDate) · Subscription Events · Tasks
|
|
49
|
+
*/
|
|
50
|
+
import { type EntitySaveOptions } from '@memberjunction/core';
|
|
51
|
+
import { type AmountChangePlan, type CreditMemoSplit, type InstalmentChange, type ReductionPlan } from './AmountChangePlan.js';
|
|
52
|
+
import type { ApprovalTaskContext } from './ConcessionApprovalTask.js';
|
|
53
|
+
export interface AmountChangeRequest {
|
|
54
|
+
SubscriptionTermID: string;
|
|
55
|
+
/** The term's new amount: net of discount, before tax. */
|
|
56
|
+
NewAmount: number;
|
|
57
|
+
/** The invoiced instalment the reduction is about, when it is about one. */
|
|
58
|
+
AppliesToInvoiceID?: string | null;
|
|
59
|
+
/** The customer asked for a refund of a paid invoice's credit. */
|
|
60
|
+
RefundRequested?: boolean;
|
|
61
|
+
/** Who asked. Excluded from the acknowledgment, which they cannot confirm themselves. */
|
|
62
|
+
RequestedByUserID: string;
|
|
63
|
+
/** The concession being approved or applied, which is not one of the line's earlier changes. */
|
|
64
|
+
OrderConcessionID?: string | null;
|
|
65
|
+
}
|
|
66
|
+
/** Everything an amount change would do, read and planned but not written. */
|
|
67
|
+
export interface CheckedAmountChange {
|
|
68
|
+
TermID: string;
|
|
69
|
+
TermNumber: number;
|
|
70
|
+
SubscriptionID: string;
|
|
71
|
+
SubscriptionNumber: string;
|
|
72
|
+
OrderHeaderID: string;
|
|
73
|
+
OrderNumber: string | null;
|
|
74
|
+
OrderLineID: string;
|
|
75
|
+
CurrentAmount: number;
|
|
76
|
+
NewAmount: number;
|
|
77
|
+
/** The tax charged on the reduction, mirrored from the line's own tax charges. */
|
|
78
|
+
TaxReduction: number;
|
|
79
|
+
/** Reduction plus its tax: what the customer is billed less. */
|
|
80
|
+
GrossReduction: number;
|
|
81
|
+
EffectiveDate: Date;
|
|
82
|
+
Recognition: AmountChangePlan;
|
|
83
|
+
Billing: ReductionPlan;
|
|
84
|
+
/** What the billing plan takes off the instalments not yet invoiced, reduction and tax together. */
|
|
85
|
+
ScheduleReduction: number;
|
|
86
|
+
/** The rest of the gross reduction, credited on a credit memo, as net and tax. Zero when none is needed. */
|
|
87
|
+
CreditMemo: CreditMemoSplit;
|
|
88
|
+
AcknowledgerIDs: string[];
|
|
89
|
+
}
|
|
90
|
+
/** Check an amount change and plan it, or say why it cannot be made. Reads only. */
|
|
91
|
+
export declare function CheckAmountChange(request: AmountChangeRequest, ctx: ApprovalTaskContext): Promise<CheckedAmountChange | string>;
|
|
92
|
+
/** The document number the order's next credit memo takes. */
|
|
93
|
+
export declare function NextCreditMemoNumber(orderHeaderID: string, orderNumber: string | null, ctx: ApprovalTaskContext): Promise<string>;
|
|
94
|
+
/** The approved concession an amount change is applied from. */
|
|
95
|
+
export interface ApprovedAmountChange {
|
|
96
|
+
ID: string;
|
|
97
|
+
SubscriptionTermID: string;
|
|
98
|
+
NewAmount: number;
|
|
99
|
+
AppliesToPaymentScheduleID: string | null;
|
|
100
|
+
RefundRequested: boolean;
|
|
101
|
+
RequestedByUserID: string;
|
|
102
|
+
ReasonCategory: string;
|
|
103
|
+
Reason: string;
|
|
104
|
+
/** The reduction the concession was valued at when recorded. */
|
|
105
|
+
ComputedValue: number;
|
|
106
|
+
/** The credit memo stamped on approval, and its number. Zero and null when none is needed. */
|
|
107
|
+
CreditMemoAmount: number;
|
|
108
|
+
CreditMemoNumber: string | null;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Apply an approved amount change to its term. Joins the caller's transaction; throws on any refusal, so the
|
|
112
|
+
* caller's approval rolls back with it.
|
|
113
|
+
*/
|
|
114
|
+
export declare function ApplyAmountChange(concession: ApprovedAmountChange, ctx: ApprovalTaskContext): Promise<CheckedAmountChange>;
|
|
115
|
+
/**
|
|
116
|
+
* Write a reduction plan's instalments: each takes its new amount, or is cancelled at zero. Refuses an
|
|
117
|
+
* instalment invoiced since the plan was made. `waited` finishes "was invoiced while …".
|
|
118
|
+
*/
|
|
119
|
+
export declare function LowerInstalments(changes: InstalmentChange[], waited: string, ctx: ApprovalTaskContext, options?: EntitySaveOptions): Promise<void>;
|
|
120
|
+
/** An approved amount change, as what it takes off its line. */
|
|
121
|
+
export interface AppliedAmountChange {
|
|
122
|
+
OrderConcessionID: string;
|
|
123
|
+
OrderLineID: string;
|
|
124
|
+
CompanyID: string;
|
|
125
|
+
/** What it took off the line's instalment billing, before tax: the schedule reduction's net. */
|
|
126
|
+
Net: number;
|
|
127
|
+
/** The tax on that. */
|
|
128
|
+
Tax: number;
|
|
129
|
+
/** Both: the concession's ScheduleReduction. Zero when a credit memo took the whole reduction. */
|
|
130
|
+
Gross: number;
|
|
131
|
+
/** The whole reduction before tax, credit memo included: the concession's value. */
|
|
132
|
+
ReducedNet: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The approved amount changes on an order. The schedule check and each instalment invoice take their schedule
|
|
136
|
+
* reductions off the lines they changed, so the lowered instalments still tie to the lines. A credit memo's part is
|
|
137
|
+
* not taken off: it was billed on an invoice already sent, and the memo gives it back.
|
|
138
|
+
*/
|
|
139
|
+
export declare function AppliedAmountChanges(orderHeaderID: string, ctx: ApprovalTaskContext): Promise<AppliedAmountChange[]>;
|
|
140
|
+
//# sourceMappingURL=AmountChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmountChange.d.ts","sourceRoot":"","sources":["../src/AmountChange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAW,KAAK,iBAAiB,EAAyB,MAAM,sBAAsB,CAAC;AAG9F,OAAO,EAOH,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA4BvE,MAAM,WAAW,mBAAmB;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yFAAyF;IACzF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,E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