/*RECETE REVIZE TARIHI 30 GUNU GECMIS ISE MAIL AT*/
OBJECT:
STRING TXT,
STRING USR,
STRING SUBTEXT,
STRING RENK,
STRING HAYALI,
INTEGER MATBOY;
MATBOY=STRLEN(TBLSARJ_MATERIAL);
MATBOY=MATBOY-1;
HAYALI=STRSTR(TBLSARJ_MATERIAL,0,MATBOY);
HAYALI=’H’+HAYALI;
RENK=STRSTR(TBLSARJ_VOPTIONS,9,3);
SELECT CASE WHEN CHANGEDBY=” THEN CREATEDAT ELSE CHANGEDAT END AS CREATEDAT, CASE WHEN CHANGEDBY=” THEN DATEDIFF(DAY,CREATEDAT,GETDATE()) ELSE DATEDIFF(DAY,
CHANGEDAT,GETDATE()) END AS TLINE
FROM PNTFBOMASSREV
WHERE BOMNUMBER=HAYALI
AND OPTIONKEY=RENK
INTO TBLREVIZE;
IF SELECTED THEN
IF TBLREVIZE_TLINE > 30 THEN
SELECT *
FROM IASUSERS
WHERE CLIENT = SYS_CLIENT
AND USERNAME = SYS_USER;
SELECT ‘R: ‘+STEXT AS RENK
FROM IASVAROPTIONX
WHERE VARIANTKEY=’L’
AND ATTRIBUTEKEY=’02′
AND OPTIONKEY=RENK
INTO TBLR;
TXT=SSARJ + TOCHAR(13) +TBLSARJ_MATERIAL+ TOCHAR(13) +TBLR_RENK+ TOCHAR(13) +TBLREVIZE_CREATEDAT+ TOCHAR(13) +TBLREVIZE_TLINE+ TOCHAR(13) +SYS_USER;
USR=’fdonmez@penti.com.tr’+TOCHAR(59)+’bkoc@penti.com.tr’+TOCHAR(59)+’laboratuvar@penti.com.tr’+TOCHAR(59)+’stin@penti.com.tr’;
USR=USR+TOCHAR(59)+’boyasarj@penti.com.tr’+TOCHAR(59)+’boyahane1@penti.com.tr’;
SUBTEXT=’IAS Boyahane Reçete Revize 30 günü geçen kontrol..’;
SENDMAIL MESSAGE TXT TOADDRESS USR SUBJECT SUBTEXT FROM IASUSERS_MAILADRESS ;
ENDIF;
ENDIF;