Function SET176D
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_176);
********** COMMENT(Function .......: SET176D);
********** COMMENT(Created on .....: 26/05/00 at 16:19:09);
********** COMMENT(Description ....: Review Credit);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: This function displays the order);
********** COMMENT(details of the order PENDING approval. It is invoked);
********** COMMENT(by clicking on any of the links that appear in the);
********** COMMENT(email sent by the trigger on file SETORD.);
********** COMMENT(It receives parameters:);
********** COMMENT(CHR_ORNO (order number in alpha format));
********** COMMENT(S_176CCOD (customer code));
********** COMMENT(S_176STAT (status for the order to be updated));
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as);
********** COMMENT(sample material only. No warranty concerning the);
********** COMMENT(material or its use in any way whatsoever is);
********** COMMENT(expressed or implied.);
********** COMMENT();
********** COMMENT(Minimum Release of LANSA: 8.0);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT(Group and field definitions);
DEFINE FIELD(#CHR_ORNO) TYPE(*CHAR) LENGTH(007);
DEFINE FIELD(#KEEP_ORNO) REFFLD(#S_176ORNO) TO_OVERLAY(#S_176ORNO 001);
DEFINE FIELD(#SHOW_COMP) TYPE(*CHAR) LENGTH(001) DESC('Show completion message');
DEFINE FIELD(#DIFF) REFFLD(#S_176OAMT);
GROUP_BY NAME(#PANELDATA) FIELDS((#S_BUTTON *HIDDEN)(#S_176CNAM *HIDDEN)(#S_176ORNO *HIDDEN)(#S_176LIMI *HIDDEN)(#STDRENTRY *HIDDEN)(#KEEP_ORNO *HIDDEN)(#S_176CCOD *HIDDEN)(#S_176STAT *HIDDEN)(#DIFF *HIDDEN)(#SHOW_COMP *HIDDEN)(#S_176OAMT *HIDDEN));
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
FETCH FIELDS(*ALL) FROM_FILE(SETCUS) WITH_KEY(#S_176CCOD);
IF COND('#s_176orno = *zeros');
SUBSTRING FIELD(#CHR_ORNO 1) INTO_FIELD(#S_176ORNO 1);
ENDIF;
********** COMMENT();
CASE OF_FIELD(#S_176STAT);
WHEN VALUE_IS('= APPROVED' '= HELD');
UPDATE FIELDS(#S_176STAT) IN_FILE(SETORD) WITH_KEY(#S_176ORNO #S_176CCOD);
EXECUTE SUBROUTINE(GET_OR_DET);
CHANGE FIELD(#SHOW_COMP) TO(X);
GOTO LABEL(REQ);
OTHERWISE;
CHANGE FIELD(#SHOW_COMP) TO(*BLANKS);
EXECUTE SUBROUTINE(GET_OR_DET);
IF COND('#s_button *ne *blanks');
EXECUTE SUBROUTINE(UPDATE_ORD);
CHANGE FIELD(#SHOW_COMP) TO(X);
ENDIF;
ENDCASE;
********** COMMENT();
REQ: REQUEST FIELDS(#PANELDATA) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT();
SUBROUTINE NAME(UPDATE_ORD);
********** COMMENT();
IF COND('#S_BUTTON = A');
CHANGE FIELD(#S_176STAT) TO(APPROVED);
ELSE;
IF COND('#S_BUTTON = H');
CHANGE FIELD(#S_176STAT) TO(HELD);
ENDIF;
ENDIF;
UPDATE FIELDS(#S_176STAT) IN_FILE(SETORD);
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(GET_OR_DET);
********** COMMENT();
FETCH FIELDS(*ALL) FROM_FILE(SETORD) WITH_KEY(#S_176ORNO #S_176CCOD);
CHANGE FIELD(#DIFF) TO('#s_176cred - #s_176limi');
********** COMMENT();
ENDROUTINE;
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_176);
********** COMMENT(Function .......: SET176D);
********** COMMENT(Created on .....: 26/05/00 at 16:19:09);
********** COMMENT(Description ....: Review Credit);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: This function displays the order);
********** COMMENT(details of the order PENDING approval. It is invoked);
********** COMMENT(by clicking on any of the links that appear in the);
********** COMMENT(email sent by the trigger on file SETORD.);
********** COMMENT(It receives parameters:);
********** COMMENT(CHR_ORNO (order number in alpha format));
********** COMMENT(S_176CCOD (customer code));
********** COMMENT(S_176STAT (status for the order to be updated));
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as);
********** COMMENT(sample material only. No warranty concerning the);
********** COMMENT(material or its use in any way whatsoever is);
********** COMMENT(expressed or implied.);
********** COMMENT();
********** COMMENT(Minimum Release of LANSA: 8.0);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT(Group and field definitions);
DEFINE FIELD(#CHR_ORNO) TYPE(*CHAR) LENGTH(007);
DEFINE FIELD(#KEEP_ORNO) REFFLD(#S_176ORNO) TO_OVERLAY(#S_176ORNO 001);
DEFINE FIELD(#SHOW_COMP) TYPE(*CHAR) LENGTH(001) DESC('Show completion message');
DEFINE FIELD(#DIFF) REFFLD(#S_176OAMT);
GROUP_BY NAME(#PANELDATA) FIELDS((#S_BUTTON *HIDDEN)(#S_176CNAM *HIDDEN)(#S_176ORNO *HIDDEN)(#S_176LIMI *HIDDEN)(#STDRENTRY *HIDDEN)(#KEEP_ORNO *HIDDEN)(#S_176CCOD *HIDDEN)(#S_176STAT *HIDDEN)(#DIFF *HIDDEN)(#SHOW_COMP *HIDDEN)(#S_176OAMT *HIDDEN));
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
FETCH FIELDS(*ALL) FROM_FILE(SETCUS) WITH_KEY(#S_176CCOD);
IF COND('#s_176orno = *zeros');
SUBSTRING FIELD(#CHR_ORNO 1) INTO_FIELD(#S_176ORNO 1);
ENDIF;
********** COMMENT();
CASE OF_FIELD(#S_176STAT);
WHEN VALUE_IS('= APPROVED' '= HELD');
UPDATE FIELDS(#S_176STAT) IN_FILE(SETORD) WITH_KEY(#S_176ORNO #S_176CCOD);
EXECUTE SUBROUTINE(GET_OR_DET);
CHANGE FIELD(#SHOW_COMP) TO(X);
GOTO LABEL(REQ);
OTHERWISE;
CHANGE FIELD(#SHOW_COMP) TO(*BLANKS);
EXECUTE SUBROUTINE(GET_OR_DET);
IF COND('#s_button *ne *blanks');
EXECUTE SUBROUTINE(UPDATE_ORD);
CHANGE FIELD(#SHOW_COMP) TO(X);
ENDIF;
ENDCASE;
********** COMMENT();
REQ: REQUEST FIELDS(#PANELDATA) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT();
SUBROUTINE NAME(UPDATE_ORD);
********** COMMENT();
IF COND('#S_BUTTON = A');
CHANGE FIELD(#S_176STAT) TO(APPROVED);
ELSE;
IF COND('#S_BUTTON = H');
CHANGE FIELD(#S_176STAT) TO(HELD);
ENDIF;
ENDIF;
UPDATE FIELDS(#S_176STAT) IN_FILE(SETORD);
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(GET_OR_DET);
********** COMMENT();
FETCH FIELDS(*ALL) FROM_FILE(SETORD) WITH_KEY(#S_176ORNO #S_176CCOD);
CHANGE FIELD(#DIFF) TO('#s_176cred - #s_176limi');
********** COMMENT();
ENDROUTINE;