[feature] Blanket Order
- Creaete Sales or Purchase order from the blanket order - If there is any blanket order for the customer/supplier rates will be fetched from that order - Manually selecting the Blanket order will change the rates accordingly - Upon submission of the order, the ordered qty will be updated in the Blanket Order
This commit is contained in:
committed by
Nabin Hait
parent
2fb63e1724
commit
e5e87f7137
@@ -342,6 +342,18 @@ class StockController(AccountsController):
|
||||
if self.docstatus==1:
|
||||
raise frappe.ValidationError
|
||||
|
||||
def update_blanket_order(self, cancel=False):
|
||||
for item in self.items:
|
||||
if item.blanket_order:
|
||||
ordered_qty, doc_name = frappe.db.get_value("Blanket Order Item", {"parent": item.blanket_order}, ["ordered_qty", "name"])
|
||||
if not cancel:
|
||||
ordered_qty = ordered_qty + item.qty
|
||||
else:
|
||||
ordered_qty = ordered_qty - item.qty
|
||||
ordered_qty = flt(ordered_qty, item.precision("qty"))
|
||||
frappe.db.set_value("Blanket Order Item", doc_name, "ordered_qty", ordered_qty)
|
||||
|
||||
|
||||
def update_gl_entries_after(posting_date, posting_time, for_warehouses=None, for_items=None,
|
||||
warehouse_account=None):
|
||||
def _delete_gl_entries(voucher_type, voucher_no):
|
||||
|
||||
Reference in New Issue
Block a user