Merge pull request #10614 from andreubisquerra/9.0

Update TakePOS in Dolibarr 9
This commit is contained in:
Laurent Destailleur
2019-02-15 15:21:35 +01:00
committed by GitHub
8 changed files with 563 additions and 222 deletions

View File

@@ -32,7 +32,7 @@ DeleteArticle=Click to remove this article
FilterRefOrLabelOrBC=Search (Ref/Label)
UserNeedPermissionToEditStockToUsePos=You ask to decrease stock on invoice creation, so user that uses POS needs to have permission to edit stock.
DolibarrReceiptPrinter=Dolibarr Receipt Printer
PointOfSale=Point of sales
PointOfSale=Point of Sale
PointOfSaleShort=POS
CloseBill=Close Bill
Floors=Floors
@@ -42,8 +42,16 @@ Place=Place
TakeposConnectorNecesary='TakePOS Connector' required
OrderPrinters=Order printers
SearchProduct=Search product
Receipt=Receipt
Header=Header
Footer=Footer
AmountAtEndOfPeriod=Amount at end of period (day, month or year)
TheoricalAmount=Theorical amount
RealAmount=Real amount
CashFenceDone=Cash fence done for the period
NbOfInvoices=Nb of invoices
NbOfInvoices=Nb of invoices
Paymentnumpad=Payment Num Pad
Numberspad=Numbers Pad
BillsCoinsPad=Bills and Coins Pad
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
TakeposNeedsCategories=TakePOS needs product categories to work

View File

