added insurance to formula
This commit is contained in:
parent
1c944e352d
commit
2eef01d153
|
|
@ -765,7 +765,7 @@ function highlight_invalid_cells(frm, invalid_rows_1, invalid_rows_2) {
|
||||||
// ==================== END VALIDATION ====================
|
// ==================== END VALIDATION ====================
|
||||||
|
|
||||||
// ==================== FORMULA 509.1 CALCULATION (TAM İL) ====================
|
// ==================== FORMULA 509.1 CALCULATION (TAM İL) ====================
|
||||||
// Calculate field 509.1 based on formula: ((501.1 + 504.1) / 2) * 1% + 505 * 1%
|
// Calculate field 509.1 based on formula: ((501.1 + 504.1) / 2) * 1% + 505.1 * 1%
|
||||||
|
|
||||||
function calculate_509_1(frm) {
|
function calculate_509_1(frm) {
|
||||||
// Only calculate when tam_il is checked
|
// Only calculate when tam_il is checked
|
||||||
|
|
@ -791,16 +791,16 @@ function calculate_509_1(frm) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get value from field 505 (sığorta from vergi_hesab_3cu)
|
// Get value from field 505.1 (sığorta from vergi_hesab_3cu)
|
||||||
let value_505 = 0;
|
let value_505_1 = 0;
|
||||||
(frm.doc.vergi_hesab_3cu || []).forEach(row => {
|
(frm.doc.vergi_hesab_3cu || []).forEach(row => {
|
||||||
if (row.göstəricilər && row.göstəricilər.startsWith('505 ')) {
|
if (row.göstəricilər && row.göstəricilər.startsWith('505.1 ')) {
|
||||||
value_505 = flt(row.manatla);
|
value_505_1 = flt(row.manatla);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Calculate: ((501.1 + 504.1) / 2) * 1% + 505 * 1%
|
// Calculate: ((501.1 + 504.1) / 2) * 1% + 505.1 * 1%
|
||||||
let result = ((value_501_1 + value_504_1) / 2) * 0.01 + value_505 * 0.01;
|
let result = ((value_501_1 + value_504_1) / 2) * 0.01 + value_505_1 * 0.01;
|
||||||
|
|
||||||
// Set value to field 509.1 (manatla in vergi_hesab_5ci)
|
// Set value to field 509.1 (manatla in vergi_hesab_5ci)
|
||||||
(frm.doc.vergi_hesab_5ci || []).forEach(row => {
|
(frm.doc.vergi_hesab_5ci || []).forEach(row => {
|
||||||
|
|
@ -820,7 +820,7 @@ function calculate_509_1(frm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== FORMULA 509.2 CALCULATION (İL ƏRZİNDƏ) ====================
|
// ==================== FORMULA 509.2 CALCULATION (İL ƏRZİNDƏ) ====================
|
||||||
// Calculate field 509.2 based on formula: ((503.1 + 504.1) / 24 * 507) * 1% + 505 * 1%
|
// Calculate field 509.2 based on formula: ((503.1 + 504.1) / 24 * 507) * 1% + 505.1 * 1%
|
||||||
|
|
||||||
function calculate_509_2(frm) {
|
function calculate_509_2(frm) {
|
||||||
// Only calculate when il_erzinde is checked
|
// Only calculate when il_erzinde is checked
|
||||||
|
|
@ -852,16 +852,16 @@ function calculate_509_2(frm) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get value from field 505 (sığorta from vergi_hesab_3cu)
|
// Get value from field 505.1 (sığorta from vergi_hesab_3cu)
|
||||||
let value_505 = 0;
|
let value_505_1 = 0;
|
||||||
(frm.doc.vergi_hesab_3cu || []).forEach(row => {
|
(frm.doc.vergi_hesab_3cu || []).forEach(row => {
|
||||||
if (row.göstəricilər && row.göstəricilər.startsWith('505 ')) {
|
if (row.göstəricilər && row.göstəricilər.startsWith('505.1 ')) {
|
||||||
value_505 = flt(row.manatla);
|
value_505_1 = flt(row.manatla);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Calculate: ((503.1 + 504.1) / 24 * 507) * 1% + 505 * 1%
|
// Calculate: ((503.1 + 504.1) / 24 * 507) * 1% + 505.1 * 1%
|
||||||
let result = ((value_503_1 + value_504_1) / 24 * value_507) * 0.01 + value_505 * 0.01;
|
let result = ((value_503_1 + value_504_1) / 24 * value_507) * 0.01 + value_505_1 * 0.01;
|
||||||
|
|
||||||
// Set value to field 509.2 (manatla in vergi_hesab_5ci)
|
// Set value to field 509.2 (manatla in vergi_hesab_5ci)
|
||||||
(frm.doc.vergi_hesab_5ci || []).forEach(row => {
|
(frm.doc.vergi_hesab_5ci || []).forEach(row => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue