Laddawn.com : DB - Link Charity Choice To Order

Overview: After the order is created and the user has been given the order number, we tell the user that Laddawn will donate $1 to a charity of their choice if the order is over $100.  We need a database routine that will update the order record with their choice they make on this screen

 

Process:

Add CHARITY.CODE to MSTRORDHDR.USR as F2.  Alpha, 3 character field. Don't forget to update SYS3002 for this file.

Routine Name: RPC$ORDER_SETCHARITY

INPUT PARAMETERS:

  • ORDER.NBR
  • P.VALUE – Charity Code

OUTPUT FIELD NAMES:

  • ORDER.NBR
  • SERVER.STATUS
  • ERROR.MSG
  • ERROR.CODE

PROCESSING:

  • ORDER.NBR will be the Master Order Number. Read it from MSTRORDHDR.USR
  • set F2 in that read record to the P.VALUE (Charity code)
  • Write the record.back to the file.
  • If an error occurs set ERROR.CODE and ERROR.MSG and return.

Note: Accounting runs a report that tells them how much to pay to each charity.  Work with Scott Dunn-Benson or Kristen Koczan to find out what report they use.  Then change that report to read the MSTRORDHDR.USR file instead of SOHDR.USR