@@ -48,7 +48,6 @@ if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward
/*
* Actions
*/
print $action;
if ($action=="SavePrinter1"){
$printedcategories=";";
if (is_array($printer1)) foreach ($printer1 as $cat){

View File

@@ -25,13 +25,14 @@
require '../../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
// If socid provided by ajax company selector
if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
{
$_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
$_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
$_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
$_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
$_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
$_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
}
// Security check
@@ -42,25 +43,28 @@ $langs->loadLangs(array("admin", "cashdesk"));
/*
* Actions
*/
if (GETPOST('action','alpha') == 'set')
if (GETPOST('action', 'alpha') == 'set')
{
$db->begin();
if (GETPOST('socid','int') < 0) $_POST["socid"]='';
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
$res = dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",(GETPOST('socid','int') > 0 ? GETPOST('socid','int') : ''),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",(GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') : ''),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",(GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') : ''),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",(GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') : ''),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",(GETPOST('CASHDESK_ID_WAREHOUSE','alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE','alpha') : ''),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",GETPOST('CASHDESK_NO_DECREASE_STOCK','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOSCONNECTOR", GETPOST('TAKEPOSCONNECTOR','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db,"TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS','alpha'),'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE", (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB", (GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE", (GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", GETPOST('CASHDESK_NO_DECREASE_STOCK', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOSCONNECTOR", GETPOST('TAKEPOSCONNECTOR', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity);
dol_syslog("admin/cashdesk: level ".GETPOST('level','alpha'));
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
if (! $res > 0) $error++;
@@ -83,10 +87,10 @@ if (GETPOST('action','alpha') == 'set')
$form=new Form($db);
$formproduct=new FormProduct($db);
llxHeader('',$langs->trans("CashDeskSetup"));
llxHeader('', $langs->trans("CashDeskSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)',$linkback,'title_setup');
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
print '<br>';
@@ -95,55 +99,101 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
if (! empty($conf->service->enabled))
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td>';
print $langs->trans("CashdeskShowServices");
print '<td colspan="2">';
print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
print "</td></tr>\n";
// Use Takepos printing
print '<tr class="oddeven"><td>';
print $langs->trans("DolibarrReceiptPrinter").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">';
print $form->selectyesno("TAKEPOSCONNECTOR",$conf->global->TAKEPOSCONNECTOR,1);
print "</td></tr>\n";
if ($conf->global->TAKEPOSCONNECTOR){
print '<tr class="oddeven value"><td>';
print $langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">';
print '<input type="text" size="20" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
print '</td></tr>';
}
// Bar Restaurant mode
print '<tr class="oddeven"><td>';
print 'Bar Restaurant';
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_BAR_RESTAURANT",$conf->global->TAKEPOS_BAR_RESTAURANT,1);
print "</td></tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT and $conf->global->TAKEPOSCONNECTOR){
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_ORDER_PRINTERS",$conf->global->TAKEPOS_ORDER_PRINTERS,1);
print '</td></tr>';
}
print '</table>';
print '<br>';
}
// Use Takepos printing
print '<tr class="oddeven"><td>';
print $langs->trans("DolibarrReceiptPrinter").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">';
print $form->selectyesno("TAKEPOSCONNECTOR", $conf->global->TAKEPOSCONNECTOR, 1);
print "</td></tr>\n";
if ($conf->global->TAKEPOSCONNECTOR){
print '<tr class="oddeven value"><td>';
print $langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">';
print '<input type="text" size="20" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
print '</td></tr>';
}
// Bar Restaurant mode
print '<tr class="oddeven"><td>';
print 'Bar Restaurant';
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_BAR_RESTAURANT", $conf->global->TAKEPOS_BAR_RESTAURANT, 1);
print "</td></tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
print '</td></tr>';
}
// Payment numpad
print '<tr class="oddeven"><td>';
print $langs->trans("Paymentnumpad");
print '<td colspan="2">';
$array=array(0=>$langs->trans("Numberspad"), 1=>$langs->trans("BillsCoinsPad"));
print $form->selectarray('TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD)?'0':$conf->global->TAKEPOS_NUMPAD), 0);
print "</td></tr>\n";
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
print '</td><td>';
$variablename='TAKEPOS_HEADER';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
}
else
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
}
print "</td></tr>\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
print '</td><td>';
$variablename='TAKEPOS_FOOTER';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
}
else
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
}
print "</td></tr>\n";
print '</table>';
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@@ -159,19 +209,19 @@ if (! empty($conf->banque->enabled))
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
print '<td colspan="2">';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",1);
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH, 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
print '<td colspan="2">';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",1);
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE, 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
print '<td colspan="2">';
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",1);
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB, 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", 1);
print '</td></tr>';
}
@@ -181,12 +231,12 @@ if (! empty($conf->stock->enabled))
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
print '<td colspan="2">';
if (empty($conf->productbatch->enabled)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK', $conf->global->CASHDESK_NO_DECREASE_STOCK, 1);
}
else
{
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", 1, 'chaine', 0, '', $conf->entity);
}
print $langs->trans("Yes").'<br>';
print '<span class="opacitymedium">'.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').'</span>';
@@ -200,7 +250,7 @@ if (! empty($conf->stock->enabled))
print '<td colspan="2">';
if (! $disabled)
{
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'CASHDESK_ID_WAREHOUSE','',1,$disabled);
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE, 'CASHDESK_ID_WAREHOUSE', '', 1, $disabled);
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">('.$langs->trans("Create").')</a>';
}
else
@@ -223,14 +273,14 @@ print '<br><br>';
// Marketplace
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td colspan="2">TakePOS Marketplace</td>';
print '<td colspan="2">'.$langs->trans("WebSiteDesc").'</td>';
print '<td>'.$langs->trans("URL").'</td>';
print '</tr>';
print "<tr class=\"oddeven\">\n";
$url='https://www.dolistore.com/en/modules/980-TakePOS-7-mobile.html';
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="../img/marketplace/takeposmobile.jpg"></a></td>';
print '<td>TakePOS for mobile devices</td>';
$url='https://www.dolistore.com/45-pos';
print '<td class="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
print '<td>'.$langs->trans("DolistorePosCategory").'</td>';
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
print '</tr>';
@@ -246,7 +296,7 @@ print '</tr>';
print "<tr class=\"oddeven\">\n";
$url='http://www.takepos.com';
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="../img/takepos.png"></a></td>';
print '<td class="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="../img/takepos.png"></a></td>';
print '<td>TakePOS original developers</td>';
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
print '</tr>';

View File

