From f4e36882161dcaa9af2d0dc65e92ecf8076d21d5 Mon Sep 17 00:00:00 2001 From: Mohit Panjwani Date: Thu, 9 Dec 2021 12:41:17 +0530 Subject: [PATCH] fix payment edit issue when invoice selected from url --- ...12_09_062434_update_crater_version_505.php | 29 +++++++++++++++++++ resources/scripts/stub/payment.js | 2 +- resources/scripts/views/payments/Create.vue | 9 ++++-- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2021_12_09_062434_update_crater_version_505.php diff --git a/database/migrations/2021_12_09_062434_update_crater_version_505.php b/database/migrations/2021_12_09_062434_update_crater_version_505.php new file mode 100644 index 00000000..eb57ee3a --- /dev/null +++ b/database/migrations/2021_12_09_062434_update_crater_version_505.php @@ -0,0 +1,29 @@ + inv.id === paymentStore.currentPayment.invoice_id ) @@ -456,9 +456,14 @@ function onCustomerChange(customer_id) { paymentStore.currentPayment.maxPayableAmount = selectedInvoice.value.due_amount + paymentStore.currentPayment.amount + + if (amount.value === 0) { + amount.value = selectedInvoice.value.due_amount / 100 + } } if (isEdit.value) { + // remove all invoices that are paid except currently selected invoice invoiceList.value = invoiceList.value.filter((v) => { return ( v.due_amount > 0 || v.id == paymentStore.currentPayment.invoice_id @@ -515,7 +520,7 @@ function selectNewCustomer(id) { if (route.params.id) params.model_id = route.params.id paymentStore.currentPayment.invoice_id = selectedInvoice.value = null - paymentStore.currentPayment.amount = 100 + paymentStore.currentPayment.amount = 0 invoiceList.value = [] paymentStore.getNextNumber(params, true) }