Passed
Push — MINOR_OPTIMIZATIONS_241106 ( 63568c )
by Rafael
57:48
created
public/htdocs/salaries/ajax/ajaxsalaries.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
  *       \brief      File to return Ajax response on salary request
29 29
  */
30 30
 
31
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
32
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
31
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
32
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
33 33
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
34 34
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
35
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
35
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
36 36
 
37 37
 // Load Dolibarr environment
38 38
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 if (!empty(GETPOSTINT('fk_user'))) {
52 52
     $sql = "SELECT s.amount, s.rowid FROM " . MAIN_DB_PREFIX . "salary as s";
53
-    $sql .= " WHERE s.fk_user = " . ((int)$fk_user);
53
+    $sql .= " WHERE s.fk_user = " . ((int) $fk_user);
54 54
     $sql .= " AND s.paye = 1";
55 55
     $sql .= $db->order("s.dateep", "DESC");
56 56
 
Please login to merge, or discard this patch.
public/htdocs/modulebuilder/template/js/mymodule.js.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@
 block discarded – undo
45 45
 // Important: Following code is to cache this file to avoid page request by browser at each Dolibarr page access.
46 46
 // You can use CTRL+F5 to refresh your browser cache.
47 47
 if (empty($dolibarr_nocache)) {
48
-	header('Cache-Control: max-age=3600, public, must-revalidate');
48
+    header('Cache-Control: max-age=3600, public, must-revalidate');
49 49
 } else {
50
-	header('Cache-Control: no-cache');
50
+    header('Cache-Control: no-cache');
51 51
 }
52 52
 ?>
53 53
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@
 block discarded – undo
20 20
 
21 21
 use Alxarafe\Lib\Functions;
22 22
 
23
-Functions::defineIfNotDefined('NOREQUIREUSER', 1);   // No user needed
24
-Functions::defineIfNotDefined('NOREQUIREDB', 1);   // No database needed
25
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
26
-Functions::defineIfNotDefined('NOREQUIRETRAN', 1);   // No translations needed
27
-Functions::defineIfNotDefined('NOCSRFCHECK', 1);  // Do not check anti CSRF attack test
28
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
29
-Functions::defineIfNotDefined('NOLOGIN', 1);  // No login needed
30
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
23
+Functions::defineIfNotDefined('NOREQUIREUSER', 1); // No user needed
24
+Functions::defineIfNotDefined('NOREQUIREDB', 1); // No database needed
25
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
26
+Functions::defineIfNotDefined('NOREQUIRETRAN', 1); // No translations needed
27
+Functions::defineIfNotDefined('NOCSRFCHECK', 1); // Do not check anti CSRF attack test
28
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
29
+Functions::defineIfNotDefined('NOLOGIN', 1); // No login needed
30
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
31 31
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
32 32
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
33 33
 
Please login to merge, or discard this patch.
public/htdocs/modulebuilder/template/css/mymodule.css.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
 
27 27
 //if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');   // Not disabled because need to load personalized language
28 28
 //if (!defined('NOREQUIREDB'))   define('NOREQUIREDB','1'); // Not disabled. Language code is found on url.
29
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
29
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
30 30
 //if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');   // Not disabled because need to do translations
31 31
 //if (!defined('NOCSRFCHECK'))   define('NOCSRFCHECK', 1);      // Should be disable only for special situation
32
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
33
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
32
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
33
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
34 34
 //if (! defined('NOREQUIREMENU'))   define('NOREQUIREMENU',1);  // We need top menu content
35 35
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
36 36
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
Please login to merge, or discard this patch.
public/htdocs/modulebuilder/template/ajax/myobject.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
  *       \brief      File to return Ajax response on product list request
26 26
  */
27 27
 
28
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
29
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
28
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
29
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
30 30
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
31 31
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
32
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
33
-Functions::defineIfNotDefined('NOCSRFCHECK', 1);  // Do not check anti CSRF attack test
32
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
33
+Functions::defineIfNotDefined('NOCSRFCHECK', 1); // Do not check anti CSRF attack test
34 34
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
35 35
 
36 36
 // Load Dolibarr environment
Please login to merge, or discard this patch.
public/htdocs/modulebuilder/template/scripts/mymodule.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 
54 54
 // Test if batch mode
55 55
 if (substr($sapi_type, 0, 3) == 'cgi') {
56
-	echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n";
57
-	exit(-1);
56
+    echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n";
57
+    exit(-1);
58 58
 }
59 59
 
60 60
 // Global variables
@@ -74,28 +74,28 @@  discard block
 block discarded – undo
74 74
 $i = strlen($tmp) - 1;
75 75
 $j = strlen($tmp2) - 1;
76 76
 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
77
-	$i--;
78
-	$j--;
77
+    $i--;
78
+    $j--;
79 79
 }
