Hot Fix For CR23023

(BEO sections - Items order could not change using the ctrl and arrow keys)

CR #

/ CR23023

Developer

/

Rajesh Shah, PCS Gandhinagar.

Product and Version

/ Enterprise 9.1 HF

Date given to Support

/

11/20/02

Files Affected -

VSS Integration Dates

/

Files Affected:

1.Delphi.MTX

  1. Delphi.MAC
  2. Delphi.SCN
  3. Delphi.MDX
Macros Affected:
  1. beoevitems:save
  2. beoevmenus:save
VSS Integration Date – 11/20/02

Description:

After adding items or menus to a BEO, user tried to change the order using the ctrl and arrow keys - new order does not save.

Items order should changed after following step 1 to 6 given in steps to reproduce.

Steps to reproduce:

  1. Go into a BEO
  2. Click on Food / Bev / Res link of BEO screen.
  3. Select Items Tab and Add several items under it.
  4. Use the red check and the ctrl and arrow keys (up or down) on the keyboard – (the items will move to a new position).
  1. Press OK. so it comes back to BEO screen.
  2. Go back into the section and select items tab.
  3. The items will have reverted to their original order.

Solution:

Rollback the changes made by CR20475 and CR22217.

Modified the following Macro:

  1. beoevitems:save
  2. beoevmenus:save

Hot fix instructions:

  1. Backup the files listed in the “Files Affected - VSS Integration Dates” section in the table above.
  2. Open the Designer. Select Macros -> All Macros-> beoevitems:save
  3. In the Macro Editor, copy and paste the following macro. [Copy following macro, which is highlighted in blue.]

NAMED MACRO: beoevitems:save

// macro: BEOEVITEMS:SAVE

// created: 1/1/80 sys

//

// mod: PCS 11/20/02 RS - CR23023 - Items Order should get change using the ctrl and arrow keys

// mod: PCS 10/23/02 RS - CR20475 - Position should not change while sorting and new position should be given to inserted row only

// mod: dl 10/12/99 - Commented out display and added display= $BEODisplay

// mod: bb 1/30/98 - Changed Display default

// mod:

// mod:

// mod:

// mod : PCS 10/30/01-AKS CR 14436

// description:

afterSave = arg(fld, 0)

$BEOChange = 1

//A PCS 10/16/01-AKS-CR0014436-RL Instrumentation

util_tracelog("START","SAVING","BEOEVITEMS","SAVE")

// End A

Cursor("HOURGLASS")

SetStatCell(1, "Saving items")

if EB_COMMENT.new == 1

CallSMacro(GetWindow("BEO_MS_QT"), "InsertComment", PUSH, EB_SECTION.value + ",Items")

end

LastChangedRow = Valf(EB_LASTROW.value)

//If any changes were made, determine defaults for all resource items

if lastChangedRow >= 2

Section = "BEODefault"

//display = GetPrivateProfileString(Section,"BEODISPLAY", "",KeysIni())

display = $BEODisplay

end

//Update foreign key values and position

row = 2

while row <= lastChangedRow

//If quantity has changed, check out the availablity...

if == 1

item_id = e

item_gid = e

if item_id != ""

Avail = ItemsInUse(item_id, item_gid)

else

Avail = 999999

end

if Avail < 0

Avail = 0

end

if Avail < Valf(e)

if YNinfoBox("There are " + NTOA(Avail) + " " + e + " available. Would you like to set the quantity to "+ NTOA(avail) + "?", $productName )

e = NTOA(avail)

end

end

end

pos = e

beoid = e

evtid = e

busid = e

Arow = NTOA(row - 1)

if ( beoid == "") or ( (pos != Arow) and XB_ALL.checked != 1 and AfterSave != "0") or (evtid == "") or (busid == "")

//Modify item

if e == "" and e != ""

e = Sub(e,1,39)

else

if e == ""

e = "blank"

end

end

e = "1"

e = $itemsys

// mod: PCS 11/20/02 RS - CR23023 - Rollback the following CR20475

//O PCS 10/23/02 RS - CR20475 - Position should not change while sorting and new position should be given to inserted row only

e = Arow

//M

//if(e == "")

// e = Arow

//end

//End M

e = "0"

e = $currentBEO

e = $currentBEOG

