r/Python • u/kl31 • Jul 12 '19
I wrote an integrated POS system for my girlfriend's restaurant using tkinter.
https://imgur.com/a/RKeuCva8
u/easylifeforme Jul 12 '19
Is the POS two different systems one for taking orders and one the kitchen? If so how do they communicate?
8
u/kl31 Jul 12 '19
websockets server
1
u/lookmanofilter Jul 18 '19
I'm super interested in websockets, I think they have a ton of potential. What library did you use for them?
1
8
Jul 12 '19
Noob questions incoming:
why tkinter?
is it on an os? If so what os.
and who eats cold hamburgers?
5
u/kl31 Jul 12 '19
why not tkinter? it comes prepackaged with python.
no its not an OS. it runs on raspbian
no one. that's why its no longer on the menu. what you see is the local file.
3
u/TheIncorrigible1 `__import__('rich').get_console().log(':100:')` Jul 12 '19
why not tkinter
Just not very programmer-friendly with abstractions that have come out since. Lots of manual setting up of GUI elements instead of components, etc. I don't have an answer to alternatives since I don't do any GUI work in Python
3
u/tristan957 Jul 12 '19
PyGObject or PyQt5
1
2
9
u/twistedgames Jul 12 '19
Looks great. Are the menu items stored in a config file?
11
u/kl31 Jul 12 '19
yes and in google drive. i haven't implemented this yet (its just low priority) but I'll be able to edit the menu remotely.
11
u/got_outta_bed_4_this Jul 12 '19
Ooh, so you can do fun things like drop a "happy birthday" button in there at the opportune moment.
10
9
Jul 12 '19
This looks very impressive, and it's amazing you've got to the point of it working in production.
Please consider making it FOSS on github so others can use and audit it, and set up unit tests, a CI pipeline, pylint and flake8 bugbear checks, type hinting with mypy and black formatting.
Then you can package it for easy deployment for others etc.
Overall I think you gain more by working with the community to make it a solid, open project rather than trying to sell it to a few other restaurants, in my opinion.
Also consider adding support for inventory tracking, report generation for sales statistics and trends (maybe in a separate program, reading output files), and integration to receive orders via Ubereats etc. (they usually have APIs) - a former colleague of mine is working on that at a startup in Europe.
Then there's also the prospect of internationalisation - supporting different currencies and tax rates, tax rate changes per product etc.
9
u/kl31 Jul 12 '19
Overall I think you gain more by working with the community to make it a solid, open project rather than trying to sell it to a few other restaurants, in my opinion.
selling it to restaurants was never the intent. I made this for many reasons but it was not to have a commercial product. that being said, after two years of programming on my own, i'm definitely more eager now to work with the community.
3
7
Jul 12 '19
That's really cool. What does it do exactly?
23
u/kl31 Jul 12 '19
That's really cool. What does it do exactly?
it's a POS system. you place an order for the customer and it shows up for the cooks. opens the cash drawer, prints out the receipt. you kno the stuff that happens behind the scenes at like any restaurant.
0
Jul 12 '19
of course not. everything is stored as integers until it needs to be read by a human.
Oh, you should compare the average time to deliver a dish to the customer with and without the system. That would be an interesting comparison.
10
u/kl31 Jul 12 '19
Oh, you should compare the average time to deliver a dish to the customer with and without the system. That would be an interesting comparison.
I definitely thought about doing that. But that time could be better used elsewhere lol
248
u/PlOrAdmin Jul 12 '19
Very impressive. I work with POS systems and I do know a company that is seriously kicking around a linux port.
If you're interested message me and I can provide info for contact.
r/raspberry_pi would love this, consider a cross-post.
11
u/dakokonutboi Jul 12 '19
I know that I’m going to get berated for this but. What does POS stand for? Piece of s*it? I always work with python but I have never heard of POS.
20
u/im_jaanko Jul 12 '19
Point of sale
6
u/dakokonutboi Jul 12 '19
Oh thanks. And what is that?
13
u/PlOrAdmin Jul 13 '19 edited Jul 14 '19
Industry term for a cash register connected to a database for accounting and inventory purposes.
POS usually have a customer display, scale(with barcode reader), cash drawer, printer and non-cash payment function(pinpad).
2
5
u/SausageMcStudmuffin Jul 12 '19
Point of Sale (aka a cash register)
1
u/dakokonutboi Jul 12 '19
Oh. Thanks, now I know.
1
u/SausageMcStudmuffin Jul 12 '19
1
u/dakokonutboi Jul 12 '19
I am now going to use this every time I teach something to a friend. I will very soon have no friends. Thanks
1
u/srilyk Jul 16 '19
If they don't love GI Joe and references to 90's cartoons, you don't want them as friends anyway.
30
u/humanitysucks999 Jul 12 '19
Having worked in a restaurant-ish environment, make sure you look into putting some anti stealing measures.
There's a very common thing where you take the order, customer pays cash, you give back the change, prepare the food, then go back and delete the still "pending" order on the machine and pocket the money.
→ More replies (7)13
11
11
u/jantari Jul 12 '19
This is very cool although I must admit I'm sad you passed on this beautiful program
1
9
7
u/p1nkpineapple Jul 12 '19
This is very cool! What were your motivations for making it? How expensive are off the shelf POS systems?
28
u/poditoo Jul 12 '19
https://www.ncr.com/silver/shop/ncr-silver-one-essentials
They are usually sold on subscription basis. Here it seems cheaper because OP's girlfriend is paying her annual maintenance contract with sex which NCR doesn't accept as a currency yet.
Also a smart move from OP to use vendor lock-in tactics on his own couple. 😄
5
u/ksye Jul 12 '19
What a POS software.
1
u/Asticoco Jul 12 '19
A POS Software is a "Point Of Sale". This is a cash register but on a pc. It's being used by restaurants, grocery store, supermarket...
3
2
Jul 12 '19
It's pretty cool. I see one big problem tho - it's support. And support after you guys will break up ...
9
8
u/SmellsLikeHerpesToMe Jul 12 '19
I assume with this much knowledge you know how to use Git? What I would suggest is setting up a a free GitLab account. To implement CI/CD (Automated deployments / updates to your software, development vs master branches), GitLab will teach you everything you need to know, and it's all free.
If you really want to dive deep, I'd look into getting your Python application containerized (Docker), as this makes CI/CD extremely simple.
4
1
u/LiberateMainSt Jul 12 '19
I've never worked food service, so I can't compare to any other restaurant POS system. But is it normal that the button to remove an item from an order displays the price of the item? It would've never occurred to me that I press that button to remove something. Might've guessed it lets me give discounts, maybe, by changing the price. Expected some kind of big red X for item removal though.
3
1
u/Buckel_Flips Jul 15 '19
Tried something like that in a while ago, but way worse.
I would like to take a look at your Code? https://github.com/Mettcon
3
u/Bargh_Joul Jul 12 '19
Why not just use POS from Odoo ERP and mod it yourself? 🤔
5
3
u/2160p_REMUX Jul 12 '19
Looks nice man.
I have messed around with tkinter a few times, thinking about all the code behind this is hurting my brain. Lol
3
u/Yoghurt42 Jul 12 '19
depending on where you live, I recommend keeping track of which version of your software was deployed at which point in time, what changes you made and so on.
if there's ever an argument with the national IRS equivalent and they claim that your system is programmed to withhold a certain amount of transactions, it increases your chances if you can provide some paperwork
1
u/apono4life Jul 13 '19
Wrote an app in WXPython for work, to do all of our billing processes. We have had to do this for auditing purposes.
2
u/n1___ Jul 12 '19
One question one advice.
How long did it take to code it?
Dont use too much colors or "hard" contrasts. It's completely okay to have red button (something like #dc1616) with white text on it. There are some tools around the net where you can mess around with colors and they give you feedback on readability. Just spend some time with them it's absolutely worth it. Also try to keep some color logic in buttons.
Also feel free to write a blog post with stuggles/chalenges you have been thru. I guess you have something to say.
2
2
u/thedjotaku Python 3.7 Jul 12 '19
dude (or dudette), VERY VERY COOL! She's lucky to have you in her life.
1
2
u/milman27 Jul 12 '19
I thought POS in this case stood for "Piece of Sh*t". Thought to myself "what a weird way to describe your own code"
2
u/FreeiPhones Jul 12 '19
A couple extra features if you plan on updating the system
under options for food, you should put
"no", "add", "sub", "extra", "only"
next to your list of condiments
I used to work in a restaurant and these options were critical for my job to go smoothly
2
u/Dan4t Jul 12 '19
An integrated piece of shit system? I'm guessing there is another meaning for POS, but I don't know what it is.
4
u/Yoghurt42 Jul 12 '19 edited Jul 28 '19
Point Of Sale. But there's a reason everybody just uses the abbreviation, because most POS systems are a POS
1
1
1
1
u/KamikazeHamster Jul 12 '19
Don't be so hard on yourself. If you write some unit tests, you could probably raise the quality to something decent.
1
u/wltechrepair Jul 12 '19
Cheers!! this is awesome! a simplified POS system. You have no idea how helpful this can become for a business. :)
1
u/rjzak Jul 12 '19
Awesome code! Maybe put it on Github? These screenshots and the public code would be a great addition for your resume, and something to show during an interview.
1
u/LieberLois Jul 12 '19
Is there any way you could share this code with all the other beginners here?
Amazing work!
1
u/fluxxis Jul 12 '19
Did you have to deal with any legal restrictions in your country, like proof that data cannot be easily altered or APIs for the tax office?
1
1
1
1
1
1
1
1
1
u/polandtown Jul 12 '19
And here I am, cleaning datasets w/pandas....
Bravo dude, I'm happy that atleast I'm in the audience if greatness.
1
1
1
u/salesvu1983 Oct 10 '19
Very impressive. I also write a Article on POS System and i covered various POS according Industries. https://medium.com/@manish.kumar_65083/the-different-types-of-pos-point-of-sale-terminal-86d3dcb2f9e3
1
0
u/jtosbornexxx Jul 12 '19
This is badass!!
I’m actually doing something very similar with node js right now.
I would love to see:
how your using the raspberry pi.
how you are opening the register (I’m using an epson printer with an rj12 connection to the register that opens on print)
how you are formatting the print jobs.
Any info is much appreciated!!!!
3
u/kl31 Jul 12 '19
i'm using my rpi as a computer? idk how else one would use it. as a paperweight maybe?
if you're using an epson interface it's super easy. what you need is a mosfet/relay connected to a 12v dc power supply on VIN side, with VOUT connected to the solenoid (disassembly of cash drawer required). then connect the signal wires to gpio.
you need to refer to printer datasheet for print job formatting. You usually just write some escaped control char before the actual text you wnat to print out. I used adafruit thermal printer and took their thermal printing library (in C++) ported it to C and built the python extension.
2
u/jtosbornexxx Jul 12 '19
Haha just curious how the pi fit in the system is all. I’m building mine as a progressive web app.
Was thinking of using the Pi to control the register but eventually decided the printer is built to do this already.
The register I’m using has an rj12 connection that is shared with the printer. The printer sends a signal to the register each time it prints to open.
I’ll need to do some research on interacting with the printer more. Thanks a bunch!
0
0
Jul 12 '19
[deleted]
17
u/kl31 Jul 12 '19
it doesn't do credit card. In the earlier stages of development it was a huge goal. But on the advice of several restaurant owners, I decided against it. All our customers are willing to pay cash and that's a few percent that we don't have to give to someone else.
4
u/MisterSnuggles Jul 12 '19
Here in Canada it's very common to have credit/debit cards processed by a separate terminal. POS systems that actually handle credit/debit directly are fairly rare. To give a little context, well over 50% of payments in Canada happen via a card of some sort, and Chip & PIN and NFC are standard for how those cards are used. Swipe & Sign is virtually non-existent, except as a fallback when the chip doesn't work, and Chip & Sign was never a thing here.
The payment processor provides a credit/debit terminal, all transactions get entered in the POS system and the actual credit card payment happens via the terminal with the merchant copy of the receipt ending up in the cash drawer. Some terminals, especially at restaurants, have integration with the POS system, so the server can punch an order number into it and it will pull the amount, and presumably report back to the POS system that it's been paid. A lot of these terminals are wireless (over a cellular network), so servers can bring them to your table, pizza delivery drivers can bring them to your door, food trucks have them, etc. Even the Apple Store has some kind of third-party payment terminal integrated with the iPod Touches that they use for their POS system - they flip it over so you can insert your card and do your thing.
If you ever want to add credit cards, look at adding integration to a third-party payment terminal instead. You'll save yourself a lot of headaches when it comes to security and PCI compliance.
3
1
u/PlOrAdmin Jul 12 '19
+1
Also, it's common now up here if a pinpad is tap-pay(not in US AFAIK) then it will most likely accept Android/Apple pay.
ofc, this is vendor specific if they want this availability.
Just commenting on tap pinpads are capable of these up and coming pay methods.
1
u/MisterSnuggles Jul 12 '19
Yup. Most of my Apple Pay transactions happen at merchants that don't advertise it.
I remember one even said "Oh, Apple Pay doesn't work" just as the pin pad said "Approved".
13
u/DrMaxwellEdison Jul 12 '19
I think that's fair. POS systems with improper security can be a goldmine for credit card thieves: sidestepping it by not processing cards on that system is a good choice, I would say.
I know several local spots that will do all cash sales on the POS and then turn to a small Stripe device for cards and NFC payments. Better to leave card processing to those folks.
1
u/pres82 Jul 12 '19
Yeah you don’t want to get into pci. Are you using sqlite? How are you tracking sales month over month? Would be dope.
2
u/kl31 Jul 12 '19
Yeah you don’t want to get into pci. Are you using sqlite? How are you tracking sales month over month? Would be dope.
google sheets. simple and gets the job done.
2
u/quotemycode Jul 12 '19
yeesh, google sheets? no way is that performant, and aren't you reliant on an internet connection to be able to place orders? I'd strongly recommend you use something like rabbitmq or just a plain sqlite connection.
As far as PCI is concerned, I have written many interfaces with different gateways, Authorize.net being the standard (others are authorize compatible). A lot of payment gateways have their "virtual terminal" where with a keyboard wedge you insert data directly into their secure payment form, bypassing the need for any PCI audit.
That said, it's easy enough to just get a terminal thats hooked into a network or land line and processes the payments offline, you'd just need to do a bit of programming on the terminal to send results (approved, denied, etc) or manually enter the approval codes.
1
0
Jul 12 '19
[deleted]
28
u/kl31 Jul 12 '19
HAHA I definitely know where you're coming from. There's a few dents in my refrigerator that proves it. Thank you for the encouragement <3
0
Jul 12 '19
[deleted]
4
u/kl31 Jul 12 '19
I'd also make the scroll bars a little wider. You've got such nice big buttons everywhere else that it's odd those are such small targets. Maybe you even want to use pagination instead of scrolling?
previous version used pagination. I'm hoping to remove the need for a scrollbar entirely. we don't serve every item on the menu so having every single menu item displayed is unnecessary. there will be an option to hide the buttons for selecting items. Well not really hide just not instanced.
2
u/ivosaurus pip'ing it up Jul 12 '19
Sort the items in a MRU cache
2
u/kl31 Jul 12 '19
what?
1
u/ivosaurus pip'ing it up Jul 12 '19
Most Recently Used. So popular items are always at top / on default tab.
1
148
u/kl31 Jul 12 '19
if anyone is interested in serious code review please message me. I've only been programming for two years and any advice would be much appreciated. I'd really like to know how to better deploy software, how to manage software across multiple devices and configuring environments for development vs production.