Merge branch 'develop' into order-by-weightage-for-web-items-develop
This commit is contained in:
commit
50170a8e62
@ -56,7 +56,7 @@ erpnext.PointOfSale.Payment = class {
|
|||||||
);
|
);
|
||||||
let df_events = {
|
let df_events = {
|
||||||
onchange: function() {
|
onchange: function() {
|
||||||
frm.set_value(this.df.fieldname, this.value);
|
frm.set_value(this.df.fieldname, this.get_value());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (df.fieldtype == "Button") {
|
if (df.fieldtype == "Button") {
|
||||||
|
@ -41,7 +41,7 @@ class LandedCostVoucher(Document):
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.check_mandatory()
|
self.check_mandatory()
|
||||||
self.validate_purchase_receipts()
|
self.validate_receipt_documents()
|
||||||
init_landed_taxes_and_totals(self)
|
init_landed_taxes_and_totals(self)
|
||||||
self.set_total_taxes_and_charges()
|
self.set_total_taxes_and_charges()
|
||||||
if not self.get("items"):
|
if not self.get("items"):
|
||||||
@ -56,13 +56,22 @@ class LandedCostVoucher(Document):
|
|||||||
frappe.throw(_("Please enter Receipt Document"))
|
frappe.throw(_("Please enter Receipt Document"))
|
||||||
|
|
||||||
|
|
||||||
def validate_purchase_receipts(self):
|
def validate_receipt_documents(self):
|
||||||
receipt_documents = []
|
receipt_documents = []
|
||||||
|
|
||||||
for d in self.get("purchase_receipts"):
|
for d in self.get("purchase_receipts"):
|
||||||
if frappe.db.get_value(d.receipt_document_type, d.receipt_document, "docstatus") != 1:
|
docstatus = frappe.db.get_value(d.receipt_document_type, d.receipt_document, "docstatus")
|
||||||
frappe.throw(_("Receipt document must be submitted"))
|
if docstatus != 1:
|
||||||
else:
|
msg = f"Row {d.idx}: {d.receipt_document_type} {frappe.bold(d.receipt_document)} must be submitted"
|
||||||
|
frappe.throw(_(msg), title=_("Invalid Document"))
|
||||||
|
|
||||||
|
if d.receipt_document_type == "Purchase Invoice":
|
||||||
|
update_stock = frappe.db.get_value(d.receipt_document_type, d.receipt_document, "update_stock")
|
||||||
|
if not update_stock:
|
||||||
|
msg = _("Row {0}: Purchase Invoice {1} has no stock impact.").format(d.idx, frappe.bold(d.receipt_document))
|
||||||
|
msg += "<br>" + _("Please create Landed Cost Vouchers against Invoices that have 'Update Stock' enabled.")
|
||||||
|
frappe.throw(msg, title=_("Incorrect Invoice"))
|
||||||
|
|
||||||
receipt_documents.append(d.receipt_document)
|
receipt_documents.append(d.receipt_document)
|
||||||
|
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user