From 4277877883c120789f3867d20b88c7eabd7726f9 Mon Sep 17 00:00:00 2001 From: GangaManoj Date: Fri, 21 May 2021 10:40:16 +0530 Subject: [PATCH] feat(Asset Repair): Change visibilty of sections --- .../doctype/asset_repair/asset_repair.js | 28 +------------------ .../doctype/asset_repair/asset_repair.json | 7 +++-- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.js b/erpnext/assets/doctype/asset_repair/asset_repair.js index 3328e664fc0..7633a595a2f 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.js +++ b/erpnext/assets/doctype/asset_repair/asset_repair.js @@ -2,35 +2,9 @@ // For license information, please see license.txt frappe.ui.form.on('Asset Repair', { - // setup: function(frm) { - // frm.add_fetch("company", "repair_and_maintenance_account", "payable_account"); - - // frm.set_query("payable_account", function() { - // return { - // filters: { - // "report_type": "Balance Sheet", - // "account_type": "Payable", - // "company": frm.doc.company, - // "is_group": 0 - // } - // }; - // }); - // }, - - // stock_items_add: function(frm){ - // var table = frm.doc.stock_items; - // for(var i in table) { - // if (table[i].valuation_rate == 0) { - // frm.set_value(table[i].total_value, (table[i].valuation_rate * table[i].consumed_quantity)) - // } - // } - // }, - refresh: function(frm) { frm.toggle_display(['completion_date', 'repair_status', 'accounting_details', 'accounting_dimensions_section'], !(frm.doc.__islocal)); - frm.toggle_display(['stock_consumption_details_section', 'total_repair_cost'], frm.doc.stock_consumption); - frm.toggle_display('asset_depreciation_details_section', frm.doc.capitalize_repair_cost); - + if (frm.doc.docstatus) { frm.add_custom_button("View General Ledger", function() { frappe.route_options = { diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.json b/erpnext/assets/doctype/asset_repair/asset_repair.json index a2d962cd959..522f2874d99 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.json +++ b/erpnext/assets/doctype/asset_repair/asset_repair.json @@ -201,11 +201,13 @@ "label": "Stock Consumed During Repair" }, { + "depends_on": "stock_consumption", "fieldname": "stock_consumption_details_section", "fieldtype": "Section Break", "label": "Stock Consumption Details" }, { + "depends_on": "stock_consumption", "fieldname": "total_repair_cost", "fieldtype": "Currency", "label": "Total Repair Cost" @@ -217,6 +219,7 @@ "options": "Warehouse" }, { + "depends_on": "capitalize_repair_cost", "fieldname": "asset_depreciation_details_section", "fieldtype": "Section Break", "label": "Asset Depreciation Details" @@ -224,7 +227,7 @@ { "fieldname": "increase_in_asset_life", "fieldtype": "Int", - "label": "Increase In Asset Life" + "label": "Increase In Asset Life(Months)" }, { "fieldname": "purchase_invoice", @@ -236,7 +239,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2021-05-14 02:31:57.226273", + "modified": "2021-05-21 10:37:35.002238", "modified_by": "Administrator", "module": "Assets", "name": "Asset Repair",