bug fixes

This commit is contained in:
Ali 2026-01-07 14:22:32 +04:00
parent 86c9178a83
commit beab57505c
1 changed files with 7 additions and 7 deletions

View File

@ -779,17 +779,17 @@ function calculate_509_1(frm) {
}
});
// Get value from field 504 (manatla from vergi_hesab_2ci)
let value_504 = 0;
// Get value from field 504.1 (manatla from vergi_hesab_2ci)
let value_504_1 = 0;
(frm.doc.vergi_hesab_2ci || []).forEach(row => {
// Точное совпадение: после "504" должна быть точка с пробелом
if (row.göstəricilər && row.göstəricilər.startsWith('504. ')) {
value_504 = flt(row.manatla);
// Точное совпадение: после "504.1" должен быть пробел (не 504.1.1)
if (row.göstəricilər && row.göstəricilər.startsWith('504.1 ')) {
value_504_1 = flt(row.manatla);
}
});
// Calculate: ((501.1 + 504) / 2) * 1%
let result = ((value_501_1 + value_504) / 2) * 0.01;
// Calculate: ((501.1 + 504.1) / 2) * 1%
let result = ((value_501_1 + value_504_1) / 2) * 0.01;
// Set value to field 509.1 (manatla in vergi_hesab_5ci)
(frm.doc.vergi_hesab_5ci || []).forEach(row => {