MOD Item Ashads & Quote Changes
Status 2 and 3
9/4/13
The website will pass in STATUS one of the following:
1 = New Quote and New MOD Item (create a new quote and assign a new configuration# with revision nbr 0) – This status is sent when creating a new MOD item from a new result that is saved/shared/put into cart or when an existing MOD item is modified via widget/results and a new MOD Item & Quote is selected (and changes were not just to Qty, Zip Code, or Frt Options). This is not being addressed in this spec (has already been handled when the create config/create quote program was created).
2 = New Quote for an Existing MOD Item *** this is an ashad (create a new quote and use existing configuration# - increment revision nbr). The new quote will be linked to the existing MOD Item.
3 = Change to an Existing Quote already attached to a MOD Item.
UI Side – Assigning QUOTE.NBR:
- From Saved Items: If there are multiple active quotes for the MOD Item, show a list and let user choose:
- Loop through CONTACT.ITEM.XRF.USR until we hit a quote date that is > 14 days old and find every quote that isn't converted. Show to user from saved items: Date, Zip Code, Qty, Price, Frt Option (possibly quote#). When choice is made, pass QUOTE.NBR through to Avante
- From Saved Items: If there is a single active quote for the MOD Item, assume that quote#
- From Saved Items: If there are no active quotes for the MOD Item, assume most recent quote from CONTACT.ITEM.XREF.USR<11,1> (or it could leave blank and the back-end could assign it)
- From Order History: Get Quote# from SOHDR<85> for the selected order
- From Active Cart: Quote# that's in the cart
UI Side – Determining STATUS:
If the quote is expired or converted (inactive):
- From Saved Item back through Widget: If the item itself is changed (dimensions, material, color, packaging, etc), set STATUS=1 (new mod item/new quote)
- From Saved Item back through Widget: If the quantity, zip code, price breaks, and/or freight options are changed, ask if this is a new MOD Item (STATUS=1) or Same MOD Item (STATUS=2). A new quote will always be created by the back-end for either status with the current date and resin prices.
- From Order History: STATUS=2 (creating ashad for same MOD Item)
- From Cart: If expired, STATUS=2 (re-pricing expired quote) *** will have to change quote# that is in the cart. If already converted, don't allow them to do anything with this quote.
If Active quote (unexpired/unconverted):
- From Saved Item back through Widget: If only the quantity and/or price breaks are changed, no question will be asked. Set STATUS=3 (quote change).
- From Saved Item back through Widget: If the Zip Code and/or Freight Option is changed, ask if this is a new Quote for same MOD Item (STATUS=2) or if they are changing the existing Quote (STATUS=3)
- From Saved Item Back through Widget: If the item has changed: If there's a single quote linked to this MOD Item, ask if this is a change to the existing quote (STATUS=3) or if this is a new Quote for a new MOD Item (STATUS=1). If there is more than a single quote linked to this MOD Item, set STATUS=1.
- From Cart: STATUS=3 (quote change for quantity/freight option/zip code)
UI Side – Ask Question "New MOD or Existing MOD?":
Only ask the question under the following conditions:
- If any changes on an Active Quote and CONFIG.REV = ""
- If Quantity, Zip Code, Freight Option and/or Price Breaks changed on an inactive quote AND CONFIG.REV = ""
AVANTE SIDE:
Ashads - Create a new Quote using same MOD Item# and configuration# - Increment Revision# (STATUS = 2):
- New Quote created from Order History (ashad) – linked to MOD Item from order history
- New Quote created from Cart for an expired quote – re-price on new quote
- New Ashad Quote created from a Saved Item (regardless of quote status) – linked to the MOD Item in Saved Items. A new quote can be generated from an expired, converted, or active quote. Ashads from active quotes would be done for quantity, price break, zip code, or freight option differences.
When the web calls WEB.MODITEM.QUOTE with STATUS=2 (New Quote/Same MOD Item#/Same Configuration/incremented Revision):
- PART.NBR will contain the MOD Item#.
- In most cases, QUOTE.NBR will contain the quote number. The only time it could be null is if an ashad is being created from a saved item that has no active quotes. In this case, get the quote number from CONTACT.ITEM.XRF.USR<11,1> using the MOD Item Number passed in PART.NBR.
- New quotes coming from a saved item go back through the widget. New quotes from order history do not.
- Increment the Revision# on the Configuration:
- Read the current configuration.revision number from QUDET<39>
- When creating an ashad, we use the original configuration# (number before '.'), and increment the revision# (number after "."):
- The revision number of the configuration will be incremented by EPCS0017.1, but you should follow the original logic in WEBS4001.1 lines 236-282 (for ORIG.CONFIG) before the EPCS0017.1 call. EPCS0017.1 will increment the revision# as long as you set KEY = original configuration.revision. When KEY = NEW.WORD, EPCS0017.1 would assign a new configuration# (which we don't want in this case).
- Going forward, we will be using variable CONFIG.REV instead or ORIG.CONFIG. If CONFIG.REV is null, you should set to the configuration.new revision after EPCS0017.1 increments it and resets KEY so that we only increment the rev# once regardless of how many changes the user makes in this session. CONFIG.REV (containing original configuration#:".":new revision#) will be passed back to the web in RETURN.VALUE. It would be used if the user makes changes to the configuration after the ashad is created (see logic for status = 3 below).
- Step through Q&A as usual, populating the CF… files with the data from the previous revision.
- Create a new quote and update CONTACT.ITEM.XRF.USR with the new quote# in field 11, multi-value 1.
- Return CONFIG.REV in RETURN.VALUE to the web with the original configuration#:".":new revision nbr
Example:
Starting from a saved item, the selected quote for the MOD Item goes back through the widget and shows original results (if active) or re-priced results (if expired/converted). A new revision for the existing configuration# will be created storing the widget answers as well as the recalculated price/price breaks. A new quote will be created linked to the existing MOD Item.
- MOD123 in saved items for 12x0x24x2mil layflat bag, color=red, packaging=in cases; packout=1250
- Goes back through the widget, defaulting to the above info and shows results. Price and price breaks would be recalculated using today's resin prices.
- A new ashad quote would be created, linked to MOD123.
- We will spin off a new revision for the existing configuration, writing all Q&A answers to the new configuration.revision. The prior configuration will not change (will be kept for historical purposes). *** We will only create one new revision for the configuration, no matter how many changes are made to the saved item during this time. So once the new revision# is created for this ashad, any changes the user now makes in this session to this new quote will not increment the revision again.
Changing an Existing Unexpired/Unconverted Quote from Saved Items (STATUS = 3):
MOD Item changes for an Active Quote can be made in the following areas:
- Saved Item that goes back through the widget – any widget fields in level 2 or 3 can be changed with the exception of Category (dimensions, zip code, all applicable level 3 fields). Note: The fields that define item (ie, dimensions, color, material, etc) may only be changed under STATUS 3 if there is a single quote associated with this MOD Item. The assumption here is that the original quote was incorrectly configured so we will allow a change to anything at this time. Once there are additional quotes attached to the MOD Item, they can never change item info on this MOD Item. A new MOD Item would be created.
- Saved Item Results – packout, quote quantity, freight options and custom price breaks
- MOD Item that's in a cart (could have come from results, saved items, order history) – quote quantity, freight options and zip code
Example:
Starting from a saved item, the selected quote for the MOD Item goes back through the widget and shows original results. If the user changes anything on the widget or in the results area for this unexpired/unconverted quote and answers 'yes' to the 'Update Saved Item?' prompt, a new revision for the existing configuration# will be created storing the new widget answers as well as the recalculated price/price breaks. The existing quote will be updated with the widget/results area changes. Note: If the user anwers "No" to the "Update Saved Item?" prompt, this is no longer a change to an existing quote. It will go through Status=1 (new quote/new mod item) or Status=2 (new quote/existing mod item) logic. The UI side will handle the setting of this Status.
- MOD123 in saved items for 12x0x24x2mil layflat bag, color=red, packaging=in cases; packout=1250
- Goes back through the widget, defaulting to the above info and shows results
- User changes color from red to blue and packaging from Cases to Rolls
- They select FIND and new results show with new price. But before the results show, they are asked if they want to 'update saved item?' They answer 'yes'.
- On the new results, they change packout from 1250 to 1500. Because they've already told us they want to update their saved item, we won't ask them again. The item is re-priced again for the new packout and price/price breaks redisplay in the results area.
- When they select FIND after making changes and after each subsequent change made in the results area, we will update the quote with all new information:
- item desc will be updated with color blue, rolls, new packout qty
- New unit and extended prices
- New price break prices (standard and custom breaks)
- We will spin off a new revision for the existing configuration, writing all Q&A answers to the new configuration.revision. The prior configuration will not change (will be kept for historical purposes). *** We will only create one new revision for the configuration, no matter how many changes are made to the saved item during this time.
Technical Notes:
When the web calls RPC$MODITEM_CREATE with STATUS=2 (New Quote/Same MOD Item):
Creating the new Quote is the same as STATUS=1 (which is already programmed). Only difference here is that the existing MOD Item (in CONTACT.ITEM.XRF.USR) is updated (no new MOD Item is created).
When the web calls RPC$MODITEM_CREATE with STATUS=3 (quote change):
PART.NBR will contain the MOD Item Nbr. QUOTE.NBR will contain the Quote Number.
- If CONFIG.REV = "" (this means this is the first change we have seen this session):
- Read the current configuration.revision number from QUDET<39>
- using same configuration# (number before '.'), increment the revision# (number after "." in CONFIG.REV):
- The revision number of the configuration will be incremented by EPCS0017.1 (called from RPC$MODITEM_CREATE), but you should follow the original logic in WEBS4001.1 lines 236-282 (for ORIG.CONFIG) before the EPCS0017.1 call. EPCS0017.1 will increment the revision# as long as you set KEY = original configuration.revision. When KEY = NEW.WORD, EPCS0017.1 would assign a new configuration# (which we don't want in this case).
- Going forward, we will be using variable CONFIG.REV instead or ORIG.CONFIG. If CONFIG.REV is null, you should set to the configuration.new revision after EPCS0017.1 increments it and resets KEY so that we only increment the rev# once regardless of how many changes the user makes in this session. CONFIG.REV (containing original configuration#:".":new revision#) will be passed back to the web in RETURN.VALUE.
- If CONFIG.REV is not null (other changes have been made in this session and we have already created the new revision), pass this as KEY to EPCS0017.1 so that it will update the same revision of this configuration.
- Step through Q&A as usual, populating the CF… files (WEB.CREATE.CONFIG). Even though this isn't a new quote, it is a new revision of the configuration so all configurator files must be updated with new answers.
- Update the quote records as follows. See QUOS4000.1 using variable LINEACT to see if new or modified line item (1=new; 2=modify). WEB.CREATE.QUOTE doesn't have any LINEACT=2 logic but will now need it. Refer to QUOS4000.1. Compare QUHDR/QUDET records to data from widget to see what has changed.
- If the unit price of the MOD item changes (QUDET<5> vs Unit Price from Wayne's Array), update (check QUOS4000.1 for calculations for these fields):
- QUHDR<31> = Merchandise$ (domestic)
- QUHDR<35> = Taxable $ (domestic)
- QUHDR<36> = Total Quote $ (domestic)
- QUHDR<120> = Merchandise$ (foreign)
- QUHDR<124> = Taxable $ (foreign)
- QUHDR<126> = Total Quote $ (foreign)
- QUDET<5> = Unit Price (domestic)
- QUDET<14> = Extended $ (domestic)
- QUDET<61> = Unit Price (foreign)
- QUDET<73> = Extended $ (foreign)
- If the quote quantity changes (QUDET<3> vs REQUESTED.QTY), update:
- QUDET<3> = new quantity ordered
- QUDET<24> = TIME()
- QUDET<40> = new quantity ordered (config qty)
- If the freight option changes or Zip Code Changes (QUHDR.USR<14> vs SHOP.FRTOPT or SHOP.ZIPCODE), update:
- QUHDR.USR<14> = Laddawn or Customer pays freight (comment)
- Always update Item Description:
- QUDET<12,1> = CFBLDHDR<8>"L#25":CFBLDHDR<9> (must store 25 characters of data in <8> because field isn't multi-valued)
- Always update the following:
- QUHDR<166> = quote status date (today)
- QUDET<39> = configuration#:".":new revision#
- If the manufacturing facility changes (whs#) (QUHDR<22> vs Warehouse from Wayne's Array), update the following with new warehouse#:
- QUHDR<22>
- QUDET<32>
- Return CONFIG.REV in RETURN.VALUE to the web with the original configuration#:".":new revision nbr
- If the unit price of the MOD item changes (QUDET<5> vs Unit Price from Wayne's Array), update (check QUOS4000.1 for calculations for these fields):
-
-
- Lock Logic – we will have to figure out a way to keep the quote locked while we are updating it when STATUS=3 and check locks before the update.
- Lock Logic – we will have to figure out a way to keep the quote locked while we are updating it when STATUS=3 and check locks before the update.
-