774 lines
16 KiB
TypeScript
774 lines
16 KiB
TypeScript
export interface OrderRecord {
|
|||
|
|
id: string;
|
||
|
|
number: string;
|
||
|
|
date: string;
|
||
|
|
customer: string;
|
||
|
|
salesperson: string;
|
||
|
|
note: string;
|
||
|
|
paper_number: string;
|
||
|
|
status: string;
|
||
|
|
lines: OrderLine[];
|
||
|
|
discount: number;
|
||
|
|
total: number;
|
||
|
|
revision: number;
|
||
|
|
reviewed_revision: number;
|
||
|
|
created: string;
|
||
|
|
delivered_date: null | string;
|
||
|
|
returned_date: null | string;
|
||
|
|
paper_date: string;
|
||
|
|
payment_account: string;
|
||
|
|
fee_items: Fee[];
|
||
|
|
fees_date: string;
|
||
|
|
rounding_mode: string;
|
||
|
|
internal_note: string;
|
||
|
|
fee_cost_mode: string;
|
||
|
|
customer_type: string;
|
||
|
|
member: string;
|
||
|
|
cancellationPending?: CancellationRequest | null;
|
||
|
|
cancellationApproved?: null | CancellationRequest;
|
||
|
|
changePending?: ChangeRequest | null;
|
||
|
|
ownershipPending: OwnershipRequest | null;
|
||
|
|
payments: Payment[];
|
||
|
|
expenses: Expense[];
|
||
|
|
settlements: Settlement[];
|
||
|
|
corrections: Correction[];
|
||
|
|
netReceived: number;
|
||
|
|
balance: number;
|
||
|
|
rounding_adjustment: number;
|
||
|
|
goodsCost: number | null;
|
||
|
|
directCost: number;
|
||
|
|
materialCostPending: boolean;
|
||
|
|
knownGoodsCost: number;
|
||
|
|
pendingFees: Fee[];
|
||
|
|
profit: number | null;
|
||
|
|
ownerCost: number;
|
||
|
|
ownerDirect: number;
|
||
|
|
ownerCredit: number;
|
||
|
|
costTransferred: number;
|
||
|
|
profitTransferred: number;
|
||
|
|
costDue: number;
|
||
|
|
profitDue: number;
|
||
|
|
settlementDue: number | null;
|
||
|
|
audit?: OrderRecordAudit[];
|
||
|
|
funds_mode: string;
|
||
|
|
credit_card_rate_permille?: number;
|
||
|
|
printStatus?: PrintStatus;
|
||
|
|
orderAfterSale?: OrderAfterSale;
|
||
|
|
assistantInventoryCredit?: number;
|
||
|
|
assistantInventoryCreditExplanation?: string;
|
||
|
|
kind?: string;
|
||
|
|
price_lock_id?: string;
|
||
|
|
recovery_id?: string;
|
||
|
|
recovery_mode?: string;
|
||
|
|
priceLockCosts?: LockCosts;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface BookData {
|
||
|
|
from: string;
|
||
|
|
date: string;
|
||
|
|
pocket: string;
|
||
|
|
rows: BookRow[];
|
||
|
|
displayRows?: BookRow[];
|
||
|
|
recoveryCount: number;
|
||
|
|
summary: BookSummary;
|
||
|
|
priceLockActivity: LockActivity;
|
||
|
|
summaryWithoutCancelled: BookSummary;
|
||
|
|
receiptsWithoutCancelled: ReceiptSummary;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ChangeRequest {
|
||
|
|
id: string;
|
||
|
|
order_id: string;
|
||
|
|
order_revision: number;
|
||
|
|
action: string;
|
||
|
|
reason: string;
|
||
|
|
status: 'pending' | 'approved' | 'rejected';
|
||
|
|
requester_name: string;
|
||
|
|
created: string;
|
||
|
|
reviewer_name: null | string;
|
||
|
|
reviewed: null | string;
|
||
|
|
note: string;
|
||
|
|
action_label: string;
|
||
|
|
order_number?: string;
|
||
|
|
order_date?: string;
|
||
|
|
stale?: boolean;
|
||
|
|
canApprove?: boolean;
|
||
|
|
before: OrderRecord;
|
||
|
|
after: OrderRecord;
|
||
|
|
summary: ChangeSummary;
|
||
|
|
relatedOrders?: RelatedOrder[];
|
||
|
|
action_details?: ChangeActionInput;
|
||
|
|
action_input?: ChangeActionInput;
|
||
|
|
relatedPriceLocks?: RelatedLock[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OwnershipRequest {
|
||
|
|
id: string;
|
||
|
|
order_id: string;
|
||
|
|
order_revision: number;
|
||
|
|
reason: string;
|
||
|
|
status: 'pending' | 'approved' | 'rejected';
|
||
|
|
direct: boolean;
|
||
|
|
requester_name: string;
|
||
|
|
created: string;
|
||
|
|
reviewer_name: null | string;
|
||
|
|
reviewed: null | string;
|
||
|
|
note: string;
|
||
|
|
before: Member;
|
||
|
|
after: Member;
|
||
|
|
order_number?: string;
|
||
|
|
order_customer?: string;
|
||
|
|
order_date?: string;
|
||
|
|
stale?: boolean;
|
||
|
|
canApprove?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CancellationRequest {
|
||
|
|
executedAt?: string;
|
||
|
|
operator_name?: string;
|
||
|
|
id: string;
|
||
|
|
order_id: string;
|
||
|
|
order_revision: number;
|
||
|
|
reason: string;
|
||
|
|
status: 'pending' | 'approved' | 'rejected';
|
||
|
|
requester_name: string;
|
||
|
|
created: string;
|
||
|
|
reviewer_name: null | string;
|
||
|
|
reviewed: null | string;
|
||
|
|
note: string;
|
||
|
|
order_number?: string;
|
||
|
|
order_date?: string;
|
||
|
|
requiresLegacyCountVerified?: boolean;
|
||
|
|
legacyCountNotice?: string;
|
||
|
|
stale?: boolean;
|
||
|
|
canApprove?: boolean;
|
||
|
|
summary: CancelSummary;
|
||
|
|
direct?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ChangeData {
|
||
|
|
eligible: boolean;
|
||
|
|
reason: string;
|
||
|
|
actions: ActionRules;
|
||
|
|
directActionDate: string;
|
||
|
|
revision: number;
|
||
|
|
pending: ChangeRequest | null;
|
||
|
|
requests: ChangeRequest[];
|
||
|
|
canApprove: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OwnershipData {
|
||
|
|
eligible: boolean;
|
||
|
|
reason: string;
|
||
|
|
revision: number;
|
||
|
|
member: string;
|
||
|
|
members: Member[];
|
||
|
|
requiresApproval: boolean;
|
||
|
|
canDirect: boolean;
|
||
|
|
canApprove: boolean;
|
||
|
|
pending: OwnershipRequest | null;
|
||
|
|
requests: OwnershipRequest[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CancellationData {
|
||
|
|
eligible: boolean;
|
||
|
|
reason: string;
|
||
|
|
revision: number;
|
||
|
|
requiresLegacyCountVerified: boolean;
|
||
|
|
legacyCountNotice: string;
|
||
|
|
directActionDate: string;
|
||
|
|
directToday: boolean;
|
||
|
|
pending: CancellationRequest | null;
|
||
|
|
requests: CancellationRequest[];
|
||
|
|
canApprove: boolean;
|
||
|
|
summary?: CancelSummary;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OrderAfterSaleData {
|
||
|
|
orderId: string;
|
||
|
|
revision: number;
|
||
|
|
eligible: boolean;
|
||
|
|
blockedReason: string;
|
||
|
|
record: null | OrderAfterSale;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IndependentDetail {
|
||
|
|
id: string;
|
||
|
|
revision: number;
|
||
|
|
record: IndependentRecord;
|
||
|
|
values: IndependentValues;
|
||
|
|
permissions: AfterPermissions;
|
||
|
|
pending: IndependentRequest | null;
|
||
|
|
history: IndependentRequest[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IndependentRequest {
|
||
|
|
id: string;
|
||
|
|
afterSaleId: string;
|
||
|
|
revision: number;
|
||
|
|
recordRevision: number;
|
||
|
|
status: 'pending' | 'approved' | 'rejected';
|
||
|
|
reason: string;
|
||
|
|
before: IndependentValues;
|
||
|
|
after: IndependentValues;
|
||
|
|
member: string;
|
||
|
|
requesterName: string;
|
||
|
|
created: string;
|
||
|
|
reviewerName: string | null;
|
||
|
|
reviewed: string | null;
|
||
|
|
note: string;
|
||
|
|
stale: boolean;
|
||
|
|
staleReason: string;
|
||
|
|
canApprove: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OrderLine {
|
||
|
|
name: string;
|
||
|
|
code: string;
|
||
|
|
unit: string;
|
||
|
|
quantity: number;
|
||
|
|
pocket: string;
|
||
|
|
payer: string;
|
||
|
|
cost: number;
|
||
|
|
sale: number;
|
||
|
|
baseSale: number;
|
||
|
|
charges: Charge[];
|
||
|
|
pricingMode: string;
|
||
|
|
priceNote: string;
|
||
|
|
costPayers?: OrderLineCostPayers;
|
||
|
|
costParts?: CostParts;
|
||
|
|
costMaterial?: CostMode;
|
||
|
|
costLabor?: CostMode;
|
||
|
|
goldPrice?: number;
|
||
|
|
laborRate?: number;
|
||
|
|
laborMode?: string;
|
||
|
|
pieces?: number;
|
||
|
|
materialPool?: LinePool;
|
||
|
|
stockCount?: number | null;
|
||
|
|
priceLockPool?: LinePool;
|
||
|
|
priceLockExtraPool?: LinePool;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OrderRecordAudit {
|
||
|
|
action: string;
|
||
|
|
actor: string;
|
||
|
|
detail: { reason?: string };
|
||
|
|
created: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface PrintStatus {
|
||
|
|
kind: string;
|
||
|
|
id: string;
|
||
|
|
printed: boolean;
|
||
|
|
revision?: number;
|
||
|
|
actor?: string | null;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Fee {
|
||
|
|
key: string;
|
||
|
|
system?: string;
|
||
|
|
source_kind?: string;
|
||
|
|
source_id?: string;
|
||
|
|
date?: string;
|
||
|
|
amount: number;
|
||
|
|
payer: string;
|
||
|
|
note: string;
|
||
|
|
status: string;
|
||
|
|
expense_id?: string;
|
||
|
|
edited?: boolean;
|
||
|
|
lineNumber?: number;
|
||
|
|
sourceName?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Payment {
|
||
|
|
price_lock_event_id?: string;
|
||
|
|
id: string;
|
||
|
|
order_id: string;
|
||
|
|
date: string;
|
||
|
|
kind: string;
|
||
|
|
amount: number;
|
||
|
|
account: string;
|
||
|
|
reference: string;
|
||
|
|
actor: string;
|
||
|
|
created: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Expense {
|
||
|
|
id: string;
|
||
|
|
order_id: string;
|
||
|
|
date: string;
|
||
|
|
amount: number;
|
||
|
|
payer: string;
|
||
|
|
note: string;
|
||
|
|
actor: string;
|
||
|
|
created: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Correction {
|
||
|
|
target: string;
|
||
|
|
type: string;
|
||
|
|
reason: string;
|
||
|
|
actor: string;
|
||
|
|
created: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface BookRow {
|
||
|
|
[key: `${string}Cost`]: number | null | undefined;
|
||
|
|
assistant2Cost?: number;
|
||
|
|
id: string;
|
||
|
|
order_id?: string;
|
||
|
|
kind?: string;
|
||
|
|
orderAfterSale?: OrderAfterSale;
|
||
|
|
member?: string;
|
||
|
|
number: string;
|
||
|
|
paper_number: string;
|
||
|
|
date: string;
|
||
|
|
order_date?: string;
|
||
|
|
created: string;
|
||
|
|
customer: string;
|
||
|
|
salesperson: string;
|
||
|
|
status: string;
|
||
|
|
note: string;
|
||
|
|
project?: string;
|
||
|
|
types: string[];
|
||
|
|
mg: number;
|
||
|
|
pieces: number;
|
||
|
|
originalSale?: number;
|
||
|
|
sale?: number;
|
||
|
|
material?: number | null;
|
||
|
|
laborAndFees?: number | null;
|
||
|
|
unallocated?: number;
|
||
|
|
totalCost?: number;
|
||
|
|
profit?: number;
|
||
|
|
ownerCost?: number;
|
||
|
|
assistantCost?: number;
|
||
|
|
known?: Known;
|
||
|
|
costItems?: BookCost[];
|
||
|
|
laborAndFeeItems?: BookCost[];
|
||
|
|
pendingCosts?: number;
|
||
|
|
unknownCosts?: number;
|
||
|
|
legacyUnallocated?: boolean;
|
||
|
|
incomplete?: boolean;
|
||
|
|
costHint: string;
|
||
|
|
balance?: number;
|
||
|
|
revision?: number;
|
||
|
|
reviewed_revision?: number;
|
||
|
|
funds_mode?: string;
|
||
|
|
price_lock_id?: string;
|
||
|
|
recovery_id?: string;
|
||
|
|
recovery_mode?: string;
|
||
|
|
cancellationApproved?: CancellationRequest | null;
|
||
|
|
materialCostPending?: boolean;
|
||
|
|
printStatus?: PrintStatus;
|
||
|
|
after_sale_id?: string;
|
||
|
|
amount?: number;
|
||
|
|
payer?: string;
|
||
|
|
cashPayment?: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface BookSummary {
|
||
|
|
[key: `${string}Cost`]: number;
|
||
|
|
assistant2Cost: number;
|
||
|
|
orderCount: number;
|
||
|
|
completedCount: number;
|
||
|
|
draftCount: number;
|
||
|
|
cancelledCount: number;
|
||
|
|
incompleteCount: number;
|
||
|
|
pendingCosts: number;
|
||
|
|
unknownCosts: number;
|
||
|
|
unknownCostCount: number;
|
||
|
|
unknownProfitCount: number;
|
||
|
|
sale: number;
|
||
|
|
material: number;
|
||
|
|
laborAndFees: number;
|
||
|
|
unallocated: number;
|
||
|
|
totalCost: number;
|
||
|
|
profit: number;
|
||
|
|
ownerCost: number;
|
||
|
|
assistantCost: number;
|
||
|
|
mg: number;
|
||
|
|
pieces: number;
|
||
|
|
knownCounts: Counts;
|
||
|
|
unknownCounts: Counts;
|
||
|
|
afterSaleCount: number;
|
||
|
|
recordCount: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface LockActivity {
|
||
|
|
basis: string;
|
||
|
|
from: string;
|
||
|
|
date: string;
|
||
|
|
customerCash: LockActivityRow[];
|
||
|
|
orderPayments: LockActivityRow[];
|
||
|
|
materialOutlays: LockActivityRow[];
|
||
|
|
directOutlays: LockActivityRow[];
|
||
|
|
deliveryGoodsOutlays: LockActivityRow[];
|
||
|
|
summary: LockActivitySummary;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ReceiptSummary {
|
||
|
|
basis: string;
|
||
|
|
filterScope: string;
|
||
|
|
from: string;
|
||
|
|
date: string;
|
||
|
|
receipt: number;
|
||
|
|
refund: number;
|
||
|
|
net: number;
|
||
|
|
channels: ReceiptSummaryChannels[];
|
||
|
|
orderCount: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ChangeSummary {
|
||
|
|
before: CostSummary;
|
||
|
|
after: CostSummary;
|
||
|
|
inventory: InventoryChange;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Member {
|
||
|
|
member: string;
|
||
|
|
label: string;
|
||
|
|
enabled?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CancelSummary extends CostSummary {
|
||
|
|
legacyCountNotice?: string;
|
||
|
|
requiresLegacyCountVerified?: boolean;
|
||
|
|
inventory: InventoryRow[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ActionRules {
|
||
|
|
[kind: string]: ActionRule;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OrderAfterSale {
|
||
|
|
orderId: string;
|
||
|
|
date: string;
|
||
|
|
reason: string;
|
||
|
|
deductionReason: string;
|
||
|
|
refund: Refund;
|
||
|
|
expenses: { note: string; amount: number; payer: string }[];
|
||
|
|
summary: AfterSummary;
|
||
|
|
lines: AfterSaleLine[];
|
||
|
|
order_id?: string;
|
||
|
|
created?: string;
|
||
|
|
number?: string;
|
||
|
|
paper_number?: string;
|
||
|
|
customer?: string;
|
||
|
|
salesperson?: string;
|
||
|
|
note?: string;
|
||
|
|
order_date?: string;
|
||
|
|
member?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IndependentRecord {
|
||
|
|
id: string;
|
||
|
|
date: string;
|
||
|
|
project: string;
|
||
|
|
customer: string;
|
||
|
|
amount: number;
|
||
|
|
payer: string;
|
||
|
|
actor: string;
|
||
|
|
created: string;
|
||
|
|
member: string;
|
||
|
|
revision: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IndependentValues {
|
||
|
|
date: string;
|
||
|
|
project: string;
|
||
|
|
customer: string;
|
||
|
|
amount: string | number;
|
||
|
|
payer: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface AfterPermissions {
|
||
|
|
canEdit: boolean;
|
||
|
|
canDirectEdit: boolean;
|
||
|
|
requiresApproval: boolean;
|
||
|
|
reason: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OrderLineCostPayers {
|
||
|
|
[component: string]: string;
|
||
|
|
material: string;
|
||
|
|
labor: string;
|
||
|
|
accessories: string;
|
||
|
|
other: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CostParts {
|
||
|
|
[component: string]: number | null;
|
||
|
|
material: number | null;
|
||
|
|
labor: number | null;
|
||
|
|
accessories: number | null;
|
||
|
|
other: number | null;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CostMode {
|
||
|
|
mode: string;
|
||
|
|
rate?: number | null;
|
||
|
|
poolId?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Charge {
|
||
|
|
id: string;
|
||
|
|
name: string;
|
||
|
|
amount: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface LinePool {
|
||
|
|
poolId: string;
|
||
|
|
date: string;
|
||
|
|
status: string;
|
||
|
|
amount: number;
|
||
|
|
quantity: number;
|
||
|
|
averageRate: number;
|
||
|
|
allocations: LinePoolAllocations[];
|
||
|
|
revision: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Known {
|
||
|
|
[key: `${string}Cost`]: number | undefined;
|
||
|
|
assistant2Cost?: number;
|
||
|
|
sale: number;
|
||
|
|
material: number;
|
||
|
|
laborAndFees: number;
|
||
|
|
unallocated: number;
|
||
|
|
totalCost: number;
|
||
|
|
profit: number;
|
||
|
|
ownerCost: number;
|
||
|
|
assistantCost: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface BookCost {
|
||
|
|
kind: string;
|
||
|
|
component: string;
|
||
|
|
name: string;
|
||
|
|
source: string;
|
||
|
|
amount: number;
|
||
|
|
payer: string;
|
||
|
|
materialPoolId?: string;
|
||
|
|
calculation?: BookCostCalculation;
|
||
|
|
excluded?: boolean;
|
||
|
|
priceLockSource?: string;
|
||
|
|
after_sale_id?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Counts {
|
||
|
|
[key: `${string}Cost`]: number;
|
||
|
|
assistant2Cost: number;
|
||
|
|
sale: number;
|
||
|
|
material: number;
|
||
|
|
laborAndFees: number;
|
||
|
|
unallocated: number;
|
||
|
|
totalCost: number;
|
||
|
|
profit: number;
|
||
|
|
ownerCost: number;
|
||
|
|
assistantCost: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface LockActivityRow {
|
||
|
|
id: string;
|
||
|
|
price_lock_id: string;
|
||
|
|
date: string;
|
||
|
|
kind: string;
|
||
|
|
amount: number;
|
||
|
|
account?: string;
|
||
|
|
number: string;
|
||
|
|
customer: string;
|
||
|
|
product?: string;
|
||
|
|
actor?: string;
|
||
|
|
created?: string;
|
||
|
|
line_index?: null | number;
|
||
|
|
voided?: number;
|
||
|
|
payer?: string;
|
||
|
|
source?: string;
|
||
|
|
quantity?: number;
|
||
|
|
rate?: number;
|
||
|
|
component?: string;
|
||
|
|
order_id?: string;
|
||
|
|
note?: string;
|
||
|
|
name?: string;
|
||
|
|
excluded?: boolean;
|
||
|
|
calculation?: null;
|
||
|
|
paper_number?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface LockActivitySummary {
|
||
|
|
receipt: number;
|
||
|
|
refund: number;
|
||
|
|
net: number;
|
||
|
|
ownerOutlay: number;
|
||
|
|
assistantOutlay: number;
|
||
|
|
eventCount: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ReceiptSummaryChannels {
|
||
|
|
channel: string;
|
||
|
|
name: string;
|
||
|
|
receipt: number;
|
||
|
|
refund: number;
|
||
|
|
net: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CostSummary {
|
||
|
|
total: number;
|
||
|
|
netReceived: number;
|
||
|
|
directCost: number;
|
||
|
|
goodsCost: number | null;
|
||
|
|
profit: number | null;
|
||
|
|
settlementDue: number | null;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface InventoryChange {
|
||
|
|
legacyCountNotice?: string;
|
||
|
|
before: InventoryRow[];
|
||
|
|
after: InventoryRow[];
|
||
|
|
changes: InventoryRow[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface InventoryRow {
|
||
|
|
stockCount?: number | null;
|
||
|
|
date: string;
|
||
|
|
pocket: string;
|
||
|
|
mg: number;
|
||
|
|
kind?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ActionRule {
|
||
|
|
eligible: boolean;
|
||
|
|
reason: string;
|
||
|
|
directToday?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Refund {
|
||
|
|
amount: number;
|
||
|
|
account: string;
|
||
|
|
payer: string;
|
||
|
|
reference: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface AfterSummary {
|
||
|
|
refundAmount: number;
|
||
|
|
retainedAmount: number;
|
||
|
|
materialReturnedCost: number;
|
||
|
|
laborRestockedCost: number;
|
||
|
|
costLoss: number;
|
||
|
|
directCost: number;
|
||
|
|
profit: number;
|
||
|
|
profitAdjustment: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface AfterSaleLine {
|
||
|
|
lineIndex: number;
|
||
|
|
name: string;
|
||
|
|
code: string;
|
||
|
|
quantity: number;
|
||
|
|
pocket: string;
|
||
|
|
disposition: string;
|
||
|
|
stockCount: null;
|
||
|
|
materialReturnedCost: number;
|
||
|
|
laborRestockedCost: number;
|
||
|
|
laborPayer: string;
|
||
|
|
costLoss: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface LinePoolAllocations {
|
||
|
|
payer: string;
|
||
|
|
amount: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface BookCostCalculation {
|
||
|
|
rate: number;
|
||
|
|
quantity: number;
|
||
|
|
weighted?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Settlement {
|
||
|
|
bucket: string;
|
||
|
|
id: string;
|
||
|
|
date: string;
|
||
|
|
amount: number;
|
||
|
|
kind: string;
|
||
|
|
note: string;
|
||
|
|
actor: string;
|
||
|
|
}
|
||
|
|
export interface RelatedOrder {
|
||
|
|
id: string;
|
||
|
|
number: string;
|
||
|
|
date: string;
|
||
|
|
customer: string;
|
||
|
|
before: OrderRecord;
|
||
|
|
after: OrderRecord;
|
||
|
|
summary: ChangeSummary;
|
||
|
|
}
|
||
|
|
export interface LockImpact {
|
||
|
|
materialAmount: number | null;
|
||
|
|
usedMaterialAmount?: number | null;
|
||
|
|
leftoverCost?: number | null;
|
||
|
|
allocations: { payer: string; amount: number }[];
|
||
|
|
}
|
||
|
|
export interface RelatedLock {
|
||
|
|
id: string;
|
||
|
|
number: string;
|
||
|
|
date: string;
|
||
|
|
customer: string;
|
||
|
|
before: LockImpact;
|
||
|
|
after: LockImpact;
|
||
|
|
}
|
||
|
|
export interface LockCosts {
|
||
|
|
date?: string;
|
||
|
|
lines?: LockCosts[];
|
||
|
|
lineId?: string;
|
||
|
|
materialSource?: string;
|
||
|
|
buyRate?: number;
|
||
|
|
buyPayer?: string;
|
||
|
|
materialAmount?: number | null;
|
||
|
|
extraRate?: number;
|
||
|
|
extraPayer?: string;
|
||
|
|
}
|
||
|
|
export interface Filters {
|
||
|
|
mode: string;
|
||
|
|
date: string;
|
||
|
|
from: string;
|
||
|
|
to: string;
|
||
|
|
q: string;
|
||
|
|
status: string;
|
||
|
|
member: string;
|
||
|
|
pocket: string;
|
||
|
|
}
|
||
|
|
export interface ReviewList<T> {
|
||
|
|
requests: T[];
|
||
|
|
counts: Record<string, number>;
|
||
|
|
canApprove?: boolean;
|
||
|
|
}
|
||
|
|
export interface DetailEntry<T> {
|
||
|
|
id: string;
|
||
|
|
revision: number;
|
||
|
|
user: string;
|
||
|
|
data?: T;
|
||
|
|
error?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type MoneyKey =
|
||
|
|
| 'sale'
|
||
|
|
| 'material'
|
||
|
|
| 'laborAndFees'
|
||
|
|
| 'unallocated'
|
||
|
|
| 'totalCost'
|
||
|
|
| 'profit'
|
||
|
|
| 'ownerCost'
|
||
|
|
| 'assistantCost'
|
||
|
|
| `${string}Cost`;
|
||
|
|
export interface ChangeActionInput {
|
||
|
|
date?: string;
|
||
|
|
amount?: string;
|
||
|
|
account?: string;
|
||
|
|
payer?: string;
|
||
|
|
note?: string;
|
||
|
|
reference?: string;
|
||
|
|
afterSale?: object;
|
||
|
|
returnCounts?: (string | number | null)[];
|
||
|
|
returnPockets?: string[];
|
||
|
|
fee_items?: { note: string; amount: string; payer: string }[];
|
||
|
|
}
|