Laddawn.com : Programming Specs-Create/Modify Drop Ship Customer

This new program will be used to:

  1. Create a new drop ship customer from Checkout (when order is placed)
  2. Create a new drop ship customer record when adding a 'location' tag in Saved Items (customer will have a name but no address)
  3. Update the new location tag customer with an address entered in the Checkout/Address Screen when the order is placed
  4. Update Customer's User Preferences from Checkout when the order is placed

 

New BP WEB.CREATE.CUSTOMER (Timeline 2-17):

  1. Create a new shipto customer record:
      1. If no shipto customer# is passed in (CUST.NBR = '') and address fields are null - this is a new 'location tag' from saved item
      2. If no shipto customer# is passed in (CUST.NBR = '') but the address fields have been filled in - this is from Order Creation
        • Assign next sequential customer#
        • Write CUSTMST/CUSTMST.USR including customer name, billto defaults, create date, created by etc.  Write Address fields if they are in shoppingcart or leave blank if not.  See RPC$CREATE_STOCKORDER for existing customer creation logic. *** how will customer name be passed from saved items location tagging???
        • Set inactive flag in CUSTMST.USR<75>=1 only if all address fields are null
        • set CUST.NBR = assigned customer#
  2. If a shipto customer# is passed in (CUST.NBR # '') - this would be from Checkout Address Screen when completing inactive customer by entering an address:
    1. Update Name and Address fields in the existing customer record (using CUST.NBR to read CUSTMST)
    2. Unset the Inactive Flag (set CUSTMST.USR<75>=0)
  3. Update the Customer's Shipping Preferences if they were checked to be updated in Bundling Shipping Instructions.  This preferences could be checked for an existing shipto customer or a new shipto customer (CUST.NBR).  If any of the comments in SHOPPINGCART.USR<55> (sub-valued for each bundle) has the new associated field "UPDATE.SHIP.PREF" as a "1", this comment# s/b added to the customer record if it's not already there. 
    1. Add a new field to SHOPPINGCART.USR associated with the comment numbers within each bundle called: UPDATE.SHIP.PREF.  This field will be flagged with a "1" if the customer has checked the box to add this shipping instruction to the drop ship customer's shipping preferences.  Let Janice know what field number this is so she can add it to the bundling update program.
    2. Loop through all sub-values associated with each bundle's comment numbers looking for any with a "1".
    3. If a comment has been flagged, locate the comment# in CUSTMST.USR<63>.  If not found, add the comment# to CUSTMST.USR<63,nextmv>, input1 to CUSTMST.USR<64,nextmv>, input2 to CUSTMST.USR<65,nextmv>.  Update the comment text in CUSTMST<53,nextmv>, inserting "\" in text with input1 and input2.  You will find these in COMMENTS.USR<03>.
    4. If the comment# is found, update input1 and input2 in CUSTMST.USR<64> and <65> in case the inputs have changed.  Rebuild the comment text in CUSTMST<53,WHERE>.

New LDLIB RPC$CUSTOMER_CREATE (Timeline 2-19):

This program will be called from the UI when it needs a new shipto customer created or updated.  All customer fields will be returned in RETURN.VALUE via DATAFIELDS.

    1. Call BP WEB.CREATE.CUSTOMER
    2. Set KEY = COMPANY.ID:"*":CUST.NBR
    3. INCLUDE LD.INCLUDES CUSTOMER.READ
    4. RETURN.VALUE = DATAFIELDS

 

Modify the Checkout Order Creation Programs as follows (Timeline 2-18):

    1. Modify LDLIB RPC$CREATE_STOCKORDER to remove logic that creates the customer record (you should have already moved it to WEB.CREATE.ORDER above)
    2. Add the call to BP WEB.CREATE.CUSTOMER from RPC$SHOPPINGCART_CREATEORDER to create/update the shipto customer BEFORE starting the creation of stock and MOD orders.  This one customer will be written to all orders created and should always be called for a new/modified customer, even if only a MOD order is being created.  This logic doesn't need to be in the CREATE_STOCKORDER or CONVERT_QUOTE programs because we only want to create or update the customer once, not for every order being created.

 Modify Customer Selection from Address Screen (Timeline 2-23):

The shipto customer selection from the Checkout Address Screen must be changed to select drop ship customers for the billto customer that have no zip code.  These are customers that were added during saved item location tagging that have been partially created (they don't have an address yet and have the inactive flag set).  During checkout, they can select one of these customers.  The customer address must be entered at that time.

When coming from the Checkout Address Screen, param FLAG will be set to a "1".  Modify RPC$CUSTOMER_GETBYFILTER to:

  1. If FLAG=1, must select with zip = cart zip or with zip = "".  This can be added to the existing line: SEL.STMT := ' AND WITH ZIP="' ZIP "'" : '""'  *** YOU DON'T NEED AN 'OR' STATEMENT.  JUST STRING A "" SURROUNDED BY SINGLE QUOTES.

  

UI Side:

  1.  Will set FLAG=1 whenever it calls CUSTOMER_GETBYFILTER from the Checkout Address Screen.  All other UI areas calling this program will have FLAG=0
  2. Saved Items will call RPC$CUSTOMER_CREATE from saved items when a new location is created
  3. Will validate that if a inactive customer is selected in checkout (that was created in saved items during location tagging) that the user enters an address.