feature: payment instruction & cashier case cicilan dan downpayment

This commit is contained in:
2026-07-21 15:22:18 +07:00
parent d92fb57751
commit a12a34f073
7 changed files with 128 additions and 19 deletions

View File

@@ -457,7 +457,13 @@
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
isSelected(p) {
return p.SupplierInvoiceID == this.$store.state.bill.selected_bill.SupplierInvoiceID
const sel = this.$store.state.bill.selected_bill;
if (!sel || !sel.type) return false;
return p.type === sel.type && (
(sel.type === 'INVOICE' && p.SupplierInvoiceID == sel.SupplierInvoiceID) ||
(sel.type === 'DP' && p.DownpaymentID == sel.DownpaymentID) ||
(sel.type === 'INSTALLMENT' && p.InstallmentID == sel.InstallmentID)
);
},
closeDialogPaySuccess() {
this.$store.commit("bill/update_dialog_pay_success", false)

View File

@@ -1202,7 +1202,18 @@
tanggalbayar: this.xtanggalbayar,
type: this.$store.state.bill.selected_bill.type,
}
//console.log(prm.amount)
if (this.$store.state.bill.selected_bill.type == 'DP') {
prm.DownpaymentID = this.$store.state.bill.selected_bill.DownpaymentID
prm.dpkode = this.$store.state.bill.selected_bill.SupplierInvoiceNumber
} else if (this.$store.state.bill.selected_bill.type == "INSTALLMENT") {
prm.InstallmentID = this.$store.state.bill.selected_bill.InstallmentID
prm.installmentkode = this.$store.state.bill.selected_bill.SupplierInvoiceNumber
} else {
prm.SupplierInvoiceID = this.$store.state.bill.selected_bill.SupplierInvoiceID
prm.invoicekode = this.$store.state.bill.selected_bill.SupplierInvoiceNumber
}
this.$store.dispatch("paymentmanual/pay", prm)
},
deleteNote(note, idx) {
@@ -1249,8 +1260,14 @@
},
closeDialogDelete() {
let arrbill = this.$store.state.bill.bills
var idx = _.findIndex(arrbill, item => item.SupplierInvoiceID === this.$store.state.bill.selected_bill
.SupplierInvoiceID)
const sel = this.$store.state.bill.selected_bill;
var idx = _.findIndex(arrbill, item =>
item.type === sel.type && (
(sel.type === 'INVOICE' && item.SupplierInvoiceID == sel.SupplierInvoiceID) ||
(sel.type === 'DP' && item.DownpaymentID == sel.DownpaymentID) ||
(sel.type === 'INSTALLMENT' && item.InstallmentID == sel.InstallmentID)
)
);
this.$store.commit("paymentmanual/update_dialog_delete", false)
this.$store.commit("bill/update_selected_bill", {})
this.$store.dispatch("bill/search", {
@@ -1264,8 +1281,14 @@
},
closeDialogEdit() {
let arrbill = this.$store.state.bill.bills
var idx = _.findIndex(arrbill, item => item.SupplierInvoiceID === this.$store.state.bill.selected_bill
.SupplierInvoiceID)
const sel = this.$store.state.bill.selected_bill;
var idx = _.findIndex(arrbill, item =>
item.type === sel.type && (
(sel.type === 'INVOICE' && item.SupplierInvoiceID == sel.SupplierInvoiceID) ||
(sel.type === 'DP' && item.DownpaymentID == sel.DownpaymentID) ||
(sel.type === 'INSTALLMENT' && item.InstallmentID == sel.InstallmentID)
)
);
this.$store.commit("paymentmanual/update_dialog_edit", false)
this.$store.commit("bill/update_selected_bill", {})
this.$store.dispatch("bill/search", {

View File

@@ -1231,8 +1231,14 @@
},
closeDialogDelete() {
let arrbill = this.$store.state.bill.bills
var idx = _.findIndex(arrbill, item => item.SupplierInvoiceID === this.$store.state.bill.selected_bill
.SupplierInvoiceID)
const sel = this.$store.state.bill.selected_bill;
var idx = _.findIndex(arrbill, item =>
item.type === sel.type && (
(sel.type === 'INVOICE' && item.SupplierInvoiceID == sel.SupplierInvoiceID) ||
(sel.type === 'DP' && item.DownpaymentID == sel.DownpaymentID) ||
(sel.type === 'INSTALLMENT' && item.InstallmentID == sel.InstallmentID)
)
);
this.$store.commit("paymentmanual/update_dialog_delete", false)
this.$store.commit("bill/update_selected_bill", {})
this.$store.dispatch("bill/search", {
@@ -1246,8 +1252,14 @@
},
closeDialogEdit() {
let arrbill = this.$store.state.bill.bills
var idx = _.findIndex(arrbill, item => item.SupplierInvoiceID === this.$store.state.bill.selected_bill
.SupplierInvoiceID)
const sel = this.$store.state.bill.selected_bill;
var idx = _.findIndex(arrbill, item =>
item.type === sel.type && (
(sel.type === 'INVOICE' && item.SupplierInvoiceID == sel.SupplierInvoiceID) ||
(sel.type === 'DP' && item.DownpaymentID == sel.DownpaymentID) ||
(sel.type === 'INSTALLMENT' && item.InstallmentID == sel.InstallmentID)
)
);
this.$store.commit("paymentmanual/update_dialog_edit", false)
this.$store.commit("bill/update_selected_bill", {})
this.$store.dispatch("bill/search", {