mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
fix: test "test_pending_and_received_qty"
This commit is contained in:
@@ -95,9 +95,7 @@ class SubcontractingOrder(SubcontractingController):
|
||||
def set_missing_values_in_items(self):
|
||||
total_qty = total = 0
|
||||
for item in self.items:
|
||||
item.rate = (
|
||||
item.rm_cost_per_qty + item.service_cost_per_qty + (item.additional_cost_per_qty or 0)
|
||||
)
|
||||
item.rate = item.rm_cost_per_qty + item.service_cost_per_qty + flt(item.additional_cost_per_qty)
|
||||
item.amount = item.qty * item.rate
|
||||
total_qty += flt(item.qty)
|
||||
total += flt(item.amount)
|
||||
@@ -168,7 +166,7 @@ class SubcontractingOrder(SubcontractingController):
|
||||
total_required_qty = total_supplied_qty = 0
|
||||
for item in self.supplied_items:
|
||||
total_required_qty += item.required_qty
|
||||
total_supplied_qty += item.supplied_qty or 0
|
||||
total_supplied_qty += flt(item.supplied_qty)
|
||||
if total_supplied_qty:
|
||||
status = "Partial Material Transferred"
|
||||
if total_supplied_qty >= total_required_qty:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import cint, getdate, nowdate
|
||||
from frappe.utils import cint, flt, getdate, nowdate
|
||||
|
||||
from erpnext.controllers.subcontracting_controller import SubcontractingController
|
||||
|
||||
@@ -128,10 +128,10 @@ class SubcontractingReceipt(SubcontractingController):
|
||||
|
||||
if item.recalculate_rate:
|
||||
item.rate = (
|
||||
item.rm_cost_per_qty + (item.service_cost_per_qty or 0) + item.additional_cost_per_qty
|
||||
flt(item.rm_cost_per_qty) + flt(item.service_cost_per_qty) + flt(item.additional_cost_per_qty)
|
||||
)
|
||||
|
||||
item.received_qty = item.qty + (item.rejected_qty or 0)
|
||||
item.received_qty = item.qty + flt(item.rejected_qty)
|
||||
item.amount = item.qty * item.rate
|
||||
total_qty += item.qty
|
||||
total_amount += item.amount
|
||||
|
||||
Reference in New Issue
Block a user