feat: Payment Entry Cheque/Reference Date follows Posting Date
Set on new entries and whenever Posting Date changes; the field stays editable for cheques dated differently.
This commit is contained in:
1 parent
2d184a5b11
commit
b6492f75e1
1 file changed
+14
@@ -1,4 +1,18 @@
|
||||
frappe.ui.form.on("Payment Entry", {
|
||||
onload(frm) {
|
||||
if (frm.is_new() && frm.doc.posting_date && !frm.doc.reference_date) {
|
||||
frm.set_value("reference_date", frm.doc.posting_date);
|
||||
}
|
||||
},
|
||||
|
||||
// Cheque/Reference Date follows Posting Date; the field stays editable for the
|
||||
// cases where the cheque is dated differently.
|
||||
posting_date(frm) {
|
||||
if (frm.doc.posting_date) {
|
||||
frm.set_value("reference_date", frm.doc.posting_date);
|
||||
}
|
||||
},
|
||||
|
||||
apply_tax_withholding_amount(frm) {
|
||||
if (frm.doc.party_type !== "Customer" || frm.doc.payment_type !== "Receive") return;
|
||||
if (!frm.doc.apply_tax_withholding_amount) {
|
||||
|
||||
Reference in new issue
Block a user