@@ -1,22 +1,9 @@
html,body {
padding:0;
box-sizing: border-box;
padding:3px;
margin:0;
height:100%;
}
body {
width:100%;
}
.row {
width:100%;
height:50%;
}
.row div {
width:33%;
height:100%;
float:left;
width:100%;
}
button.calcbutton {
@@ -27,10 +14,11 @@ button.calcbutton {
cursor: pointer;
vertical-align: middle;
text-align: center;
font-size:180%;
overflow: visible; /* removes extra width in IE */
width:24%;
height:24%;
font-weight: bold;
color: #555555;
}
button.calcbutton2 {
@@ -41,10 +29,11 @@ button.calcbutton2 {
cursor: pointer;
vertical-align: middle;
text-align: center;
font-size:120%;
overflow: visible; /* removes extra width in IE */
width:24%;
height:24%;
font-weight: bold;
color: #555555;
}
button.calcbutton3 {
@@ -59,7 +48,6 @@ button.calcbutton3 {
overflow: visible; /* removes extra width in IE */
width:12%;
height:24%;
}
button.actionbutton {
@@ -70,35 +58,42 @@ button.actionbutton {
cursor: pointer;
vertical-align: middle;
text-align: center;
font-size:100%;
overflow: visible; /* removes extra width in IE */
width:32%;
height:32%;
width:33%;
height:33%;
}
div.wrapper{
float:left; /* important */
position:relative; /* important(so we can absolutely position the description div */
width:21.5%;
height:23%;
margin:1%;
width:25%;
height:25%;
margin:0;
padding:1px;
border: 0.1em solid;
box-shadow: 3px 3px 2px #888;
text-align: center;
box-sizing: border-box;
background-color:#f0eeee;
}
div.wrapper2{
float:left; /* important */
position:relative; /* important(so we can absolutely position the description div */
width:10.2%;
height:23%;
margin-top:0.5%;
margin-bottom:0.5%;
margin-left:0.5%;
margin-right:0.5%;
width:12.5%;
height:25%;
margin:0;
padding:1px;
border: 0.1em solid;
box-shadow: 3px 3px 2px #888;
box-shadow: 2px 2px 1px #888;
text-align: center;
box-sizing: border-box;
background-color:#f0eeee;
}
button:active{
background:black;
color: white;
}
div.description{
@@ -106,10 +101,9 @@ div.description{
bottom:0px; /* position will be on bottom */
left:0px;
width:100%;
/* styling bellow */
/* styling below */
background-color:black;
font-family: 'tahoma';
font-size:100%;
color:white;
opacity:0.8; /* transparency */
filter:alpha(opacity=80); /* IE transparency */
@@ -122,8 +116,126 @@ div.description{
}
}
.container{
width: 100%;
height: 100%;
margin: 0 auto;
overflow: visible;
box-sizing: border-box;
}
.row1{
margin: 0 auto;
width: 100%;
height: 34%;
}
.row2{
margin: 0 auto;
width: 100%;
height: 66%;
}
.div1{
height:100%;
width: 34%;
float: left;
text-align: center;
box-sizing: border-box;
overflow: auto;
background-color:white;
}
.div2{
height: 100%;
width: 33%;
font-size: 0;
float: left;
padding-left: 10px;
box-sizing: border-box;
}
.div3{
height: 100%;
width: 33%;
float: left;
box-sizing: border-box;
}
.div4{
height: 100%;
width: 34%;
float: left;
box-sizing: border-box;
font-size: 6px;
padding:3px;
}
.div5{
height: 100%;
width: 66%;
float: left;
box-sizing: border-box;
font-size: 6px;
padding:10px;
}
p.description_content{
padding:10px;
margin:0px;
}
@media screen and (min-width: 892px) {
.calcbutton{
font-size: 18px;
}
.calcbutton2{
font-size: 14px;
}
.actionbutton{
font-size: 13px;
}
div.description{
font-size: 15px;
}
.invoice{
font-size: 14px;
}
}
@media (max-width: 891px) and (min-width: 386px) {
.calcbutton{
font-size: 12px;
}
.calcbutton2{
font-size: 9px;
}
.actionbutton{
font-size: 12px;
}
div.description{
font-size: 13px;
}
.invoice{
font-size: 12px;
}
}
@media screen and (max-width: 385px){
.calcbutton{
font-size: 8px;
}
.calcbutton2{
font-size: 7px;
}
.actionbutton{
font-size: 10px;
}
div.description{
font-size: 11px;
}
.invoice{
font-size: 10px;
}
}

View File

@@ -189,7 +189,7 @@ if ($action=="order" and $placeid!=0){
?>
<style>
.selected {
color: red;
font-weight: bold;
}
.order {
color: limegreen;
@@ -198,6 +198,7 @@ if ($action=="order" and $placeid!=0){
<script language="javascript">
var selectedline=0;
var selectedtext="";
var placeid=<?php echo $placeid;?>;
$(document).ready(function(){
$('table tbody tr').click(function(){
$('table tbody tr').removeClass("selected");
@@ -224,11 +225,36 @@ if ($action=="order" and $order_receipt_printer2!=""){
});
<?php
}
if ($action=="search"){
?>
$('#search').focus();
<?php
if ($action == "search") {
?>
$('#search').focus();
<?php
}
?>
});
$(document).ready(function(){
$('table tbody tr').click(function(){
$('table tbody tr').removeClass("selected");
$(this).addClass("selected");
if (selectedline==this.id) return; // If is already selected
else selectedline=this.id;
selectedtext=$('#'+selectedline).find("td:first").html();
});
<?php
if ($action == "temp" and $ticket_printer1 != "") {
?>
$.ajax({
type: "POST",
url: 'http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
data: '<?php
print $header_soc . $header_ticket . $body_ticket . $ticket_printer1 . $ticket_total . $footer_ticket; ?>'
});
<?php
}
?>
});
@@ -249,7 +275,7 @@ function TakeposPrinting(id){
}
</script>
<?php
print '<div class="div-table-responsive-no-min">';
print '<div class="div-table-responsive-no-min invoice">';
print '<table id="tablelines" class="noborder noshadow" width="100%">';
print '<tr class="liste_titre nodrag nodrop">';
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
@@ -261,7 +287,7 @@ if ($placeid>0) foreach ($invoice->lines as $line)
print '<tr class="drag drop oddeven';
if ($line->special_code=="3") print ' order';
print '" id="'.$line->rowid.'">';
print '<td>'.$line->product_label.$line->desc.'</td>';
print '<td align="left">'.$line->product_label.$line->desc.'</td>';
print '<td align="right">'.$line->qty.'</td>';
print '<td align="right">'.price($line->total_ttc).'</td>';
print '</tr>';
@@ -271,14 +297,14 @@ print '<p style="font-size:120%;" align="right"><b>'.$langs->trans('TotalTTC');
if($conf->global->TAKEPOS_BAR_RESTAURANT) print " ".$langs->trans('Place')." ".$place;
print ': '.price($invoice->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'&nbsp;</b></p>';
//if ($invoice->socid != $conf->global->CASHDESK_ID_THIRDPARTY){
if ($invoice->socid != $conf->global->CASHDESK_ID_THIRDPARTY){
$soc = new Societe($db);
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
else $soc->fetch($conf->global->CASHDESK_ID_THIRDPARTY);
print '<p style="font-size:120%;" align="right">';
print $langs->trans("Customer").': '.$soc->name;
print '</p>';
//}
}
if ($action=="valid"){
print '<p style="font-size:120%;" align="center"><b>'.$invoice->facnumber." ".$langs->trans('BillShortStatusValidated').'</b></p>';
if ($conf->global->TAKEPOSCONNECTOR) print '<center><button type="button" onclick="TakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button><center>';

View File

@@ -53,14 +53,20 @@ $langs->loadLangs(array("main", "bills", "cashdesk"));
?>
<link rel="stylesheet" href="css/pos.css">
<script>
var received=0;
<?php
if ($conf->global->TAKEPOS_NUMPAD==0) print "var received='';";
else print "var received=0;";
?>
function addreceived(price)
{
received+=parseFloat(price);
$('#change1').html(received.toFixed(2));
if (received><?php echo $invoice->total_ttc;?>)
<?php
if ($conf->global->TAKEPOS_NUMPAD==0) print 'received+=String(price);';
else print 'received+=parseFloat(price);';
?>
$('#change1').html(parseFloat(received).toFixed(2));
if (parseFloat(received)><?php echo $invoice->total_ttc;?>)
{
var change=parseFloat(received-<?php echo $invoice->total_ttc;?>);
var change=parseFloat(parseFloat(received)-<?php echo $invoice->total_ttc;?>);
$('#change2').html(change.toFixed(2));
}
}
@@ -98,21 +104,24 @@ $langs->loadLangs(array("main", "bills", "cashdesk"));
</div>
<div style="position:absolute; top:40%; left:5%; height:55%; width:91%;">
<button type="button" class="calcbutton" onclick="addreceived(10);">10</button>
<button type="button" class="calcbutton" onclick="addreceived(20);">20</button>
<button type="button" class="calcbutton" onclick="addreceived(50);">50</button>
<?php
$numpad=$conf->global->TAKEPOS_NUMPAD;
?>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "7"; else print "10";?>);"><?php if ($numpad==0) print "7"; else print "10";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "8"; else print "20";?>);"><?php if ($numpad==0) print "8"; else print "20";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "9"; else print "50";?>);"><?php if ($numpad==0) print "9"; else print "50";?></button>
<button type="button" <?php if ($placeid==0) echo "disabled";?> class="calcbutton2" onclick="Validate('cash');"><?php echo $langs->trans("Cash"); ?></button>
<button type="button" class="calcbutton" onclick="addreceived(1);">1</button>
<button type="button" class="calcbutton" onclick="addreceived(2);">2</button>
<button type="button" class="calcbutton" onclick="addreceived(5);">5</button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "4"; else print "1";?>);"><?php if ($numpad==0) print "4"; else print "1";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "5"; else print "2";?>);"><?php if ($numpad==0) print "5"; else print "2";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "6"; else print "5";?>);"><?php if ($numpad==0) print "6"; else print "5";?></button>
<button type="button" <?php if ($placeid==0) echo "disabled";?> class="calcbutton2" onclick="Validate('card');"><?php echo $langs->trans("PaymentTypeCB"); ?></button>
<button type="button" class="calcbutton" onclick="addreceived(0.10);">0.10</button>
<button type="button" class="calcbutton" onclick="addreceived(0.20);">0.20</button>
<button type="button" class="calcbutton" onclick="addreceived(0.50);">0.50</button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "1"; else print "0.10";?>);"><?php if ($numpad==0) print "1"; else print "0.10";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "2"; else print "0.20";?>);"><?php if ($numpad==0) print "2"; else print "0.20";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "3"; else print "0.50";?>);"><?php if ($numpad==0) print "3"; else print "0.50";?></button>
<button type="button" <?php if ($placeid==0) echo "disabled";?> class="calcbutton2" onclick="Validate('cheque');"><?php echo $langs->trans("Cheque"); ?></button>
<button type="button" class="calcbutton" onclick="addreceived(0.01);">0.01</button>
<button type="button" class="calcbutton" onclick="addreceived(0.02);">0.02</button>
<button type="button" class="calcbutton" onclick="addreceived(0.05);">0.05</button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "0"; else print "0.01";?>);"><?php if ($numpad==0) print "0"; else print "0.01";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "'000'"; else print "0.02";?>);"><?php if ($numpad==0) print "000"; else print "0.02";?></button>
<button type="button" class="calcbutton" onclick="addreceived(<?php if ($numpad==0) print "'.'"; else print "0.05";?>);"><?php if ($numpad==0) print "."; else print "0.05";?></button>
<button type="button" class="calcbutton3" onclick="reset();"><span style='font-size: 150%;'>C</span></button>
<button type="button" class="calcbutton3" onclick="parent.$.colorbox.close();"><span id="printtext"><?php echo $langs->trans("GoBack"); ?></span></button>
</div>

View File

@@ -46,12 +46,19 @@ $object->fetch($facid);
<body>
<center>
<font size="4">
<?php echo $mysoc->name; ?>
<?php echo '<b>'.$mysoc->name.'</b>';?>
</font>
</center>
<br>
<p align="left">
<?php print dol_nl2br(dol_format_address($mysoc)); ?>
<?php
$substitutionarray=getCommonSubstitutionArray($langs);
if (! empty($conf->global->TAKEPOS_HEADER))
{
$newfreetext=make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
echo $newfreetext;
}
?>
</p>
<p align="right">
<?php
@@ -62,11 +69,12 @@ print $object->ref;
</p>
<br>
<table width="100%">
<table width="100%" style="border-top-style: double;">
<thead>
<tr>
<th align="center"><?php print $langs->trans("Label"); ?></th>
<th align="right"><?php print $langs->trans("Qty"); ?></th>
<th align="right"><?php print $langs->trans("Price"); ?></th>
<th align="right"><?php print $langs->trans("TotalTTC"); ?></th>
</tr>
</thead>
@@ -78,6 +86,7 @@ print $object->ref;
<tr>
<td><?php echo $line->product_label;?></td>
<td align="right"><?php echo $line->qty;?></td>
<td align="right"><?php echo $line->total_ttc/$line->qty;?></td>
<td align="right"><?php echo price($line->total_ttc);?></td>
</tr>
<?php
@@ -98,6 +107,18 @@ print $object->ref;
<th align="right"><?php echo ''.$langs->trans("TotalTTC").'</th><td align="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
</tr>
</table>
<div style="border-top-style: double;">
<br>
<br>
<br>
<?php
$substitutionarray=getCommonSubstitutionArray($langs);
if (! empty($conf->global->TAKEPOS_FOOTER))
{
$newfreetext=make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
echo $newfreetext;
}
?>
<script type="text/javascript">
window.print();

View File

@@ -31,6 +31,8 @@ require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$place = GETPOST('place','int');
if ($place=="") $place="0";
@@ -46,6 +48,10 @@ $langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter
// Title
$title='TakePOS - Dolibarr '.DOL_VERSION;
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title='TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
$head='<meta name="apple-mobile-web-app-title" content="TakePOS"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
?>
@@ -57,11 +63,28 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
<?php
$categorie = new Categorie($db);
$categories = $categorie->get_full_arbo('product');
$maincategories = array_filter($categories, function ($item) {
if (($item['level']==1) !== false) {
return true;
}
return false;
});
$subcategories = array_filter($categories, function ($item) {
if (($item['level']!=1) !== false) {
return true;
}
return false;
});
?>
var categories = <?php echo json_encode($categories); ?>;
var subcategories = <?php echo json_encode($subcategories); ?>;
var currentcat;
var pageproducts=0;
var pagecategories=0;
var subcategories = <?php echo json_encode($subcategories); ?>;
var place="<?php echo $place;?>";
var editaction="qty";
var editnumber="";
@@ -76,7 +99,7 @@ function PrintCategories(first){
function MoreCategories(moreorless){
if (moreorless=="more"){
$('#catimg15').animate({opacity: '0.5'}, 100);
$('#catimg15').animate({opacity: '0.5'}, 1);
$('#catimg15').animate({opacity: '1'}, 100);
pagecategories=pagecategories+1;
}
@@ -102,35 +125,55 @@ function MoreCategories(moreorless){
}
}
function LoadProducts(position){
$('#catimg'+position).animate({opacity: '0.5'}, 100);
function LoadProducts(position, issubcat=false){
$('#catimg'+position).animate({opacity: '0.5'}, 1);
$('#catimg'+position).animate({opacity: '1'}, 100);
currentcat=$('#catdiv'+position).data('rowid');
if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid');
else currentcat=$('#catdiv'+position).data('rowid');
if (currentcat=="") return;
pageproducts=0;
ishow=0; //product to show counter
jQuery.each(subcategories, function(i, val) {
if (currentcat==val.fk_parent){
$("#prodesc"+ishow).text(val.label);
$("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid);
$("#prodiv"+ishow).data("rowid",val.rowid);
$("#prodiv"+ishow).data("iscat",1);
ishow++;
}
});
idata=0; //product data counter
$.getJSON('./ajax.php?action=getProducts&category='+currentcat, function(data) {
for (i = 0; i < 30; i++) {
if (typeof (data[i]) == "undefined"){
$("#prodesc"+i).text("");
$("#proimg"+i).attr("src","");
$("#prodiv"+i).data("rowid","");
continue;
while (idata < 30 && ishow < 30) {
if (typeof (data[idata]) == "undefined") {
$("#prodesc"+ishow).text("");
$("#proimg"+ishow).attr("src","");
$("#prodiv"+ishow).data("rowid","");
ishow++; //Next product to show after print data product
}
$("#prodesc"+i).text(data[parseInt(i)]['label']);
$("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['id']);
$("#prodiv"+i).data("rowid",data[i]['id']);
else if ((data[idata]['status']) == "1") {
//Only show products with status=1 (for sell)
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
$("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']);
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
$("#prodiv"+ishow).data("iscat",0);
ishow++; //Next product to show after print data product
}
idata++; //Next data everytime
}
});
}
function MoreProducts(moreorless){
if (moreorless=="more"){
$('#proimg31').animate({opacity: '0.5'}, 100);
$('#proimg31').animate({opacity: '0.5'}, 1);
$('#proimg31').animate({opacity: '1'}, 100);
pageproducts=pageproducts+1;
}
if (moreorless=="less"){
$('#proimg30').animate({opacity: '0.5'}, 100);
$('#proimg30').animate({opacity: '0.5'}, 1);
$('#proimg30').animate({opacity: '1'}, 100);
if (pageproducts==0) return; //Return if no less pages
pageproducts=pageproducts-1;
@@ -140,29 +183,41 @@ function MoreProducts(moreorless){
pageproducts=pageproducts-1;
return;
}
for (i = 0; i < 30; i++) {
if (typeof (data[i+(30*pageproducts)]) == "undefined"){
$("#prodesc"+i).text("");
$("#proimg"+i).attr("src","");
$("#prodiv"+i).data("rowid","");
continue;
idata=30*pageproducts; //product data counter
ishow=0; //product to show counter
while (idata < (30*pageproducts)+30) {
if (typeof (data[idata]) == "undefined") {
$("#prodesc"+ishow).text("");
$("#proimg"+ishow).attr("src","");
$("#prodiv"+ishow).data("rowid","");
ishow++; //Next product to show after print data product
}
$("#prodesc"+i).text(data[parseInt(i+(30*pageproducts))]['label']);
$("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i+(30*pageproducts)]['id']);
$("#prodiv"+i).data("rowid",data[i+(30*pageproducts)]['id']);
else if ((data[idata]['status']) == "1") {
//Only show products with status=1 (for sell)
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
$("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']);
$("#prodiv"+ishow).data("rowid",data[idata]['id']);
$("#prodiv"+ishow).data("iscat",0);
ishow++; //Next product to show after print data product
}
idata++; //Next data everytime
}
});
}
function ClickProduct(position){
$('#proimg'+position).animate({opacity: '0.5'}, 100);
$('#proimg'+position).animate({opacity: '0.5'}, 1);
$('#proimg'+position).animate({opacity: '1'}, 100);
idproduct=$('#prodiv'+position).data('rowid');
if (idproduct=="") return;
$("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() {
$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
if ($('#prodiv'+position).data('iscat')==1){
LoadProducts(position, true);
}
else{
idproduct=$('#prodiv'+position).data('rowid');
if (idproduct=="") return;
$("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() {
$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
}
}
function deleteline(){
@@ -212,6 +267,7 @@ function Search2(){
$("#prodesc"+i).text(data[parseInt(i)]['label']);
$("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']);
$("#prodiv"+i).data("rowid",data[i]['rowid']);
$("#prodiv"+i).data("iscat",0);
}
});
}
@@ -292,6 +348,12 @@ function TakeposPrintingOrder(){
});
}
function TakeposPrintingTemp(){
$("#poslines").load("invoice.php?action=temp&place="+place, function() {
$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
}
function OpenDrawer(){
$.ajax({
type: "POST",
@@ -300,6 +362,23 @@ function OpenDrawer(){
});
}
function MoreActions(totalactions){
if (pageactions==0){
pageactions=1;
for (i = 0; i <= totalactions; i++){
if (i<9) $("#action"+i).hide();
else $("#action"+i).show();
}
}
else if (pageactions==1){
pageactions=0;
for (i = 0; i <= totalactions; i++){
if (i<9) $("#action"+i).show();
else $("#action"+i).hide();
}
}
}
$( document ).ready(function() {
PrintCategories(0);
LoadProducts(0);
@@ -307,31 +386,41 @@ $( document ).ready(function() {
});
</script>
<body style="overflow: hidden; background-color:#E8E8E8;">
<body style="overflow: hidden; background-color:#D1D1D1;">
<div id="poslines" style="position:absolute; top:2%; left:0.5%; height:36%; width:31%; overflow: auto;">
</div>
<div class="container">
<div class="row1">
<div style="position:absolute; top:1%; left:32.5%; height:37%; width:32.5%;">
<button type="button" class="calcbutton" onclick="Edit(7);">7</button>
<button type="button" class="calcbutton" onclick="Edit(8);">8</button>
<button type="button" class="calcbutton" onclick="Edit(9);">9</button>
<button type="button" id="qty" class="calcbutton2" onclick="Edit('qty');"><?php echo $langs->trans("Qty"); ?></button>
<button type="button" class="calcbutton" onclick="Edit(4);">4</button>
<button type="button" class="calcbutton" onclick="Edit(5);">5</button>
<button type="button" class="calcbutton" onclick="Edit(6);">6</button>
<button type="button" id="price" class="calcbutton2" onclick="Edit('p');"><?php echo $langs->trans("Price"); ?></button>
<button type="button" class="calcbutton" onclick="Edit(1);">1</button>
<button type="button" class="calcbutton" onclick="Edit(2);">2</button>
<button type="button" class="calcbutton" onclick="Edit(3);">3</button>
<button type="button" id="reduction" class="calcbutton2" onclick="Edit('r');"><?php echo $langs->trans("ReductionShort"); ?></button>
<button type="button" class="calcbutton" onclick="Edit(0);">0</button>
<button type="button" class="calcbutton" onclick="Edit('.');">.</button>
<button type="button" class="calcbutton" onclick="Edit('c');">C</button>
<button type="button" class="calcbutton2" id="delete" style="color: red;" onclick="deleteline();"><b>X</b></button>
</div>
<div id="poslines" class="div1">
</div>
<div class="div2">
<button type="button" class="calcbutton" onclick="Edit(7);">7</button>
<button type="button" class="calcbutton" onclick="Edit(8);">8</button>
<button type="button" class="calcbutton" onclick="Edit(9);">9</button>
<button type="button" id="qty" class="calcbutton2" onclick="Edit('qty');"><?php echo $langs->trans("Qty"); ?></button>
<button type="button" class="calcbutton" onclick="Edit(4);">4</button>
<button type="button" class="calcbutton" onclick="Edit(5);">5</button>
<button type="button" class="calcbutton" onclick="Edit(6);">6</button>
<button type="button" id="price" class="calcbutton2" onclick="Edit('p');"><?php echo $langs->trans("Price"); ?></button>
<button type="button" class="calcbutton" onclick="Edit(1);">1</button>
<button type="button" class="calcbutton" onclick="Edit(2);">2</button>
<button type="button" class="calcbutton" onclick="Edit(3);">3</button>
<button type="button" id="reduction" class="calcbutton2" onclick="Edit('r');"><?php echo $langs->trans("ReductionShort"); ?></button>
<button type="button" class="calcbutton" onclick="Edit(0);">0</button>
<button type="button" class="calcbutton" onclick="Edit('.');">.</button>
<button type="button" class="calcbutton" onclick="Edit('c');">C</button>
<button type="button" class="calcbutton2" id="delete" style="color: red;" onclick="deleteline();"><b>X</b></button>
</div>
<?php
// TakePOS setup check
if (empty($conf->global->CASHDESK_ID_THIRDPARTY) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB)) {
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
}
if (count($maincategories)==0) {
setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors');
}
// User menu and external TakePOS modules
$menus = array();
$r=0;
@@ -347,63 +436,90 @@ $menus[$r++]=array('title'=>$langs->trans("ValidateBill"),
'action'=>'CloseBill();');
$menus[$r++]=array('title'=>$langs->trans("Logout"),
'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php\';');
//BAR RESTAURANT specified menu
if($conf->global->TAKEPOS_BAR_RESTAURANT){
$menus[$r++]=array('title'=>$langs->trans("Floors"),
'action'=>'Floors();');
if ($conf->global->TAKEPOS_ORDER_PRINTERS){
$menus[$r++]=array('title'=>$langs->trans("Order"),
'action'=>'TakeposPrintingOrder();');
'action'=>'TakeposPrintingOrder();');
}
//add temp ticket button
if ($conf->global->TAKEPOS_BAR_RESTAURANT){
if ($conf->global->TAKEPOSCONNECTOR) $menus[$r++]=array('title'=>$langs->trans("Receipt"),'action'=>'TakeposPrinting(placeid);');
else $menus[$r++]=array('title'=>$langs->trans("Receipt"),'action'=>'Print(placeid);');
}
}
if ($conf->global->TAKEPOSCONNECTOR){
$menus[$r++]=array('title'=>$langs->trans("DOL_OPEN_DRAWER"),
'action'=>'OpenDrawer();');
}
?>
<div style="position:absolute; top:1%; left:65.5%; height:37%; width:32.5%;">
<?php
foreach($menus as $menu) {
echo '<button type="button" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
}
?>
</div>
<div style="position:absolute; top:39%; left:0.3%; height:59%; width:32%;">
if ($conf->global->TAKEPOSCONNECTOR){
$menus[$r++]=array(
'title'=>$langs->trans("DOL_OPEN_DRAWER"),
'action'=>'OpenDrawer();'
);
}
$hookmanager->initHooks(array('takeposfrontend'));
$reshook=$hookmanager->executeHooks('ActionButtons');
if (!empty($reshook)) {
$menus[$r++]=$reshook;
}
?>
<div class="div3">
<?php
$i = 0;
foreach($menus as $menu) {
$i++;
if (count($menus)>9 and $i==9)
{
echo '<button type="button" id="actionnext" class="actionbutton" onclick="MoreActions('.count($menus).');">'.$langs->trans("Next").'</button>';
echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
}
elseif ($i>9) echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
else echo '<button type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
}
?>
</div>
</div>
<div class="row2">
<div class="div4">
<?php
$count=0;
while ($count<16)
{
?>
<div class='wrapper' <?php if ($count==14) echo 'onclick="MoreCategories(\'less\');"'; else if ($count==15) echo 'onclick="MoreCategories(\'more\');"'; else echo 'onclick="LoadProducts('.$count.');"';?> id='catdiv<?php echo $count;?>'>
<img class='imgwrapper' <?php if ($count==14) echo 'src="img/arrow-prev-top.png"'; if ($count==15) echo 'src="img/arrow-next-top.png"';?> width="98%" id='catimg<?php echo $count;?>'/>
<div class='description'>
<div class='description_content' id='catdesc<?php echo $count;?>'></div>
</div>
</div>
<div class='wrapper' <?php if ($count==14) echo 'onclick="MoreCategories(\'less\');"'; elseif ($count==15) echo 'onclick="MoreCategories(\'more\');"'; else echo 'onclick="LoadProducts('.$count.');"';?> id='catdiv<?php echo $count;?>'>
<img class='imgwrapper' <?php if ($count==14) echo 'src="img/arrow-prev-top.png"'; if ($count==15) echo 'src="img/arrow-next-top.png"';?> width="98%" id='catimg<?php echo $count;?>'/>
<div class='description'>
<div class='description_content' id='catdesc<?php echo $count;?>'></div>
</div>
</div>
<?php
$count++;
}
?>
</div>
</div>
<div style="position:absolute; top:39%; left:32%; height:58%; width:72%;">
<div class="div5">
<?php
$count=0;
while ($count<32)
{
?>
<div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==30) {?> onclick="MoreProducts('less');" <?php } if ($count==31) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
<img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="95%" id='proimg<?php echo $count;?>'/>
<div class='description'>
<div class='description_content' id='prodesc<?php echo $count;?>'></div>
{
?>
<div class='wrapper2' id='prodiv<?php echo $count;?>' <?php if ($count==30) {?> onclick="MoreProducts('less');" <?php } if ($count==31) {?> onclick="MoreProducts('more');" <?php } else echo 'onclick="ClickProduct('.$count.');"';?>>
<img class='imgwrapper' <?php if ($count==30) echo 'src="img/arrow-prev-top.png"'; if ($count==31) echo 'src="img/arrow-next-top.png"';?> width="95%" id='proimg<?php echo $count;?>'/>
<div class='description'>
<div class='description_content' id='prodesc<?php echo $count;?>'></div>
</div>
</div>
<?php
$count++;
}
?>
</div>
</div>
<?php
$count++;
}
?>
</div>
</body>
<?php