diff --git a/POS/components.d.ts b/POS/components.d.ts index c2b07c605..8137884ed 100644 --- a/POS/components.d.ts +++ b/POS/components.d.ts @@ -20,6 +20,7 @@ declare module 'vue' { CustomerDialog: typeof import('./src/components/sale/CustomerDialog.vue')['default'] DraftInvoicesDialog: typeof import('./src/components/sale/DraftInvoicesDialog.vue')['default'] EditItemDialog: typeof import('./src/components/sale/EditItemDialog.vue')['default'] + ExpenseDialog: typeof import('./src/components/sale/ExpenseDialog.vue')['default'] InstallAppBadge: typeof import('./src/components/common/InstallAppBadge.vue')['default'] InvoiceCart: typeof import('./src/components/sale/InvoiceCart.vue')['default'] InvoiceDetailDialog: typeof import('./src/components/invoices/InvoiceDetailDialog.vue')['default'] diff --git a/POS/src/components/ShiftClosingDialog.vue b/POS/src/components/ShiftClosingDialog.vue index b2c95990f..8bc2c2355 100644 --- a/POS/src/components/ShiftClosingDialog.vue +++ b/POS/src/components/ShiftClosingDialog.vue @@ -102,6 +102,24 @@ + +
+ {{ + __( + "{0} expenses totaling {1}", + [ + closingData.expenses_count, + formatCurrency(closingData.expenses_total), + ] + ) + }} +
+| + {{ __("Journal Entry") }} + | ++ {{ __("Expense Account") }} + | ++ {{ __("Amount") }} + | ++ {{ __("Employee") }} + | ++ {{ __("Remarks") }} + | +
|---|---|---|---|---|
| + {{ expense.journal_entry || __("N/A") }} + | ++ {{ expense.expense_account }} + | ++ {{ formatCurrency(expense.amount) }} + | ++ {{ expense.employee || __("N/A") }} + | ++ {{ expense.remarks || __("N/A") }} + | +
+ {{ + __( + "Expenses: -{0}", + [formatCurrency(payment.expense_amount)], + ) + }} +
@@ -1303,6 +1430,21 @@ const hasReturns = computed(() => { return (closingData.value.returns_count || 0) > 0; }); +const hasExpenses = computed(() => { + if (!closingData.value) return false; + return (closingData.value.expenses_count || 0) > 0; +}); + +const netCashImpact = computed(() => { + if (!closingData.value) return 0; + const sales = Number.parseFloat( + closingData.value.sales_total || closingData.value.grand_total || 0, + ); + const returns = Number.parseFloat(closingData.value.returns_total || 0); + const expenses = Number.parseFloat(closingData.value.expenses_total || 0); + return sales - returns - expenses; +}); + // Count of sales invoices (non-returns) const salesInvoiceCount = computed(() => { if (!closingData.value) return 0; diff --git a/POS/src/components/sale/ExpenseDialog.vue b/POS/src/components/sale/ExpenseDialog.vue new file mode 100644 index 000000000..333289838 --- /dev/null +++ b/POS/src/components/sale/ExpenseDialog.vue @@ -0,0 +1,1247 @@ + + + + + + + diff --git a/POS/src/components/sale/InvoiceCart.vue b/POS/src/components/sale/InvoiceCart.vue index 0414cf433..485f0056b 100644 --- a/POS/src/components/sale/InvoiceCart.vue +++ b/POS/src/components/sale/InvoiceCart.vue @@ -849,6 +849,36 @@ }} + + + + @@ -567,6 +589,17 @@ @return-created="handleReturnCreated" /> + +