mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 13:42:10 +01:00
fix: Depreciation posting date only when calculate depreciation is checked
(cherry picked from commit fac82cf69b)
This commit is contained in:
@@ -239,8 +239,10 @@ frappe.ui.form.on('Asset', {
|
|||||||
|
|
||||||
|
|
||||||
item_code: function(frm) {
|
item_code: function(frm) {
|
||||||
if(frm.doc.item_code) {
|
if(frm.doc.item_code && frm.doc.calculate_depreciation) {
|
||||||
frm.trigger('set_finance_book');
|
frm.trigger('set_finance_book');
|
||||||
|
} else {
|
||||||
|
frm.set_value('finance_books', []);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -381,6 +383,11 @@ frappe.ui.form.on('Asset', {
|
|||||||
|
|
||||||
calculate_depreciation: function(frm) {
|
calculate_depreciation: function(frm) {
|
||||||
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
|
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) {
|
gross_purchase_amount: function(frm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user