Laddawn.com : Programming Spec - Master Order File Updating

We have decided to change the single MASTERORDER.USR file into two files (header and detail) and to move the logic from the web RPC$SHOPPINGCART_CREATEORDER into SYSS0123.1 so that all order creation and maintenance from both the web and Avante will use the same logic in a single program (since all roads lead to SYSS0123.1).  This logic will be used by:

  • Web - creating stock orders
  • Web - creating MOD orders
  • Avante SOP4000 - adding lines to existing order, creating a sample order
  • Avante QUO4001 - creating NS made/buy orders from quotes

Joe:

Create new files (Joe):

  • In DEV Using /UTL3001, create new files MSTRORDHDR.USR and MSTRORDDET.USR and resize to 201,1 (or whatever prime number this becomes)
  • Copy all dictionaries from MASTERORDER.USR to MSTRORDHDR.USR - make sure to copy via /FD so that they end up on your task
  • Create the following dictionaries in MSTRORDDET.USR:Copy all records from MASTERORDER.USR to MSTRORDHDR.USR  **** DON'T DO THIS UNTIL WAYNE HAS THE NEW LOGIC WORKING
    • MSTRORD.NBR (G0*1)
    • CPN (G1*1)
    • MOD.ITEMNBR (G1*1)
    • SODET.IDS (field 1 - multi-valued)
    • ORDER.NBR (field 1 - G0*1)
    • LINE.NBR (field 1 - G1*1)
    • QORD (from SODET<3> using id's in field 1
    • BILLTO.NBR (from SOHDR<2> using ORDER.NBR from field 1
  • DELETE-FILE MASTERORDER.USR **** DON'T DO THIS UNTIL WAYNE HAS THE NEW LOGIC WORKING

Modify Master Order Conversion Program (IIUTIL WEB.CONV.MASTER.ORDERS) (Joe): 

  • Change your select from SELECT SOHDR to SELECT SOHDR WITH @ID <= "9999999" - existing web-created records with a suffix are being converted and shouldn't be.
  • Change MASTERORDER.USR file to MSTRORDHDR.USR - updating remains the same
  • Open MSTRORDDET.USR and do the following updating: 
    • For each SODET record associated with an order, create one MSTRORDDET.USR record for each unique part number (CPN) with a key of Master Order# * CPN.  The master order# and the order# are the same thing for the records you are converting.
    • Write the SODET Key(s) multi-valued into field 1.  So if part# 000300 was split between two lines on the order (different warehouse), you will write one record for 000300's CPN and will put the two SODET keys into field 1.  NOTE: Since we don't have MOD Item Numbers for the existing custom orders, we will just use CPN (ie, CPN for BAGS, NS, or ROLLSHEET)

Modify GETBYFILTER programs (Joe):

  • RPC$ORDER_GETBYFILTER - Change filename from MASTERORDER.USR to MSTRORDHDR.USR
  • RPC$ORDER_GETBYID - Change filename from MASTERORDER.USR to MSTRORDHDR.USR
  • RPC$ORDER_GETBYCUSTID - Change filename

  

= = = = = = = = = = = = = = = = = = = = =

WAYNE:

SYSS0123.1 - Update MSTRORDHDR.USR/MSTRORDDET.USR (Wayne):

  • Move the updating of the Master Order File from RPC$SHOPPINGCART_CREATEORDER to SYSS0123.1 - change filename from MASTERORDER.USR to MSTRORDHDR.USR.
  • If not already doing so, READ first to see if the master order# record already exists and only create if not already there.  This logic will be executed when ce makes order changes on Avante via SOP4000, so we don't want to re-create the header record if it's already there.
  • From Avante, when a new order is created via SOP4000 (sample orders) or QUO4001 (NS Buy/Make), apply the new master order logic.  Write a header of the order# with F1 = Order#:A (avante has no bundling so single order#).
  • Will have to pass both the real order# (with suffix) as well as the master order# to SYSS0123.1 from Avante as well as from the web when creating stock and MOD orders
  • The header file layout stays the same:  Key=Master Order# and <1> = real order numbers (with alpha suffix).  If the order is being created via SOP4000, it will have the same format.
  • We will be writing an additional 'detail' file (MSTRORDDET.USR) for the master order#.  This file will combine all unique item numbers across all real orders under a master order#.  So if part# 000300 was split onto multiple line items of an order (split shipment) or was a ship and backorder (separate orders), we will combine them back together here referencing each SODET key within the record.  You will use this for RPC$ORDERITEM_GETBYFILTER to find all master orders that included a part# that someone is searching on without have to do break logic. 
    • Key = Master Order# * CPN (for stock) or MOD12345 (for MOD).  Note: For NS quotes being converted via Avante, use the CPN for part# "NS".  They do not have MOD item numbers and are not part of the phase I rollout of the site.
    • F1 = multi-valued SODET Keys
    • This file will be written for web stock and MOD orders
    • This file will also be written for Avante Stock Orders.  If the order is new, the header/details file will be written (assigning the next master order# and appending "A" to suffix since Avante has no bundling).  If a new line item is added to an existing order, just write a new MSTRORDDET.USR record.  Only create if the record doesn't already exist.  If it exists, add the new SODET Id to field 1.