e = $currentEvtID

e = $currentEvtGID

e = $currentBEOBusID

e = $currentBEOBusGID

= 1

= 1

//Determine default tax rates for each new resource item ...

catrow = 1

catid = "0"

itemcatid = e

itmcatid = GetIDVal(itemcatid, 1)

itmcatgid = GetIDVal(itemcatid, 2)

e = itmcatgid

while e != "" and catid == "0"

if ( (e == itmcatid) and (e == itmcatgid) )

catid = e

BillYN = e

TaxYN = e

Tax = e

Svchrg = e

end

catrow = catrow + 1

end

if TaxYN == "" or TaxYN == "DVAR"

TaxYN = "0"

end

if BillYN == "" or BillYN == "DVAR"

BillYN = "0"

end

if Tax == ""

Tax = "0.00"

end

if Svchrg == ""

Svchrg = "0.00"

end

//Set font to 0 if null

if e == ''

e = '0'

end

if e == "" and e == ""

e = Display

end

if e == ""

e = TaxYN

e = Tax

e = BillYN

e = svchrg

end

end

row = row + 1

end

Modify(0)

SetStatCell(1, "")

if aftersave != "open"

CallSMacro(me, "Refresh", PUSH, "")

end

Cursor("ARROW")

//A PCS 10/16/01-AKS-CR0014436-RL Instrumentation

util_tracelog("END","SAVING","BEOEVITEMS","SAVE")

// End A

//if afterSave != ""

// row = afterSave

// itemtype = e

// itemID = e

// itemGid = e

// $FromScreen = "RSRC"

// GetEvtItem(itemtype, itemID, itemGid)

//end

RETURN

END of MACRO beoevitems:save
  1. Save it.
  2. Select Macros -> All Macros-> beoevmenus:save
  3. In the Macro Editor, copy and paste the following macro. [Copy following macro, which is highlighted in blue.]

NAMED MACRO: beoevmenus:save

// macro: BEOEVMENUS:SAVE

// created: 1/1/80 sys

//

// mod: PCS 11/20/02 RS - CR23023 - Items Order should get change using the ctrl and arrow keys

// mod: PCS 10/10/02 RS - CR22217 - Position should not change while sorting and new position should be given to inserted row only

// mod: 2/10/99 SML: return out if pricing type is null (kludge)

// mod:1.30.98 bb:

// mod:11.18.97 bb: Added check for null evitem_id when checking for comps.

// mod:11/12/97 bb: added default categories for F & B items

// mod:10/3/97 bap: added two comp field loops (1 for item & 1 for menu)

//

// description:

//

// description: Save functionality on this screen is unique:

// In some instances, We allow rows which have not been flagged as

// new to save anyway if followed by a valid row (Blank spaces between items)

// In another case, we remove the NGS New flag because we assume

// the user has made a mistake. Please see comments throughout.

//We will scan up to 250 items. This # has been set because of the consensus that

//there would never be more than 250 non-menu F&B items per event per BEO.

MaxRowsToCheck = 250

$BEOChange = 1

SetStatCell(1, "Saving items")

//LastChangedRow = ChangedRows(me, LB_ITEM)

//LastChangedRow = ChangedRows(me, LB_MENU)

if EB_COMMENT.new == 1

CallSMacro(GetWindow("BEO_MS_QT"), "InsertComment", PUSH, EB_SECTION.value + ",Menus")

end

//LastChangedRow = ChangedRows(me, LB_ITEM)

//Check for the last row with a value since blank lines are allowed...

row = 2

LastChangedRow = 1

blanklines = 0

//We allow up to 5 blank lines in a row to be saved if there is an item below.

while row < MaxRowsToCheck and blanklines < 5

if (e != "" or e != "" or e != "" or e != "" or e != "" or e != "")

LastChangedRow = row

blanklines = 0

else

blanklines = blanklines + 1

end

row = row + 1

end

//Find last row modified from NGS.

LastRowFromNGS = ChangedRows(me, LB_ITEM)

//If any changes were made, determine defaults for all menu items

if lastChangedRow >= 2

TaxYN = "1"

BillYN = "1"

FTax = $FTaxRate

BTax = $BTaxRate

display = $BEODisplay

gratuity = $Gratuity

end

