fix: Depreciation posting date only when calculate depreciation is checked
This commit is contained in:
parent
487d825ede
commit
fac82cf69b
@ -239,8 +239,10 @@ frappe.ui.form.on('Asset', {
|
||||
|
||||
|
||||
item_code: function(frm) {
|
||||
if(frm.doc.item_code) {
|
||||
if(frm.doc.item_code && frm.doc.calculate_depreciation) {
|
||||
frm.trigger('set_finance_book');
|
||||
} else {
|
||||
frm.set_value('finance_books', []);
|
||||
}
|
||||
},
|
||||
|
||||
@ -381,6 +383,11 @@ frappe.ui.form.on('Asset', {
|
||||
|
||||
calculate_depreciation: function(frm) {
|
||||
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
|
||||
if (frm.doc.item_code && frm.doc.calculate_depreciation ) {
|
||||
frm.trigger("set_finance_book");
|
||||
} else {
|
||||
frm.set_value("finance_books", []);
|
||||
}
|
||||
},
|
||||
|
||||
gross_purchase_amount: function(frm) {
|
||||
|
Loading…
Reference in New Issue
Block a user