From 7e439a38fdff393e68e3affbcd358f089eb4f6c5 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 18 Jan 2023 23:58:26 +0800 Subject: [PATCH] multi invoice combined ui --- ...CustomerPaymentBillingSectionComponent.vue | 25 +++++++++++-------- .../elements/PaymentsBillingComponents.vue | 4 +-- routes/web.php | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue index b375eafd..b12882ee 100644 --- a/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue +++ b/resources/assets/vue/components/companies/sections/CustomerPaymentBillingSectionComponent.vue @@ -17,9 +17,9 @@
Invoice Date
-
+
Amount
@@ -61,10 +61,10 @@
-
lorem ipsum
+
{{ invoice.bill_no }}
-
52x62x635 CM
+
MYR {{ invoice.amount.toFixed(2) }}
@@ -72,17 +72,17 @@
-
Total Payments
+
Total Amount
-
RM 3300.00
+
MYR {{ sumAmount }}
-
Make Payments
+
Generate Summary Invoice
@@ -110,6 +110,12 @@ computed: { pendingQueue () { return this.$store.getters.isInCompleteQueue(this.section); + }, + sumAmount () { + var new_object = this.selectedInvoice; + return Object.keys(new_object).reduce(function(total, key) { + return total + Math.round(new_object[key].amount * 100) / 100; + }, 0).toFixed(2); } }, watch: { @@ -132,10 +138,9 @@ this.isLoading = false; this.invoices = response.payload.data; }, - makePayment(){ + generateSummaryInvoice(){ var selectedId = this.selectedInvoice.map(s=>s.id); - console.log(selectedId); - + window.open(route('invoice.combined_summary', JSON.stringify(selectedId)), '_blank'); }, updateList(packageList){ this.selectedInvoice.includes(packageList) ? this.selectedInvoice.splice(this.selectedInvoice.indexOf(packageList), 1) : this.selectedInvoice.push(packageList); diff --git a/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue b/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue index 590a78ca..d62c1e4f 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/PaymentsBillingComponents.vue @@ -13,9 +13,9 @@
{{ item.created_at }}
-
+
MYR {{ item.amount.toFixed(2) }}
diff --git a/routes/web.php b/routes/web.php index 42f94dd4..e9473af4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -696,6 +696,6 @@ Route::get('/invoices/combine/{ids}', function($ids){ $pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoices_combined', ['invoice_transactions' => $transactions]); return $pdf->download('combined_invoice_.pdf'); -}); +})->name('invoice.combined_summary');