//Update foreign key values and position

row = 2

while row <= lastChangedRow

pos = e

beoid = e

evtid = e

busid = e

Arow = NTOA(row - 1)

if ( beoid == "") or ( (pos != Arow) and XB_ALL.checked != 1) or (evtid == "") or (busid == "")

//New item

if e == ""

if e != ""

e = Sub(e,1,39)

else

e = "blank"

end

end

e = "1"

e = $itemsys

// mod: PCS 11/20/02 RS - CR23023 - Rollback the following CR22217

//O PCS 10/10/02 RS - CR22217 - Position should not change while sorting and new position should be given to inserted row only

e = Arow

//M

//if(e == "")

// e = Arow

//end

//End M

e = "0"

e = $currentBEO

e = $currentBEOG

e = $currentEvtID

e = $currentEvtGID

e = $currentBEOBusID

e = $currentBEOBusGID

= 1

= 1

if e == "3"

Tax = FTax

else

Tax = BTax

end

// If no tax is set (Value is null)

if e == "" and e != "0"

e = Tax

end

//If Include on check value is null

if e == ""

e = BillYN

end

//If gratuity value is null

if e == ""

e = gratuity

end

//If category is null

if e == ""

Category = GetFBDefaultCat($itemsys)

e = GetIDVal(Category, 1)

e = GetIDVal(Category, 2)

end

if e == ""

e = Display

end

//If this item is set to no tax, we don't want to give it any sml 5/6

if e != "0"

e = TaxYN

end

e = "0"

end

//if Item price does not = zero then uncheck the comp field which is

//displayed on the BEOEvItem screen - bap

If valf(e) != 0

EvItem_Id = e

EvItemGid = e

//added bb 11-17-97

if EvItem_Id != ""

setsubstitution("EvItem_Id", EvItem_Id)

setsubstitution("EvItemGid", EvItemGid)

XSelect=""

XFrom=""

XWhere=""

XOrderBy=""

XGroupBy=""

XHaving=""

GetQuery("Macro_BEOEVMENUS_Save_SQL1", &XSelect, &XFrom, &XWhere, &XOrderBy, &XGroupBy, &XHaving)

XSelect = XSelect + " " + XFrom + " " + XWhere + " " + XOrderBy + " " + XGroupBy + " " + XHaving

ExecuteSQL(XSelect)

Commit()

end

end

row = row + 1

end

//Scan through remaining rows and set to not - modified.

//We do this because a user in New Orleans entered a value then backspaced

//out the letter so NGS saw it as modified but the BEO processing did not...

while row <= LastRowFromNGS

setssStateByRow(me, LB_ITEM, row, 0)

row = row + 1

end

//Check Menus

lastChangedRow = changedRows( me, LB_MENU )

MRow = 2

while MRow <= lastChangedRow

if Valf(e) != (Valf(e) + Valf(e))

if e == ""

e = "0.00"

end

if Valf(e) > Valf(e)

e = e

= 1

else

e = NTOA(Valf(e) - Valf(e))

= 1

end

end

//SML 11/12

if e == ""

//ProductBox("You must choose a Pricing Type before Saving.")

return

end

//if Menu price does not = zero then uncheck the comp field which is

//displayed on the BEOEvMenu screen - bap

If valf(e) != 0

EvMenu_Id = e

EvMenu_Gid = e

setsubstitution("EvMenu_Id", EvMenu_Id)

setsubstitution("EvMenu_Gid", EvMenu_Gid)

XSelect=""

XFrom=""

XWhere=""

XOrderBy=""

XGroupBy=""

XHaving=""

GetQuery("Macro_BEOEVMENUS_Save_SQL2", &XSelect, &XFrom, &XWhere, &XOrderBy, &XGroupBy, &XHaving)

XSelect = XSelect + " " + XFrom + " " + XWhere + " " + XOrderBy + " " + XGroupBy + " " + XHaving

ExecuteSQL(XSelect)

Commit()

End

MRow = MRow + 1

end

Modify(0)

SetStatCell(1, "")

CallSMacro(me, "Refresh", PUSH, "")

RETURN

END of MACRO beoevmenus:save
  1. Again follow the steps, and check the items order shouldchange using the ctrl and arrow keys.

Page 1 of 12