From 2595f571c74ef424add3c3ca687b769f90df3cb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 00:21:09 +0200 Subject: [PATCH 01/46] Fix exclude credit note when searching situation invoice to use for next --- htdocs/core/class/html.form.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index acbd15712e5..ec7bfeab7c4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3582,10 +3582,11 @@ class Form $opt = ''; $sql = 'SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc'; - $sql.= ' FROM ' . MAIN_DB_PREFIX . 'facture'; - $sql.= ' WHERE entity IN ('.getEntity('invoice').')'; - $sql.= ' AND situation_counter>=1'; - $sql.= ' ORDER by situation_cycle_ref, situation_counter desc'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture'; + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; + $sql .= ' AND situation_counter>=1'; + $sql .= ' AND type <> 2'; + $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { // Last seen cycle From 1c45866409a5b3f0cced0464acc74e4260902953 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 26 May 2020 10:33:07 +0200 Subject: [PATCH 02/46] FIX missing accountancy report menu for simple accountancy conf --- htdocs/core/menus/standard/eldy.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index be455d5431a..7dd048ee15a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1433,7 +1433,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); - + //Achats + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report", $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); // Journaux $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); From 56708e8c353a8a09ca00943dec4889016060433f Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Tue, 26 May 2020 22:52:55 +0200 Subject: [PATCH 03/46] Update phone.php for Auto Order --- htdocs/takepos/phone.php | 149 ++++++++++++++++++++++++++++----------- 1 file changed, 106 insertions(+), 43 deletions(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 8714173e45f..88ab8ef5227 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // Decode place if it is an order from customer phone - $key = GETPOST('key'); - $place=dol_decode($key); + $place = GETPOSTISSET("key") ? dol_decode(GETPOST('key')) : GETPOST('place', 'aZ09'); +} else { + $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant } -else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); $idproduct = GETPOST('idproduct', 'int'); @@ -62,28 +62,54 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI * View */ -// Title -$title = 'TakePOS - Dolibarr '.DOL_VERSION; -if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; -$head = ' - - -'; -top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - -print ''; - -if ($action=="productinfo"){ +if ($action == "productinfo") { $prod = new Product($db); $prod->fetch($idproduct); - print "".$prod->label."
"; - print ''; + print ''; + print "
".$prod->label."
"; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; - print ''; +} elseif ($action == "publicpreorder") { + print ''; + print "

"; + print '
+ +
'; + print '
'; +} elseif ($action == "publicpayment") { + $langs->loadLangs(array("orders")); + print '

'.$langs->trans('StatusOrderDelivered').'

'; + print ''; + print '
'; } -elseif ($action=="editline"){ +elseif ($action == "checkplease") { + if (GETPOSTISSET("payment")) { + print '

'.$langs->trans('StatusOrderDelivered').'

'; + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $printer = new dolReceiptPrinter($db); + $printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->text($langs->trans('IM')); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Place').": ".$place); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Payment').": ".$langs->trans(GETPOST('payment', 'alpha'))); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->close(); + } else { + print ''; + print ''; + print '
'; + } +} elseif ($action == "editline") { $placeid = GETPOST('placeid', 'int'); $selectedline = GETPOST('selectedline', 'int'); $invoice = new Facture($db); @@ -95,17 +121,25 @@ elseif ($action=="editline"){ $prod = new Product($db); $prod->fetch($line->fk_product); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } } -} else { + // Title + $title = 'TakePOS - Dolibarr '.DOL_VERSION; + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; + $head = ' + + +'; + $arrayofcss = array('/takepos/css/phone.css'); + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> - + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; ?> @@ -300,19 +363,19 @@ function CheckPlease(){ print ''; print ''; } - else{ - print ''; - print ''; - print ''; + else { + print ''; + print ''; + print ''; } ?> -
-
-
-
+
+
+
+
Date: Tue, 26 May 2020 23:03:47 +0200 Subject: [PATCH 04/46] Update invoice.php for Auto Order --- htdocs/takepos/invoice.php | 45 ++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3d6cec96319..07006eb5cd1 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -70,10 +70,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == '; + $arrayofcss = array( + '/takepos/css/pos.css.php', + '/takepos/js/jquery.colorbox-min.js' + ); + $arrayofjs = array('/takepos/js/jquery.colorbox-min.js'); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - print ' - - '; } /** @@ -863,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) print $langs->trans('Place')." ".$label." - "; print $langs->trans('Floor')." ".$floor." - "; } + elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name; + elseif ($mobilepage == "cats") print $langs->trans('Category'); + elseif ($mobilepage == "products") print $langs->trans('Label'); } // In phone version only show when is invoice page if ($mobilepage == "invoice" || $mobilepage == "") { @@ -877,6 +882,7 @@ if ($_SESSION["basiclayout"] != 1) print ''.$langs->trans('Qty').''; print ''.$langs->trans('TotalTTCShort').''; } +elseif ($mobilepage == "invoice") print ''.$langs->trans('Qty').''; print "\n"; @@ -889,12 +895,14 @@ if ($_SESSION["basiclayout"] == 1) $categories = $categorie->get_full_arbo('product'); $htmlforlines = ''; foreach ($categories as $row) { - $htmlforlines .= ''; - $htmlforlines .= ''; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '
'; + else $htmlforlines .= ''; $htmlforlines .= $row['label']; - $htmlforlines .= ''; - $htmlforlines .= ''."\n"; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= ''."\n"; + else $htmlforlines .= ''."\n"; } $htmlforlines .= ''; $htmlforlines .= ''; @@ -910,12 +918,20 @@ if ($_SESSION["basiclayout"] == 1) $prods = $object->getObjectsInCateg("product"); $htmlforlines = ''; foreach ($prods as $row) { - $htmlforlines .= 'id.')">'; - $htmlforlines .= ''; - $htmlforlines .= $row->label; - $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; - $htmlforlines .= ''."\n"; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + $htmlforlines .= '
'; + $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency); + $htmlforlines .= ''."\n"; + } + else { + $htmlforlines .= ''; + $htmlforlines .= $row->label; + $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; + $htmlforlines .= ''."\n"; + } } $htmlforlines .= ''; print $htmlforlines; @@ -991,7 +1007,7 @@ if ($placeid > 0) } $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= ''; - if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x "; + if ($_SESSION["basiclayout"] == 1) $htmlforlines .= ''.$line->qty." x "; //if ($line->product_label) $htmlforlines.= ''.$line->product_label.''; if (isset($line->product_type)) { @@ -1026,7 +1042,8 @@ if ($placeid > 0) } } if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "
(".$line->array_options['options_order_notes'].")"; - if ($_SESSION["basiclayout"] != 1) + if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '  '; + if ($_SESSION["basiclayout"] != 1) { $moreinfo = ''; $moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht); From abf7fce10873bb24108dbc3cff0c4ed23bf86a8b Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:44:00 +0200 Subject: [PATCH 05/46] Update auto_order.php --- htdocs/takepos/public/auto_order.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/public/auto_order.php b/htdocs/takepos/public/auto_order.php index c7612711df0..910c00327b4 100644 --- a/htdocs/takepos/public/auto_order.php +++ b/htdocs/takepos/public/auto_order.php @@ -33,4 +33,5 @@ $_SESSION["takeposterminal"] = 1; define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); if (GETPOSTISSET("mobilepage")) require '../invoice.php'; +elseif (GETPOSTISSET("genimg")) require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php'; else require '../phone.php'; From 7d323f43793016f2dc0f4b107413ff5ecc6f3262 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:48:40 +0200 Subject: [PATCH 06/46] Update index.php --- htdocs/takepos/genimg/index.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index a5686054193..2559d5f5b29 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -25,7 +25,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -require '../../main.inc.php'; // Load $user and permissions +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../../main.inc.php'; // Load $user and permissions $id = GETPOST('id', 'int'); $w = GETPOST('w', 'int'); @@ -60,7 +60,7 @@ if ($query == "cat") { $filename = $obj['photo']; } - $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); + $file = DOL_URL_ROOT.'/viewimage.php?cache=1&publictakepos=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); header('Location: '.$file); exit; } @@ -72,12 +72,20 @@ elseif ($query == "pro") $objProd = new Product($db); $objProd->fetch($id); - $image = $objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1); + $image = $objProd->show_photos('product', $conf->product->multidir_output[$objProd->entity], 'small', 1); preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); - if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file.'&cache=1'); + if ($file == "") { + header('Location: ../../public/theme/common/nophoto.png'); + } else { + if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + header('Location: '.$file.'&cache=1'); + } else { + header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); + } + } +} else header('Location: '.$file.'&cache=1'); } else { From 896e3166b75a8b7b30178db02ef2903f2a1196be Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:49:37 +0200 Subject: [PATCH 07/46] Update phone.css --- htdocs/takepos/css/phone.css | 96 ++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/css/phone.css b/htdocs/takepos/css/phone.css index 0f3606071f0..bdfdf45e116 100644 --- a/htdocs/takepos/css/phone.css +++ b/htdocs/takepos/css/phone.css @@ -4,6 +4,7 @@ html,body { margin:0; height:100%; width:100%; + background-color: #FFF !important; } .container{ @@ -17,14 +18,14 @@ html,body { .phonerow1{ margin: 0 auto; width: 100%; - height: 40%; + height: auto; min-height: 40%; } .phonerow2{ margin: 0 auto; width: 100%; - height: 40%; + height: auto; } .phonebuttonsrow{ @@ -90,7 +91,71 @@ button.publicphonebutton { text-align: center; overflow: visible; /* removes extra width in IE */ width:33%; - height:90%; + height:50px; + font-weight: bold; + color: #fff; +} + +.phoneblue{ + color: #fff; + background-color: #428bca; + border-color: #357ebd; +} + +.phonegreen{ + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; + font-size:20px; + text-align:center; + width:20px; +} + +.phonetable{ + width:130px; +} + +.phoneqty{ + font-size:24px; + font-weight: bold; + + +} + +.phonered{ + color: #fff; + background-color: #dc3545; + border-color: #dc3545; + font-size:20px; + text-align:center; + width:20px; +} + +.phoneorange{ + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} + +.total{ + width:100% !important; + font-size:24px; +} + +.width24{ + font-size:24px; +} + +.leftcat{ + margin-top:15px; + float:left; + width: 50%; + text-align:center; + height:150px;; + overflow:hidden; + margin-bottom:5px; + font-size:18px; + color:#5B5858; font-weight: bold; } @@ -107,3 +172,28 @@ button.publicphonebutton2 { font-weight: bold; padding: 8px 16px; } + +.div-table-responsive-no-min{ + margin-top:20px; +} + +.comment { + float: left; + width: 100%; + height: auto; +} + +.comment-text-area { + float: left; + width: 80%; + height: auto; +} + +.textinput { + float: left; + width: 100%; + min-height: 75px; + outline: none; + resize: none; + border: 1px solid grey; +} From 8891595993a4ccf1fcb5334db0ada54af776cd2f Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:57:12 +0200 Subject: [PATCH 08/46] Fix travis --- htdocs/takepos/phone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 88ab8ef5227..0e49eff4ed5 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -130,7 +130,7 @@ elseif ($action == "checkplease") { print ''; } } -else { +} else { // Title $title = 'TakePOS - Dolibarr '.DOL_VERSION; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; From 3b884c40513677a2280b779bd54ede87ace43a16 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 07:03:57 +0200 Subject: [PATCH 09/46] Fix travis --- htdocs/takepos/genimg/index.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index 2559d5f5b29..ea863374f3c 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -85,10 +85,7 @@ elseif ($query == "pro") header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); } } -} else header('Location: '.$file.'&cache=1'); -} -else -{ +} else { // TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded. // The file From 0b48ffe3cd127e503c3493bc084d75af82bbbbb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 11:38:28 +0200 Subject: [PATCH 10/46] Removed not used var $useglobalvars --- htdocs/core/ajax/ajaxdirpreview.php | 2 +- htdocs/core/class/html.form.class.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index bb6a8de30d4..83227b00e51 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -355,7 +355,7 @@ if ($useajax || $action == 'delete') $section_id = $section; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - $useglobalvars = 1; + $form = new Form($db); $formquestion['urlfile'] = array('type'=>'hidden', 'value'=>$urlfile, 'name'=>'urlfile'); // We must always put field, even if empty because it is filled by javascript later $formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); // We must always put field, even if empty because it is filled by javascript later diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f2b11938ca2..30519077c9e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4207,7 +4207,6 @@ class Form public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0) { global $langs, $conf; - global $useglobalvars; $more = ''; $formconfirm = ''; @@ -4355,7 +4354,7 @@ class Form if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko, $input['name']); } } - // Show JQuery confirm box. Note that global var $useglobalvars is used inside this template + // Show JQuery confirm box. $formconfirm .= '