80 80
 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/master.inc.php")) {
81
-	$res = @include substr($tmp, 0, ($i + 1)) . "/master.inc.php";
81
+    $res = @include substr($tmp, 0, ($i + 1)) . "/master.inc.php";
82 82
 }
83 83
 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/master.inc.php")) {
84
-	$res = @include dirname(substr($tmp, 0, ($i + 1))) . "/master.inc.php";
84
+    $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/master.inc.php";
85 85
 }
86 86
 // Try master.inc.php using relative path
87 87
 if (!$res && file_exists("../master.inc.php")) {
88
-	$res = @include "../master.inc.php";
88
+    $res = @include "../master.inc.php";
89 89
 }
90 90
 if (!$res && file_exists("../../master.inc.php")) {
91
-	$res = @include "../../master.inc.php";
91
+    $res = @include "../../master.inc.php";
92 92
 }
93 93
 if (!$res && file_exists("../../../master.inc.php")) {
94
-	$res = @include "../../../master.inc.php";
94
+    $res = @include "../../../master.inc.php";
95 95
 }
96 96
 if (!$res) {
97
-	print "Include of master fails";
98
-	exit(-1);
97
+    print "Include of master fails";
98
+    exit(-1);
99 99
 }
100 100
 // After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
101 101
 // $user is created but empty.
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 // Load user and its permissions
107 107
 $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
108 108
 if (!($result > 0)) {
109
-	dol_print_error(null, $user->error);
110
-	exit;
109
+    dol_print_error(null, $user->error);
110
+    exit;
111 111
 }
112 112
 $user->getrights();
113 113
 
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 
121 121
 print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
122 122
 if (!isset($argv[1])) { // Check parameters
123
-	print "Usage: " . $script_file . " param1 param2 ...\n";
124
-	exit(-1);
123
+    print "Usage: " . $script_file . " param1 param2 ...\n";
124
+    exit(-1);
125 125
 }
126 126
 print '--- start' . "\n";
127 127
 print 'Argument 1=' . $argv[1] . "\n";
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 // -------------------- END OF YOUR CODE --------------------
213 213
 
214 214
 if (!$error) {
215
-	$db->commit();
216
-	print '--- end ok' . "\n";
215
+    $db->commit();
216
+    print '--- end ok' . "\n";
217 217
 } else {
218
-	print '--- end error code=' . $error . "\n";
219
-	$db->rollback();
218
+    print '--- end error code=' . $error . "\n";
219
+    $db->rollback();
220 220
 }
221 221
 
222 222
 $db->close(); // Close $db database opened handler
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule');    // Force authentication handler
46 46
 //if (! defined('CSRFCHECK_WITH_TOKEN'))     define('CSRFCHECK_WITH_TOKEN', '1');       // Force use of CSRF protection with tokens even for GET
47 47
 //if (! defined('NOBROWSERNOTIF'))           define('NOBROWSERNOTIF', '1');             // Disable browser notification
48
-Functions::defineIfNotDefined('NOSESSION', 1);   // On CLI mode, no need to use web sessions
48
+Functions::defineIfNotDefined('NOSESSION', 1); // On CLI mode, no need to use web sessions
49 49
 
