diff --git a/POS/components.d.ts b/POS/components.d.ts index 1f2e8b35f..7ee001c9c 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 ad02948af..64c03bd81 100644 --- a/POS/src/components/ShiftClosingDialog.vue +++ b/POS/src/components/ShiftClosingDialog.vue @@ -102,6 +102,24 @@ + +
+
+ {{ __("POS Expenses") }} +
+
+ -{{ formatCurrency(closingData.expenses_total) }} +
+
+ {{ __("{0} expenses", [closingData.expenses_count]) }} +
+
+
{{ __("After returns") }}
+ +
+
+ {{ __("Net Cash Impact") }} +
+
+ {{ formatCurrency(netCashImpact) }} +
+
+ {{ __("Sales - Returns - Expenses") }} +
+
+
+ +
+
+

+ {{ __("POS Expenses") }} +

+

+ {{ + __("{0} expenses totaling {1}", [ + closingData.expenses_count, + formatCurrency(closingData.expenses_total), + ]) + }} +

+
+
+ + + + + + + + + + + + + + + + + +
+ {{ __("Expense Account") }} + + {{ __("Amount") }} + + {{ __("Employee") }} + + {{ __("Remarks") }} +
+ {{ expense.expense_account }} + + {{ formatCurrency(expense.amount) }} + + {{ expense.employee || __("N/A") }} + + {{ expense.remarks || __("N/A") }} +
+
+
+
+

+ {{ + __("Expenses: -{0}", [ + formatCurrency(payment.expense_amount), + ]) + }} +

@@ -1226,6 +1341,19 @@ 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..f73842692 --- /dev/null +++ b/POS/src/components/sale/ExpenseDialog.vue @@ -0,0 +1,363 @@ + + + + + diff --git a/POS/src/components/sale/InvoiceCart.vue b/POS/src/components/sale/InvoiceCart.vue index aeefa004d..028240e22 100644 --- a/POS/src/components/sale/InvoiceCart.vue +++ b/POS/src/components/sale/InvoiceCart.vue @@ -849,6 +849,36 @@ }} + + + +