Basically what happens the System would call FormatRecipitEntery_Single with the product name and value etc in it
FormatRecipitEntery_Single("VALUE ORANGE JUICE","£0.35","A")
Public Sub FormatRecipitEntery_Single(TextToShow As String, PriceToShow As String, VATCode As String)
Global.SpaceNeeded = (56 - (String.Len(TextToShow) + String.Len(PriceToShow)))
If Global.VATActive = "Yes" Then
Global.SpaceNeeded -= 2
CreateRecipitFile("L", "1", TextToShow & Space(Global.SpaceNeeded) & PriceToShow & " " & VATCode)
Else
CreateRecipitFile("L", "1", TextToShow & Space(Global.SpaceNeeded) & PriceToShow)
End If
End
then once the spacing etc has been calculated the system then called CreateRecipitFile
Public Sub CreateRecipitFile(AligmentType As String, FontType As String, TextToUse As String)
Dim DataToWrite As String = Null
Select Case AligmentType
Case "L"
DataToWrite &= Global.LeftAlignText
Case "C"
DataToWrite &= Global.CentreAlignText
Case "R"
DataToWrite &= Global.RightAlignText
End Select
Select Case FontType
Case "1"
DataToWrite &= Global.NormalFont
Case "2"
DataToWrite &= Global.DoubleWidthFont
Case "3"
DataToWrite &= Global.DoubleHeightFont
Case "4"
DataToWrite &= Global.DoubleWidthHeightFont
Case "B1"
DataToWrite &= Global.BoldNormalFont
Case "B2"
DataToWrite &= Global.BoldDoubleWidthFont
Case "B3"
DataToWrite &= Global.BoldDoubleHeightFont
Case "B4"
DataToWrite &= Global.BoldDoubleWidthHeightFont
Case "B5"
DataToWrite &= Global.LargeDoubleWidthHeightFont
End Select
DataToWrite &= TextToUse & "~"
If Exist(Global.RecipitFileName) = True Then
Global.RecipitFile = Open Global.RecipitFileName For Write Append
Print #Global.RecipitFile, gb.NewLine;
Print #Global.RecipitFile, DataToWrite;
Global.RecipitFile.Close
Else
Global.RecipitFile = Open Global.RecipitFileName For Write Create
Print #Global.RecipitFile, DataToWrite;
Global.RecipitFile.Close
End If
End
The Void is the same sort of process but it would call FormatRecipitEntery_TwoLines
FormatRecipitEntery_Single("**NEXT ITEM IS VOIDED**|VALUE ORANGE JUICE","-£0.35","A")
Public Sub FormatRecipitEntery_TwoLines(TextToShow As String, PriceToShow As String, VATCode As String)
Global.LineMessages = Split(TextToShow, "|")
Global.SpaceNeeded = (56 - (String.Len(Global.LineMessages[1]) + String.Len(PriceToShow)))
If Global.VATActive = "Yes" Then
Global.SpaceNeeded -= 2
CreateRecipitFile("L", "1", Global.LineMessages[0])
CreateRecipitFile("L", "1", Global.LineMessages[1] & Space(Global.SpaceNeeded) & PriceToShow & " " & VATCode)
Else
CreateRecipitFile("L", "1", Global.LineMessages[0])
CreateRecipitFile("L", "1", Global.LineMessages[1] & Space(Global.SpaceNeeded) & PriceToShow)
End If
End
If you have a smarter way of doing this then I am more then happy to update the receipt function to work with the new format