Simple data entry form for supermarket style checkout system.

I have created a stock system for a customer. I have now added barcoded labels for the stock. So now we need a simple stock taking system. I have a barcode reader that takes the scanned barcode and enters the code into a field in the form followed by an “enter” key. You can also type in a bar code and press enter.

What I want to do is take the scanned barcode, or typed-in entry + enter key, and add the code to a list. The entries will be added to a table. But, I want the operation to be automatic so the user can scan as many items as required one after the other. It’s a bit like a supermarket checkout. A “process” button then processes the list of scanned codes with some SQL/PHP.

How do I create a form that works like this?

Hi,
1- Make Ajax Event (OnBlur) for your field that will catch the barcode.
2- In the (OnBlur) Select any data you need using sc_lookup, use $insert_sql to insert data into your table.
3- on the same area put the following code:
sc_ajax_javascript(‘LoadPOS’);
sc_set_focus(‘barcode’);
{barcode} = 0;
first line here is a javascript to refresh the frame if you use master/detail form, i will provide the code later, second line is to make the cursor focus automatically on the barcode field, third line is to reset the barcode field.
4- Go to ajax events (OnAfterUpdate) and put the following function calc();
5- go to php methods and create a function with the name calc and make your calculations here, for example quantity and discount and put the function in Ajax events for your fields.
6- go to javascript methods and create a function LoadPOS and put the following code: document.getElementById(‘nmsc_iframe_liga_form_pos_detail’).contentDocument.location.reload(true);

  • Note: inspect for the iframe to put your iframe id instead of “nmsc_iframe_liga_form_pos_detail”.

Done.

Thank you That’s exactly what i was looking for. I want to try it immediately. Giorgio