Jump to content

smallbizwiz

Recommended Posts

Overview

This statement of work (SOW) contains the functional and technical requirements for the task of tracking a shop’s Till in PrestaShop 1.5.4.1. 

Functional Background

This module is one of many that will be used to create a point-of-sale system with PrestaShop as a backbone.  This point-of-sale system will be used primarily in restaurants.  It is imperative that you think like someone at a restaurant when developing this module.  If you have never worked at a restaurant, eaten at a restaurant or have any concept what the front-of-the-house or back-of-the-house is in a restaurant, you might not want to develop this module.  We are focused on meeting the functional requirements; the technical requirement might not be as detailed as need to meet the overall needs of this SOW.

Requirements

There will be two new links on the Back Office Dashboard home page as a quick link “Till Management” on the home screen (i.e. not just the Quick Link drop down – the actual main page).  This functionality should configurable via Administration – Permissions and will primarily be access

·         Open Till.  This will simply send a short text print command “Open Till”.  NOTE: The thermal transfer printer automatically opens the cash register – this functionality is already complete

·         Till Management.  Upon clicking on Till Management, the user is present with the following options:

·         Set Daily Till.  This allows the user to enter a starting figure (i.e. amount of cash-on-hand).  After submitting, this is entered into the database as well as the user_id, time and other relevant tracking information

·         Reconcile Till.  This identical to the Set Daily Till, except it can be done at any time.  Additionally, there is a comment box that allows the user to enter why the reconciliation was performed

·         Close Till.  This calculates all orders that have been paid for with cash since the Set Daily Till was created

·         Till Activity.  This will show every time the Till was opened, by whom and a time stamp, and reason (e.g. Order, Till Reconciliation)

·         Print Sales.  This will be a link to the Stats – Stats - Sales and Orders page – nothing special, very simple

Delivery Mechanism

All solutions must be created as a module (or group of modules) that can be installed on PrestaShop 1.5.4.1.  The module(s) must be created on the contractor’s server, and then sent to Small Biz Wiz for installation and test on Small Biz Wiz’s installation of PrestaShop 1.5.4.1.

Link to comment
Share on other sites

I would love to have look, just to see how you implemented it all in to prestashop

I should have said; I'm only interested in giving it to owner-operators or retail solutions providers.

 

To answer your question, for everything expect physically opening the Till, the implementation was quite simple: create a class extending the module class as well as another that extends the ObjectModel class.  Create the appropriate database tables; use the new ObjectModel extension class to update/read the database.

 

Opening the Till took some digging, but here's the code.  The fundamental strategy was to find "something" that could easily print from the TPL file.  I have the thermal transfer printer set up so that it automatically opens the cash register drawer every time it prints.

 

function openTill(){
var str = 'OpenTill-'+{/literal}{$sessionVars.currentEmployeeID}{literal}+'-';
   var newwin = window.open('', 'printwin', 'left=100,top=100,width=400,height=400');
 
   newwin.document.write('<HTML>\n<HEAD>\n');
   newwin.document.write('<TITLE>Open Till</TITLE>\n');
   newwin.document.write('<script>\n');
   newwin.document.write('function chkstate(){\n');
   newwin.document.write('if(document.readyState=="complete"){\n');
   newwin.document.write('window.close()\n');
   newwin.document.write('}\n');
   newwin.document.write('else{\n');
   newwin.document.write('setTimeout("chkstate()",2000)\n');
   newwin.document.write('}\n');
   newwin.document.write('}\n');
   newwin.document.write('function print_win(){\n');
   newwin.document.write('window.print();\n');
   newwin.document.write('chkstate();\n');
   newwin.document.write('}\n');
   newwin.document.write('<\/script>\n');
   newwin.document.write('</HEAD>\n');
   newwin.document.write('<BODY onload="print_win()">\n');
   newwin.document.write(str);
   newwin.document.write('</BODY>\n');
   newwin.document.write('</HTML>\n');
   newwin.document.close();
}
</script>
 
//YOUR CODE HERE
 
<form action="someActionFile" method="post" onsubmit="openTill();">
      <input type="submit" value="Open Till 1" name="open-till" id="open-till">
</form>
 
 
Good luck!
Teo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...