fix: base_amount and exchange_rate in additional-cost table

This commit is contained in:
Sagar Sharma 2022-08-18 17:16:29 +05:30
parent d7ed4093d8
commit eabd3135f0
2 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
let document_list = ['Landed Cost Voucher', 'Stock Entry'];
let document_list = ['Landed Cost Voucher', 'Stock Entry', 'Subcontracting Order'];
document_list.forEach((doctype) => {
frappe.ui.form.on(doctype, {

View File

@ -3,6 +3,8 @@
frappe.provide('erpnext.buying');
{% include 'erpnext/stock/landed_taxes_and_charges_common.js' %};
frappe.ui.form.on('Subcontracting Order', {
setup: (frm) => {
frm.get_field("items").grid.cannot_add_rows = true;
@ -136,6 +138,16 @@ frappe.ui.form.on('Subcontracting Order', {
}
});
frappe.ui.form.on('Landed Cost Taxes and Charges', {
amount: function (frm, cdt, cdn) {
frm.events.set_base_amount(frm, cdt, cdn);
},
expense_account: function (frm, cdt, cdn) {
frm.events.set_account_currency(frm, cdt, cdn);
}
});
erpnext.buying.SubcontractingOrderController = class SubcontractingOrderController {
setup() {
this.frm.custom_make_buttons = {