50 50
 $sapi_type = php_sapi_name();
51 51
 $script_file = basename(__FILE__);
Please login to merge, or discard this patch.
public/htdocs/takepos/genimg/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@
 block discarded – undo
26 26
 
27 27
 //if (! defined('NOREQUIREUSER'))   define('NOREQUIREUSER','1');    // Not disabled cause need to load personalized language
28 28
 //if (! defined('NOREQUIREDB'))     define('NOREQUIREDB','1');      // Not disabled cause need to load personalized language
29
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
29
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
30 30
 //if (! defined('NOREQUIRETRAN'))       define('NOREQUIRETRAN','1');
31
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
32
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
31
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
32
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
33 33
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
34 34
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
35 35
 
Please login to merge, or discard this patch.
public/htdocs/takepos/genimg/qr.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
 // This page return an image of a QR code of a public link
24 24
 // Note: Generating a QR code from a string, like done by this script, can be done with any online tool.
25 25
 
26
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
26
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
27 27
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
28
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
29
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
30
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
28
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
29
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
30
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
31 31
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
32 32
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
33 33
 
Please login to merge, or discard this patch.
public/htdocs/takepos/invoice.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 // if (! defined('NOREQUIRESOC'))       define('NOREQUIRESOC', '1');
49 49
 // if (! defined('NOREQUIRETRAN'))      define('NOREQUIRETRAN', '1');
50 50
 
51
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
52
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
51
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
52
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
53 53
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
54 54
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
55 55
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
  */
176 176
 
177 177
 $parameters = array();
178
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
178
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
179 179
 if ($reshook < 0) {
180 180
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
181 181
 }
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
             $bankaccount = GETPOSTINT('accountid');
