fix(Asset Repair): cancellation

This commit is contained in:
Saqib 2021-06-28 11:42:28 +05:30 committed by GangaManoj
parent 073b50f7fd
commit 2e507b47a8

View File

@ -30,7 +30,7 @@ class AssetRepair(AccountsController):
item.total_value = flt(item.valuation_rate) * flt(item.consumed_quantity)
def calculate_total_repair_cost(self):
self.total_repair_cost = self.repair_cost
self.total_repair_cost = flt(self.repair_cost)
total_value_of_stock_consumed = self.get_total_value_of_stock_consumed()
self.total_repair_cost += total_value_of_stock_consumed
@ -129,6 +129,7 @@ class AssetRepair(AccountsController):
def increase_stock_quantity(self):
stock_entry = frappe.get_doc('Stock Entry', self.stock_entry)
stock_entry.flags.ignore_links = True
stock_entry.cancel()
def make_gl_entries(self, cancel=False):
@ -252,4 +253,4 @@ class AssetRepair(AccountsController):
@frappe.whitelist()
def get_downtime(failure_date, completion_date):
downtime = time_diff_in_hours(completion_date, failure_date)
return round(downtime, 2)
return round(downtime, 2)