multi invoice combined ui

This commit is contained in:
edmondlang
2023-01-18 23:58:26 +08:00
parent 1c800b70ec
commit 7e439a38fd
3 changed files with 18 additions and 13 deletions
@@ -17,9 +17,9 @@
<div class="col">
<h5 class="no-margin">Invoice Date</h5>
</div>
<div class="col">
<!-- <div class="col">
<h5 class="no-margin">Status</h5>
</div>
</div> -->
<div class="col">
<h5 class="no-margin">Amount</h5>
</div>
@@ -61,10 +61,10 @@
<div class="col">
<div class="row" v-for="invoice in selectedInvoice">
<div class="col">
<h6 class="no-margin">lorem ipsum</h6>
<h6 class="no-margin">{{ invoice.bill_no }}</h6>
</div>
<div class="col-auto">
<h6 class="no-margin">52x62x635 CM</h6>
<h6 class="no-margin">MYR {{ invoice.amount.toFixed(2) }}</h6>
</div>
</div>
</div>
@@ -72,17 +72,17 @@
<hr>
<div class="row">
<div class="col">
<h6 class="normal">Total Payments</h6>
<h6 class="normal m-t-0 m-b-0">Total Amount</h6>
</div>
<div class="col-auto">
<h6 class="text-primary bold">RM 3300.00</h6>
<h6 class="text-primary bold m-t-0 m-b-0">MYR {{ sumAmount }}</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="btn btn-xl btn-success pointer m-t-10 w-100" @click='makePayment'>Make Payments</div>
<div class="btn btn-xl btn-success pointer m-t-10 w-100" @click='generateSummaryInvoice'>Generate Summary Invoice</div>
</div>
</div>
</div>
@@ -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);
@@ -13,9 +13,9 @@
<div class="col">
<h5 class="no-margin">{{ item.created_at }}</h5>
</div>
<div class="col">
<!-- <div class="col">
<h5 class="no-margin">Status</h5>
</div>
</div> -->
<div class="col">
<h5 class="no-margin">MYR {{ item.amount.toFixed(2) }}</h5>
</div>
+1 -1
View File
@@ -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');