191 191
         } else {
192 192
             if ($pay == 'LIQ') {
193
-                $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH' . $_SESSION["takeposterminal"]);            // For backward compatibility
193
+                $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH' . $_SESSION["takeposterminal"]); // For backward compatibility
194 194
             } elseif ($pay == "CHQ") {
195
-                $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE' . $_SESSION["takeposterminal"]);    // For backward compatibility
195
+                $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE' . $_SESSION["takeposterminal"]); // For backward compatibility
196 196
             } else {
197 197
                 $accountname = "CASHDESK_ID_BANKACCOUNT_" . $pay . $_SESSION["takeposterminal"];
198 198
                 $bankaccount = getDolGlobalInt($accountname);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
             $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facture";
219 219
             $sql .= " WHERE entity IN (" . getEntity('invoice') . ")";
220
-            $sql .= " AND fk_soc = " . ((int)$invoice->socid);
220
+            $sql .= " AND fk_soc = " . ((int) $invoice->socid);
221 221
             $sql .= " AND type <> " . Facture::TYPE_CREDIT_NOTE;
222 222
             $sql .= " AND fk_statut >= " . $invoice::STATUS_VALIDATED;
223 223
             $sql .= " ORDER BY rowid DESC";
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
     // If we add a line and no invoice yet, we create the invoice
537 537
     if (($action == "addline" || $action == "freezone") && $placeid == 0 && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
538 538
         $invoice->socid = getDolGlobalInt($constforcompanyid);
539
-        $invoice->date = dol_now('tzuserrel');      // We use the local date, only the day will be saved.
539
+        $invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved.
540 540
         $invoice->module_source = 'takepos';
541 541
         $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '';
542 542
         $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity;
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             if ($placeid < 0) {
553 553
                 dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
554 554
             }
555
-            $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")' where rowid = " . ((int)$placeid);
555
+            $sql = "UPDATE " . MAIN_DB_PREFIX . "facture set ref='(PROV-POS" . $_SESSION["takeposterminal"] . "-" . $place . ")' where rowid = " . ((int) $placeid);
556 556
             $resql = $db->query($sql);
557 557
             if (!$resql) {
558 558
                 $error++;
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
             $categories = $cat->containing($idproduct, 'product');
681 681
             $found = (array_search(getDolGlobalInt('TAKEPOS_SUPPLEMENTS_CATEGORY'), array_column($categories, 'id')));
682 682
             if ($found !== false) { // If this product is a supplement
683
-                $sql = "SELECT fk_parent_line FROM " . MAIN_DB_PREFIX . "facturedet where rowid = " . ((int)$selectedline);
683
+                $sql = "SELECT fk_parent_line FROM " . MAIN_DB_PREFIX . "facturedet where rowid = " . ((int) $selectedline);
684 684
                 $resql = $db->query($sql);
685 685
                 $row = $db->fetch_array($resql);
686 686
                 if ($row[0] == null) {
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 
747 747
             // complete line by hook
748 748
             $parameters = array('prod' => $prod, 'line' => $line);
749
-            $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action);    // Note that $action and $line may have been modified by some hooks
749
+            $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks
750 750
             if ($reshook < 0) {
751 751
                 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
752 752
             }
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
             $invoice->deleteLine($idline);
833 833
             $invoice->fetch($placeid);
834 834
         } elseif ($placeid > 0) {             // If invoice exists but no line selected, proceed to delete last line.
835
-            $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = " . ((int)$placeid) . " ORDER BY rowid DESC";
835
+            $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = " . ((int) $placeid) . " ORDER BY rowid DESC";
836 836
             $resql = $db->query($sql);
837 837
             $row = $db->fetch_array($resql);
838 838
             $deletelineid = $row[0];
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 
875 875
                 $sql = "UPDATE " . MAIN_DB_PREFIX . "facture";
876 876
                 $varforconst = 'CASHDESK_ID_THIRDPARTY' . $_SESSION["takeposterminal"];
877
-                $sql .= " SET fk_soc = " . ((int)getDolGlobalString($varforconst)) . ", ";
877
+                $sql .= " SET fk_soc = " . ((int) getDolGlobalString($varforconst)) . ", ";
878 878
                 $sql .= " datec = '" . $db->idate(dol_now()) . "'";
879 879
                 $sql .= " WHERE entity IN (" . getEntity('invoice') . ")";
880 880
                 $sql .= " AND ref = '(PROV-POS" . $db->escape($_SESSION["takeposterminal"] . "-" . $place) . ")'";
@@ -1005,9 +1005,9 @@  discard block
 block discarded – undo
1005 1005
 
1006 1006
     if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
1007 1007
         $constantforkey = 'CASHDESK_ID_WAREHOUSE' . $_SESSION["takeposterminal"];
1008
-        $warehouseid = getDolGlobalInt($constantforkey);    // TODO Get the wrehouse id from GETPOSTINT('warehouseid');
1009
-        $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet SET batch = '" . $db->escape($batch) . "', fk_warehouse = " . ((int)$warehouseid);
1010
-        $sql .= " WHERE rowid=" . ((int)$idoflineadded);
1008
+        $warehouseid = getDolGlobalInt($constantforkey); // TODO Get the wrehouse id from GETPOSTINT('warehouseid');
1009
+        $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet SET batch = '" . $db->escape($batch) . "', fk_warehouse = " . ((int) $warehouseid);
1010
+        $sql .= " WHERE rowid=" . ((int) $idoflineadded);
1011 1011
         $db->query($sql);
1012 1012
     }
1013 1013
 
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
             $printer = new dolReceiptPrinter($db);
1017 1017
         }
1018 1018
 
1019
-        $sql = "SELECT label FROM " . MAIN_DB_PREFIX . "takepos_floor_tables where rowid=" . ((int)$place);
1019
+        $sql = "SELECT label FROM " . MAIN_DB_PREFIX . "takepos_floor_tables where rowid=" . ((int) $place);
1020 1020
         $resql = $db->query($sql);
1021 1021
         $row = $db->fetch_object($resql);
1022 1022
         $headerorder = '<html><br><b>' . $langs->trans('Place') . ' ' . $row->label . '<br><table width="65%"><thead><tr><th class="left">' . $langs->trans("Label") . '</th><th class="right">' . $langs->trans("Qty") . '</th></tr></thead><tbody>';
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
 
1600 1600
 $usediv = (GETPOST('format') == 'div');
1601 1601
 
1602
-print '<!-- invoice.php place=' . (int)$place . ' invoice=' . $invoice->ref . ' usediv=' . json_encode($usediv) . ', mobilepage=' . (empty($mobilepage) ? '' : $mobilepage) . ' $_SESSION["basiclayout"]=' . (empty($_SESSION["basiclayout"]) ? '' : $_SESSION["basiclayout"]) . ' conf TAKEPOS_BAR_RESTAURANT=' . getDolGlobalString('TAKEPOS_BAR_RESTAURANT') . ' -->' . "\n";
1602
+print '<!-- invoice.php place=' . (int) $place . ' invoice=' . $invoice->ref . ' usediv=' . json_encode($usediv) . ', mobilepage=' . (empty($mobilepage) ? '' : $mobilepage) . ' $_SESSION["basiclayout"]=' . (empty($_SESSION["basiclayout"]) ? '' : $_SESSION["basiclayout"]) . ' conf TAKEPOS_BAR_RESTAURANT=' . getDolGlobalString('TAKEPOS_BAR_RESTAURANT') . ' -->' . "\n";
1603 1603
 print '<div class="div-table-responsive-no-min invoice">';
1604 1604
 if ($usediv) {
1605 1605
     print '<div id="tablelines">';
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 }
1628 1628
 if (!$usediv) {
1629 1629
     if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
1630
-        $sql = "SELECT floor, label FROM " . MAIN_DB_PREFIX . "takepos_floor_tables where rowid=" . ((int)$place);
1630
+        $sql = "SELECT floor, label FROM " . MAIN_DB_PREFIX . "takepos_floor_tables where rowid=" . ((int) $place);
1631 1631
         $resql = $db->query($sql);
1632 1632
         $obj = $db->fetch_object($resql);
1633 1633
         if ($obj) {
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
 
1647 1647
 // Complete header by hook
1648 1648
 $parameters = array();
1649
-$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1649
+$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1650 1650
 if ($reshook < 0) {
1651 1651
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1652 1652
 }
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
 
1810 1810
                 // complete line by hook
1811 1811
                 $parameters = array('line' => $line);
1812
-                $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1812
+                $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1813 1813
                 if ($reshook < 0) {
1814 1814
                     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1815 1815
                 }
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 
1923 1923
                 // complete line by hook
1924 1924
                 $parameters = array('line' => $line);
1925
-                $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action);    // Note that $action and $object may have been modified by some hooks
1925
+                $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
1926 1926
                 if ($reshook < 0) {
1927 1927
                     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1928 1928
                 }
@@ -1941,9 +1941,9 @@  discard block
 block discarded – undo
1941 1941
                         $sql .= " " . MAIN_DB_PREFIX . "product_stock as ps";
1942 1942
                         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = ps.fk_product";
1943 1943
                         $sql .= " WHERE ps.reel != 0";
1944
-                        $sql .= " AND ps.fk_entrepot = " . ((int)getDolGlobalString($constantforkey));
1944
+                        $sql .= " AND ps.fk_entrepot = " . ((int) getDolGlobalString($constantforkey));
1945 1945
                         $sql .= " AND e.entity IN (" . getEntity('stock') . ")";
1946
-                        $sql .= " AND ps.fk_product = " . ((int)$line->fk_product);
1946
+                        $sql .= " AND ps.fk_product = " . ((int) $line->fk_product);
1947 1947
                         $resql = $db->query($sql);
1948 1948
                         if ($resql) {
1949 1949
                             $stock_real = 0;
Please login to merge, or discard this patch.
public/htdocs/takepos/public/menu.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
  *       \brief      Public menu for customers
27 27
  */
28 28
 
29
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
29
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
30 30
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
31
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
31
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
32 32
 
33 33
 // Load Dolibarr environment
34 34
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
Please login to merge, or discard this patch.