@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | $error = 0; |
| 182 | 182 | $parameters = array(); |
| 183 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 183 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 184 | 184 | if ($reshook < 0) { |
| 185 | 185 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 186 | 186 | } |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | $bankaccount = GETPOSTINT('accountid'); |
| 203 | 203 | } else { |
| 204 | 204 | if ($pay == 'LIQ') { |
| 205 | - $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 205 | + $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 206 | 206 | } elseif ($pay == "CHQ") { |
| 207 | - $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 207 | + $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 208 | 208 | } else { |
| 209 | 209 | $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; |
| 210 | 210 | $bankaccount = getDolGlobalInt($accountname); |
@@ -272,14 +272,14 @@ discard block |
||
| 272 | 272 | // The case for isModEnabled('productbatch') is processed few lines later. |
| 273 | 273 | $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); |
| 274 | 274 | |
| 275 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation |
|
| 275 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation |
|
| 276 | 276 | |
| 277 | 277 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
| 278 | 278 | dol_syslog("Validate invoice with stock change. Warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey)); |
| 279 | 279 | |
| 280 | 280 | // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) |
| 281 | 281 | // Label of stock movement will be the same as when we validate invoice "Invoice XXXX validated" |
| 282 | - $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 282 | + $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 283 | 283 | $res = $invoice->validate($user, '', getDolGlobalInt($constantforkey), 0, $batch_rule); |
| 284 | 284 | |
| 285 | 285 | // Restore setup |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | dol_syslog("Now we record the stock movement for each qualified line"); |
| 360 | 360 | |
| 361 | 361 | // The case !isModEnabled('productbatch') was processed few lines before. |
| 362 | - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; |
|
| 362 | + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; |
|
| 363 | 363 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
| 364 | 364 | $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); |
| 365 | 365 | // Label of stock movement will be "TakePOS - Invoice XXXX" |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $creditnote->socid = $invoice->socid; |
| 411 | 411 | $creditnote->date = dol_now(); |
| 412 | 412 | $creditnote->module_source = 'takepos'; |
| 413 | - $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
| 413 | + $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
| 414 | 414 | $creditnote->type = Facture::TYPE_CREDIT_NOTE; |
| 415 | 415 | $creditnote->fk_facture_source = $placeid; |
| 416 | 416 | //$creditnote->remise_absolue = $invoice->remise_absolue; |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | // If module stock is enabled and we do not setup takepo to disable stock decrease |
| 538 | 538 | // The case for isModEnabled('productbatch') is processed few lines later. |
| 539 | 539 | $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); |
| 540 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // We force setup to have update of stock on invoice validation/unvalidation |
|
| 540 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // We force setup to have update of stock on invoice validation/unvalidation |
|
| 541 | 541 | |
| 542 | 542 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
| 543 | 543 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | |
| 546 | 546 | // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) |
| 547 | 547 | // Label of stock movement will be the same as when we validate invoice "Invoice XXXX validated" |
| 548 | - $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 548 | + $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 549 | 549 | $res = $creditnote->validate($user, '', getDolGlobalInt($constantforkey), 0, $batch_rule); |
| 550 | 550 | if ($res < 0) { |
| 551 | 551 | $error++; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | dol_syslog("Now we record the stock movement for each qualified line"); |
| 566 | 566 | |
| 567 | 567 | // The case !isModEnabled('productbatch') was processed few lines before. |
| 568 | - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; |
|
| 568 | + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; |
|
| 569 | 569 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
| 570 | 570 | $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); |
| 571 | 571 | // Label of stock movement will be "TakePOS - Invoice XXXX" |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | if (!$error && $res >= 0) { |
| 606 | 606 | $db->commit(); |
| 607 | 607 | } else { |
| 608 | - $creditnote->id = $placeid; // Creation has failed, we reset to ID of source invoice so we go back to this one in action=history |
|
| 608 | + $creditnote->id = $placeid; // Creation has failed, we reset to ID of source invoice so we go back to this one in action=history |
|
| 609 | 609 | $db->rollback(); |
| 610 | 610 | } |
| 611 | 611 | } |
@@ -625,14 +625,14 @@ discard block |
||
| 625 | 625 | if (($action == "addline" || $action == "freezone") && $placeid == 0 && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { |
| 626 | 626 | $invoice->socid = getDolGlobalInt($constforcompanyid); |
| 627 | 627 | |
| 628 | - $dolnowtzuserrel = dol_now('tzuserrel'); // If user is 02 january 22:00, we want to store '02 january' |
|
| 628 | + $dolnowtzuserrel = dol_now('tzuserrel'); // If user is 02 january 22:00, we want to store '02 january' |
|
| 629 | 629 | $monthuser = dol_print_date($dolnowtzuserrel, '%m', 'gmt'); |
| 630 | 630 | $dayuser = dol_print_date($dolnowtzuserrel, '%d', 'gmt'); |
| 631 | 631 | $yearuser = dol_print_date($dolnowtzuserrel, '%Y', 'gmt'); |
| 632 | - $dateinvoice = dol_mktime(0, 0, 0, (int) $monthuser, (int) $dayuser, (int) $yearuser, 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 632 | + $dateinvoice = dol_mktime(0, 0, 0, (int) $monthuser, (int) $dayuser, (int) $yearuser, 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 633 | 633 | |
| 634 | 634 | include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
| 635 | - $invoice->date = $dateinvoice; // Invoice::create() needs a date with no hours |
|
| 635 | + $invoice->date = $dateinvoice; // Invoice::create() needs a date with no hours |
|
| 636 | 636 | |
| 637 | 637 | /* |
| 638 | 638 | print "monthuser=".$monthuser." dayuser=".$dayuser." yearuser=".$yearuser.'<br>'; |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | */ |
| 648 | 648 | |
| 649 | 649 | $invoice->module_source = 'takepos'; |
| 650 | - $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
| 650 | + $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
| 651 | 651 | $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity; |
| 652 | 652 | |
| 653 | 653 | if ($invoice->socid <= 0) { |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | |
| 861 | 861 | // complete line by hook |
| 862 | 862 | $parameters = array('prod' => $prod, 'line' => $line); |
| 863 | - $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
| 863 | + $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
| 864 | 864 | if ($reshook < 0) { |
| 865 | 865 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 866 | 866 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | |
| 1076 | 1076 | if (!$permissiontoupdateline) { |
| 1077 | 1077 | dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos").' - No permission to updateprice', [], 1); |
| 1078 | - } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
| 1078 | + } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
| 1079 | 1079 | $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $vatratecode, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
| 1080 | 1080 | } else { |
| 1081 | 1081 | $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $vatratecode, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | |
| 1148 | 1148 | if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { |
| 1149 | 1149 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
| 1150 | - $warehouseid = (GETPOSTINT('warehouseid') > 0 ? GETPOSTINT('warehouseid') : getDolGlobalInt($constantforkey)); // Get the warehouse id from GETPOSTINT('warehouseid'), otherwise use default setup. |
|
| 1150 | + $warehouseid = (GETPOSTINT('warehouseid') > 0 ? GETPOSTINT('warehouseid') : getDolGlobalInt($constantforkey)); // Get the warehouse id from GETPOSTINT('warehouseid'), otherwise use default setup. |
|
| 1151 | 1151 | $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET batch = '".$db->escape($batch)."', fk_warehouse = ".((int) $warehouseid); |
| 1152 | 1152 | $sql .= " WHERE rowid=".((int) $idoflineadded); |
| 1153 | 1153 | $db->query($sql); |
@@ -1294,7 +1294,7 @@ discard block |
||
| 1294 | 1294 | |
| 1295 | 1295 | $sectionwithinvoicelink .= '</span><br>'; |
| 1296 | 1296 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
| 1297 | - $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>'; |
|
| 1297 | + $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>'; |
|
| 1298 | 1298 | } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { |
| 1299 | 1299 | if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { |
| 1300 | 1300 | $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.')">'.$langs->trans('PrintTicket').'</button>'; |
@@ -1333,7 +1333,7 @@ discard block |
||
| 1333 | 1333 | if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { |
| 1334 | 1334 | $title = 'TakePOS - Dolibarr '.DOL_VERSION; |
| 1335 | 1335 | if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { |
| 1336 | - $title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE'); |
|
| 1336 | + $title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE'); |
|
| 1337 | 1337 | } |
| 1338 | 1338 | $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/> |
| 1339 | 1339 | <meta name="apple-mobile-web-app-capable" content="yes"> |
@@ -1560,7 +1560,7 @@ discard block |
||
| 1560 | 1560 | if ($contactid > 0) { |
| 1561 | 1561 | $contact = new Contact($db); |
| 1562 | 1562 | $contact->fetch($contactid); |
| 1563 | - $s .= " - " . $contact->getFullName($langs); |
|
| 1563 | + $s .= " - ".$contact->getFullName($langs); |
|
| 1564 | 1564 | } |
| 1565 | 1565 | } |
| 1566 | 1566 | } elseif (getDolGlobalInt("TAKEPOS_NO_GENERIC_THIRDPARTY")) { |
@@ -1623,10 +1623,10 @@ discard block |
||
| 1623 | 1623 | $s = ''; |
| 1624 | 1624 | |
| 1625 | 1625 | $idwarehouse = 0; |
| 1626 | - $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1626 | + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1627 | 1627 | if (isModEnabled('stock')) { |
| 1628 | 1628 | if (getDolGlobalString($constantforkey) != "1") { |
| 1629 | - $constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1629 | + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1630 | 1630 | $idwarehouse = getDolGlobalInt($constantforkey); |
| 1631 | 1631 | if ($idwarehouse > 0) { |
| 1632 | 1632 | $s = '<span class="small">'; |
@@ -1774,7 +1774,7 @@ discard block |
||
| 1774 | 1774 | |
| 1775 | 1775 | // Complete header by hook |
| 1776 | 1776 | $parameters = array(); |
| 1777 | -$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 1777 | +$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 1778 | 1778 | if ($reshook < 0) { |
| 1779 | 1779 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 1780 | 1780 | } |
@@ -1788,16 +1788,16 @@ discard block |
||
| 1788 | 1788 | print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; |
| 1789 | 1789 | if (getDolGlobalString('TAKEPOS_SHOW_HT')) { |
| 1790 | 1790 | print '<td class="linecolht right nowraponall">'; |
| 1791 | - print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>'; |
|
| 1791 | + print '<span class="opacitymedium small">'.$langs->trans('TotalHTShort').'</span><br>'; |
|
| 1792 | 1792 | // In phone version only show when it is invoice page |
| 1793 | 1793 | if (empty($mobilepage) || $mobilepage == "invoice") { |
| 1794 | - print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>'; |
|
| 1794 | + print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency).'</span>'; |
|
| 1795 | 1795 | if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { |
| 1796 | 1796 | //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency |
| 1797 | - include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; |
|
| 1797 | + include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; |
|
| 1798 | 1798 | $multicurrency = new MultiCurrency($db); |
| 1799 | 1799 | $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); |
| 1800 | - print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">(' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')</span>'; |
|
| 1800 | + print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ht * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>'; |
|
| 1801 | 1801 | } |
| 1802 | 1802 | } |
| 1803 | 1803 | print '</td>'; |
@@ -1941,7 +1941,7 @@ discard block |
||
| 1941 | 1941 | |
| 1942 | 1942 | // complete line by hook |
| 1943 | 1943 | $parameters = array('line' => $line); |
| 1944 | - $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 1944 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 1945 | 1945 | if ($reshook < 0) { |
| 1946 | 1946 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 1947 | 1947 | } |
@@ -1996,7 +1996,7 @@ discard block |
||
| 1996 | 1996 | } |
| 1997 | 1997 | } |
| 1998 | 1998 | if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) { |
| 1999 | - $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>' . $line->product_ref . '</b> - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
| 1999 | + $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>'.$line->product_ref.'</b> - '.$line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
| 2000 | 2000 | } elseif (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) { |
| 2001 | 2001 | $htmlforlines .= $form->textwithpicto($line->product_ref ? '<b>'.$line->product_ref.'<b>' : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
| 2002 | 2002 | } else { |
@@ -2054,7 +2054,7 @@ discard block |
||
| 2054 | 2054 | |
| 2055 | 2055 | // complete line by hook |
| 2056 | 2056 | $parameters = array('line' => $line); |
| 2057 | - $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 2057 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 2058 | 2058 | if ($reshook < 0) { |
| 2059 | 2059 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 2060 | 2060 | } |
@@ -2165,7 +2165,7 @@ discard block |
||
| 2165 | 2165 | if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE && !getDolGlobalString('TAKEPOS_NO_CREDITNOTE')) { |
| 2166 | 2166 | print '<button id="buttonprint" type="button" onclick="ModalBox(\'ModalCreditNote\')">'.$langs->trans('CreateCreditNote').'</button>'; |
| 2167 | 2167 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
| 2168 | - print ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>'; |
|
| 2168 | + print ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>'; |
|
| 2169 | 2169 | } |
| 2170 | 2170 | } |
| 2171 | 2171 | |
@@ -665,11 +665,11 @@ discard block |
||
| 665 | 665 | $this->pass_indatabase = $obj->pass; |
| 666 | 666 | $this->pass_indatabase_crypted = $obj->pass_crypted; |
| 667 | 667 | $this->pass = $obj->pass; |
| 668 | - $this->pass_temp = $obj->pass_temp; |
|
| 668 | + $this->pass_temp = $obj->pass_temp; |
|
| 669 | 669 | $this->datelastpassvalidation = $obj->datelastpassvalidation; |
| 670 | 670 | $this->api_key = dolDecrypt($obj->api_key); |
| 671 | 671 | |
| 672 | - $this->address = $obj->address; |
|
| 672 | + $this->address = $obj->address; |
|
| 673 | 673 | $this->zip = $obj->zip; |
| 674 | 674 | $this->town = $obj->town; |
| 675 | 675 | |
@@ -692,11 +692,11 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | $this->job = $obj->job; |
| 694 | 694 | $this->signature = $obj->signature; |
| 695 | - $this->admin = $obj->admin; |
|
| 695 | + $this->admin = $obj->admin; |
|
| 696 | 696 | $this->note_public = $obj->note_public; |
| 697 | 697 | $this->note_private = $obj->note_private; |
| 698 | 698 | |
| 699 | - $this->statut = $obj->status; // deprecated |
|
| 699 | + $this->statut = $obj->status; // deprecated |
|
| 700 | 700 | $this->status = $obj->status; |
| 701 | 701 | |
| 702 | 702 | $this->photo = $obj->photo; |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php'; |
| 829 | 829 | |
| 830 | 830 | $defaultValues = new DefaultValues($this->db); |
| 831 | - $result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined) |
|
| 831 | + $result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined) |
|
| 832 | 832 | //$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity))); // User 0 (all) + me (if defined) |
| 833 | 833 | |
| 834 | 834 | if (!is_array($result) && $result < 0) { |
@@ -943,16 +943,16 @@ discard block |
||
| 943 | 943 | // Special case for external user |
| 944 | 944 | if (!empty($this->socid)) { |
| 945 | 945 | if ($module == 'societe' && ($permlevel1 == 'creer' || $permlevel1 == 'write')) { |
| 946 | - return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself) |
|
| 946 | + return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself) |
|
| 947 | 947 | } |
| 948 | 948 | if ($module == 'societe' && $permlevel1 == 'client' && $permlevel2 == 'voir') { |
| 949 | - return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself) |
|
| 949 | + return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself) |
|
| 950 | 950 | } |
| 951 | 951 | if ($module == 'societe' && $permlevel1 == 'export') { |
| 952 | - return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself) |
|
| 952 | + return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself) |
|
| 953 | 953 | } |
| 954 | 954 | if ($module == 'societe' && ($permlevel1 == 'supprimer' || $permlevel1 == 'delete')) { |
| 955 | - return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself) |
|
| 955 | + return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself) |
|
| 956 | 956 | } |
| 957 | 957 | } |
| 958 | 958 | |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | $sql .= " FROM ".$this->db->prefix()."rights_def"; |
| 1101 | 1101 | $sql .= " WHERE entity = ".((int) $entity); |
| 1102 | 1102 | if (!empty($whereforadd) && $whereforadd != 'allmodules') { |
| 1103 | - $sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized |
|
| 1103 | + $sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized |
|
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | $sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights"; |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | $sql .= " FROM ".$this->db->prefix()."rights_def"; |
| 1237 | 1237 | $sql .= " WHERE entity IN (".$this->db->sanitize($entity, 0, 0, 0, 0).")"; |
| 1238 | 1238 | if (!empty($wherefordel) && $wherefordel != 'allmodules') { |
| 1239 | - $sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized |
|
| 1239 | + $sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized |
|
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | 1242 | // avoid admin to remove his own important rights |
@@ -1415,12 +1415,12 @@ discard block |
||
| 1415 | 1415 | $sql .= " AND r.entity = ".((int) $conf->entity); |
| 1416 | 1416 | } |
| 1417 | 1417 | } else { |
| 1418 | - $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity |
|
| 1418 | + $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity |
|
| 1419 | 1419 | // The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r. |
| 1420 | 1420 | // but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of |
| 1421 | 1421 | // other entities, so we are forced to add a filter on gu here |
| 1422 | 1422 | $sql .= " AND gu.entity IN (0,".$conf->entity.")"; |
| 1423 | - $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity |
|
| 1423 | + $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity |
|
| 1424 | 1424 | } |
| 1425 | 1425 | // End of strange business rule |
| 1426 | 1426 | $sql .= " AND gr.fk_usergroup = gu.fk_usergroup"; |
@@ -1973,7 +1973,7 @@ discard block |
||
| 1973 | 1973 | $this->civility_code = $member->civility_code; |
| 1974 | 1974 | $this->lastname = $member->lastname; |
| 1975 | 1975 | $this->firstname = $member->firstname; |
| 1976 | - $this->gender = $member->gender; |
|
| 1976 | + $this->gender = $member->gender; |
|
| 1977 | 1977 | $this->email = $member->email; |
| 1978 | 1978 | $this->fk_member = $member->id; |
| 1979 | 1979 | $this->address = $member->address; |
@@ -2116,45 +2116,45 @@ discard block |
||
| 2116 | 2116 | $this->lastname = trim((string) $this->lastname); |
| 2117 | 2117 | $this->firstname = trim((string) $this->firstname); |
| 2118 | 2118 | $this->ref_employee = trim((string) $this->ref_employee); |
| 2119 | - $this->national_registration_number = trim((string) $this->national_registration_number); |
|
| 2119 | + $this->national_registration_number = trim((string) $this->national_registration_number); |
|
| 2120 | 2120 | $this->employee = ($this->employee > 0 ? $this->employee : 0); |
| 2121 | 2121 | $this->login = trim((string) $this->login); |
| 2122 | - $this->gender = trim((string) $this->gender); |
|
| 2122 | + $this->gender = trim((string) $this->gender); |
|
| 2123 | 2123 | |
| 2124 | 2124 | $this->pass = trim((string) $this->pass); |
| 2125 | - $this->api_key = trim((string) $this->api_key); |
|
| 2126 | - $this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity; |
|
| 2127 | - $this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity; |
|
| 2125 | + $this->api_key = trim((string) $this->api_key); |
|
| 2126 | + $this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity; |
|
| 2127 | + $this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity; |
|
| 2128 | 2128 | |
| 2129 | - $this->address = trim((string) $this->address); |
|
| 2130 | - $this->zip = trim((string) $this->zip); |
|
| 2131 | - $this->town = trim((string) $this->town); |
|
| 2129 | + $this->address = trim((string) $this->address); |
|
| 2130 | + $this->zip = trim((string) $this->zip); |
|
| 2131 | + $this->town = trim((string) $this->town); |
|
| 2132 | 2132 | |
| 2133 | - $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); |
|
| 2133 | + $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); |
|
| 2134 | 2134 | $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); |
| 2135 | - $this->office_phone = trim((string) $this->office_phone); |
|
| 2135 | + $this->office_phone = trim((string) $this->office_phone); |
|
| 2136 | 2136 | $this->office_fax = trim((string) $this->office_fax); |
| 2137 | - $this->user_mobile = trim((string) $this->user_mobile); |
|
| 2138 | - $this->personal_mobile = trim((string) $this->personal_mobile); |
|
| 2139 | - $this->email = trim((string) $this->email); |
|
| 2140 | - $this->personal_email = trim((string) $this->personal_email); |
|
| 2141 | - |
|
| 2142 | - $this->job = trim((string) $this->job); |
|
| 2143 | - $this->signature = trim((string) $this->signature); |
|
| 2144 | - $this->note_public = trim((string) $this->note_public); |
|
| 2145 | - $this->note_private = trim((string) $this->note_private); |
|
| 2146 | - $this->openid = trim((string) $this->openid); |
|
| 2147 | - $this->admin = ($this->admin > 0 ? $this->admin : 0); |
|
| 2148 | - |
|
| 2149 | - $this->accountancy_code_user_general = trim((string) $this->accountancy_code_user_general); |
|
| 2137 | + $this->user_mobile = trim((string) $this->user_mobile); |
|
| 2138 | + $this->personal_mobile = trim((string) $this->personal_mobile); |
|
| 2139 | + $this->email = trim((string) $this->email); |
|
| 2140 | + $this->personal_email = trim((string) $this->personal_email); |
|
| 2141 | + |
|
| 2142 | + $this->job = trim((string) $this->job); |
|
| 2143 | + $this->signature = trim((string) $this->signature); |
|
| 2144 | + $this->note_public = trim((string) $this->note_public); |
|
| 2145 | + $this->note_private = trim((string) $this->note_private); |
|
| 2146 | + $this->openid = trim((string) $this->openid); |
|
| 2147 | + $this->admin = ($this->admin > 0 ? $this->admin : 0); |
|
| 2148 | + |
|
| 2149 | + $this->accountancy_code_user_general = trim((string) $this->accountancy_code_user_general); |
|
| 2150 | 2150 | $this->accountancy_code = trim((string) $this->accountancy_code); |
| 2151 | - $this->color = trim((string) $this->color); |
|
| 2152 | - $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; |
|
| 2151 | + $this->color = trim((string) $this->color); |
|
| 2152 | + $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; |
|
| 2153 | 2153 | $this->dateemploymentend = empty($this->dateemploymentend) ? '' : $this->dateemploymentend; |
| 2154 | 2154 | |
| 2155 | - $this->birth = empty($this->birth) ? '' : $this->birth; |
|
| 2156 | - $this->fk_warehouse = (int) $this->fk_warehouse; |
|
| 2157 | - $this->fk_establishment = (int) $this->fk_establishment; |
|
| 2155 | + $this->birth = empty($this->birth) ? '' : $this->birth; |
|
| 2156 | + $this->fk_warehouse = (int) $this->fk_warehouse; |
|
| 2157 | + $this->fk_establishment = (int) $this->fk_establishment; |
|
| 2158 | 2158 | |
| 2159 | 2159 | $this->setUpperOrLowerCase(); |
| 2160 | 2160 | |
@@ -2919,7 +2919,7 @@ discard block |
||
| 2919 | 2919 | $sql .= " WHERE fk_user = ".((int) $this->id); |
| 2920 | 2920 | $sql .= " AND fk_usergroup = ".((int) $group); |
| 2921 | 2921 | if (empty($entity)) { |
| 2922 | - $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. |
|
| 2922 | + $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. |
|
| 2923 | 2923 | } else { |
| 2924 | 2924 | $sql .= " AND entity = ".((int) $entity); |
| 2925 | 2925 | } |
@@ -3180,7 +3180,7 @@ discard block |
||
| 3180 | 3180 | $linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"'; |
| 3181 | 3181 | } |
| 3182 | 3182 | $linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"'); |
| 3183 | - $linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
| 3183 | + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
| 3184 | 3184 | } else { |
| 3185 | 3185 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
| 3186 | 3186 | } |
@@ -3419,11 +3419,11 @@ discard block |
||
| 3419 | 3419 | global $conf; |
| 3420 | 3420 | $dn = ''; |
| 3421 | 3421 | if ($mode == 0) { |
| 3422 | - $dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN'); |
|
| 3422 | + $dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN'); |
|
| 3423 | 3423 | } elseif ($mode == 1) { |
| 3424 | 3424 | $dn = getDolGlobalString('LDAP_USER_DN'); |
| 3425 | 3425 | } elseif ($mode == 2) { |
| 3426 | - $dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]; |
|
| 3426 | + $dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')]; |
|
| 3427 | 3427 | } |
| 3428 | 3428 | return $dn; |
| 3429 | 3429 | } |
@@ -3638,7 +3638,7 @@ discard block |
||
| 3638 | 3638 | $this->iplastlogin = '127.0.0.1'; |
| 3639 | 3639 | $this->datepreviouslogin = $now; |
| 3640 | 3640 | $this->ippreviouslogin = '127.0.0.1'; |
| 3641 | - $this->statut = 1; // deprecated |
|
| 3641 | + $this->statut = 1; // deprecated |
|
| 3642 | 3642 | $this->status = 1; |
| 3643 | 3643 | |
| 3644 | 3644 | $this->entity = 1; |
@@ -18,19 +18,19 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * @var Conf $conf |
|
| 22 | - * @var DoliDB $db |
|
| 23 | - * @var ?FormMail $formmail |
|
| 24 | - * @var ?FormWebsite $formwebsite |
|
| 25 | - * @var ?FormAI $formai |
|
| 26 | - * @var string $htmlname |
|
| 27 | - * @var string $showlinktolayout 'emailing', 'email', 'websitepage', ... |
|
| 28 | - * @var string $showlinktolayoutlabel '...' |
|
| 29 | - * @var string $showlinktoai '' or 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', ... |
|
| 30 | - * @var string $showlinktoailabel '...' |
|
| 31 | - * @var string $htmlname |
|
| 32 | - * @var ?string $out |
|
| 33 | - */ |
|
| 21 | + * @var Conf $conf |
|
| 22 | + * @var DoliDB $db |
|
| 23 | + * @var ?FormMail $formmail |
|
| 24 | + * @var ?FormWebsite $formwebsite |
|
| 25 | + * @var ?FormAI $formai |
|
| 26 | + * @var string $htmlname |
|
| 27 | + * @var string $showlinktolayout 'emailing', 'email', 'websitepage', ... |
|
| 28 | + * @var string $showlinktolayoutlabel '...' |
|
| 29 | + * @var string $showlinktoai '' or 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', ... |
|
| 30 | + * @var string $showlinktoailabel '...' |
|
| 31 | + * @var string $htmlname |
|
| 32 | + * @var ?string $out |
|
| 33 | + */ |
|
| 34 | 34 | |
| 35 | 35 | //Protection to avoid direct call of template |
| 36 | 36 | if (empty($conf) || !is_object($conf)) { |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | $sql .= " JOIN ".$db->prefix()."product_stock as ps"; |
| 193 | 193 | $sql .= " ON ps.rowid = pb.fk_product_stock"; |
| 194 | 194 | $sql .= " WHERE pb.batch = '".$db->escape($lot)."'"; |
| 195 | - $sql .= " AND ps.fk_product = ".((int) $prod_id) ; |
|
| 196 | - $sql .= " AND ps.fk_entrepot = ".((int) $warehouse_id) ; |
|
| 195 | + $sql .= " AND ps.fk_product = ".((int) $prod_id); |
|
| 196 | + $sql .= " AND ps.fk_entrepot = ".((int) $warehouse_id); |
|
| 197 | 197 | |
| 198 | 198 | $resql = $db->query($sql); |
| 199 | 199 | if ($resql) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $qtystart = 0; |
| 221 | 221 | |
| 222 | 222 | if ($idline > 0) { |
| 223 | - $result = $expeditiondispatch->fetch($idline); // get line from llx_expeditiondet |
|
| 223 | + $result = $expeditiondispatch->fetch($idline); // get line from llx_expeditiondet |
|
| 224 | 224 | if ($result < 0) { |
| 225 | 225 | setEventMessages($expeditiondispatch->error, $expeditiondispatch->errors, 'errors'); |
| 226 | 226 | $error++; |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | llxHeader('', $title, $help_url, '', 0, 0, $morejs, '', '', 'mod-expedition page-card_dispatch'); |
| 397 | 397 | |
| 398 | 398 | if ($object->id > 0 || !empty($object->ref)) { |
| 399 | - $lines = $object->lines; // This is an array of detail of line, on line per source order line found intolines[]->fk_elementdet, then each line may have sub data |
|
| 399 | + $lines = $object->lines; // This is an array of detail of line, on line per source order line found intolines[]->fk_elementdet, then each line may have sub data |
|
| 400 | 400 | //var_dump($lines[0]->fk_elementdet); exit; |
| 401 | 401 | |
| 402 | 402 | $num_prod = count($lines); |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | |
| 455 | 455 | // Ref customer shipment |
| 456 | 456 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1); |
| 457 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 457 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 458 | 458 | |
| 459 | 459 | // Thirdparty |
| 460 | 460 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1); |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | print '<center>'; |
| 546 | 546 | |
| 547 | 547 | print '<br>'; |
| 548 | - $disabled = 0; // This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0. |
|
| 548 | + $disabled = 0; // This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0. |
|
| 549 | 549 | |
| 550 | 550 | if ($object->statut == Expedition::STATUS_DRAFT) { |
| 551 | 551 | require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | } |
| 655 | 655 | print '<td class="right">'.$langs->trans("QtyOrdered").'</td>'; |
| 656 | 656 | if ($object->status == Expedition::STATUS_DRAFT) { |
| 657 | - print '<td class="right">'.$langs->trans("QtyToShip"); // Qty to dispatch (sum for all lines of batch detail if there is) |
|
| 657 | + print '<td class="right">'.$langs->trans("QtyToShip"); // Qty to dispatch (sum for all lines of batch detail if there is) |
|
| 658 | 658 | } else { |
| 659 | 659 | print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>'; |
| 660 | 660 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * \remarks To run this script as CLI: phpunit filename.php |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -global $conf,$user,$langs,$db; |
|
| 29 | +global $conf, $user, $langs, $db; |
|
| 30 | 30 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 31 | 31 | //require_once 'PHPUnit/Autoload.php'; |
| 32 | 32 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public static function setUpBeforeClass(): void |
| 59 | 59 | { |
| 60 | - global $conf,$user,$langs,$db; |
|
| 60 | + global $conf, $user, $langs, $db; |
|
| 61 | 61 | |
| 62 | 62 | if (getDolGlobalString('MAIN_MODULE_LDAP')) { |
| 63 | 63 | print "\n".__METHOD__." module LDAP must be disabled.\n"; |
| 64 | 64 | die(1); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
| 67 | + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
| 68 | 68 | |
| 69 | 69 | print __METHOD__."\n"; |
| 70 | 70 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function testUserCreate() |
| 78 | 78 | { |
| 79 | - global $conf,$user,$langs,$db; |
|
| 79 | + global $conf, $user, $langs, $db; |
|
| 80 | 80 | $conf = $this->savconf; |
| 81 | 81 | $user = $this->savuser; |
| 82 | 82 | $langs = $this->savlangs; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function testUserFetch($id) |
| 105 | 105 | { |
| 106 | - global $conf,$user,$langs,$db; |
|
| 106 | + global $conf, $user, $langs, $db; |
|
| 107 | 107 | $conf = $this->savconf; |
| 108 | 108 | $user = $this->savuser; |
| 109 | 109 | $langs = $this->savlangs; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function testUserUpdate($localobject) |
| 129 | 129 | { |
| 130 | - global $conf,$user,$langs,$db; |
|
| 130 | + global $conf, $user, $langs, $db; |
|
| 131 | 131 | $conf = $this->savconf; |
| 132 | 132 | $user = $this->savuser; |
| 133 | 133 | $langs = $this->savlangs; |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | // Test everything are still same than specimen |
| 143 | 143 | $newlocalobject = new User($db); |
| 144 | 144 | $newlocalobject->initAsSpecimen(); |
| 145 | - $this->changeProperties($newlocalobject); // Change some properties int $newlocalobject |
|
| 145 | + $this->changeProperties($newlocalobject); // Change some properties int $newlocalobject |
|
| 146 | 146 | |
| 147 | - $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('array_options','id','socid','societe_id','specimen','note','ref','pass','pass_indatabase','pass_indatabase_crypted','pass_temp','datec','datem','datelastlogin','datepreviouslogin','datelastpassvalidation','flagdelsessionsbefore','iplastlogin','ippreviouslogin','trackid')), array()); // Actual, Expected |
|
| 147 | + $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('array_options', 'id', 'socid', 'societe_id', 'specimen', 'note', 'ref', 'pass', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'datec', 'datem', 'datelastlogin', 'datepreviouslogin', 'datelastpassvalidation', 'flagdelsessionsbefore', 'iplastlogin', 'ippreviouslogin', 'trackid')), array()); // Actual, Expected |
|
| 148 | 148 | return $localobject; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function testUserDisable($localobject) |
| 160 | 160 | { |
| 161 | - global $conf,$user,$langs,$db; |
|
| 161 | + global $conf, $user, $langs, $db; |
|
| 162 | 162 | $conf = $this->savconf; |
| 163 | 163 | $user = $this->savuser; |
| 164 | 164 | $langs = $this->savlangs; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function testUserOther($localobject) |
| 184 | 184 | { |
| 185 | - global $conf,$user,$langs,$db; |
|
| 185 | + global $conf, $user, $langs, $db; |
|
| 186 | 186 | $conf = $this->savconf; |
| 187 | 187 | $user = $this->savuser; |
| 188 | 188 | $langs = $this->savlangs; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function testUserHasRight($localobject) |
| 210 | 210 | { |
| 211 | - global $conf,$user,$langs,$db; |
|
| 211 | + global $conf, $user, $langs, $db; |
|
| 212 | 212 | $conf = $this->savconf; |
| 213 | 213 | $user = $this->savuser; |
| 214 | 214 | $langs = $this->savlangs; |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | $this->assertLessThan($result, 0); |
| 219 | 219 | */ |
| 220 | 220 | |
| 221 | - print __METHOD__." id=". $localobject->id ."\n"; |
|
| 221 | + print __METHOD__." id=".$localobject->id."\n"; |
|
| 222 | 222 | //$this->assertNotEquals($user->date_creation, ''); |
| 223 | 223 | $localobject->addrights(0, 'supplier_proposal'); |
| 224 | 224 | $this->assertEquals($localobject->hasRight('member', ''), 0); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function testUserSetPassword($localobject) |
| 242 | 242 | { |
| 243 | - global $conf,$user,$langs,$db; |
|
| 243 | + global $conf, $user, $langs, $db; |
|
| 244 | 244 | $conf = $this->savconf; |
| 245 | 245 | $user = $this->savuser; |
| 246 | 246 | $langs = $this->savlangs; |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function testUserDelete($id) |
| 355 | 355 | { |
| 356 | - global $conf,$user,$langs,$db; |
|
| 356 | + global $conf, $user, $langs, $db; |
|
| 357 | 357 | $conf = $this->savconf; |
| 358 | 358 | $user = $this->savuser; |
| 359 | 359 | $langs = $this->savlangs; |
@@ -378,14 +378,14 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | public function testUserAddPermission($id) |
| 380 | 380 | { |
| 381 | - global $conf,$user,$langs,$db; |
|
| 381 | + global $conf, $user, $langs, $db; |
|
| 382 | 382 | $conf = $this->savconf; |
| 383 | 383 | $user = $this->savuser; |
| 384 | 384 | $langs = $this->savlangs; |
| 385 | 385 | $db = $this->savdb; |
| 386 | 386 | |
| 387 | 387 | $localobject = new User($db); |
| 388 | - $result = $localobject->fetch(1); // Other tests use the user id 1 |
|
| 388 | + $result = $localobject->fetch(1); // Other tests use the user id 1 |
|
| 389 | 389 | $result = $localobject->addrights(0, 'supplier_proposal'); |
| 390 | 390 | |
| 391 | 391 | print __METHOD__." id=".$id." result=".$result."\n"; |