diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index 162f6faaca49..838a9abf8c07 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -16,7 +16,7 @@ "pr_required", "maintain_same_rate", "allow_multiple_items", - "consider_rejected_quantity_in_purchase_invoice", + "bill_for_rejected_quantity_in_purchase_invoice", "subcontract", "backflush_raw_materials_of_subcontract_based_on", "column_break_11", @@ -112,10 +112,10 @@ }, { "default": "1", - "description": "If checked, Rejected Quantity will be considered while making Purchase Invoice from Purchase Receipt.", - "fieldname": "consider_rejected_quantity_in_purchase_invoice", + "description": "If checked, Rejected Quantity will be included while making Purchase Invoice from Purchase Receipt.", + "fieldname": "bill_for_rejected_quantity_in_purchase_invoice", "fieldtype": "Check", - "label": "Consider Rejected Quantity in Purchase Invoice" + "label": "Bill for Rejected Quantity in Purchase Invoice" } ], "icon": "fa fa-cog", @@ -123,7 +123,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2021-06-17 17:17:40.024658", + "modified": "2021-06-23 19:40:00.120822", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index e53cf9513fa4..1c086e9edcda 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -830,7 +830,7 @@ def validate_multiple_billing(self, ref_dt, item_ref_dn, based_on, parentfield): if total_billed_amt - max_allowed_amt > 0.01 and role_allowed_to_over_bill not in frappe.get_roles(): if self.doctype != "Purchase Invoice": self.throw_overbill_exception(item, max_allowed_amt) - elif not cint(frappe.db.get_single_value("Buying Settings", "consider_rejected_quantity_in_purchase_invoice")): + elif not cint(frappe.db.get_single_value("Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice")): self.throw_overbill_exception(item, max_allowed_amt) def throw_overbill_exception(self, item, max_allowed_amt): diff --git a/erpnext/patches.txt b/erpnext/patches.txt index a705c93f72b0..339e7f99d268 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -288,5 +288,5 @@ execute:frappe.rename_doc("Workspace", "Loan Management", "Loans", force=True) erpnext.patches.v13_0.update_timesheet_changes erpnext.patches.v13_0.add_doctype_to_sla #14-06-2021 erpnext.patches.v13_0.set_training_event_attendance -erpnext.patches.v13_0.consider_rejected_quantity_in_purchase_invoice +erpnext.patches.v13_0.bill_for_rejected_quantity_in_purchase_invoice erpnext.patches.v13_0.rename_issue_status_hold_to_on_hold diff --git a/erpnext/patches/v13_0/consider_rejected_quantity_in_purchase_invoice.py b/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py similarity index 75% rename from erpnext/patches/v13_0/consider_rejected_quantity_in_purchase_invoice.py rename to erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py index 9eacd0c77e50..7de9fa1e23e9 100644 --- a/erpnext/patches/v13_0/consider_rejected_quantity_in_purchase_invoice.py +++ b/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py @@ -4,5 +4,5 @@ def execute(): frappe.reload_doctype("Buying Settings") buying_settings = frappe.get_single("Buying Settings") - buying_settings.consider_rejected_quantity_in_purchase_invoice = 0 + buying_settings.bill_for_rejected_quantity_in_purchase_invoice = 0 buying_settings.save() diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 8f7d36f544c9..e488b695b5f6 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -600,14 +600,14 @@ def set_missing_values(source, target): def update_item(source_doc, target_doc, source_parent): target_doc.qty, returned_qty = get_pending_qty(source_doc) - if frappe.db.get_single_value("Buying Settings", "consider_rejected_quantity_in_purchase_invoice"): + if frappe.db.get_single_value("Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice"): target_doc.rejected_qty = 0 target_doc.stock_qty = flt(target_doc.qty) * flt(target_doc.conversion_factor, target_doc.precision("conversion_factor")) returned_qty_map[source_doc.name] = returned_qty def get_pending_qty(item_row): qty = item_row.qty - if frappe.db.get_single_value("Buying Settings", "consider_rejected_quantity_in_purchase_invoice"): + if frappe.db.get_single_value("Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice"): qty = item_row.received_qty pending_qty = qty - invoiced_qty_map.get(item_row.name, 0) returned_qty = flt(returned_qty_map.get(item_row.name, 0)) diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index eb8d9243e0b8..99abf3a68cf5 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -422,7 +422,7 @@ def test_purchase_return_partial(self): # Make PI against unreturned amount buying_settings = frappe.get_single("Buying Settings") - buying_settings.consider_rejected_quantity_in_purchase_invoice = 0 + buying_settings.bill_for_rejected_quantity_in_purchase_invoice = 0 buying_settings.save() pi = make_purchase_invoice(pr.name) @@ -430,7 +430,7 @@ def test_purchase_return_partial(self): self.assertEqual(pi.items[0].qty, 3) - buying_settings.consider_rejected_quantity_in_purchase_invoice = 1 + buying_settings.bill_for_rejected_quantity_in_purchase_invoice = 1 buying_settings.save() pr.load_from_db()