bug fixes

This commit is contained in:
Ali 2026-01-06 19:04:28 +04:00
parent aee61d4c5b
commit e0bdb39662
1 changed files with 26 additions and 17 deletions

View File

@ -363,8 +363,8 @@ function calculate_elave_2_totals(frm) {
if (category === 'Vergiyə cəlb olunan əmlakın CƏMİ dəyəri:') { if (category === 'Vergiyə cəlb olunan əmlakın CƏMİ dəyəri:') {
total_row = row; total_row = row;
} else { } else if (category !== '1. Binalar, tikililər və qurğular') {
// Все остальные строки для суммирования // Все остальные строки для суммирования (кроме итоговой и строки Binalar)
other_rows.push(row); other_rows.push(row);
} }
}); });
@ -374,7 +374,7 @@ function calculate_elave_2_totals(frm) {
return; return;
} }
// Суммируем все числовые поля из всех строк (кроме итоговой) // Суммируем все числовые поля из всех строк (кроме итоговой и Binalar)
const fields_to_sum = [ const fields_to_sum = [
'hesabatilininəvvəlinəəsasvəsaitlərinqalıqdəyəri', // 501.1 'hesabatilininəvvəlinəəsasvəsaitlərinqalıqdəyəri', // 501.1
'ləğvolunmatarixinəəsasvəsaitlərinqalıqdəyəri', // 502.1 'ləğvolunmatarixinəəsasvəsaitlərinqalıqdəyəri', // 502.1
@ -521,22 +521,31 @@ 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) {
// Расчет месяцев для обоих режимов (Tam İl и İl Ərzində) if (frm.doc.il_erzinde) {
frappe.call({ // Расчет месяцев только для İl Ərzində режима
method: 'taxes_az.taxes_az.doctype.property_tax_return.property_tax_return.calculate_months_for_vergi_hesab_4cu_1', frappe.call({
args: { method: 'taxes_az.taxes_az.doctype.property_tax_return.property_tax_return.calculate_months_for_vergi_hesab_4cu_1',
company: company, args: {
year: frm.doc.il company: company,
}, year: frm.doc.il
callback: function(r) { },
if (r.message !== undefined && frm.doc.vergi_hesab_4cu_1 && frm.doc.vergi_hesab_4cu_1.length > 0) { callback: function(r) {
// Обновить первую строку 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]; // Обновить первую строку
frappe.model.set_value(first_row.doctype, first_row.name, 'ayla', r.message); const first_row = frm.doc.vergi_hesab_4cu_1[0];
frm.refresh_field('vergi_hesab_4cu_1'); frappe.model.set_value(first_row.doctype, first_row.name, 'ayla', r.message);
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 ====================