Fix hemorrhoid chx always reset on save in v8-all

normal flag was set whenever perut_18 existed in details array,
not when it was actually checked — causing perut_15/perut_16 chx
to always be forced false on save.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sas.fajri
2026-05-12 08:48:32 +07:00
parent 209d7b0b4c
commit 9818d6aa79

View File

@@ -5306,9 +5306,6 @@ module.exports = {
if (entry.name === "Hemorroid") {
let normal = 'Y'
let count_x = _.filter(entry.details, function (o) {
if(o.id_code == 'perut_18' || o.id_code == 'perut_17'){
normal = 'N'
}
return o.chx;
}).length;
if (count_x === 0) {
@@ -5318,6 +5315,12 @@ module.exports = {
error_msg_fisik.push(x_msg);
}
entry.details.forEach((detail) => {
if(detail.chx && (detail.id_code == 'perut_18' || detail.id_code == 'perut_17')){
normal = 'N'
}
})
entry.details.forEach((detail) => {
if(normal == 'N'){
if(detail.id_code == 'perut_15' || detail.id_code == 'perut_16'){