bug fixes

This commit is contained in:
Ali 2026-01-06 18:36:37 +04:00
parent 93d09a7bcf
commit aee61d4c5b
1 changed files with 14 additions and 23 deletions

View File

@ -521,31 +521,22 @@ function update_child_table_values(frm, table_name, data_map) {
// Update the 'ayla' field in vergi_hesab_4cu_1 based on earliest Asset // Update the 'ayla' field in vergi_hesab_4cu_1 based on earliest Asset
function update_vergi_hesab_4cu_1(frm, company) { function update_vergi_hesab_4cu_1(frm, company) {
if (frm.doc.il_erzinde) { // Расчет месяцев для обоих режимов (Tam İl и İl Ərzində)
// Расчет месяцев для İl Ərzində режима frappe.call({
frappe.call({ method: 'taxes_az.taxes_az.doctype.property_tax_return.property_tax_return.calculate_months_for_vergi_hesab_4cu_1',
method: 'taxes_az.taxes_az.doctype.property_tax_return.property_tax_return.calculate_months_for_vergi_hesab_4cu_1', args: {
args: { company: company,
company: company, year: frm.doc.il
year: frm.doc.il },
}, callback: function(r) {
callback: function(r) { if (r.message !== undefined && frm.doc.vergi_hesab_4cu_1 && frm.doc.vergi_hesab_4cu_1.length > 0) {
if (r.message !== undefined && frm.doc.vergi_hesab_4cu_1 && frm.doc.vergi_hesab_4cu_1.length > 0) { // Обновить первую строку
// Обновить первую строку const first_row = frm.doc.vergi_hesab_4cu_1[0];
const first_row = frm.doc.vergi_hesab_4cu_1[0]; frappe.model.set_value(first_row.doctype, first_row.name, 'ayla', r.message);
frappe.model.set_value(first_row.doctype, first_row.name, 'ayla', r.message); frm.refresh_field('vergi_hesab_4cu_1');
frm.refresh_field('vergi_hesab_4cu_1');
}
} }
});
} else {
// Очистить поле ayla если tam_il
if (frm.doc.vergi_hesab_4cu_1 && frm.doc.vergi_hesab_4cu_1.length > 0) {
const first_row = frm.doc.vergi_hesab_4cu_1[0];
frappe.model.set_value(first_row.doctype, first_row.name, 'ayla', 0);
frm.refresh_field('vergi_hesab_4cu_1');
} }
} });
} }
// ==================== MINIMUM ASSET VALUE VALIDATION ==================== // ==================== MINIMUM ASSET VALUE VALIDATION ====================