From 872fc661ce878ecdc6c9a2dfe3cbb18e203b2222 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 28 Dec 2025 12:01:24 +0200 Subject: [PATCH 1/3] bugs bashing --- .../InventoryValuationSheet.ts | 2 +- .../InventoryValuationSheetService.ts | 2 +- .../TrialBalanceSheet/TrialBalanceSheet.ts | 5 +- .../SaleInvoices/SaleInvoiceCostGLEntries.ts | 2 +- .../subscribers/InvoiceGLEntriesSubscriber.ts | 2 +- .../src/components/Branches/BranchSelect.tsx | 9 - .../src/constants/financialReportsMenu.tsx | 9 + .../AllocateLandedCostFormFields.tsx | 215 ++++++++---------- .../ContactDuplicateForm.tsx | 46 ++-- .../InventoryAdjustmentFormDialogFields.tsx | 69 +++--- .../RefundCreditNoteFormFields.tsx | 1 - .../UserFormDialog/UserFormContent.tsx | 49 ++-- .../APAgingSummaryActionsBar.tsx | 5 - .../ARAgingSummaryActionsBar.tsx | 5 - .../BalanceSheet/BalanceSheetActionsBar.tsx | 12 - .../CashFlowStatementActionsBar.tsx | 12 - .../CustomersBalanceSummaryActionsBar.tsx | 12 - .../CustomersTransactionsActionsBar.tsx | 12 - .../GeneralLedger/GeneralLedgerActionsBar.tsx | 13 -- .../InventoryItemDetailsActionsBar.tsx | 12 - .../InventoryValuationActionsBar.tsx | 12 - .../InventoryValuationTable.tsx | 16 +- .../Journal/JournalActionsBar.tsx | 13 -- .../ProfitLossSheet/ProfitLossActionsBar.tsx | 12 - .../ProjectProfitabilitySummaryActionsBar.tsx | 11 - .../PurchasesByItemsActionsBar.tsx | 11 - .../RealizedGainOrLossActionsBar.tsx | 5 - .../SalesByItems/SalesByItemsActionsBar.tsx | 12 - .../SalesTaxLiabilitySummaryActionsBar.tsx | 12 - .../TrialBalanceActionsBar.tsx | 12 - .../TrialBalanceSheetHeader.tsx | 1 + .../UnrealizedGainOrLossActionsBar.tsx | 5 - .../VendorsBalanceSummaryActionsBar.tsx | 5 - .../VendorsTransactionsActionsBar.tsx | 12 - .../NotifyViaSMS/NotifyViaSMSFormFields.tsx | 43 ++-- packages/webapp/src/utils/withConnectHOC.tsx | 98 ++++++++ 36 files changed, 312 insertions(+), 462 deletions(-) create mode 100644 packages/webapp/src/utils/withConnectHOC.tsx diff --git a/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheet.ts b/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheet.ts index 8eab7581d..2fb7f2cf7 100644 --- a/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheet.ts +++ b/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheet.ts @@ -211,7 +211,7 @@ export class InventoryValuationSheet extends FinancialSheet { * Detarmines whether the items post filter is active. */ private isItemsPostFilter = (): boolean => { - return isEmpty(this.query.itemsIds); + return !isEmpty(this.query.itemsIds); }; /** diff --git a/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheetService.ts b/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheetService.ts index 059c6648d..560b77a8d 100644 --- a/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheetService.ts +++ b/packages/server/src/modules/FinancialStatements/modules/InventoryValuationSheet/InventoryValuationSheetService.ts @@ -18,7 +18,7 @@ export class InventoryValuationSheetService { private readonly inventoryValuationMeta: InventoryValuationMetaInjectable, private readonly eventPublisher: EventEmitter2, private readonly inventoryValuationSheetRepository: InventoryValuationSheetRepository, - ) {} + ) { } /** * Inventory valuation sheet. diff --git a/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts b/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts index 9110920fc..1cee9693a 100644 --- a/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts +++ b/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts @@ -172,7 +172,10 @@ export class TrialBalanceSheet extends FinancialSheet { private filterNoneTransactions = ( accountNode: ITrialBalanceAccount ): boolean => { - return false === this.repository.totalAccountsLedger.isEmpty(); + const accountLedger = this.repository.totalAccountsLedger.whereAccountId( + accountNode.id, + ); + return !accountLedger.isEmpty(); }; /** diff --git a/packages/server/src/modules/SaleInvoices/SaleInvoiceCostGLEntries.ts b/packages/server/src/modules/SaleInvoices/SaleInvoiceCostGLEntries.ts index a209e2290..78053973f 100644 --- a/packages/server/src/modules/SaleInvoices/SaleInvoiceCostGLEntries.ts +++ b/packages/server/src/modules/SaleInvoices/SaleInvoiceCostGLEntries.ts @@ -19,7 +19,7 @@ export class SaleInvoiceCostGLEntries { private readonly inventoryCostLotTracker: TenantModelProxy< typeof InventoryCostLotTracker >, - ) {} + ) { } /** * Writes journal entries from sales invoices. diff --git a/packages/server/src/modules/SaleInvoices/subscribers/InvoiceGLEntriesSubscriber.ts b/packages/server/src/modules/SaleInvoices/subscribers/InvoiceGLEntriesSubscriber.ts index 1917d1477..0c27afa51 100644 --- a/packages/server/src/modules/SaleInvoices/subscribers/InvoiceGLEntriesSubscriber.ts +++ b/packages/server/src/modules/SaleInvoices/subscribers/InvoiceGLEntriesSubscriber.ts @@ -10,7 +10,7 @@ import { events } from '@/common/events/events'; @Injectable() export class InvoiceGLEntriesSubscriber { - constructor(public readonly saleInvoiceGLEntries: SaleInvoiceGLEntries) {} + constructor(public readonly saleInvoiceGLEntries: SaleInvoiceGLEntries) { } /** * Records journal entries of the non-inventory invoice. diff --git a/packages/webapp/src/components/Branches/BranchSelect.tsx b/packages/webapp/src/components/Branches/BranchSelect.tsx index 2641f2704..190c5122b 100644 --- a/packages/webapp/src/components/Branches/BranchSelect.tsx +++ b/packages/webapp/src/components/Branches/BranchSelect.tsx @@ -20,12 +20,3 @@ export function BranchSelect({ branches, ...rest }) { /> ); } - -/** - * - * @param {*} param0 - * @returns - */ -export function BranchSelectButton({ label, ...rest }) { - return