This commit is contained in:
Rizki
2026-04-15 14:59:16 +07:00
parent d3e3034fbd
commit 5d33ceefaf

View File

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