Advise on Cleaning up data
Posted
#1
(In Topic #1082)
Enthusiast

I was wondering if someone could help with a puzzle I have
I am thinking about adding a "Clean Receipt" option on my software for when Items are voided during the sale
This is what I have at the moment
What I would need to do is remove the Item(s) that was originally placed on the receipt as well as the Voided one
in the above example I would need to remove
so when the receipt is printed it would show like
How would I do this? I know i would need to loop though the receipt file but I am not sure how I would remove the lines i need
And yes the voided format will always show the |L|1** NEXT ITEM HAS BEEN VOIDED **~ before the item that is voided.
the following is what could be shown
Code (gambas)
- ** Price Override **
- Qty @ Price (qty sale)
Posted
Guru

Posted
Enthusiast

cogier said
Is the list of products in an array? If so, you can just delete the correct item with Array.Remove()
At the moment the receipt data file is created each time an item is scanned.
The file is called recipit.tmp
The system is using the ~ when it reads the file in for printing as a end of line marker
I'm not sure if this is the best way to make the receipt file as the item is still showing on the main screen as being scanned and the. Voided.
I'm always open to way to improve the system.
Posted
Guru

Posted
Enthusiast

Posted
Guru

..I can post the code that adds data to the receipt file if that helps.
Yes that would help.
Posted
Enthusiast

FormatRecipitEntery_Single("VALUE ORANGE JUICE","£0.35","A")
Code (gambas)
- Global.SpaceNeeded -= 2
then once the spacing etc has been calculated the system then called CreateRecipitFile
Code (gambas)
- Case "L"
- DataToWrite &= Global.LeftAlignText
- Case "C"
- DataToWrite &= Global.CentreAlignText
- Case "R"
- DataToWrite &= Global.RightAlignText
- 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
- DataToWrite &= TextToUse & "~"
- Print #Global.RecipitFile, DataToWrite;
- Global.RecipitFile.Close
- Print #Global.RecipitFile, DataToWrite;
- Global.RecipitFile.Close
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")
Code (gambas)
- Global.SpaceNeeded -= 2
- CreateRecipitFile("L", "1", Global.LineMessages[0])
- CreateRecipitFile("L", "1", Global.LineMessages[1] & Space(Global.SpaceNeeded) & PriceToShow & " " & VATCode)
- CreateRecipitFile("L", "1", Global.LineMessages[0])
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
Posted
Guru

I have looked at till receipts and if there is a credit it is clearly shown and, I think, a record should be kept. Below is a simplified piece of code showing the way I would go about this. Sorry but I have run out of time today to improve it.
Code (gambas)
- ' Gambas class file
- StartNewCustomer
- sTempReceiept.Clear
- fTempValue = 0
- NewReceipt("CADBURY'S CREAM EGG 40G", 0.60)
- NewReceipt("FARM FRESH LSE BRAEBURN CL1 12", 2.89)
- NewReceipt("* * NEXT ITEM HAS BEEN VOIDED * *")
- NewReceipt("FARM FRESH LSE BRAEBURN CL1 12", -2.89)
- NewReceipt("EndTransaction")
- fTempValue += iValue
Posted
Enthusiast

The way I handled this was since the sale is on the screen in a columnview when it is time to print the receipt I just iterate through the columnview and print. All items in the columnview are stored in a mysql database for easy retrieval including remotely. I am assuming that your sale is on the screen when you want to print. My receipt print is relatively simple this way. I may not be giving code but the concept of how to do it may be more simple allowing you to code it easier. My thought is put the original item on the sale, then the voided item would simply have a negative quantity. You can even include a "notation" item with it. Then printing a receipt would be as simple as just step through the list on screen.
cogier has helped me on a few options with my POS so this is the guy you want to listen to. He solves problems I can't.
1 guest and 0 members have just viewed this.



