This commit is contained in:
Rizki
2026-04-15 14:56:51 +07:00
parent 30027d0214
commit d3e3034fbd

View File

@ -122,7 +122,7 @@ function notifyOnSubmit(idxjustification) {
const qryApprover = `
select t.nik, e.fullname, e.email
from tbl_justificationttd t
join dbssotcel.tbl_employee e on e.nik = t.nik
join dbssotcel.tbl_employee e on e.nik = t.nik AND email != '-'
where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0
order by t._idx asc limit 1
`;
@ -160,7 +160,7 @@ function notifyOnSigned(idxjustification, signerNik) {
const qryNext = `
select t.nik, e.fullname, e.email
from tbl_justificationttd t
join dbssotcel.tbl_employee e on e.nik = t.nik
join dbssotcel.tbl_employee e on e.nik = t.nik AND email != '-'
where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0
order by t._idx asc limit 1
`;
@ -195,7 +195,7 @@ function notifyOnReturn(idxjustification, returnerNik) {
const creatorName = rows[0].creator_name;
const creatorEmail = rows[0].creator_email;
const qryReturner = `select fullname from dbssotcel.tbl_employee where nik = '${returnerNik}' limit 1`;
const qryReturner = `select fullname from dbssotcel.tbl_employee where nik = '${returnerNik}' AND email != '-' limit 1`;
db.query(qryReturner, [], function(err2, rows2) {
if (err2 || rows2.length === 0) {
console.error('[email-notif] notifyOnReturn: failed to get returner name', err2);