feat: over transfer allowance for material transfers
This commit is contained in:
parent
cbddedab7b
commit
bc82344fc7
@ -162,8 +162,15 @@ class MaterialRequest(BuyingController):
|
||||
from `tabStock Entry Detail` where material_request = %s
|
||||
and material_request_item = %s and docstatus = 1""",
|
||||
(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} \
|
||||
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",
|
||||
"over_delivery_receipt_allowance",
|
||||
"role_allowed_to_over_deliver_receive",
|
||||
"mr_qty_allowance",
|
||||
"column_break_12",
|
||||
"auto_insert_price_list_rate_if_missing",
|
||||
"allow_negative_stock",
|
||||
@ -283,6 +284,12 @@
|
||||
"fieldtype": "Select",
|
||||
"label": "Action If Quality Inspection Is Rejected",
|
||||
"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",
|
||||
@ -290,7 +297,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2021-07-10 16:17:42.159829",
|
||||
"modified": "2021-06-28 17:02:26.683002",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Settings",
|
||||
@ -310,4 +317,4 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user