mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
feat: over transfer allowance for material transfers
This commit is contained in:
@@ -162,8 +162,15 @@ class MaterialRequest(BuyingController):
|
|||||||
from `tabStock Entry Detail` where material_request = %s
|
from `tabStock Entry Detail` where material_request = %s
|
||||||
and material_request_item = %s and docstatus = 1""",
|
and material_request_item = %s and docstatus = 1""",
|
||||||
(self.name, d.name))[0][0])
|
(self.name, d.name))[0][0])
|
||||||
|
mr_qty_allowance = frappe.db.get_single_value('Stock Settings', 'mr_qty_allowance')
|
||||||
|
|
||||||
if d.ordered_qty and d.ordered_qty > d.stock_qty:
|
if mr_qty_allowance:
|
||||||
|
allowed_qty = d.qty + (d.qty * (mr_qty_allowance/100))
|
||||||
|
if d.ordered_qty and d.ordered_qty > allowed_qty:
|
||||||
|
frappe.throw(_("The total Issue / Transfer quantity {0} in Material Request {1} \
|
||||||
|
cannot be greater than allowed requested quantity {2} for Item {3}").format(d.ordered_qty, d.parent, allowed_qty, d.item_code))
|
||||||
|
|
||||||
|
elif d.ordered_qty and d.ordered_qty > d.stock_qty:
|
||||||
frappe.throw(_("The total Issue / Transfer quantity {0} in Material Request {1} \
|
frappe.throw(_("The total Issue / Transfer quantity {0} in Material Request {1} \
|
||||||
cannot be greater than requested quantity {2} for Item {3}").format(d.ordered_qty, d.parent, d.qty, d.item_code))
|
cannot be greater than requested quantity {2} for Item {3}").format(d.ordered_qty, d.parent, d.qty, d.item_code))
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"section_break_9",
|
"section_break_9",
|
||||||
"over_delivery_receipt_allowance",
|
"over_delivery_receipt_allowance",
|
||||||
"role_allowed_to_over_deliver_receive",
|
"role_allowed_to_over_deliver_receive",
|
||||||
|
"mr_qty_allowance",
|
||||||
"column_break_12",
|
"column_break_12",
|
||||||
"auto_insert_price_list_rate_if_missing",
|
"auto_insert_price_list_rate_if_missing",
|
||||||
"allow_negative_stock",
|
"allow_negative_stock",
|
||||||
@@ -283,6 +284,12 @@
|
|||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Action If Quality Inspection Is Rejected",
|
"label": "Action If Quality Inspection Is Rejected",
|
||||||
"options": "Stop\nWarn"
|
"options": "Stop\nWarn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "The percentage you are allowed to transfer more against the quantity ordered. For example, if you have ordered 100 units, and your Allowance is 10%, then you are allowed transfer 110 units.",
|
||||||
|
"fieldname": "mr_qty_allowance",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Over Transfer Allowance"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
@@ -290,7 +297,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-07-10 16:17:42.159829",
|
"modified": "2021-06-28 17:02:26.683002",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Settings",
|
"name": "Stock Settings",
|
||||||
|
|||||||
Reference in New Issue
Block a user