Page 1 of 2
Point of sale system
Posted: Wed Dec 23, 2015 3:40 am
by Opaquer
Hey everyone! So, at my work, we've got a lot of stock, but don't even have a program to keep track of it (we still write receipts by hand, and write in the diary when we're low or out of stock!)
My boss would like me to make a point of sales system, though I'm not quite sure where exactly to start. What he's looking for is something that will keep track of current stock, let us write up an order for someone (let's say they buy 2 of product a and 3 of product b it'll automatically add it all up etc) and then update the stock. Perhaps at the end of the day there can be a print out for him for what's low on stock or if we run out of things. Lastly (for now), he'd like a way to manage all the stock that we have - so if there's a sale on product a and he changes the price, he can update it on his end and our screens will update too if that makes sense?
Also, if we can have it print customer's receipts with our logo and whatnot instead of us having to hand write it, that would be handy, but I don't know if livecode can do that sort of stuff (also our printer probably won't print things out quickly I'm guessing, so that's maybe an optional feature if we get a better printer)
Any advice would be appreciated, because as it stands, I'm not even sure where to start with this project

!
Thanks in advance!
Re: Point of sale system
Posted: Wed Dec 23, 2015 5:22 am
by dunbarx
Hi.
Hmmm. Er,
How far along are you with LC? What I mean is, can you make a little stack to solve any sort of little task that confronts you? I am not being flip. I work on several ongoing projects. But I make little stacks all the time that either solve a problem, or are adjuncts to things I am working on, most discarded after their usefulness has ended, I ask this to try to see if what you are considering is either too daunting, or better solved with some packaged solution. Much depends on what you reply.
In any event, if you are both capable and willing, you will start with one or two "modules", an inventory, an order system, whatever, and try to pre-plan so they can work together one day. You will need time, and lots of testing, and passion.
Craig Newman
Re: Point of sale system
Posted: Wed Dec 23, 2015 5:27 am
by Opaquer
dunbarx wrote:Hi.
Hmmm. Er,
How far along are you with LC? What I mean is, can you make a little stack to solve any sort of little task that confronts you? I am not being flip. I work on several ongoing projects. But I make little stacks all the time that either solve a problem, or adjuncts to things I am working on, most discarded after their usefulness has ended, I ask this to try to see if what you are considering is either too daunting, or better solved with some packaged solution. Much depends on what you reply.
In any event, if you are both capable and willing, you will start with one or two "modules", an inventory, an order system, whatever, and try to pre-plan so they can work together one day. You will need time, and lots of testing, and passion.
Craig Newman
Thanks Craig!
I've done quite a few things with LC before, but the issue is never something that needs to be updated live like this. Given enough time, I can make individual modules easily enough for inventory, or stock, but I don't know how to make the communicate between each other, or how to make it so that my boss has a "master" version that will let him put things on special or anything like that. No point spending days over the holiday season to get something working only to have it not be able to communicate with each other

.
I'm also happy to try something that's quite daunting - after all, that's the only way you'll learn something! Time and passion I've got, and I'm willing to put up with all the testing that needs doing

!
Re: Point of sale system
Posted: Wed Dec 23, 2015 6:16 am
by Simon
Hi Opaquer,
I'd write support AT livecode.com because they used to have a demo stack of an inventory system, with pix of the products and everything. Maybe support can release it to you.
At any rate it can be done in liveCode.
Simon
Re: Point of sale system
Posted: Wed Dec 23, 2015 8:01 am
by Opaquer
Simon wrote:Hi Opaquer,
I'd write support AT livecode.com because they used to have a demo stack of an inventory system, with pix of the products and everything. Maybe support can release it to you.
At any rate it can be done in liveCode.
Simon
Thanks Simon, I'll give that a try. Do you know if they had a live update system set up, or was it all just local data? Because I could definitely make something along the lines of the inventory system with local data

Re: Point of sale system
Posted: Wed Dec 23, 2015 8:31 am
by Simon
I think it was a local sqlite but not difficult to update it to a networked mysql.
Simon
Re: Point of sale system
Posted: Wed Dec 23, 2015 8:47 am
by Opaquer
Simon wrote:I think it was a local sqlite but not difficult to update it to a networked mysql.
Simon
Perfect! Is there any documentation that you know of that says how to do that? I've never touched mysql before, and have absolutely no idea how it works

. Is it reliable? For example, if the internet drops out, or if my boss accidentally closes the program, will it be able to reconnect or anything?
Re: Point of sale system
Posted: Wed Dec 23, 2015 3:54 pm
by dunbarx
Hi.
HC used to be able to send a message directly to another stack, using the "send to program" command.
LC uses sockets. I think that a bit of experimentation with that feature is going to be essential.
There are sample socket stacks. Anyone know where they are?
Craig
Re: Point of sale system
Posted: Wed Dec 23, 2015 4:36 pm
by FourthWorld
dunbarx wrote:There are sample socket stacks. Anyone know where they are?
Included in the installation - click the "Resources" button in the Toolbar, and under "Sample Projects" see "Internet Chat".
Also on the web, and personally I find the background info in this article a bit more helpful:
http://lessons.livecode.com/m/4071/l/12 ... ng-sockets
That said, direct socket communications are great for intranets or certain types of game or other specialized application servers, but I would caution against exposing a database directly to the Internet. Instead, the most common approach is to use a middleware between Apache and the DB, most commonly PHP but LiveCode, Perl, Python, Ruby, and others all work great in that role.
Re: Point of sale system
Posted: Wed Dec 23, 2015 10:47 pm
by Opaquer
So, with sockets, what happens if two people send a sale through at the same time? Will it pick up both of them, or just whichever got there first? And I've used sockets a bit, but when I used it last, when I closed the server side of the application and reopened it, it sometimes had issues connecting to the client, though this could have just been bad coding because it was my first time using sockets. Are they reliable though, because my boss is not computer savvy at all and I don't want him accidentally closing it and not realising

Re: Point of sale system
Posted: Sat Dec 26, 2015 7:18 am
by Opaquer
Hey all! So, I've been looking into it, and I did have a few questions - firstly is how do I get a MySQL database working? I can't tell if I'm just tired from the festivities from the past two days or if there's something more to it, but I can't for the life of me figure out how to make a new MySQL database
That's the main question I have for now about it

Re: Point of sale system
Posted: Thu Jan 07, 2016 11:25 pm
by MWCoastMedia
The database most likely needs to be created through the cPanel of your webhost using something like phpAdmin. Who is your host? Technically, it could be a local computer running WAMP or MAMP but probably easier and just as cheap to use an existing online host.
Without much initial LiveCode experience I was able to get a MySQL database connection going, all through the LiveCode.com tutorials and some forum searches. Know I'm in the process of reworking that connection through an API for security, as noted by a wise user here.
Re: Point of sale system
Posted: Fri Jan 22, 2016 7:02 pm
by Da_Elf
im using livecode for a POS as well. getting the cash drawer to kick is tricky and not perfect but it works. my database is a local mysql database
Re: Point of sale system
Posted: Fri Jan 22, 2016 8:58 pm
by Lagi Pittas
Hi Da Elf,
For anyone else trying to attach a cash draw to a POS system I have a bit of advice.
1. Don't use the totally USB based cashdraw kicker boxes - they change virtual com [port depending on the direction of the wind and if the SUN rises.
2. If your thinking of using the printer to do the "kicking" I hope you have better luck than me - try as I might on 3 different receipt printers it always printed a "receipt"
of 1 line - if anyone has a fix i'd be very appreciative
3. I use a box with an actual com port cable attached (they are windows terminals) never had a problem with losing the com port since.
here is the code if anyone is interested. From memory I think it wouldn't work properly unless I opened and closed the serial port everytime
-- For opening the Cash Draw
Code: Select all
--Initialisation in openstack
put "COM3:" into gCashDrawPort
-- set "com" port parameters
put "BAUD=9600 PARITY=N DATA=8 STOP=1" into gCashDrawSerial
===========================================================
Command OpenCashDraw
local lcData
OpenSerialPort
put "anything" into lcData
write lcData & CRLF to file gCashDrawPort
CloseSerialPort
play audioclip ID 1054 -- Kaching
end OpenCashDraw
Command OpenSerialPort
set the serialControlString to gCashDrawSerial
open file gCashDrawPort for binary update
end OpenSerialPort
command CloseSerialPort
close file gCashDrawPort
end CloseSerialPort
Regards Lagi
Re: Point of sale system
Posted: Mon Jan 25, 2016 1:11 am
by Da_Elf
my cash box was hooked up to a usb epson t20. in the end i had to print off a sliver of paper each time i wanted to kick the drawer. i never did have the sun rise properly or the right virgin to sacrifice in order to write the hex message that would kick the drawer