mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 23:31:20 +00:00
fix: clear payment schedule in purchase invoice for is_paid
(cherry picked from commit e1fc239f3d)
# Conflicts:
# erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
# erpnext/controllers/accounts_controller.py
This commit is contained in:
@@ -366,8 +366,15 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
hide_fields(this.frm.doc);
|
hide_fields(this.frm.doc);
|
||||||
if(cint(this.frm.doc.is_paid)) {
|
if(cint(this.frm.doc.is_paid)) {
|
||||||
this.frm.set_value("allocate_advances_automatically", 0);
|
this.frm.set_value("allocate_advances_automatically", 0);
|
||||||
|
<<<<<<< HEAD
|
||||||
if(!this.frm.doc.company) {
|
if(!this.frm.doc.company) {
|
||||||
this.frm.set_value("is_paid", 0)
|
this.frm.set_value("is_paid", 0)
|
||||||
|
=======
|
||||||
|
this.frm.set_value("payment_terms_template", "");
|
||||||
|
this.frm.set_value("payment_schedule", []);
|
||||||
|
if (!this.frm.doc.company) {
|
||||||
|
this.frm.set_value("is_paid", 0);
|
||||||
|
>>>>>>> e1fc239f3d (fix: clear payment schedule in purchase invoice for is_paid)
|
||||||
frappe.msgprint(__("Please specify Company to proceed"));
|
frappe.msgprint(__("Please specify Company to proceed"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,10 +415,14 @@ class AccountsController(TransactionBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def validate_invoice_documents_schedule(self):
|
def validate_invoice_documents_schedule(self):
|
||||||
if self.is_return:
|
if (
|
||||||
|
self.is_return
|
||||||
|
or (self.doctype == "Purchase Invoice" and self.is_paid)
|
||||||
|
or (self.doctype == "Sales Invoice" and self.is_pos)
|
||||||
|
or self.get("is_opening") == "Yes"
|
||||||
|
):
|
||||||
self.payment_terms_template = ""
|
self.payment_terms_template = ""
|
||||||
self.payment_schedule = []
|
self.payment_schedule = []
|
||||||
return
|
|
||||||
|
|
||||||
self.validate_payment_schedule_dates()
|
self.validate_payment_schedule_dates()
|
||||||
self.set_due_date()
|
self.set_due_date()
|
||||||
@@ -2177,9 +2181,6 @@ class AccountsController(TransactionBase):
|
|||||||
dates = []
|
dates = []
|
||||||
li = []
|
li = []
|
||||||
|
|
||||||
if self.doctype == "Sales Invoice" and self.is_pos:
|
|
||||||
return
|
|
||||||
|
|
||||||
for d in self.get("payment_schedule"):
|
for d in self.get("payment_schedule"):
|
||||||
if self.doctype == "Sales Order" and getdate(d.due_date) < getdate(self.transaction_date):
|
if self.doctype == "Sales Order" and getdate(d.due_date) < getdate(self.transaction_date):
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
@@ -2196,9 +2197,12 @@ class AccountsController(TransactionBase):
|
|||||||
frappe.throw(_("Rows with duplicate due dates in other rows were found: {0}").format(duplicates))
|
frappe.throw(_("Rows with duplicate due dates in other rows were found: {0}").format(duplicates))
|
||||||
|
|
||||||
def validate_payment_schedule_amount(self):
|
def validate_payment_schedule_amount(self):
|
||||||
|
<<<<<<< HEAD
|
||||||
if self.doctype == "Sales Invoice" and self.is_pos:
|
if self.doctype == "Sales Invoice" and self.is_pos:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> e1fc239f3d (fix: clear payment schedule in purchase invoice for is_paid)
|
||||||
party_account_currency = self.get("party_account_currency")
|
party_account_currency = self.get("party_account_currency")
|
||||||
if not party_account_currency:
|
if not party_account_currency:
|
||||||
party_type, party = self.get_party()
|
party_type, party = self.get_party()
|
||||||
|
|||||||
Reference in New Issue
Block a user