From 79ef11bb23e90917f9ea11d29c1cb7022ab3d5a9 Mon Sep 17 00:00:00 2001 From: akshayitzme Date: Tue, 22 Aug 2023 18:30:24 +0530 Subject: [PATCH] incr: pos shift models --- models/inventory/Point of Sale/ClosingCash.ts | 4 +++- models/inventory/Point of Sale/OpeningAmounts.ts | 4 ++++ models/inventory/Point of Sale/POSShift.ts | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/models/inventory/Point of Sale/ClosingCash.ts b/models/inventory/Point of Sale/ClosingCash.ts index 2fcae076..dd5c787f 100644 --- a/models/inventory/Point of Sale/ClosingCash.ts +++ b/models/inventory/Point of Sale/ClosingCash.ts @@ -1,3 +1,5 @@ import { CashDenominations } from './CashDenominations'; -export class ClosingCash extends CashDenominations {} +export class ClosingCash extends CashDenominations { + count?: number; +} diff --git a/models/inventory/Point of Sale/OpeningAmounts.ts b/models/inventory/Point of Sale/OpeningAmounts.ts index 860e2699..86a0ad72 100644 --- a/models/inventory/Point of Sale/OpeningAmounts.ts +++ b/models/inventory/Point of Sale/OpeningAmounts.ts @@ -4,4 +4,8 @@ import { Money } from 'pesa'; export class OpeningAmounts extends Doc { amount?: Money; paymentMethod?: 'Cash' | 'Transfer'; + + get openingCashAmount() { + return this.parentdoc?.openingCashAmount as Money; + } } diff --git a/models/inventory/Point of Sale/POSShift.ts b/models/inventory/Point of Sale/POSShift.ts index b56fc859..ff9e6134 100644 --- a/models/inventory/Point of Sale/POSShift.ts +++ b/models/inventory/Point of Sale/POSShift.ts @@ -5,13 +5,13 @@ import { OpeningAmounts } from './OpeningAmounts'; import { OpeningCash } from './OpeningCash'; export class POSShift extends Doc { - closingAmounts?: ClosingAmounts[]; - closingCash?: ClosingCash[]; - closingDate?: Date; isShiftOpen?: boolean; - openingAmounts?: OpeningAmounts[]; - openingCash?: OpeningCash[]; openingDate?: Date; + closingDate?: Date; + openingAmounts?: OpeningAmounts[]; + closingAmounts?: ClosingAmounts[]; + openingCash?: OpeningCash[]; + closingCash?: ClosingCash[]; get openingCashAmount() { if (!this.openingCash) {