Merge pull request #28123 from marination/cost-of-poor-quality
fix: Remove RM Cost column as cost is not retrievable from Job card
This commit is contained in:
commit
a369094eca
@ -1,7 +1,6 @@
|
|||||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
@ -30,7 +29,6 @@ def get_data(report_filters):
|
|||||||
|
|
||||||
for row in job_cards:
|
for row in job_cards:
|
||||||
row.operating_cost = flt(row.hour_rate) * (flt(row.total_time_in_mins) / 60.0)
|
row.operating_cost = flt(row.hour_rate) * (flt(row.total_time_in_mins) / 60.0)
|
||||||
update_raw_material_cost(row, report_filters)
|
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
@ -46,12 +44,6 @@ def get_filters(report_filters, operations):
|
|||||||
|
|
||||||
return filters
|
return filters
|
||||||
|
|
||||||
def update_raw_material_cost(row, filters):
|
|
||||||
row.rm_cost = 0.0
|
|
||||||
for data in frappe.get_all("Job Card Item", fields = ["amount"],
|
|
||||||
filters={"parent": row.name, "docstatus": 1}):
|
|
||||||
row.rm_cost += data.amount
|
|
||||||
|
|
||||||
def get_columns(filters):
|
def get_columns(filters):
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@ -59,7 +51,7 @@ def get_columns(filters):
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"fieldname": "name",
|
"fieldname": "name",
|
||||||
"options": "Job Card",
|
"options": "Job Card",
|
||||||
"width": "100"
|
"width": "120"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Work Order"),
|
"label": _("Work Order"),
|
||||||
@ -111,18 +103,12 @@ def get_columns(filters):
|
|||||||
"label": _("Operating Cost"),
|
"label": _("Operating Cost"),
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"fieldname": "operating_cost",
|
"fieldname": "operating_cost",
|
||||||
"width": "100"
|
"width": "150"
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": _("Raw Material Cost"),
|
|
||||||
"fieldtype": "Currency",
|
|
||||||
"fieldname": "rm_cost",
|
|
||||||
"width": "100"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Total Time (in Mins)"),
|
"label": _("Total Time (in Mins)"),
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"fieldname": "total_time_in_mins",
|
"fieldname": "total_time_in_mins",
|
||||||
"width": "100"
|
"width": "150"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user