feat(Asset Repair): Change visibilty of sections

This commit is contained in:
GangaManoj 2021-05-21 10:40:16 +05:30
parent 30fdebafa7
commit 4277877883
2 changed files with 6 additions and 29 deletions

View File

@ -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 = {

View File

@ -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",