Laddawn.com : Programming Spec - MOD Item Search (Godzilla)

10/31/14 - Godzilla has been re-designed based on input from CE and the Design Group.  The new logic is as follows:

 

The following decisions were made: 

  1. All Expired Quotes will be removed from the display with the following exceptions:
    1. If the item has been saved by the customer (no delete date) and there are no other active quotes with a location of 'saved item' for the MOD Item/Owner, then we will show the most recent expired quote.
    2. If the item has NOT been saved (has a delete date), no expired quotes will ever be shown as a 'saved item'
  2. What will be included for each MOD Item close match:
    1. The most recent Order for each MOD item will always be included.  These have a location of 'Order History'.  Exclude all other order history items.
    2. All Active/Saved Cart prices for each MOD item will always be included.
    3. If a MOD item has been saved for that contact (delete date is null), make sure there is at least one 'saved item' location included per MOD Item and Owner.  This should happen regardless of who owns the data.  If a saved item is not found, add one to the list as follows (see examples below in blue**):
      1. If there is a price in the active cart, duplicate this price as the 'saved item' line.
      2. If there is a price in a saved cart, duplicate the most recent cart price as a 'saved item' line
      3. If there are no active/saved carts for this MOD item but there is an order history line, duplicate the order history price as the 'saved item' line
      4. If there are no prices in carts or order history for this saved item and owner, display the most recent expired price as the saved item line.
    4. If the MOD item has not been saved, we will never include a 'saved item' line in Godzilla for that item 
  3. The 'quantity' difference will be removed.  This isn't an important difference to CE and at the time that Godzilla is calculated, the user hasn't had the choice to change the quantity in results.
  4. The main sort will be by-descending date (quote/order/cart)

**Examples for point#2 - these examples apply only when the contact has saved the item (CONTACT.ITEM.XRF.USR<5>="").  The examples reflect what should happen for each MOD Item/Owner combination:

  • If Price1 is in the active cart and there are no ordered prices for this MOD Item/Owner, Price1 will be shown twice: with a Location of 'Active Cart' and the second with a location of 'Saved Item'. These will be shown by-descending date (cart date for the active cart and quote date for the saved item).  If they have the same date, show the active cart first (so add the saved item next).
  • If Price1 has been ordered and there are no active prices and it's not in a cart, Price1 will be shown twice: with a location of 'Order History' and a location of 'Saved Item'.  These will be shown by-descending date (order history date or quote date).  If they have the same date, show the order history first.
  • If Price1 has been ordered and Price2 is in a saved cart and Price3 is active but not in a cart: These 3 will be shown with their appropriate locations of Order History, Active/Saved Cart, Saved Item - no price will be duplicated in the list because there is already at least one saved item showing for this MOD Item/Owner.
  • If Price1 is in the active cart and Price2 and Price3 are active (but not in a cart): These 3 will be shown with their appropriate locations of Active Cart, Saved Item, Saved Item - no price will be duplicated in the list because there is at least one saved item showing for this MOD Item/Owner.
  • If there are no active prices in a cart or order history or saved item: The most recent expired price will be shown with a Location of Saved Item.

