Skip to content

Commit

Permalink
Merge pull request frappe#28123 from marination/cost-of-poor-quality
Browse files Browse the repository at this point in the history
fix: Remove RM Cost column as cost is not retrievable from Job card
  • Loading branch information
marination committed Nov 25, 2021
2 parents 8d2abc4 + ffdf32b commit a369094
Showing 1 changed file with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -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


import frappe
from frappe import _
from frappe.utils import flt
Expand Down Expand Up @@ -30,7 +29,6 @@ def get_data(report_filters):

for row in job_cards:
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)

return data
Expand All @@ -46,20 +44,14 @@ def get_filters(report_filters, operations):

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):
return [
{
"label": _("Job Card"),
"fieldtype": "Link",
"fieldname": "name",
"options": "Job Card",
"width": "100"
"width": "120"
},
{
"label": _("Work Order"),
Expand Down Expand Up @@ -111,18 +103,12 @@ def get_columns(filters):
"label": _("Operating Cost"),
"fieldtype": "Currency",
"fieldname": "operating_cost",
"width": "100"
},
{
"label": _("Raw Material Cost"),
"fieldtype": "Currency",
"fieldname": "rm_cost",
"width": "100"
"width": "150"
},
{
"label": _("Total Time (in Mins)"),
"fieldtype": "Float",
"fieldname": "total_time_in_mins",
"width": "100"
"width": "150"
}
]

0 comments on commit a369094

Please sign in to comment.