mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 11:44:11 +00:00
@@ -257,13 +257,13 @@ class SubcontractingOrder(SubcontractingController):
|
|||||||
si.purchase_order_item,
|
si.purchase_order_item,
|
||||||
["qty", "subcontracted_quantity", "fg_item_qty"],
|
["qty", "subcontracted_quantity", "fg_item_qty"],
|
||||||
)
|
)
|
||||||
available_qty = qty - subcontracted_quantity
|
available_qty = flt(qty) - flt(subcontracted_quantity)
|
||||||
|
|
||||||
if available_qty == 0:
|
if available_qty == 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
si.qty = available_qty
|
si.qty = available_qty
|
||||||
conversion_factor = qty / fg_item_qty
|
conversion_factor = flt(qty) / flt(fg_item_qty)
|
||||||
si.fg_item_qty = flt(
|
si.fg_item_qty = flt(
|
||||||
available_qty / conversion_factor, frappe.get_precision("Purchase Order Item", "qty")
|
available_qty / conversion_factor, frappe.get_precision("Purchase Order Item", "qty")
|
||||||
)
|
)
|
||||||
@@ -342,9 +342,11 @@ class SubcontractingOrder(SubcontractingController):
|
|||||||
|
|
||||||
def update_subcontracted_quantity_in_po(self, cancel=False):
|
def update_subcontracted_quantity_in_po(self, cancel=False):
|
||||||
for service_item in self.service_items:
|
for service_item in self.service_items:
|
||||||
subcontracted_quantity = frappe.db.get_value(
|
subcontracted_quantity = flt(
|
||||||
|
frappe.db.get_value(
|
||||||
"Purchase Order Item", service_item.purchase_order_item, "subcontracted_quantity"
|
"Purchase Order Item", service_item.purchase_order_item, "subcontracted_quantity"
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
subcontracted_quantity = (
|
subcontracted_quantity = (
|
||||||
(subcontracted_quantity + service_item.qty)
|
(subcontracted_quantity + service_item.qty)
|
||||||
|
|||||||
Reference in New Issue
Block a user