Tech Notes:

  • Work in a copy of the CLOSEMATCH program until your changes are complete.  This way there will be no disruption in the Godzilla display until the database and UI programming is complete.  Sal will be working on the UI side.  Work closely with him once you are both at the point where this can be tested.
  • Continue to send the code differences to the UI, but don't need to send the differences in text any longer (because differences column is no longer shown - UI just needs codes to do the underlining of differences in the item details)
  • The UI will do a database call to get the item details (same as current hover).  We will not attempt to write the item details into the SCRATCHPAD.USR record at this time.  If we find that the display is slow because of the multiple database calls, we will have it moved to the database.
  •  We will continue to send the MOD Item#, Order Name, Cart Name, etc as separate info.
  • See if this logic will take care of removing expired quotes and always showing a 'saved item' line if the contact has saved the item:
    • Load the arrays as you are doing today for Quotes, Order History, Carts. Only exception is only load order history for the most recent order.
    • When you get to Saved Items (CONTACT.ITEM.XRF.USR):
      • If <5> # "" (has a deleted date), bypass this record (we don't need saved items on Godzilla if the contact never saved the item - we will only show their carts/order history)
      • If <5> = "" (this is a saved item): As you are looping through each quote, check to see if converted (QUHDR<167,1>=5) or expired (QUHDR<9>+14 < TODAY).  If so, don't include this quote.
      • If the quote is active, load it as a saved item into array 2 as you do today (set a flag that you've loaded at least one saved item into the array for this MOD Item/Contact#). Also keep track of the most recent order history and most recent quote in a cart)
      • When finished with this CONTACT.ITEM.XRF.USR, make sure that your saved item flag is set.  If no saved items, dupe either the most recent quote that's in a cart or the most recent order history as the saved item.  If neither of those, include the most recent expired quote as the saved item.

  

New Program to re-evaluate Count Differences when the user changes Count in the results area (this is after the SCRATCHPAD.USR records have already been created for Godzilla):

  1. Create a new LDLIB RPC$MODITEM_COUNTDIFF - The UI will need to pass you P.VALUE so that you can select the SCRATCHPAD.USR records that were created for this session.

  2.  Go through all SCRATCHPAD.USR records and compare the Count (packout) field on the each quote to SHOP.PACKOUT (what the user just changed). If they are different, set the Count Difference on that quote. If they are the same, unset the Count Difference it it was previously set. 

UI Side: 

  1. Title of popup will be changed, and explanatory notes added.
  2. Resequence the columns: 
    1. Col 1: Item Details.  MOD Item# will show first, then item details (from original hover) with the differences underlined (instead of highlighted). Owner differences will be shown at the end of the item details, highlighted if different.  Tags will show below item details, product tags first.  The UI will continue to get the item details by doing a database call for each price.
    2. Col 2: Priced/Ordered - quote, shopping cart, or order date
    3. Col 3: Location: Active Cart, Saved Cart, Saved Item, Order History.  Expired Cart will be removed.  For saved carts, the cart name will show under the location.  For order history, the order name will show under location.
  3. When the Count is changed in results:
    1. Do a MOD Item lookup again to see if an exact match is found and display the new MOD Item# if found
    2. Call new RPC$MODITEM_COUNTDIFF that will go through previously calculated Godzilla results and re-evaluate the Count Differences.  Send P.VALUE with id for Godzilla.
  4.  When choosing a saved item, place it directly into the widget (don’t go to saved items first). UI Side.  If the quote is active, the result is the active quote.  If the quote is expired or ordered, a new quote will be generated automatically in results.  Action will be the same as if you had pulled this price from the saved items tab.

 

 

 

 

*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *

ORIGINAL GODZILLA NOTES *** PRIOR TO 10/31/14 RE-DESIGN ***

The MOD Item Search, otherwise known as Godzilla, will show all MOD Items matching the width, depth, length and Product Type entered in the Widget.  This will replace the 'ashad' search that ce currently uses to search for 'close matches' to the item that they are quoting.  The search will executed by the UI regardless of who is using the widget (customer or ce).  The search will initially show all 'close match' MOD items for the contact's billto customer, but the user may switch views to see only their items.  This new program will be called directly from the UI once FIND is selected on the Shop Widget.  The UI will only call this program if a MOD result can be given (meaning that all required dimensions have been entered and it is an item that we can either make or buy via Marketplace).

Because of the way paging will be done on the UI side, we will need to pass only the items that belong on the page that the UI is asking for.  Ie, if 10 records per page and site asks for page 2, we should send items 11-20.  Because this process will be labor-intensive, we will be using a new work file to store the data, then can just select against that file for passing back and forth to the UI.

This single program will be split into two sections:

  1. Clear the work file and rebuild work file in first pass - only if P.VALUE from the UI is null.  Return P.VALUE = MOD*Contact#*Date to UI in RETURN.VALUE
  2. Select the work file and pass data to UI for requested page# - this is done regardless of the value of P.VALUE.  Whether it's the first pass or subsequent passes, the UI will tell you the page# and how many items it wants returned.

Create new Work File:

  • Create new file SCRATCHPAD.USR (using /UTL3001)
  • Setup a VOC pointer in DEV925 to this new file
  • Create dictionaries for this file (/FD and SYS3002):
    • Key = WORK.TYPE:"*":SortSeq:"*":BILLTO.NBR:"*":CONTACT.NBR:"*":INTERNALDATE:"*":OPERATOR (operator will only be appended if ce is working on behalf of the contact)
    • <1> = Location Type (1-4)
    • <2> = Quote Date
    • <3>= Quote Number
    • <4>= MOD Item number
    • <5> = Owner Nbr (contact# on the quote or shopping cart)
    • <6> = Cart Name
    • <7> = Tags1 (comma delimited tags for carts/order history/saved item product tags) 
    • <8> = Tags2 (comma delimited location tags for saved items only)
    • <9> = Summary Differences, comma delimited
    • <10>= *** not going to pass "Detailed Differences, colon delimited" any longer - use this field for "Order Number"

NEW LDLIB RPC$MODITEM_CLOSEMATCH:

FIRST PASS (P.VALUE=""):

Clear the Work File:

  • Before starting the search, cleanup the scratchpad file (since there is no trigger on the UI side that they've left the Godzilla area, data from previous sessions would still be there).  We will be clearing data for the billto customer/contact regardless of date, so will pickup old dates as well as the current date.
  • SELECT and DELETE scratchpad.usr records:  Work Type = "MOD" AND DATE < TODAY   and Contact = CONTACT.NBR.  If ce, add to the SELECT: "and operator = OPERATOR"

Selection Criteria:

  • The search will look for MOD item 'close' matches for the billto customer associated with the contact
  • Selection will be done based on the top product category: 1-Poly Bags, 2-Reclosables, 3-Tubing&Sleeves, 4-Film&Sheeting using PROD.TYPE[1,1]
  • Width, Depth (if enabled), and Length (if enabled) must be an exact match for selection.  You won't have to worry about what fields are enabled.  The UI will have only called this program if all required fields were entered.
  • We will ignore the gauge in the selection criteria (although it must be entered for the search to take place).
  • All Level 3 & Results area answers will be ignored in the initial select.  Differences from widget answers will be highlighted in the 'Exact Match?' column
  • Limit on how far back in history we will look for quotes.  This s/b in a SYSCON so it can be easily changed.
  • If no close matches are found, the 'show me' link will not be shown at the top of Results (UI Side)
  1. Field 14 in SYSCON QUOTE.TERMS.LAD now stores the Quote History Cutoff Days
  2. Call BP WEB.MODITEM.MATCH passing the following arguments (this program will do the selection and return a list of MOD Item Numbers for you to use): 
    1. EXACT.MATCH = 0
    2. MODREC = '' 
  3. You will receive back a multi-valued record (MODREC) containing:
    1. mv list of billto customer's MOD Item Numbers that are exact or close matches (comparison against Shop Widget's catalog.group, width, depth and length)
    2. SVM list of numbered differences (in summarized form) - if null, then this is an exact match for the item (doesn't include matches against contact, zip code, or quote qty)
    3. *** THIS ISN'T BEING PASS ANY LONGER - mv list of each SHOP. variable (without the SHOP. prefix) where the SHOP. data # MOD.ITMMST.USR data.  This will be used by the UI to display in some manner what the individual differences were when they hover over the 'Exact Match' column.  The exact match column will only show the summarized list in b. above.  For example, the exact match column may show 'Color' as a difference, and the hover will break down that the Color=Red and Opacity=Tint.
  4. Loop through the MOD Item Numbers in MODREC<1>, looking for quotes that are within the SYSCON history cutoff: Read the MOD.ITMMST.USR record for the billto customer/MOD Item#, then loop through quote numbers and bypass any whose quote date is < (Today - Quote History Cutoff Days).  Keep a list of the quotes we are looking for with their corresponding MOD/Quote information, sorted by quote# so we can locate easily:
    ARRAY1 (list of quotes)
      1. <1> = mv Quote nbrs
      2. <2> = mv MOD Item# from MOD.ITMMST.USR<0>"G2*1"
      3. <3>= mv Quote Dates (QUHDR<9>)
      4. <4> = mv Order Nbrs (QUHDR<88>)
      5. <5> = mv Quote Contact Nbrs (QUHDR.USR<6>)
      6. <6> = mv Quote Contact Names (SLSCONTACT.USR<4>:" ":<5>) - IF NO FIRST NAME, DON'T PREFIX WITH SPACE
      7. <7> = mv Quote Destination Zip Code (CFORDER<13,17> using config.rev in QUDET< 39>)
      8. <8> = mv Quote Quantity (QUDET< 3>)

Sort Order for Display:

The quotes will then be re-sorted by the location(s) that they exist in.  A quote can be in multiple Locations (ie, Active Cart and Saved Items or Saved Items and Order History):

  • If any matches found in the Active Cart, these will be shown first sorted by descending Quote Date
  • Next, any matches found in a Saved Cart will be shown, sorted by descending Quote Date
  • Then any matches found in either Saved Items or Order History, sorted by descending Quote Date (these locations will be mixed)
  • Last, any quotes that are not in any other location (will be shown as 'Expired Cart') sorted by descending Quote Date (these are orphaned quotes that were put into a cart that expired and has been purged.  It was never saved or ordered).
  1. Start building a second array to re-sort the quotes in location/descending date order.  Note that a quote can be found in multiple locations.  For example, a quote could be in Saved Items as well as Order History or Saved Items and Saved/Active Cart.  Insert the quote into the array multiple times by the location(s) that it exists in sorted in descending quote date order.

    Working with Array1 of quote numbers that we are looking for, determine which location(s) each quote is found in and sort it in the correct order.
    1. If the Order Number in Array1<4,x> for the quote is not null then this quote has been converted.  Read the order name (from SOHDR.USR<81>) (from MSTRORDHDR.USR<2> using master order# in SOHDR.USR<86>) and keep in your array along with the Order Number, then place this order in the Order History location (type 3) by descending quote date.  Note: Converted quotes will only be found in Order History and possibly Saved Items.  They cannot be in a shopping cart or an expired cart.
    2. Once you've loaded up your array with Order History, look in the SHOPPINGCART.USR file next for each quote number in Array1: SELECT SHOPPINGCART.USR WITH BILLTO.NBR = BILLTO.NBR (NAMED PARAM) AND WITH QUOTE.NBR # "".  Loop through each quote in SHOPPINGCART.USR<6> and check it against Array1 to see if this is a quote that we are looking for.  If so, add it to your array2 with location of 1 or 2 by-descending cart date (from <5>).  Put in Location 1 (active cart) if second part of the cart key = "CURRENT" else put into Location 2 (saved cart).  Save the contact# from SHOPPINGCART.USR Key (G0*1) for writing to ARRAY2<6>.
    3. Next, look for each quote in Saved Items: SELECT CONTACT.ITEM.XRF.USR WITH CUST.NBR = BILLTO.NBR AND WITH ITEM.TYPE = "M".  Loop through each quote in CONTACT.ITEM.XRF.USR<7> and check it against Array1 to see if this is a quote we are looking for.  If so, add it to your Array2 with location type 3 by-descending saved date (from CONTACT.ITEM.XRF.USR<4>).  Do not write the Order# for this location 3 info.  ** note: type 3 is a mix of order history and saved items.  Also save the Product Tags and Location Tags.
    4. If any quote from Array1 was not found in shopping carts, saved items, or order history, put it in Array2 with location type 4 (expired cart).  This means that the quote was never ordered or put into saved items. It was in a cart that expired and the cart has been deleted.
    • Array2 (sorted list by location):
    • <1> = mv location type of where quote was found (1=active cart; 2=saved cart; 3=saved item or order history; 4=expired cart)
    • <2> = mv quote dates (descending) (QUHDR<9>)
    • <3>= mv quote numbers
    • <4>= mv order names (from SOHDR.USR<81> MSTRORDHDR.USR<2> using QUHDR<88> to SOHDR.USR<86> - order# will only be in <88> if the quote has been converted)
    • <5> = mv MOD Item numbers
    • <6> = mv Owner Contact Numbers (ShoppingCart Contact# if location is 1 or 2 or Quote Contact# for all other location types)
    • <7> = mv Quote Contact (owner) Names (from SLSCONTACT.USR<4>:" ":<5> for contact in <6,x>
    • <8> = mv Cart Names (if in a cart) (SHOPPINGCART.USR<0>"G1*1")
    • <9> = mv Quote Destination Zip Code (CFORDER<13,17>)
      <10> = mv Quote Quantity (QUDET<3>)
    • <11>= mv list of difference numbers between widget & MOD Item, comma delimited (summary level for display purposes - ie, Color or Material)
    • <12>= This has been changed - store Order Number from ARRAY1<4,x> here instead of Detailed Differences, which are no longer needed.  You should only keep an order# here when you are writing from Order History (location 3).
    • <13> = mv list of Product tags (comma delimited) - from CONTACT.ITEM.XRF.USR<1> to ITMTAGS.USR<2>
    • <14> = mv list of Location tags (comma delimited) - from CONTACT.ITEM.XRF.USR<2> to CUSTMST<3> with COMPANY.ID

Determining Additional Differences for the 'Exact Match?' column:

For each quote listed in the search results, we will pass a string of 'differences' that each of the listed quotes has from what was entered on the Shop Widget.  If there are no differences, a "Yes" will be passed back, indicating that this is an 'exact match'.  The call to WEB.MODITEM.MATCH will return a list of differences for the item itself, but won't include differences for owner, shipto/cpu and zip code or quote quantity, all of which are quote-specific.

Differences will be listed in the following order, delimited by a comma.  WEB.MODITEM.MATCH is returning differences by sequence # (2, 4, 6, 7, 8, 9, 10).  You will now insert differences 1, 3, and 5 if they are truly different.  These must be passed to the UI in the order as outlined below:

  1. MOD Item Owner (different contact): If Owner Contact# from ARRAY2<6,x> is different from param CONTACT.NBR, insert the contact name from Array2<7,x> as diference#1 in ARRAY2<1,x> followed by a comma (if any other differences are listed in ARRAY2<11,x>).  ***don't need any longer: Add 'CONTACT.NBR' to ARRAY2<12,x> followed by a ":" if any other differences following.
  2. Gauge & Full Gauge: MOD.ITMMST.USR<11> # SHOP.GAUGE or MOD.ITMMST.USR<12> # SHOP.FULLGAUGE  *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call
  3. Zip Code: QUOTE ZIP # SHOP.ZIPCODE  If ARRAY2<9,x> # SHOP.ZIPCODE, insert "Zip" into ARRAY2<11,x> as difference#3. Add a comma if there are any differences after this difference.  ***don't need any longer: Add 'ZIPCODE' to ARRAY2<12,x> following by a ":" if any other differences following.
  4. Count per Case/Roll (packout):  MOD.ITMMST.USR<new field> # SHOP.PACKOUT *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call
  5. Quantity Ordered:   Quote Quantity # REQUESTED.QTY  If ARRAY<10,x> # REQUESTED.QTY, insert "Quantity" into ARRAY2<11,x> as difference#5.  Add a comma if there are any differences after this difference.  ***don't need any longer: Add 'REQUESTED.QTY' to ARRAY2<12,x> followed by a ":" if any other differences following.
  6. Materials/Additives  *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call
  7. Color/Opacity  *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call
  8. Printing/Plate#  *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call
  9. Venting  *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call
  10. Packaging/Folded in Half  *** this is already included in ARRAY2<11,x> from WEB.MODITEM.MATCH call

Writing to the scratchpad file:

We will write to the scratchpad file once, then will select against the file as the UI asks for different pages or the user switches views between 'all for billto' or 'my items only'.

First pass only (P.VALUE=''): you will write each individual multi-value of ARRAY2 as a separate record into the SCRATCHPAD.USR file:

Key (if ce):            MOD (work type) * Billto# (BILLTO.NBR) * Contact# (CONTACT.NBR) * InternalDate:InternalTime * Operator Code * Sort#

Key (if customer): MOD (work type) * Billto# (BILLTO.NBR) * Contact# (CONTACT.NBR) * InternalDate:InternalTime * Sort#(right justified zero-padded to 5 places)

Sort# = multi-value number in ARRAY2 (this is the order that we want to send the data to the UI), right justified and padded with 0 to 5 places.

  • <1> = ARRAY2<1,x> (location type 1-4)  - Return Field name: LOCATION
  • <2> = ARRAY2<2,x> (quote date) - Return Field name: ENTRY.DATE
  • <3>= ARRAY2< 3,x> (quote number) - Return Field name: QUOTE.NBR
  • <4>= ARRAY2<5,x> (MOD Item number) - Return Field name: PART.NBR
  • <5> = ARRAY2<6,x> (Owner Contact Nbr) - Return Field name: OWNER.ID
  • <6> = ARRAY2<8,x> (Cart Name) - Return Field name: CART.NAME
  • <7> = Tags1 ** - Return Field name: PRODUCT.TAGS
  • <8> = Tags2 *** - Return Field name: LOCATION.TAGS
  • <9> = Yes or No : ARRAY2<11,x> (Summary Differences, comma delimited)  ** If ARRAY2<11,x>='' then write "Yes" else insert "No" before ARRAY2<11,x>.  This will display in the 'Exact Match?' column. - Return Field name: DIFFERENCES
  • <10>= Store 'Order Number' from ARRAY2<12,x> instead of Detailed Differences.  This will be null except when this info came from Order History.
  • <11>= Contact Name (Array2<7,x>)
     

 **Tags1 - build a comma-delimited list of the tags for all locations except Expired Carts:

  • If Active/Saved Cart (location 1 or 2):  Cart name (ARRAY2<8,x>)  *** If cart name = 'CURRENT', pass null for Tags1   *** pass to ui in NAME
  • If Order History (location=3 & ARRAY2<4> # ''):  Order Name (ARRAY2<4,x>) *** pass to ui in NAME
  • If Saved Item (location=3 & ARRAY2<4> = ''):  Comma delimited-> MOD Item# (ARRAY2<5,x>),Product Tags (ARRAY2<13,x>)  *** pass to ui in NAME

***Tags2: 

  • If Saved Item (location=3 & ARRAY2<4> = ''): Comma delimited Location Tags (ARRAY2<14,x>)

 **** THIS IS THE END OF FIRST PASS (P.VALUE='') 

 - - - - - - - - -

PASSING DATA BACK TO THE UI: This will be done regardless of what's in P.VALUE.  This will be the initial pass back to the UI of page 1, then every subsequent pass to the UI (different page or 'my items' view)

Using standard paging logic from GETBYFILTER programs (PAGE.INDEX and PAGE.SIZE), send back a single Page of data using RETURN.VALUE:

If no matches were found, send via return.value only system data (no scratchpad data).  ie, send SERVER.STATUS, TOTAL.LINES, PAGE.COUNT.  Do not return P.VALUE or any scratchpad data.

If matches were found: Select SCRATCHPAD.USR with: 

  • Select scratchpad.usr record(s):
    • If PAGE.INDEX=0 and PAGE.SIZE=1, read SCRATCHPAD.USR record P.VALUE:"*00001".  Then set IDS=P.VALUE:"*00001"
    • If CRITERIA=1 (selected 'my items' view), SSELECT SCRATCHPAD.USR WITH @ID = P.VALUE:"]" AND WITH OWNER.NBR = CONTACT.NBR. Then READSELECT IDS.
    • If none of the above: SSELECT SCRATCHPAD.USR WITH @ID = P.VALUE:"]".  Then READSELECT IDS.
  • Loop through IDS and send back 1 record and total.lines=1 (when page.index=0 and page.size=1) or multiple records for requested page and total.lines=total records in IDs (when page.size > 1)
  • work type = "MOD"
  • billto# in key = BILLTO.NBR
  • Internal Date in key = DATE()
  • Only if CRITERIA # '': Contact# in field 5 = CONTACT.NBR (they only want to see 'their' info)
  • Only if ce:  Operator Code in key = OPERATOR
  • Sort# in the key is within the range of records to be selected for this page (ie, if 10 per page and UI requests page 2, send sort seq 11-20 back)
  • Sorted by the 'Sort#' in the key

Send each scratchpad record's info back to the UI in RETURN.VALUE in groups of 7:

  • First 9 fields of Scratch as defined above.
  • Location ID: Field Name: LOCATION.ID 
    • If Location Type =1 or 2 (cart), pass: Owner Contact#:"*":Cart Name (SCRATCHPAD<5>:"*":SCRATCHPAD<6>)
    • If Location Type=3 and Order Number='' (Saved Item), pass: COMPANY.ID:"*":Owner Contact#:"*":MOD Item# (COMPANY.ID:"*":SCRATCHPAD<6>:"*":SCRATCHPAD<4>  ***UI will look for existence of "*" to know it's a saved item
    • If Location Type=3 and Order Number # '' (Order History), pass: Order Number (SCRATCHPAD<10>)
  • Summary Differences - These have to be changed from numbers to text and from sub-values to comma-delimited: Return Field name: DIFF.CODES 
    • 1 = The Contact Name  (from SCRATCHPAD<11>)
    • 2 = "Gauge"
    • 3 = "Zip Code"
    • 4 = "CSRL Count"
    • 5 = "Quantity"
    • 6 = "Materials"
    • 7 = "Color"
    • 8 = "Printing"
    • 9 = "Venting"
    • 10="Packaging"
  • Detailed Differences - we aren't passing this to UI any longer.  The UI side will highlight the entire area (ie, Material, Printing) based on difference code numbers above.
  •  P.VALUE
    • Defined below.  Essentially the first parts of the key.

Always send back P.VALUE in RETURN.VALUE ... first set to MOD*Contact#*Billto.nbr*Date*operator (everything from the key expect Sort#) if null.  This will be your indicator that you've already built the scratchpad.usr file.

 

DIFF.CODES is a comma delimited list of the codes that represent what the difference is, DIFFERENCES is the string that will show up in the exact match column of the popup.

 

5/6/14 (timeline 29-7):

Change for Godzilla - how to assign location as 'Active Cart':

The existing logic says to assign the location as 'Active Cart' if the Cart Name = CURRENT.  Please change this logic to assign the location as 'Active Cart' if the Cart Name = SHOPPINGCART.USR<10>.

NOTE:  We have to make sure that SHOPPINGCART.USR<10> is being populated immediately and not waiting until the shipto customer is written.*** (see 5/7 notes below)

5/7/14 (timeline 29-8):

Update SHOPPINGCART.USR<10> with the Billto Customer Number (BILLTO.NBR) when an item is added to the cart (if it isn't already there).  Put logic into RPC$SHOPPINGCARTITEM_SAVE.  Check to see if RPC$SHOPPINGCART_SAVE is updating the billto after the address screen.  If so, it only needs to do that in the case where the billto# field is null (which it shouldn't be). 

 

6/12/14 - calc Qty Per (packout) and Minimum Qty values if the shop variables are null (bug 252):

When Godzilla is initially called from Results, the UI side didn't have the requested qty. Chuck is making a change so that it will pass these two params when the user started with a saved item (quote) and pulled it back through the widget and make SHOP.PACKOUT and REQUESTED.QTY params available to Godzilla.  But if the user doesn't start with a saved item and just enters dimensions etc into the widget, these params will still be blank.  In that case, your program(s) need to call the default value functions to establish this data before you check for Godzilla differences:

  • BP WEB.MODITEM.MATCH:  in the CMATCH subroutine, check to see if SHOP.PACKOUT is null.  If it's null, get a value as follows:  SHOP.PACKOUT = FCT.PACKOUT.DEFAULT.VALUE()
  • If REQUESTED.QTY='' THEN REQUESTED.QTY = FCT.MINIMUM.MODQTY() 
  • Now you can check for differences