Point of sale system

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Point of sale system

Post by Opaquer » Wed Dec 23, 2015 3:40 am

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 :-P!

Thanks in advance!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Point of sale system

Post by dunbarx » Wed Dec 23, 2015 5:22 am

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

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Point of sale system

Post by Opaquer » Wed Dec 23, 2015 5:27 am

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 :P.

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 :P!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Point of sale system

Post by Simon » Wed Dec 23, 2015 6:16 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Point of sale system

Post by Opaquer » Wed Dec 23, 2015 8:01 am

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 :)

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Point of sale system

Post by Simon » Wed Dec 23, 2015 8:31 am

I think it was a local sqlite but not difficult to update it to a networked mysql.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Point of sale system

Post by Opaquer » Wed Dec 23, 2015 8:47 am

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 :P. 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?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Point of sale system

Post by dunbarx » Wed Dec 23, 2015 3:54 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Point of sale system

Post by FourthWorld » Wed Dec 23, 2015 4:36 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Point of sale system

Post by Opaquer » Wed Dec 23, 2015 10:47 pm

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 :P

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Point of sale system

Post by Opaquer » Sat Dec 26, 2015 7:18 am

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 :)

MWCoastMedia
Posts: 32
Joined: Fri Jan 16, 2015 5:31 pm

Re: Point of sale system

Post by MWCoastMedia » Thu Jan 07, 2016 11:25 pm

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.

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Point of sale system

Post by Da_Elf » Fri Jan 22, 2016 7:02 pm

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

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 366
Joined: Mon Jun 10, 2013 1:32 pm

Re: Point of sale system

Post by Lagi Pittas » Fri Jan 22, 2016 8:58 pm

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

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Point of sale system

Post by Da_Elf » Mon Jan 25, 2016 1:11 am

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

Post Reply