@tallyui/pos 3.13.0 → 3.14.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/index.d.ts +342 -102
- package/dist/index.js +414 -46
- package/package.json +7 -7
- package/src/app-settings/app-settings.ts +17 -2
- package/src/customer-display/display-link.ts +72 -0
- package/src/customer-display/index.ts +5 -0
- package/src/customer-display/transport.ts +54 -0
- package/src/customer-display/use-customer-display.ts +36 -0
- package/src/index.ts +8 -2
- package/src/print/escpos/code-page.ts +48 -0
- package/src/print/escpos/commands.ts +53 -0
- package/src/print/escpos/encode.ts +127 -0
- package/src/print/escpos/index.ts +7 -0
- package/src/print/escpos/transport.ts +45 -0
- package/src/print/index.ts +2 -0
- package/src/print/types.ts +4 -0
- package/src/register/handover.ts +103 -0
- package/src/register/index.ts +2 -0
- package/src/reports/sales-figures.ts +22 -8
- package/src/sale/in-cart.ts +18 -0
- package/src/sale/index.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { Money, TaxRounding, StoreSettings, TallyConnector, SyncContext, StoreSettingsChoice, StoreSettingsChoices, Cashier, CashierPermission, PaymentMethodDescriptor, ProductTraits, woocommerceCoupons, OrderCreateLine, PaymentMethodKind, CommandServerRefs, CommandWarning, CommandError, StoreOrder, ProductCategory, TraitContext, ServerCapabilities, OrderCreateEnvelope, OrderRefundEnvelope, OrderRefundResult, RegisterInfo, RegisterCommandType, RegisterCommandResult, RegisterSessionTransitionPayload,
|
|
3
|
+
import { Money, TaxRounding, StoreSettings, TallyConnector, SyncContext, StoreSettingsChoice, StoreSettingsChoices, Cashier, CashierPermission, PaymentMethodDescriptor, ProductTraits, woocommerceCoupons, OrderCreateLine, PaymentMethodKind, CommandServerRefs, CommandWarning, CommandError, StoreOrder, ProductCategory, TraitContext, ServerCapabilities, OrderCreateEnvelope, OrderRefundEnvelope, OrderRefundResult, RegisterInfo, RegisterCommandType, RegisterCommandResult, RegisterSessionTransitionPayload, CommandResult, AnyCommandEnvelope, CommandEnvelope, OrderCreatePayload, VariantSummary, RegisterCommandEnvelope, OrderRefundLine, StoreOrderLine } from '@tallyui/core';
|
|
4
4
|
export { getProductStock, withStockOverlay } from '@tallyui/core';
|
|
5
5
|
import * as rxdb from 'rxdb';
|
|
6
6
|
import { RxCollection, RxJsonSchema, MangoQuery, RxDatabase, MigrationStrategies, RxLocalDocumentMutation } from 'rxdb';
|
|
@@ -312,6 +312,11 @@ interface AppSettings {
|
|
|
312
312
|
'ui.scale': UiScale;
|
|
313
313
|
/** A font id; `'auto'` follows the theme. Not an enum: the font list lives in the UI layer. */
|
|
314
314
|
'ui.font': string;
|
|
315
|
+
/**
|
|
316
|
+
* The cart's quick-discount keys in percent, for `Cart`'s `quickDiscounts`. v2 keeps them per screen,
|
|
317
|
+
* `pos-cart.quickDiscounts: [5, 10, 15]` (`core/src/screens/main/contexts/ui-settings/initial-settings.json`).
|
|
318
|
+
*/
|
|
319
|
+
'cart.quickDiscounts': readonly number[];
|
|
315
320
|
}
|
|
316
321
|
type AppSettingKey = keyof AppSettings;
|
|
317
322
|
/** One key's default and its check: `parse` returns the value when valid, else `undefined`. */
|
|
@@ -1268,6 +1273,54 @@ declare const initialDisplayState: DisplayState;
|
|
|
1268
1273
|
/** The display side's state, driven by decoded messages from the till. */
|
|
1269
1274
|
declare function displayReducer(state: DisplayState, envelope: DisplayEnvelope): DisplayState;
|
|
1270
1275
|
|
|
1276
|
+
/** How the till and the customer display reach each other. The first is a second window on this device (ADR-084 3). */
|
|
1277
|
+
interface DisplayTransport {
|
|
1278
|
+
/** False when the channel refuses (closed); never throws. */
|
|
1279
|
+
send(envelope: DisplayEnvelope): boolean;
|
|
1280
|
+
/** Decoded messages from the other window; returns the unsubscribe. */
|
|
1281
|
+
onMessage(listener: (envelope: DisplayEnvelope) => void): () => void;
|
|
1282
|
+
close(): void;
|
|
1283
|
+
}
|
|
1284
|
+
declare const DISPLAY_CHANNEL = "tallyui.customer-display";
|
|
1285
|
+
/** The structural part of BroadcastChannel the transport uses (a test passes a fake). */
|
|
1286
|
+
interface BroadcastChannelLike {
|
|
1287
|
+
postMessage(message: unknown): void;
|
|
1288
|
+
close(): void;
|
|
1289
|
+
onmessage: ((event: MessageEvent) => void) | null;
|
|
1290
|
+
}
|
|
1291
|
+
/** A same-origin second window over BroadcastChannel. Whatever arrives is decoded; anything refused is dropped. */
|
|
1292
|
+
declare function createBroadcastDisplayTransport(channelName?: string, open?: (name: string) => BroadcastChannelLike): DisplayTransport;
|
|
1293
|
+
|
|
1294
|
+
interface DisplayClock {
|
|
1295
|
+
setTimeout(run: () => void, ms: number): unknown;
|
|
1296
|
+
clearTimeout(handle: unknown): void;
|
|
1297
|
+
}
|
|
1298
|
+
interface DisplayLink {
|
|
1299
|
+
/** The order as it stands; null, or no lines, fees or shipping, shows idle. */
|
|
1300
|
+
showCart(receipt: ReceiptData | null): void;
|
|
1301
|
+
showPayment(receipt: ReceiptData, payment: DisplayPayment): void;
|
|
1302
|
+
close(): void;
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* The till's side of the customer display. Ported from WCPOS v2 (monorepo main 51e7c43,
|
|
1306
|
+
* core/services/customer-display/display-session.ts and service.ts) without the WebRTC: each `display.hello` is
|
|
1307
|
+
* answered with `display.config` under the hello's id, then the current state; a completed payment stays up for
|
|
1308
|
+
* `config.idle.afterCompleteMs` before `display.idle`, and an empty cart inside that window waits for it.
|
|
1309
|
+
*/
|
|
1310
|
+
declare function createDisplayLink(transport: DisplayTransport, options: {
|
|
1311
|
+
config: DisplayConfig;
|
|
1312
|
+
clock?: DisplayClock;
|
|
1313
|
+
}): DisplayLink;
|
|
1314
|
+
|
|
1315
|
+
declare const DISPLAY_TEMPLATE: DisplayTemplate;
|
|
1316
|
+
/** The hello is re-sent until a config answers it, so a till opened after the display still finds it. */
|
|
1317
|
+
declare const HELLO_RETRY_MS = 2000;
|
|
1318
|
+
/**
|
|
1319
|
+
* The customer display's side: says `display.hello`, then shows what the till sends. As v2's display page
|
|
1320
|
+
* (Pro packages/display/src/session.ts), nothing is applied before the `display.config` that answers this hello.
|
|
1321
|
+
*/
|
|
1322
|
+
declare function useCustomerDisplay(transport: DisplayTransport | null): DisplayState;
|
|
1323
|
+
|
|
1271
1324
|
/**
|
|
1272
1325
|
* Filters product documents by a cashier's search term, through traits, so
|
|
1273
1326
|
* it works the same on every backend.
|
|
@@ -1710,6 +1763,7 @@ declare function createSimulatedDriver(options?: SimulatedDriverOptions): Paymen
|
|
|
1710
1763
|
* `PrinterTransport` has `printRaw(bytes)` and `printHtml(html)`; here one `print(job)` takes a job that
|
|
1711
1764
|
* carries HTML, bytes or both, and each transport prints what it can.
|
|
1712
1765
|
*/
|
|
1766
|
+
|
|
1713
1767
|
type PrintJobKind = 'receipt' | 'report' | 'test';
|
|
1714
1768
|
interface PrintJob {
|
|
1715
1769
|
id: string;
|
|
@@ -1718,6 +1772,8 @@ interface PrintJob {
|
|
|
1718
1772
|
html?: string;
|
|
1719
1773
|
/** Pre-encoded printer bytes (ESC/POS and the like), for a raw transport. */
|
|
1720
1774
|
bytes?: Uint8Array;
|
|
1775
|
+
/** The receipt itself, for a transport that lays it out (`createEscPosTransport`). */
|
|
1776
|
+
receipt?: ReceiptData;
|
|
1721
1777
|
}
|
|
1722
1778
|
/** `unsupported`: this transport cannot print the job; `unavailable`: the platform has no way to print; `failed`: the print went wrong. */
|
|
1723
1779
|
type PrintErrorCode = 'unsupported' | 'unavailable' | 'failed';
|
|
@@ -1830,6 +1886,83 @@ interface SystemPrintTransportOptions {
|
|
|
1830
1886
|
}
|
|
1831
1887
|
declare function createSystemPrintTransport(options?: SystemPrintTransportOptions): PrintTransport;
|
|
1832
1888
|
|
|
1889
|
+
/**
|
|
1890
|
+
* Character tables for ESC/POS text. WCPOS v2 (monorepo main) leaves the code page to
|
|
1891
|
+
* `@point-of-sale/receipt-printer-encoder`; here two fixed tables cover Latin receipts without a dependency.
|
|
1892
|
+
* `high` holds the characters for bytes 0x80-0xFF; `id` is the `ESC t n` table number.
|
|
1893
|
+
*/
|
|
1894
|
+
declare const ESCPOS_CODE_PAGES: {
|
|
1895
|
+
readonly cp437: {
|
|
1896
|
+
readonly id: 0;
|
|
1897
|
+
readonly high: string;
|
|
1898
|
+
};
|
|
1899
|
+
readonly cp858: {
|
|
1900
|
+
readonly id: 19;
|
|
1901
|
+
readonly high: string;
|
|
1902
|
+
};
|
|
1903
|
+
};
|
|
1904
|
+
interface EscPosCodePage {
|
|
1905
|
+
id: number;
|
|
1906
|
+
high: string;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* A small ESC/POS command builder. The command bytes follow WCPOS v2 (monorepo main): `escpos-text.ts`
|
|
1911
|
+
* opens every job with `ESC @` then `ESC M 0` (Font A, so the profile's column count holds whatever the
|
|
1912
|
+
* printer's memory switch says; v2 gotcha N39), and `render-escpos.ts` `writeCut` cuts with `GS V 0x41|0x42 0`
|
|
1913
|
+
* (feed to the cutter, then cut). Text goes through `foldText`, so no multibyte UTF-8 ever reaches the printer.
|
|
1914
|
+
*/
|
|
1915
|
+
|
|
1916
|
+
interface EscPosBuilder {
|
|
1917
|
+
/** `ESC @` (reset), then `ESC M 0` (Font A). */
|
|
1918
|
+
init(): EscPosBuilder;
|
|
1919
|
+
/** `ESC t n`: select the builder's code page. */
|
|
1920
|
+
codePage(): EscPosBuilder;
|
|
1921
|
+
align(mode: 'left' | 'center' | 'right'): EscPosBuilder;
|
|
1922
|
+
bold(on: boolean): EscPosBuilder;
|
|
1923
|
+
/** `GS ! n`: character width and height multipliers, 1-8 each. */
|
|
1924
|
+
size(width: number, height: number): EscPosBuilder;
|
|
1925
|
+
/** Folded to the code page, one byte per character; `\n` is LF. */
|
|
1926
|
+
text(value: string): EscPosBuilder;
|
|
1927
|
+
/** `ESC d n`: print and feed n lines. */
|
|
1928
|
+
feed(lines: number): EscPosBuilder;
|
|
1929
|
+
cut(type?: 'full' | 'partial'): EscPosBuilder;
|
|
1930
|
+
/** `ESC p m 25 250`: a drawer kick, on 50 ms and off 500 ms; m 0 for pin 2, 1 for pin 5. */
|
|
1931
|
+
pulse(connector?: DrawerConnector): EscPosBuilder;
|
|
1932
|
+
bytes(): Uint8Array;
|
|
1933
|
+
}
|
|
1934
|
+
declare function escpos(page?: EscPosCodePage): EscPosBuilder;
|
|
1935
|
+
|
|
1936
|
+
interface EncodeEscPosOptions extends ReceiptTemplateOptions {
|
|
1937
|
+
/** Characters per line: 32 for 58 mm, 42 or 48 for 80 mm. */
|
|
1938
|
+
columns: number;
|
|
1939
|
+
/** `cp437` (the default, also for an unknown name) or `cp858`. */
|
|
1940
|
+
codePage?: string;
|
|
1941
|
+
/** Default true: a partial cut after the feed. */
|
|
1942
|
+
cut?: boolean;
|
|
1943
|
+
/** Default false: kick the drawer before the cut. */
|
|
1944
|
+
openDrawer?: boolean;
|
|
1945
|
+
/** Default `pin2`. */
|
|
1946
|
+
drawerConnector?: DrawerConnector;
|
|
1947
|
+
}
|
|
1948
|
+
declare function encodeEscPos(receipt: ReceiptData, options: EncodeEscPosOptions): Uint8Array;
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* A `PrintTransport` that writes ESC/POS bytes to a sink the app supplies (WebUSB, WebSerial, a TCP socket,
|
|
1952
|
+
* Bluetooth). It holds no device code; ADR-084 decision 2 keeps vendor SDKs out of the MIT packages. Run it
|
|
1953
|
+
* through `createPrintQueue`, like the system transport, so one printer prints one job at a time.
|
|
1954
|
+
*/
|
|
1955
|
+
|
|
1956
|
+
interface EscPosSink {
|
|
1957
|
+
write(bytes: Uint8Array): Promise<void>;
|
|
1958
|
+
}
|
|
1959
|
+
interface EscPosTransportOptions {
|
|
1960
|
+
sink: EscPosSink;
|
|
1961
|
+
profile: PrinterProfile;
|
|
1962
|
+
format?: Pick<ReceiptTemplateOptions, 'formatMoney' | 'formatDate' | 'paymentLabel'>;
|
|
1963
|
+
}
|
|
1964
|
+
declare function createEscPosTransport({ sink, profile, format }: EscPosTransportOptions): PrintTransport;
|
|
1965
|
+
|
|
1833
1966
|
/** RFC 9562 UUIDv7: monotonic with no arguments; stateless with an explicit timestamp or random source. */
|
|
1834
1967
|
declare function uuidv7(now?: number, randomBytes?: (n: number) => Uint8Array): string;
|
|
1835
1968
|
|
|
@@ -3214,6 +3347,182 @@ declare function useRegisterSession(options: UseRegisterSessionOptions): {
|
|
|
3214
3347
|
};
|
|
3215
3348
|
};
|
|
3216
3349
|
|
|
3350
|
+
/** Local-only context for a transport (ADR-076 amendment 1): never serialised, never part of a payload. */
|
|
3351
|
+
interface OrderTransportContext {
|
|
3352
|
+
/** The stored (frozen) order of each envelope in the batch, keyed by the envelope's `id` (its commandId). */
|
|
3353
|
+
local: {
|
|
3354
|
+
orders: ReadonlyMap<string, PosOrder>;
|
|
3355
|
+
};
|
|
3356
|
+
}
|
|
3357
|
+
type TransportOutcome = {
|
|
3358
|
+
kind: 'results';
|
|
3359
|
+
results: CommandResult[];
|
|
3360
|
+
} | {
|
|
3361
|
+
kind: 'unauthorized';
|
|
3362
|
+
} | {
|
|
3363
|
+
kind: 'refused';
|
|
3364
|
+
status: number;
|
|
3365
|
+
reason: string;
|
|
3366
|
+
}
|
|
3367
|
+
/** `reason` is `network` when the store could not be reached, `timeout` when a sent request got no answer in time,
|
|
3368
|
+
* else what the store answered (`status_503`, `bad_body`, ...). The order outbox counts every reason but `network`. */
|
|
3369
|
+
| {
|
|
3370
|
+
kind: 'retry';
|
|
3371
|
+
reason: string;
|
|
3372
|
+
retryAfterMs?: number;
|
|
3373
|
+
};
|
|
3374
|
+
interface CommandTransport<E extends AnyCommandEnvelope = CommandEnvelope<OrderCreatePayload>> {
|
|
3375
|
+
send(batch: E[], context?: OrderTransportContext): Promise<TransportOutcome>;
|
|
3376
|
+
}
|
|
3377
|
+
interface OutboxState {
|
|
3378
|
+
pending: number;
|
|
3379
|
+
/** The order outbox's count of `pos_orders` the store refused (`syncStatus: 'rejected'`), read with `pending`. Each
|
|
3380
|
+
* stays until requeue() sends it again. The register outbox's count of rejected `register_commands` that stop their
|
|
3381
|
+
* register's ledger (superseded, abandoned and an abandoned session's already-open refusal are left out, ADR-078, and so
|
|
3382
|
+
* are the two refused closure approvals, which hold only their register's next closure, ADR-082 decision 6). */
|
|
3383
|
+
rejected?: number;
|
|
3384
|
+
sending: boolean;
|
|
3385
|
+
lastRetryReason?: string;
|
|
3386
|
+
nextAttemptAt?: number;
|
|
3387
|
+
/** Set after 3 consecutive 401s; the app should ask the cashier to sign in, then call flush(). */
|
|
3388
|
+
authRequired?: boolean;
|
|
3389
|
+
/** Set when the server refused a whole batch (HTTP 400, 403, 413, 415, 422). No order is changed; sending pauses until the next flush(). */
|
|
3390
|
+
refused?: {
|
|
3391
|
+
status: number;
|
|
3392
|
+
reason: string;
|
|
3393
|
+
};
|
|
3394
|
+
/** Set while the store (not offline) has kept failing some orders for 15 minutes, each on its own clock. Those
|
|
3395
|
+
* orders stay pending and keep retrying. `orders` has each order's own entry: its `since` is when its clock
|
|
3396
|
+
* would have started had there been no offline gaps (now minus its answered time; while offline, as of the
|
|
3397
|
+
* moment the clock paused), and its latest `reason`. `since` is the earliest of theirs, virtual for the threshold;
|
|
3398
|
+
* `reason` the latest. `firstFailedAt` is the earliest real wall-clock first failure, only when every stuck clock
|
|
3399
|
+
* has one. Each order entry has its own real wall-clock `firstFailedAt`. Both are in memory only, absent after restart. */
|
|
3400
|
+
stuck?: {
|
|
3401
|
+
commandIds: string[];
|
|
3402
|
+
since: number;
|
|
3403
|
+
firstFailedAt?: number;
|
|
3404
|
+
reason: string;
|
|
3405
|
+
orders: {
|
|
3406
|
+
commandId: string;
|
|
3407
|
+
since: number;
|
|
3408
|
+
firstFailedAt?: number;
|
|
3409
|
+
reason: string;
|
|
3410
|
+
}[];
|
|
3411
|
+
};
|
|
3412
|
+
/** Set after 3 consecutive 404 answers (counted across the outboxes sharing one BackendNotFound): the store address
|
|
3413
|
+
* may be wrong, or the store's plugin isn't installed or is switched off. The outbox keeps retrying; the next answer
|
|
3414
|
+
* that isn't a 404 clears it (offline changes nothing). `since` is when the first of those 404s arrived. */
|
|
3415
|
+
backendMissing?: {
|
|
3416
|
+
since: number;
|
|
3417
|
+
};
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
interface OutboxCounts {
|
|
3421
|
+
/** `OutboxState.pending`. */
|
|
3422
|
+
pending: number;
|
|
3423
|
+
/** `OutboxState.rejected`, 0 when unset. */
|
|
3424
|
+
rejected: number;
|
|
3425
|
+
/** `OutboxState.stuck.commandIds.length`, 0 when unset. These rows are pending too. */
|
|
3426
|
+
stuck: number;
|
|
3427
|
+
}
|
|
3428
|
+
interface OutboxHealth {
|
|
3429
|
+
/** The order outbox (`useOrderOutbox`): sales. */
|
|
3430
|
+
sales: OutboxCounts;
|
|
3431
|
+
/** The register outbox (`useRegisterOutbox`): till updates. */
|
|
3432
|
+
tillUpdates: OutboxCounts;
|
|
3433
|
+
/** Rejected plus stuck rows across both outboxes. Not `needsAttention()`'s list, which also holds applied orders with warnings. */
|
|
3434
|
+
attention: number;
|
|
3435
|
+
/** Either outbox parked after repeated 401s (`OutboxState.authRequired`): the cashier signs in again, then both flush. */
|
|
3436
|
+
authRequired: boolean;
|
|
3437
|
+
}
|
|
3438
|
+
/** The health of both outboxes from their states. Pure. */
|
|
3439
|
+
declare function summarizeOutboxHealth(sales: OutboxState, tillUpdates: OutboxState): OutboxHealth;
|
|
3440
|
+
/** summarizeOutboxHealth over both state streams (combineLatest), emitting only when a field changes. */
|
|
3441
|
+
declare function watchOutboxHealth(sales$: Observable<OutboxState>, tillUpdates$: Observable<OutboxState>): Observable<OutboxHealth>;
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* What a cashier switch, a register switch or a sign-out leaves behind, and the hand-over slip (v2 parity A4, A12).
|
|
3445
|
+
* Port provenance: WCPOS v2 monorepo `main` 51e7c4351, `packages/core/src/screens/main/pos/cart/switch-confirm.tsx`
|
|
3446
|
+
* (the warnings it shows) and `services/register-session/use-session-report.ts:26-65` with
|
|
3447
|
+
* `closure-document.ts:206-273` (the slip is the open session's X report, marked as a hand-over, naming the cashier).
|
|
3448
|
+
*/
|
|
3449
|
+
|
|
3450
|
+
type SwitchKind = 'cashier' | 'register' | 'signOut';
|
|
3451
|
+
type SwitchWarning = {
|
|
3452
|
+
code: 'unsentSales';
|
|
3453
|
+
count: number;
|
|
3454
|
+
} | {
|
|
3455
|
+
code: 'unsentTillUpdates';
|
|
3456
|
+
count: number;
|
|
3457
|
+
} | {
|
|
3458
|
+
code: 'parkedSales';
|
|
3459
|
+
count: number;
|
|
3460
|
+
} | {
|
|
3461
|
+
code: 'partlyPaidSale';
|
|
3462
|
+
} | {
|
|
3463
|
+
code: 'openSession';
|
|
3464
|
+
};
|
|
3465
|
+
interface SwitchWarningInput {
|
|
3466
|
+
kind: SwitchKind;
|
|
3467
|
+
/** `summarizeOutboxHealth`'s result (or `useOutboxHealth().health`). */
|
|
3468
|
+
outbox: Pick<OutboxHealth, 'sales' | 'tillUpdates'>;
|
|
3469
|
+
/** `useParkedSales(...).parked.length`. */
|
|
3470
|
+
parkedSales: number;
|
|
3471
|
+
/** Captured minor units on the sale in progress; 0 when nothing is paid. */
|
|
3472
|
+
paidMinor: number;
|
|
3473
|
+
/** The bound register's session status; `null` or absent when no session. */
|
|
3474
|
+
sessionStatus?: RegisterSession['status'] | null;
|
|
3475
|
+
}
|
|
3476
|
+
interface SwitchWarnings {
|
|
3477
|
+
kind: SwitchKind;
|
|
3478
|
+
/** In this order: unsentSales, unsentTillUpdates, parkedSales, partlyPaidSale, openSession; only those that apply. */
|
|
3479
|
+
warnings: SwitchWarning[];
|
|
3480
|
+
/** `outbox.sales.pending`: the confirm wording reads it. */
|
|
3481
|
+
unsentSales: number;
|
|
3482
|
+
/** An `open` or `counting` session, for `register` and `signOut` only (a cashier switch keeps the drawer open by design). */
|
|
3483
|
+
sessionOpen: boolean;
|
|
3484
|
+
}
|
|
3485
|
+
/** What the switch would leave behind. Pure. */
|
|
3486
|
+
declare function switchWarnings({ kind, outbox, parkedSales, paidMinor, sessionStatus }: SwitchWarningInput): SwitchWarnings;
|
|
3487
|
+
interface HandoverSlipInput {
|
|
3488
|
+
session: RegisterSession;
|
|
3489
|
+
/** The cashier handing over. */
|
|
3490
|
+
cashier: Pick<Cashier, 'name'>;
|
|
3491
|
+
registerName: string;
|
|
3492
|
+
/** Who opened the session; '' when unknown. */
|
|
3493
|
+
openedByName?: string;
|
|
3494
|
+
/** `useRegisterSession().salesCount`. */
|
|
3495
|
+
salesCount: number;
|
|
3496
|
+
/** `useRegisterSession().expected`, minor units per tender. */
|
|
3497
|
+
expected: Record<string, number>;
|
|
3498
|
+
/** `useRegisterSession().blind`: no expected figures on the slip. */
|
|
3499
|
+
blind: boolean;
|
|
3500
|
+
outbox: Pick<OutboxHealth, 'sales' | 'tillUpdates'>;
|
|
3501
|
+
context: ClosureContext;
|
|
3502
|
+
}
|
|
3503
|
+
type XReportDocument = ReturnType<typeof buildXReportDocument>;
|
|
3504
|
+
interface HandoverSlipData {
|
|
3505
|
+
registerName: string;
|
|
3506
|
+
cashierName: string;
|
|
3507
|
+
openedByName: string;
|
|
3508
|
+
/** `document.closure.opened_at.time`. */
|
|
3509
|
+
openedAtTime: string;
|
|
3510
|
+
salesCount: number;
|
|
3511
|
+
/** `null` while blind. */
|
|
3512
|
+
expected: Record<string, number> | null;
|
|
3513
|
+
unsentSales: number;
|
|
3514
|
+
unsentTillUpdates: number;
|
|
3515
|
+
/** The X-report envelope for the closure template and the print queue (`kind: 'report'`), marked as a hand-over. */
|
|
3516
|
+
document: XReportDocument & {
|
|
3517
|
+
fiscal: XReportDocument['fiscal'] & {
|
|
3518
|
+
document_type: 'handover';
|
|
3519
|
+
is_handover: true;
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3522
|
+
}
|
|
3523
|
+
/** The hand-over slip's data and its printable envelope. Pure. */
|
|
3524
|
+
declare function handoverSlip({ session, cashier, registerName, openedByName, salesCount, expected, blind, outbox, context, }: HandoverSlipInput): HandoverSlipData;
|
|
3525
|
+
|
|
3217
3526
|
type CatalogueEntry<Doc> = {
|
|
3218
3527
|
product: Doc;
|
|
3219
3528
|
variant: VariantSummary;
|
|
@@ -3542,75 +3851,20 @@ declare class CartError extends Error {
|
|
|
3542
3851
|
}
|
|
3543
3852
|
declare function addEntryToCart<Doc>(builder: OrderBuilder, entry: CatalogueEntry<Doc>, traits: ProductTraits<Doc>, currency: string): string;
|
|
3544
3853
|
|
|
3545
|
-
/**
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
};
|
|
3551
|
-
}
|
|
3552
|
-
type TransportOutcome = {
|
|
3553
|
-
kind: 'results';
|
|
3554
|
-
results: CommandResult[];
|
|
3555
|
-
} | {
|
|
3556
|
-
kind: 'unauthorized';
|
|
3557
|
-
} | {
|
|
3558
|
-
kind: 'refused';
|
|
3559
|
-
status: number;
|
|
3560
|
-
reason: string;
|
|
3561
|
-
}
|
|
3562
|
-
/** `reason` is `network` when the store could not be reached, `timeout` when a sent request got no answer in time,
|
|
3563
|
-
* else what the store answered (`status_503`, `bad_body`, ...). The order outbox counts every reason but `network`. */
|
|
3564
|
-
| {
|
|
3565
|
-
kind: 'retry';
|
|
3566
|
-
reason: string;
|
|
3567
|
-
retryAfterMs?: number;
|
|
3854
|
+
/** The part of a cart line the in-cart count reads (`LineItem` has all three). */
|
|
3855
|
+
type CartQuantityLine = {
|
|
3856
|
+
productId: string;
|
|
3857
|
+
quantity: number;
|
|
3858
|
+
custom?: true;
|
|
3568
3859
|
};
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
* are the two refused closure approvals, which hold only their register's next closure, ADR-082 decision 6). */
|
|
3578
|
-
rejected?: number;
|
|
3579
|
-
sending: boolean;
|
|
3580
|
-
lastRetryReason?: string;
|
|
3581
|
-
nextAttemptAt?: number;
|
|
3582
|
-
/** Set after 3 consecutive 401s; the app should ask the cashier to sign in, then call flush(). */
|
|
3583
|
-
authRequired?: boolean;
|
|
3584
|
-
/** Set when the server refused a whole batch (HTTP 400, 403, 413, 415, 422). No order is changed; sending pauses until the next flush(). */
|
|
3585
|
-
refused?: {
|
|
3586
|
-
status: number;
|
|
3587
|
-
reason: string;
|
|
3588
|
-
};
|
|
3589
|
-
/** Set while the store (not offline) has kept failing some orders for 15 minutes, each on its own clock. Those
|
|
3590
|
-
* orders stay pending and keep retrying. `orders` has each order's own entry: its `since` is when its clock
|
|
3591
|
-
* would have started had there been no offline gaps (now minus its answered time; while offline, as of the
|
|
3592
|
-
* moment the clock paused), and its latest `reason`. `since` is the earliest of theirs, virtual for the threshold;
|
|
3593
|
-
* `reason` the latest. `firstFailedAt` is the earliest real wall-clock first failure, only when every stuck clock
|
|
3594
|
-
* has one. Each order entry has its own real wall-clock `firstFailedAt`. Both are in memory only, absent after restart. */
|
|
3595
|
-
stuck?: {
|
|
3596
|
-
commandIds: string[];
|
|
3597
|
-
since: number;
|
|
3598
|
-
firstFailedAt?: number;
|
|
3599
|
-
reason: string;
|
|
3600
|
-
orders: {
|
|
3601
|
-
commandId: string;
|
|
3602
|
-
since: number;
|
|
3603
|
-
firstFailedAt?: number;
|
|
3604
|
-
reason: string;
|
|
3605
|
-
}[];
|
|
3606
|
-
};
|
|
3607
|
-
/** Set after 3 consecutive 404 answers (counted across the outboxes sharing one BackendNotFound): the store address
|
|
3608
|
-
* may be wrong, or the store's plugin isn't installed or is switched off. The outbox keeps retrying; the next answer
|
|
3609
|
-
* that isn't a 404 clears it (offline changes nothing). `since` is when the first of those 404s arrived. */
|
|
3610
|
-
backendMissing?: {
|
|
3611
|
-
since: number;
|
|
3612
|
-
};
|
|
3613
|
-
}
|
|
3860
|
+
/**
|
|
3861
|
+
* Quantity per product id, summed across the product's lines, so a product with variants counts every
|
|
3862
|
+
* variant's lines; a custom line belongs to no catalogue product and counts for none.
|
|
3863
|
+
*
|
|
3864
|
+
* Ported from WCPOS v2 `useProductCount`, packages/core/src/screens/main/pos/products/rows/product-row.tsx
|
|
3865
|
+
* (MIT, WCPOS): the cashier reads how many are in the cart, not how many lines.
|
|
3866
|
+
*/
|
|
3867
|
+
declare function cartQuantities(lines: readonly CartQuantityLine[]): Map<string, number>;
|
|
3614
3868
|
|
|
3615
3869
|
interface HttpTransportOptions {
|
|
3616
3870
|
baseUrl: string;
|
|
@@ -3782,29 +4036,6 @@ interface UseOrderOutboxResult {
|
|
|
3782
4036
|
/** Opens the order store for `storeKey`, runs its outbox and watches the recent orders (lifted from medusapos/app, ADR-052). */
|
|
3783
4037
|
declare function useOrderOutbox(options: UseOrderOutboxOptions): UseOrderOutboxResult;
|
|
3784
4038
|
|
|
3785
|
-
interface OutboxCounts {
|
|
3786
|
-
/** `OutboxState.pending`. */
|
|
3787
|
-
pending: number;
|
|
3788
|
-
/** `OutboxState.rejected`, 0 when unset. */
|
|
3789
|
-
rejected: number;
|
|
3790
|
-
/** `OutboxState.stuck.commandIds.length`, 0 when unset. These rows are pending too. */
|
|
3791
|
-
stuck: number;
|
|
3792
|
-
}
|
|
3793
|
-
interface OutboxHealth {
|
|
3794
|
-
/** The order outbox (`useOrderOutbox`): sales. */
|
|
3795
|
-
sales: OutboxCounts;
|
|
3796
|
-
/** The register outbox (`useRegisterOutbox`): till updates. */
|
|
3797
|
-
tillUpdates: OutboxCounts;
|
|
3798
|
-
/** Rejected plus stuck rows across both outboxes. Not `needsAttention()`'s list, which also holds applied orders with warnings. */
|
|
3799
|
-
attention: number;
|
|
3800
|
-
/** Either outbox parked after repeated 401s (`OutboxState.authRequired`): the cashier signs in again, then both flush. */
|
|
3801
|
-
authRequired: boolean;
|
|
3802
|
-
}
|
|
3803
|
-
/** The health of both outboxes from their states. Pure. */
|
|
3804
|
-
declare function summarizeOutboxHealth(sales: OutboxState, tillUpdates: OutboxState): OutboxHealth;
|
|
3805
|
-
/** summarizeOutboxHealth over both state streams (combineLatest), emitting only when a field changes. */
|
|
3806
|
-
declare function watchOutboxHealth(sales$: Observable<OutboxState>, tillUpdates$: Observable<OutboxState>): Observable<OutboxHealth>;
|
|
3807
|
-
|
|
3808
4039
|
interface UseOutboxHealthOptions {
|
|
3809
4040
|
/** `useOrderOutbox()`'s result; only `state` and `flush` are read. */
|
|
3810
4041
|
sales: Pick<UseOrderOutboxResult, 'state' | 'flush'>;
|
|
@@ -4047,6 +4278,14 @@ type LineJoin = (line: {
|
|
|
4047
4278
|
category?: ReportCategory;
|
|
4048
4279
|
} | undefined;
|
|
4049
4280
|
|
|
4281
|
+
type DatePreset = 'today' | 'yesterday' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth';
|
|
4282
|
+
declare const DATE_PRESETS: readonly DatePreset[];
|
|
4283
|
+
/**
|
|
4284
|
+
* The preset's store days at `now` in `timezone` (IANA or 'device'). Weeks start Monday;
|
|
4285
|
+
* this week and this month end today, as WCPOS v2's date button clamps a preset to today.
|
|
4286
|
+
*/
|
|
4287
|
+
declare function presetRange(preset: DatePreset, now: Date, timezone: string): DayRange;
|
|
4288
|
+
|
|
4050
4289
|
interface Margin {
|
|
4051
4290
|
costedNetMinor: number;
|
|
4052
4291
|
costMinor: number;
|
|
@@ -4126,20 +4365,21 @@ interface SalesFigures {
|
|
|
4126
4365
|
}
|
|
4127
4366
|
declare function inRange(at: string, range: DayRange, timezone: string): boolean;
|
|
4128
4367
|
declare function daysOf(range: DayRange): StoreDay[];
|
|
4129
|
-
declare function comparisonRange(range: DayRange, mode: 'previous' | 'week'): DayRange;
|
|
4130
|
-
declare function marginOf(lines: readonly ReportLine[]): Margin;
|
|
4131
|
-
declare function salesFigures(input: SalesFiguresInput): SalesFigures;
|
|
4132
|
-
|
|
4133
|
-
type DatePreset = 'today' | 'yesterday' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth';
|
|
4134
|
-
declare const DATE_PRESETS: readonly DatePreset[];
|
|
4135
4368
|
/**
|
|
4136
|
-
* The
|
|
4137
|
-
*
|
|
4369
|
+
* The range a report is compared with, period to date. Port of WCPOS v2 `useReportsPeriod`
|
|
4370
|
+
* (`screens/main/reports/context.tsx`). A week or month preset is a week or a month; any other
|
|
4371
|
+
* range is a day (one day), a week (up to seven) or a month (longer). A day goes back one day
|
|
4372
|
+
* (`previous`) or seven (`week`), and a week seven, so Monday to today meets the same weekdays of
|
|
4373
|
+
* the week before. A month starts a month earlier, a 31st clamped to a shorter month's last day:
|
|
4374
|
+
* a whole calendar month meets the whole month before, and any other range keeps its day count,
|
|
4375
|
+
* so 1–10 Nov meets 1–10 Oct.
|
|
4138
4376
|
*/
|
|
4139
|
-
declare function
|
|
4377
|
+
declare function comparisonRange(range: DayRange, mode: 'previous' | 'week', preset?: DatePreset): DayRange;
|
|
4378
|
+
declare function marginOf(lines: readonly ReportLine[]): Margin;
|
|
4379
|
+
declare function salesFigures(input: SalesFiguresInput): SalesFigures;
|
|
4140
4380
|
|
|
4141
4381
|
declare function reportOrderFromPosOrder(order: PosOrder, join?: LineJoin): ReportOrder;
|
|
4142
4382
|
declare function reportOrderFromStoreOrder(order: StoreOrder, join?: LineJoin): ReportOrder;
|
|
4143
4383
|
declare function reportRefundFromPosRefund(refund: PosRefund): ReportRefund | undefined;
|
|
4144
4384
|
|
|
4145
|
-
export { APP_SETTING_DEFINITIONS, type Actor, type AddLineInput, type AppSettingCollection, type AppSettingDefinition, type AppSettingDoc, type AppSettingKey, type AppSettings, type AppliedDiscount, type ApprovalNeeded, type BackendNotFound, type BasketLine, COUPONS_UNSUPPORTED, CartError, type CashMovement, type CashMovementCollection, type CashierState, type CatalogueEntry, type CatalogueGridColumns, type CatalogueView, type CatalogueViewAction, type CatalogueViewState, type ChargeInput, type ChargeLine, type Closure, type ClosureApprovalStatus, type ClosureCollection, type ClosureContext, type ClosureScope, type CollectInput, type CollectOutcome, type CollectResult, type CommandTransport, type Correction, type CsvColumn, CurrencyProvider, type CurrencyProviderProps, type CustomerSummary, DATE_PRESETS, DEFAULT_APP_SETTINGS, DEFAULT_CATALOGUE_VIEW_STATE, DEFAULT_COOLDOWN_MS, DEFAULT_MIN_SCAN_CHARS, DEFAULT_RECEIPT_TEMPLATES, DEFAULT_WEDGE_SETTINGS, DISCOUNTS_UNSUPPORTED, DISPLAY_ACTIONS, DISPLAY_PROTOCOL_VERSION, type DatePreset, type DayPoint, type DayRange, type DecodeRefusal, type DecodeResult, type Discount, type DisplayAction, type DisplayCart, type DisplayConfig, type DisplayEnvelope, type DisplayLine, type DisplayPayloads, type DisplayPayment, type DisplayState, type DisplayTemplate, type DisplayTotals, type DisplayView, type DriverAvailability, type DriverCapabilities, type DriverStatus, type DriverStatusSource, type EarlierRefund, type FeeLine, type FinalizeOptions, type FloatSuggestion, type GroupRow, type HttpTransportOptions, type LedgerRow, type LineItem, type LineJoin, type LineTaxLine, type LogEntry, type LogLevel, type LogSink, type Logger, MAX_MESSAGE_BYTES, MAX_TENDER_MINOR, MICROS_PER_MINOR, type Margin, type Movement$1 as Movement, type MovementType, type NoteDelivery, type OpenSale, type Order, type OrderBuilder, type OrderBuilderOptions, OrderContentMismatchError, type OrderCoupon, type OrderCouponContext, type OrderManager, type OrderManagerOptions, type OrderOutbox, type OrderOutboxOptions, type OrderRefundOutcome, type OrderTaxTotals, type OrderTransportContext, type OutboxCounts, type OutboxHealth, type OutboxState, PAPER_COLUMNS, PAYMENT_IN_MOTION, PRINTER_PROFILES_COLLECTION, PRODUCT_SORT_FIELDS, type ParkedOrderSummary, type Payment, type PaymentDriver, type PaymentDriverRegistry, type PaymentLegStatus, type PaymentMethod, type PaymentPhase, type PaymentRow, type PaymentTransport, type PlanLeg, type PosOrder, type PosOrderCoupon, type PosOrderLine, type PosOrderLocalWarning, PosOrderOpenClosedError, type PosOrderPayment, type PosOrderServerFailures, type PosOrderSyncStatus, type PosRefund, type PosRefundCollection, type PosRefundStatus, type PricedRefund, type PricedRefundLine, PrintError, type PrintErrorCode, type PrintJob, type PrintJobKind, type PrintQueue, type PrintQueueOptions, type PrintQueueState, type PrintTransport, type PrinterProfile, type PrinterProfileCollection, type ProductSort, type ProductSortValue, RECEIPT_SCHEMA_VERSION, REGISTER_SESSION_MIGRATION_CLOSE_WAIT_MS, REOPENABLE_CODES, type RateTaxLine, type ReaderInfo, type ReceiptConfig, type ReceiptData, type ReceiptFiscal, type ReceiptLineItem, type ReceiptNode, type ReceiptPaper, type ReceiptRegister, type ReceiptSoftware, type ReceiptTemplateData, type ReceiptTemplateLine, type ReceiptTemplateOptions, type ReceiptTemplateRow, type RecordedFigures, RefundAnswerPendingError, type RefundableLine, type RefundableOrderLine, RegisterApprovalRequiredError, type RegisterBucket, RegisterCloseIncompleteError, type RegisterCommand, type RegisterCommandCollection, type RegisterCounters, type RegisterDocument, type RegisterFact, type RegisterHost, RegisterIdInvalidError, RegisterMovementAmountError, RegisterMovementReasonError, RegisterMovementStrandedError, RegisterNeedsUpgradeError, type RegisterOutbox, type RegisterOutboxOptions, RegisterReapproveError, type RegisterSession, RegisterSessionAlreadyOpenError, RegisterSessionClosedError, type RegisterSessionCollection, RegisterSessionConflictError, RegisterSessionOpenClosedError, RegisterSessionRequiredError, type RegisterStore, RegisterTakeOverError, RegisterTenderInProgressError, type RenderReceiptOptions, type RenderSanitizeOptions, type ReopenRefusal, ReopenRefusedOrderError, type ReportCategory, type ReportLine, type ReportOrder, type ReportPayment, type ReportRefund, type ReportTax, type Repository, type ResolveStoreSettingsOptions, SALE_IN_TENDER, SALE_PARTLY_PAID, SALE_SAVING, SIMULATED_PROVIDER, SIMULATED_TIMING, SYSTEM_PRINTER_ID, SYSTEM_PRINT_TIMING, type SaleDiscountCodes, type SaleDiscountState, type SaleStage, type SalesFigures, type SalesFiguresInput, type SalesTotals, type SanitizeHtmlOptions, type ScanOfferResult, type ScanRejectReason, type ScanSession, type ScanSessionOptions, type SentOrder, type ShippingLine, type SimulatedDriverOptions, type SimulatedReaderId, type SplitTab, type StoreDay, type StoreSettingsResolution, type StoreSettingsState, type SystemPrintTransportOptions, TAX_ROUNDING_MIXED_NOTE, type TaxContext, type TaxLineInput, TaxProvider, type TaxProviderProps, type TaxRateMap, type TaxRow, type TenderAction, type TenderKey, type TenderLineId, type TenderPlan, type TenderRounding, type TenderState, type TenderView, type TenderVoid, type ThermalNode, type TraceKey, type TransportOutcome, UI_SCALES, UI_THEMES, type UiScale, type UiTheme, UnsupportedOrderVersionError, type UseBarcodeScannerOptions, type UseOrderOutboxOptions, type UseOrderOutboxResult, type UseOutboxHealthOptions, type UseOutboxHealthResult, type UseRegisterOutboxOptions, type UseRegisterOutboxResult, type UseRegisterSessionOptions, WEDGE_END_OF_SCAN_MS, type WedgeDetector, type WedgeDetectorOptions, type WedgeReplayResult, type WedgeSettings, type WedgeState, abandonSession, activePlan, addEntryToCart, addPosOrderCollection, addPrinterProfileCollection, addRegisterSessionCollection, adoptRegisterResults, advancePerpetual, allocateOrderDiscount, appSettingCollection, appSettingSchema, appSettings$, appliedMinor, backToSelling, bindRegister, buildClosureDocument, buildReceiptData, buildReceiptDataFromPosOrder, buildReceiptDataFromStoreOrder, buildXReportDocument, callbackSink, can, canMoveLeg, canVoidLeg, capturedMinor, cashMovementSchema, catalogueEntries, catalogueViewReducer, changeMinor, clampClosureScope, closeNeedsApproval, closeSession, closureApprovalStatus, closureCommand, closureSchema, closureVariance, comparisonRange, computeOrderTax, consoleSink, countVariance, countsTowardPaid, createBackendNotFound, createHttpCommandTransport, createLogger, createOrderBuilder, createOrderManager, createOrderOutbox, createPaymentDriverRegistry, createPrintQueue, createRegisterOutbox, createRepository, createScanSession, createSimulatedDriver, createSystemPrintTransport, createWedgeDetector, createWedgeState, csvCell, csvFromCells, daysOf, decode as decodeDisplayMessage, denominationTotal, denominations, deriveExpected, deriveSettled, displayCart, displayReducer, driverForMethod, encode as encodeDisplayMessage, ensureRegister, evenSplitShareMinor, exportCsv, finalizeOrder, findEntryByCode, foldWedgeKey, formatClosureDate, getBoundRegisterId, getDeviceId, hasValidRetailCheckDigit, inCategory, inMotionMinor, inRange, initTenderState, initialDisplayState, initialTenderState, isInMotion, isKnownSessionStatus, isLiveAtStore, isPartlyPaid, isRegisterRequeueable, isReopened, isRequeueable, isServerDecimal, labelKeys, legStatus, listCategories, makeEnvelope, marginOf, messageBytes, minorToDecimal, mintClosureNumber, mintUuid, movementCommand, movementFieldError, needsAttention, nextSaleCounter, normalizeAmount, normalizeCatalogueViewState, normalizeRetailCode, noteDelivery, observeRegister$, openSales, openSession, openSessionSelector, orderDraftSchema, outboxLogger, overThreshold, parkedOrderSummaries$, parseMinor, parseXml, planLegs, posOrderCollection, posOrderSchema, posOrdersLogger, posRefundCollection, posRefundSchema, presetRange, priceRefund, printerProfileCollection, printerProfileSchema, productCategories, productSortValue, quickTenderedAmounts, ratePpmFromPercent, readAppSettings, readBoundRegister, readRegister, reapproveClosure, receiptTemplateData, reconcileRegisterCommands, recordMovement, recordRegisterFact, refundableLines, registerCommandCollection, registerCommandSchema, registerCommandsLogger, registerFactsLogger, registerSessionCollection, registerSessionSchema, registerSessionsLogger, renderHtml, renderLogiclessTemplate, renderReceiptHtml, renderReceiptTemplate, renderThermalPreview, reopenRefusedOrder, replacedOrderIds, replayWedgeDetector, reportOrderFromPosOrder, reportOrderFromStoreOrder, reportRefundFromPosRefund, requireOpenSession, resolveAppSettings, resolveGridColumns, resolveStoreSettings, restoreOrderDraft, retailCodeTwin, roundMicrosToMinor, roundedDue, saleLogger, salesFigures, sameSale, sanitizeHtml, searchProducts, selectClosureRows, sendOrderRefund, sessionOpenCommand, sessionTransitionCommand, sortProducts, stampSession, startCounting, stockOverlay$, stockOverlayAsOf$, stripBoundary, submitOrderRefund, suggestFloat, summarizeOutboxHealth, takeOverSession, taxFiguresForBasket, taxLinesByRate, taxLogger, taxMicros, taxProviderProps, tenderReducer, tenderRounding, tenderVoidCollection, tenderVoidSchema, toCsv, toOrderCreateEnvelope, toPrintError, unbindRegister, useAppSettings, useBarcodeScanner, useCashier, useCurrencyCode, useCurrencyFormatter, useOrderOutbox, useOutboxHealth, useParkedSales, useRegisterOutbox, useRegisterSession, useSale, useStoreSettings, useTax, uuidv7, validAmount, varianceText, variantPriceLabel, voidMovement, watchOutboxHealth, withPricingContext, index as woocommerceDiscountCodes, writeAppSetting, writeClosure, writeOrderDraft };
|
|
4385
|
+
export { APP_SETTING_DEFINITIONS, type Actor, type AddLineInput, type AppSettingCollection, type AppSettingDefinition, type AppSettingDoc, type AppSettingKey, type AppSettings, type AppliedDiscount, type ApprovalNeeded, type BackendNotFound, type BasketLine, type BroadcastChannelLike, COUPONS_UNSUPPORTED, CartError, type CartQuantityLine, type CashMovement, type CashMovementCollection, type CashierState, type CatalogueEntry, type CatalogueGridColumns, type CatalogueView, type CatalogueViewAction, type CatalogueViewState, type ChargeInput, type ChargeLine, type Closure, type ClosureApprovalStatus, type ClosureCollection, type ClosureContext, type ClosureScope, type CollectInput, type CollectOutcome, type CollectResult, type CommandTransport, type Correction, type CsvColumn, CurrencyProvider, type CurrencyProviderProps, type CustomerSummary, DATE_PRESETS, DEFAULT_APP_SETTINGS, DEFAULT_CATALOGUE_VIEW_STATE, DEFAULT_COOLDOWN_MS, DEFAULT_MIN_SCAN_CHARS, DEFAULT_RECEIPT_TEMPLATES, DEFAULT_WEDGE_SETTINGS, DISCOUNTS_UNSUPPORTED, DISPLAY_ACTIONS, DISPLAY_CHANNEL, DISPLAY_PROTOCOL_VERSION, DISPLAY_TEMPLATE, type DatePreset, type DayPoint, type DayRange, type DecodeRefusal, type DecodeResult, type Discount, type DisplayAction, type DisplayCart, type DisplayClock, type DisplayConfig, type DisplayEnvelope, type DisplayLine, type DisplayLink, type DisplayPayloads, type DisplayPayment, type DisplayState, type DisplayTemplate, type DisplayTotals, type DisplayTransport, type DisplayView, type DriverAvailability, type DriverCapabilities, type DriverStatus, type DriverStatusSource, ESCPOS_CODE_PAGES, type EarlierRefund, type EncodeEscPosOptions, type EscPosBuilder, type EscPosSink, type EscPosTransportOptions, type FeeLine, type FinalizeOptions, type FloatSuggestion, type GroupRow, HELLO_RETRY_MS, type HandoverSlipData, type HandoverSlipInput, type HttpTransportOptions, type LedgerRow, type LineItem, type LineJoin, type LineTaxLine, type LogEntry, type LogLevel, type LogSink, type Logger, MAX_MESSAGE_BYTES, MAX_TENDER_MINOR, MICROS_PER_MINOR, type Margin, type Movement$1 as Movement, type MovementType, type NoteDelivery, type OpenSale, type Order, type OrderBuilder, type OrderBuilderOptions, OrderContentMismatchError, type OrderCoupon, type OrderCouponContext, type OrderManager, type OrderManagerOptions, type OrderOutbox, type OrderOutboxOptions, type OrderRefundOutcome, type OrderTaxTotals, type OrderTransportContext, type OutboxCounts, type OutboxHealth, type OutboxState, PAPER_COLUMNS, PAYMENT_IN_MOTION, PRINTER_PROFILES_COLLECTION, PRODUCT_SORT_FIELDS, type ParkedOrderSummary, type Payment, type PaymentDriver, type PaymentDriverRegistry, type PaymentLegStatus, type PaymentMethod, type PaymentPhase, type PaymentRow, type PaymentTransport, type PlanLeg, type PosOrder, type PosOrderCoupon, type PosOrderLine, type PosOrderLocalWarning, PosOrderOpenClosedError, type PosOrderPayment, type PosOrderServerFailures, type PosOrderSyncStatus, type PosRefund, type PosRefundCollection, type PosRefundStatus, type PricedRefund, type PricedRefundLine, PrintError, type PrintErrorCode, type PrintJob, type PrintJobKind, type PrintQueue, type PrintQueueOptions, type PrintQueueState, type PrintTransport, type PrinterProfile, type PrinterProfileCollection, type ProductSort, type ProductSortValue, RECEIPT_SCHEMA_VERSION, REGISTER_SESSION_MIGRATION_CLOSE_WAIT_MS, REOPENABLE_CODES, type RateTaxLine, type ReaderInfo, type ReceiptConfig, type ReceiptData, type ReceiptFiscal, type ReceiptLineItem, type ReceiptNode, type ReceiptPaper, type ReceiptRegister, type ReceiptSoftware, type ReceiptTemplateData, type ReceiptTemplateLine, type ReceiptTemplateOptions, type ReceiptTemplateRow, type RecordedFigures, RefundAnswerPendingError, type RefundableLine, type RefundableOrderLine, RegisterApprovalRequiredError, type RegisterBucket, RegisterCloseIncompleteError, type RegisterCommand, type RegisterCommandCollection, type RegisterCounters, type RegisterDocument, type RegisterFact, type RegisterHost, RegisterIdInvalidError, RegisterMovementAmountError, RegisterMovementReasonError, RegisterMovementStrandedError, RegisterNeedsUpgradeError, type RegisterOutbox, type RegisterOutboxOptions, RegisterReapproveError, type RegisterSession, RegisterSessionAlreadyOpenError, RegisterSessionClosedError, type RegisterSessionCollection, RegisterSessionConflictError, RegisterSessionOpenClosedError, RegisterSessionRequiredError, type RegisterStore, RegisterTakeOverError, RegisterTenderInProgressError, type RenderReceiptOptions, type RenderSanitizeOptions, type ReopenRefusal, ReopenRefusedOrderError, type ReportCategory, type ReportLine, type ReportOrder, type ReportPayment, type ReportRefund, type ReportTax, type Repository, type ResolveStoreSettingsOptions, SALE_IN_TENDER, SALE_PARTLY_PAID, SALE_SAVING, SIMULATED_PROVIDER, SIMULATED_TIMING, SYSTEM_PRINTER_ID, SYSTEM_PRINT_TIMING, type SaleDiscountCodes, type SaleDiscountState, type SaleStage, type SalesFigures, type SalesFiguresInput, type SalesTotals, type SanitizeHtmlOptions, type ScanOfferResult, type ScanRejectReason, type ScanSession, type ScanSessionOptions, type SentOrder, type ShippingLine, type SimulatedDriverOptions, type SimulatedReaderId, type SplitTab, type StoreDay, type StoreSettingsResolution, type StoreSettingsState, type SwitchKind, type SwitchWarning, type SwitchWarningInput, type SwitchWarnings, type SystemPrintTransportOptions, TAX_ROUNDING_MIXED_NOTE, type TaxContext, type TaxLineInput, TaxProvider, type TaxProviderProps, type TaxRateMap, type TaxRow, type TenderAction, type TenderKey, type TenderLineId, type TenderPlan, type TenderRounding, type TenderState, type TenderView, type TenderVoid, type ThermalNode, type TraceKey, type TransportOutcome, UI_SCALES, UI_THEMES, type UiScale, type UiTheme, UnsupportedOrderVersionError, type UseBarcodeScannerOptions, type UseOrderOutboxOptions, type UseOrderOutboxResult, type UseOutboxHealthOptions, type UseOutboxHealthResult, type UseRegisterOutboxOptions, type UseRegisterOutboxResult, type UseRegisterSessionOptions, WEDGE_END_OF_SCAN_MS, type WedgeDetector, type WedgeDetectorOptions, type WedgeReplayResult, type WedgeSettings, type WedgeState, abandonSession, activePlan, addEntryToCart, addPosOrderCollection, addPrinterProfileCollection, addRegisterSessionCollection, adoptRegisterResults, advancePerpetual, allocateOrderDiscount, appSettingCollection, appSettingSchema, appSettings$, appliedMinor, backToSelling, bindRegister, buildClosureDocument, buildReceiptData, buildReceiptDataFromPosOrder, buildReceiptDataFromStoreOrder, buildXReportDocument, callbackSink, can, canMoveLeg, canVoidLeg, capturedMinor, cartQuantities, cashMovementSchema, catalogueEntries, catalogueViewReducer, changeMinor, clampClosureScope, closeNeedsApproval, closeSession, closureApprovalStatus, closureCommand, closureSchema, closureVariance, comparisonRange, computeOrderTax, consoleSink, countVariance, countsTowardPaid, createBackendNotFound, createBroadcastDisplayTransport, createDisplayLink, createEscPosTransport, createHttpCommandTransport, createLogger, createOrderBuilder, createOrderManager, createOrderOutbox, createPaymentDriverRegistry, createPrintQueue, createRegisterOutbox, createRepository, createScanSession, createSimulatedDriver, createSystemPrintTransport, createWedgeDetector, createWedgeState, csvCell, csvFromCells, daysOf, decode as decodeDisplayMessage, denominationTotal, denominations, deriveExpected, deriveSettled, displayCart, displayReducer, driverForMethod, encode as encodeDisplayMessage, encodeEscPos, ensureRegister, escpos, evenSplitShareMinor, exportCsv, finalizeOrder, findEntryByCode, foldWedgeKey, formatClosureDate, getBoundRegisterId, getDeviceId, handoverSlip, hasValidRetailCheckDigit, inCategory, inMotionMinor, inRange, initTenderState, initialDisplayState, initialTenderState, isInMotion, isKnownSessionStatus, isLiveAtStore, isPartlyPaid, isRegisterRequeueable, isReopened, isRequeueable, isServerDecimal, labelKeys, legStatus, listCategories, makeEnvelope, marginOf, messageBytes, minorToDecimal, mintClosureNumber, mintUuid, movementCommand, movementFieldError, needsAttention, nextSaleCounter, normalizeAmount, normalizeCatalogueViewState, normalizeRetailCode, noteDelivery, observeRegister$, openSales, openSession, openSessionSelector, orderDraftSchema, outboxLogger, overThreshold, parkedOrderSummaries$, parseMinor, parseXml, planLegs, posOrderCollection, posOrderSchema, posOrdersLogger, posRefundCollection, posRefundSchema, presetRange, priceRefund, printerProfileCollection, printerProfileSchema, productCategories, productSortValue, quickTenderedAmounts, ratePpmFromPercent, readAppSettings, readBoundRegister, readRegister, reapproveClosure, receiptTemplateData, reconcileRegisterCommands, recordMovement, recordRegisterFact, refundableLines, registerCommandCollection, registerCommandSchema, registerCommandsLogger, registerFactsLogger, registerSessionCollection, registerSessionSchema, registerSessionsLogger, renderHtml, renderLogiclessTemplate, renderReceiptHtml, renderReceiptTemplate, renderThermalPreview, reopenRefusedOrder, replacedOrderIds, replayWedgeDetector, reportOrderFromPosOrder, reportOrderFromStoreOrder, reportRefundFromPosRefund, requireOpenSession, resolveAppSettings, resolveGridColumns, resolveStoreSettings, restoreOrderDraft, retailCodeTwin, roundMicrosToMinor, roundedDue, saleLogger, salesFigures, sameSale, sanitizeHtml, searchProducts, selectClosureRows, sendOrderRefund, sessionOpenCommand, sessionTransitionCommand, sortProducts, stampSession, startCounting, stockOverlay$, stockOverlayAsOf$, stripBoundary, submitOrderRefund, suggestFloat, summarizeOutboxHealth, switchWarnings, takeOverSession, taxFiguresForBasket, taxLinesByRate, taxLogger, taxMicros, taxProviderProps, tenderReducer, tenderRounding, tenderVoidCollection, tenderVoidSchema, toCsv, toOrderCreateEnvelope, toPrintError, unbindRegister, useAppSettings, useBarcodeScanner, useCashier, useCurrencyCode, useCurrencyFormatter, useCustomerDisplay, useOrderOutbox, useOutboxHealth, useParkedSales, useRegisterOutbox, useRegisterSession, useSale, useStoreSettings, useTax, uuidv7, validAmount, varianceText, variantPriceLabel, voidMovement, watchOutboxHealth, withPricingContext, index as woocommerceDiscountCodes, writeAppSetting, writeClosure, writeOrderDraft };
|