Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FixPrintForm()
- 'This is so we can have a common print form for all stores.
- ' The parts that vary from store to store about between a commented
- ' sections. This functions reads the default replaces comment sections
- ' as needed. And remove others as needed.
- 'Dim all Markers as strings here
- Dim ReceiptHeaderBitmap As String = "Receipt Header BitMap"
- Dim ReceiptHeaderBitMapReplacment As String = ""
- Dim PrintOrderNumberChit As String = "Print Order Number Chit"
- Dim PrintOrderNumberChitReplacment As String = ""
- Dim PrintOrderNumber As String = "Print Order Number"
- Dim PrintOrderNumberReplacemnt As String = ""
- Dim PrintOrderNumberCharge As String = "Print Order Number Charge"
- Dim PrintOrderNumberChargeReplacemnt As String = ""
- Dim GrillPrintOrderNumberChit As String = "Grill Print Order Number Chit"
- Dim GrillPrintOrderNumberChitReplacemnt As String = ""
- Dim TrailerBitMap As String = "Trailer Bit Map"
- Dim TrailerBitMapReplacemnt As String = ""
- Dim lstOrgPrintForm As List(Of String) = System.IO.File.ReadAllLines("c:\iris\data\Print.frm").ToList
- PrintFormClean(lstOrgPrintForm, ReceiptHeaderBitmap)
- PrintFormClean(lstOrgPrintForm, PrintOrderNumberChit)
- PrintFormClean(lstOrgPrintForm, PrintOrderNumber)
- PrintFormClean(lstOrgPrintForm, PrintOrderNumberCharge)
- PrintFormClean(lstOrgPrintForm, GrillPrintOrderNumberChit)
- PrintFormClean(lstOrgPrintForm, TrailerBitMap)
- 'Build Common Replacments
- 'Grill Print Order Number Chit
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "#prtr,=,Grill1" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "`dh,dw,c" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "`FontSize3" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "~ExpoNum,-5~~TotalOrderItems,3~" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "#destination,>,1" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "`dh,dw,c" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "********** To Go **********" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "#" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "`sh,sw" & vbCrLf
- GrillPrintOrderNumberChitReplacemnt = GrillPrintOrderNumberChitReplacemnt & "#" & vbCrLf
- 'End of Common Replacement
- 'Build PrintForm String and Preform replacement
- Dim OrgPrintForm As String = Join(lstOrgPrintForm.ToArray, vbCrLf)
- PrintFormReplacment(OrgPrintForm, GrillPrintOrderNumberChit, GrillPrintOrderNumberChitReplacemnt)
- 'Process each register
- For xLoop As Integer = 0 To PosMaint.RegisterInformations.Count - 1
- Dim RegInfo As PosMaint10.RegInfo = PosMaint.RegisterInformations(xLoop)
- 'Build Register replacements
- ReceiptHeaderBitMapReplacment = ""
- PrintOrderNumberReplacemnt = ""
- PrintOrderNumberChargeReplacemnt = ""
- PrintOrderNumberChitReplacment = ""
- TrailerBitMapReplacemnt = ""
- 'Trailer Bit Map
- If IO.File.Exists("c:\iris\images\Braums_Guarantee.bmp") Then
- DispThis(" Reg " & RegInfo.RegisterNumber.ToString & " has a trailer bit map, ")
- TrailerBitMapReplacemnt = TrailerBitMapReplacemnt & "`sh" & vbNewLine
- TrailerBitMapReplacemnt = TrailerBitMapReplacemnt & "`c,hilogo" & vbNewLine
- TrailerBitMapReplacemnt = TrailerBitMapReplacemnt & "`sh" & vbNewLine
- TrailerBitMapReplacemnt = TrailerBitMapReplacemnt & "`sh" & vbNewLine
- If RegInfo.PrinterType = ePrinterType.Old Then
- DispThis("loading old printer, ")
- TrailerBitMapReplacemnt = TrailerBitMapReplacemnt & "c:\iris\images\Braums_Guarantee.bmp,2" & vbNewLine
- Else
- DispThis("loading OPOS printer, ")
- TrailerBitMapReplacemnt = TrailerBitMapReplacemnt & "c:\iris\images\Braums_Guarantee.bmp" & vbNewLine
- End If
- DispThis("Done" & NewLine)
- End If
- 'End of Trailer Bit Map
- 'Start Set correct Header bit map
- Select Case RegInfo.DefaultConcept
- Case eDefaultConcept.Fountain
- If RegInfo.PrinterType = ePrinterType.Old Then
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_fountain.bmp,1" & vbCrLf
- Else
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_fountain.bmp" & vbCrLf
- End If
- Case eDefaultConcept.Lobby
- 'Receipt Header BitMap
- If RegInfo.PrinterType = ePrinterType.Old Then
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_lobby.bmp,1" & vbCrLf
- Else
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_lobby.bmp" & vbCrLf
- End If
- Case eDefaultConcept.DualLane1, eDefaultConcept.DualLane2, eDefaultConcept.Tender, eDefaultConcept.TenderBlockReg, eDefaultConcept.SplitScreen
- If RegInfo.PrinterType = ePrinterType.Old Then
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_drive.bmp,1" & vbCrLf
- Else
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_drive.bmp" & vbCrLf
- End If
- Case Else
- If RegInfo.PrinterType = ePrinterType.Old Then
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_package.bmp,1" & vbCrLf
- Else
- ReceiptHeaderBitMapReplacment = "c:\iris\images\braumprt_package.bmp" & vbCrLf
- End If
- End Select
- 'End Set correct Header bit map
- 'Start Fix for Tray Chit
- If RegInfo.DefaultConcept = eDefaultConcept.Lobby OrElse RegInfo.DefaultConcept = eDefaultConcept.FreshMarket Then
- 'Print Order Number
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "`dh,dw,c" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#SeatEXPOnum,#,0" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "&paystate,=,1" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "&destination,<,3" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "Paid Group Order" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#else" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#destination,<,3" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "`nonl" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "Order# " & vbCrLf
- ' If RegInfo.PrinterType = ePrinterType.Old Then
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "`FontSize5" & vbCrLf
- ' End If
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#SeatEXPOnum,#,0" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "~SeatExpoNum~" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#else" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "~ExpoNum~" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "#" & vbCrLf
- PrintOrderNumberReplacemnt = PrintOrderNumberReplacemnt & "`sh,sw" & vbCrLf
- 'Print Order Number and Order Number Charge is the same except the starting test
- ' So we just build the body and #(end if) the same. Set the PrintOrderNumberReplacemnt
- ' then add the appropriate test to the start
- PrintOrderNumberChargeReplacemnt = PrintOrderNumberReplacemnt
- PrintOrderNumberChargeReplacemnt = PrintOrderNumberChargeReplacemnt & ""
- PrintOrderNumberChargeReplacemnt = "#State,=,1" & vbCrLf &
- "&paytype,<>,201" & vbCrLf &
- "&paytype,<>,202" & vbCrLf &
- "&paytype,<>,203" & vbCrLf &
- "&paytype,<>,701" & vbCrLf &
- PrintOrderNumberChargeReplacemnt &
- "#" & vbCrLf
- 'PrintOrderNumberReplacemnt = "#State,=,1" & vbCrLf & PrintOrderNumberReplacemnt
- 'Print Order Number Chit Replacement
- If PosMaint.PrtExpoNumberPriName.ToUpper = "NONE" Then
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#State,=,1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "&destination,<,3" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`cut" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`dh,dw,c" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#SeatEXPOnum,#,0" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "Group Order" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize3" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "~SeatExpoNum~~TotalTrayItems,3~" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#BusSeatModified,=,1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "!!Tray Count Change!!" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`sh,sw" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#else" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize3" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "~ExpoNum~~TotalOrderItemsPlusChildren,3~" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#destination,>,1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`dh,dw,c" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "********** To Go **********" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`sh,sw" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "<item>" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#itemnum,=,300001" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "** Order Changed **" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`Sh,Sw" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- Else
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#prtr,=,Grill1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "&destination,<,3" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`dh,dw,c" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#SeatEXPOnum,#,0" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "Group Order" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize3" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "~SeatExpoNum~~TotalTrayItems,3~" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#BusSeatModified,=,1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "!!Tray Count Change!!" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`sh,sw" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#else" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize3" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "~ExpoNum~~TotalOrderItemsPlusChildren,3~" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#destination,>,1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`dh,dw,c" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "********** To Go **********" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`sh,sw" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "<item>" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#itemnum,=,300001" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`FontSize1" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "** Order Changed **" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "`Sh,Sw" & vbCrLf
- PrintOrderNumberChitReplacment = PrintOrderNumberChitReplacment & "#" & vbCrLf
- End If
- End If
- 'End Fix for Tray Chit
- 'Build Register PrintForm String and Preform register replacment
- Dim RegPrintForm As String = OrgPrintForm
- PrintFormReplacment(RegPrintForm, ReceiptHeaderBitmap, ReceiptHeaderBitMapReplacment)
- PrintFormReplacment(RegPrintForm, PrintOrderNumber, PrintOrderNumberReplacemnt)
- PrintFormReplacment(RegPrintForm, PrintOrderNumberCharge, PrintOrderNumberChargeReplacemnt)
- PrintFormReplacment(RegPrintForm, PrintOrderNumberChit, PrintOrderNumberChitReplacment)
- PrintFormReplacment(RegPrintForm, TrailerBitMap, TrailerBitMapReplacemnt)
- IO.File.WriteAllText("c:\iris\reginfo\reg" & RegInfo.RegisterNumber & "\data\Print.frm", RegPrintForm)
- Sleep(10)
- Next
- IO.File.Copy("c:\iris\data\print.frm", "c:\iris\reginfo\common\data\Print.frm", True)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement