@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | $error = 0; |
| 204 | 204 | $parameters = array(); |
| 205 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 205 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 206 | 206 | if ($reshook < 0) { |
| 207 | 207 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 208 | 208 | } |
@@ -224,9 +224,9 @@ discard block |
||
| 224 | 224 | $bankaccount = GETPOSTINT('accountid'); |
| 225 | 225 | } else { |
| 226 | 226 | if ($pay == 'LIQ') { |
| 227 | - $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 227 | + $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 228 | 228 | } elseif ($pay == "CHQ") { |
| 229 | - $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 229 | + $bankaccount = getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
| 230 | 230 | } else { |
| 231 | 231 | $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; |
| 232 | 232 | $bankaccount = getDolGlobalInt($accountname); |
@@ -296,14 +296,14 @@ discard block |
||
| 296 | 296 | // The case for isModEnabled('productbatch') is processed few lines later. |
| 297 | 297 | $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); |
| 298 | 298 | |
| 299 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation |
|
| 299 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation |
|
| 300 | 300 | |
| 301 | 301 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
| 302 | 302 | dol_syslog("Validate invoice with stock change. Warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey)); |
| 303 | 303 | |
| 304 | 304 | // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) |
| 305 | 305 | // Label of stock movement will be the same as when we validate invoice "Invoice XXXX validated" |
| 306 | - $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 306 | + $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 307 | 307 | $res = $invoice->validate($user, '', getDolGlobalInt($constantforkey), 0, $batch_rule); |
| 308 | 308 | |
| 309 | 309 | // Restore setup |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $payment->num_payment = $invoice->ref; |
| 345 | 345 | |
| 346 | 346 | if ($pay != "delayed") { |
| 347 | - $res = $payment->create($user); // This record payment and regenerate the PDF |
|
| 347 | + $res = $payment->create($user); // This record payment and regenerate the PDF |
|
| 348 | 348 | if ($res < 0) { |
| 349 | 349 | $error++; |
| 350 | 350 | //setEventMessages($payment->error, $payment->errors, 'error'); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | dol_syslog("Now we record the stock movement for each qualified line"); |
| 394 | 394 | |
| 395 | 395 | // The case !isModEnabled('productbatch') was processed few lines before. |
| 396 | - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; |
|
| 396 | + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; |
|
| 397 | 397 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
| 398 | 398 | $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); |
| 399 | 399 | // Label of stock movement will be "TakePOS - Invoice XXXX" |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $creditnote->socid = $invoice->socid; |
| 450 | 450 | $creditnote->date = dol_now(); |
| 451 | 451 | $creditnote->module_source = 'takepos'; |
| 452 | - $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
| 452 | + $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
| 453 | 453 | $creditnote->type = Facture::TYPE_CREDIT_NOTE; |
| 454 | 454 | $creditnote->fk_facture_source = $placeid; |
| 455 | 455 | //$creditnote->remise_absolue = $invoice->remise_absolue; |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | // If module stock is enabled and we do not setup takepo to disable stock decrease |
| 577 | 577 | // The case for isModEnabled('productbatch') is processed few lines later. |
| 578 | 578 | $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); |
| 579 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // We force setup to have update of stock on invoice validation/unvalidation |
|
| 579 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // We force setup to have update of stock on invoice validation/unvalidation |
|
| 580 | 580 | |
| 581 | 581 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
| 582 | 582 | |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | |
| 585 | 585 | // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) |
| 586 | 586 | // Label of stock movement will be the same as when we validate invoice "Invoice XXXX validated" |
| 587 | - $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 587 | + $batch_rule = 0; // Module productbatch is disabled here, so no need for a batch_rule. |
|
| 588 | 588 | $res = $creditnote->validate($user, '', getDolGlobalInt($constantforkey), 0, $batch_rule); |
| 589 | 589 | if ($res < 0) { |
| 590 | 590 | $error++; |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | dol_syslog("Now we record the stock movement for each qualified line"); |
| 605 | 605 | |
| 606 | 606 | // The case !isModEnabled('productbatch') was processed few lines before. |
| 607 | - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; |
|
| 607 | + require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; |
|
| 608 | 608 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
| 609 | 609 | $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); |
| 610 | 610 | // Label of stock movement will be "TakePOS - Invoice XXXX" |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | if (!$error && $res >= 0) { |
| 645 | 645 | $db->commit(); |
| 646 | 646 | } else { |
| 647 | - $creditnote->id = $placeid; // Creation has failed, we reset to ID of source invoice so we go back to this one in action=history |
|
| 647 | + $creditnote->id = $placeid; // Creation has failed, we reset to ID of source invoice so we go back to this one in action=history |
|
| 648 | 648 | $db->rollback(); |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -664,14 +664,14 @@ discard block |
||
| 664 | 664 | if (($action == "addline" || $action == "freezone") && $placeid == 0 && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { |
| 665 | 665 | $invoice->socid = getDolGlobalInt($constforcompanyid); |
| 666 | 666 | |
| 667 | - $dolnowtzuserrel = dol_now('tzuserrel'); // If user is 02 january 22:00, we want to store '02 january' |
|
| 667 | + $dolnowtzuserrel = dol_now('tzuserrel'); // If user is 02 january 22:00, we want to store '02 january' |
|
| 668 | 668 | $monthuser = dol_print_date($dolnowtzuserrel, '%m', 'gmt'); |
| 669 | 669 | $dayuser = dol_print_date($dolnowtzuserrel, '%d', 'gmt'); |
| 670 | 670 | $yearuser = dol_print_date($dolnowtzuserrel, '%Y', 'gmt'); |
| 671 | - $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 |
|
| 671 | + $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 |
|
| 672 | 672 | |
| 673 | 673 | include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
| 674 | - $invoice->date = $dateinvoice; // Invoice::create() needs a date with no hours |
|
| 674 | + $invoice->date = $dateinvoice; // Invoice::create() needs a date with no hours |
|
| 675 | 675 | |
| 676 | 676 | /* |
| 677 | 677 | print "monthuser=".$monthuser." dayuser=".$dayuser." yearuser=".$yearuser.'<br>'; |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | |
| 688 | 688 | $invoice->module_source = 'takepos'; |
| 689 | - $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
| 689 | + $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
| 690 | 690 | $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity; |
| 691 | 691 | |
| 692 | 692 | if ($invoice->socid <= 0) { |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | |
| 900 | 900 | // complete line by hook |
| 901 | 901 | $parameters = array('prod' => $prod, 'line' => $line); |
| 902 | - $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
| 902 | + $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
| 903 | 903 | if ($reshook < 0) { |
| 904 | 904 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 905 | 905 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | |
| 1115 | 1115 | if (!$permissiontoupdateline) { |
| 1116 | 1116 | dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos").' - No permission to updateprice', [], 1); |
| 1117 | - } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
| 1117 | + } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
| 1118 | 1118 | $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); |
| 1119 | 1119 | } else { |
| 1120 | 1120 | $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); |
@@ -1186,7 +1186,7 @@ discard block |
||
| 1186 | 1186 | |
| 1187 | 1187 | if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { |
| 1188 | 1188 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
| 1189 | - $warehouseid = (GETPOSTINT('warehouseid') > 0 ? GETPOSTINT('warehouseid') : getDolGlobalInt($constantforkey)); // Get the warehouse id from GETPOSTINT('warehouseid'), otherwise use default setup. |
|
| 1189 | + $warehouseid = (GETPOSTINT('warehouseid') > 0 ? GETPOSTINT('warehouseid') : getDolGlobalInt($constantforkey)); // Get the warehouse id from GETPOSTINT('warehouseid'), otherwise use default setup. |
|
| 1190 | 1190 | $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET batch = '".$db->escape($batch)."', fk_warehouse = ".((int) $warehouseid); |
| 1191 | 1191 | $sql .= " WHERE rowid=".((int) $idoflineadded); |
| 1192 | 1192 | $db->query($sql); |
@@ -1334,12 +1334,12 @@ discard block |
||
| 1334 | 1334 | $customprinttemplateallowed = true; |
| 1335 | 1335 | include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; |
| 1336 | 1336 | if (isALNERunningVersion()) { // No need to show this option because it has no effect when isALNERunningVersion is true. |
| 1337 | - $customprinttemplateallowed = false; // Custom printer may be allowed if mandatory information in template are guaranteed. For the moment, we prefer not allow this. |
|
| 1337 | + $customprinttemplateallowed = false; // Custom printer may be allowed if mandatory information in template are guaranteed. For the moment, we prefer not allow this. |
|
| 1338 | 1338 | } |
| 1339 | 1339 | |
| 1340 | 1340 | if ($invoice->status == $invoice::STATUS_CLOSED) { |
| 1341 | 1341 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
| 1342 | - $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">'.$langs->trans("Invoice").'</a>'; |
|
| 1342 | + $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">'.$langs->trans("Invoice").'</a>'; |
|
| 1343 | 1343 | } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { |
| 1344 | 1344 | // Used when the external addon takeposconnector is installed. Deprecated. |
| 1345 | 1345 | if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { |
@@ -1382,7 +1382,7 @@ discard block |
||
| 1382 | 1382 | if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { |
| 1383 | 1383 | $title = 'TakePOS - Dolibarr '.DOL_VERSION; |
| 1384 | 1384 | if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { |
| 1385 | - $title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE'); |
|
| 1385 | + $title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE'); |
|
| 1386 | 1386 | } |
| 1387 | 1387 | $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/> |
| 1388 | 1388 | <meta name="apple-mobile-web-app-capable" content="yes"> |
@@ -1632,7 +1632,7 @@ discard block |
||
| 1632 | 1632 | if ($contactid > 0) { |
| 1633 | 1633 | $contact = new Contact($db); |
| 1634 | 1634 | $contact->fetch($contactid); |
| 1635 | - $s .= " - " . $contact->getFullName($langs); |
|
| 1635 | + $s .= " - ".$contact->getFullName($langs); |
|
| 1636 | 1636 | } |
| 1637 | 1637 | } |
| 1638 | 1638 | } elseif (getDolGlobalInt("TAKEPOS_NO_GENERIC_THIRDPARTY")) { |
@@ -1695,10 +1695,10 @@ discard block |
||
| 1695 | 1695 | $s = ''; |
| 1696 | 1696 | |
| 1697 | 1697 | $idwarehouse = 0; |
| 1698 | - $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1698 | + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1699 | 1699 | if (isModEnabled('stock')) { |
| 1700 | 1700 | if (getDolGlobalString($constantforkey) != "1") { |
| 1701 | - $constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1701 | + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
| 1702 | 1702 | $idwarehouse = getDolGlobalInt($constantforkey); |
| 1703 | 1703 | if ($idwarehouse > 0) { |
| 1704 | 1704 | $s = '<span class="small">'; |
@@ -1808,11 +1808,11 @@ discard block |
||
| 1808 | 1808 | } |
| 1809 | 1809 | |
| 1810 | 1810 | $buttontocreatecreditnote = ''; |
| 1811 | -if (($action == "valid" || $action == "history" || ($action == "addline" && $invoice->status == $invoice::STATUS_CLOSED)) && $invoice->type != Facture::TYPE_CREDIT_NOTE && !getDolGlobalString('TAKEPOS_NO_CREDITNOTE')) { |
|
| 1811 | +if (($action == "valid" || $action == "history" || ($action == "addline" && $invoice->status == $invoice::STATUS_CLOSED)) && $invoice->type != Facture::TYPE_CREDIT_NOTE && !getDolGlobalString('TAKEPOS_NO_CREDITNOTE')) { |
|
| 1812 | 1812 | $buttontocreatecreditnote .= ' <!-- Show button to create a credit note -->'."\n"; |
| 1813 | 1813 | $buttontocreatecreditnote .= '<button id="buttonprint" type="button" onclick="ModalBox(\'ModalCreditNote\')">'.$langs->trans('CreateCreditNote').'</button>'; |
| 1814 | 1814 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
| 1815 | - $buttontocreatecreditnote .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . urlencode($invoice->ref . '/' . $invoice->ref . '.pdf').'">'.$langs->trans("Invoice").'</a>'; |
|
| 1815 | + $buttontocreatecreditnote .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.urlencode($invoice->ref.'/'.$invoice->ref.'.pdf').'">'.$langs->trans("Invoice").'</a>'; |
|
| 1816 | 1816 | } |
| 1817 | 1817 | } |
| 1818 | 1818 | |
@@ -1864,7 +1864,7 @@ discard block |
||
| 1864 | 1864 | |
| 1865 | 1865 | // Complete header by hook |
| 1866 | 1866 | $parameters = array(); |
| 1867 | -$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 1867 | +$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 1868 | 1868 | if ($reshook < 0) { |
| 1869 | 1869 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 1870 | 1870 | } |
@@ -1878,16 +1878,16 @@ discard block |
||
| 1878 | 1878 | print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; |
| 1879 | 1879 | if (getDolGlobalString('TAKEPOS_SHOW_HT')) { |
| 1880 | 1880 | print '<td class="linecolht right nowraponall">'; |
| 1881 | - print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>'; |
|
| 1881 | + print '<span class="opacitymedium small">'.$langs->trans('TotalHTShort').'</span><br>'; |
|
| 1882 | 1882 | // In phone version only show when it is invoice page |
| 1883 | 1883 | if (empty($mobilepage) || $mobilepage == "invoice") { |
| 1884 | - 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>'; |
|
| 1884 | + 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>'; |
|
| 1885 | 1885 | if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { |
| 1886 | 1886 | //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency |
| 1887 | - include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; |
|
| 1887 | + include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; |
|
| 1888 | 1888 | $multicurrency = new MultiCurrency($db); |
| 1889 | 1889 | $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); |
| 1890 | - 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>'; |
|
| 1890 | + 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>'; |
|
| 1891 | 1891 | } |
| 1892 | 1892 | } |
| 1893 | 1893 | print '</td>'; |
@@ -2034,7 +2034,7 @@ discard block |
||
| 2034 | 2034 | |
| 2035 | 2035 | // complete line by hook |
| 2036 | 2036 | $parameters = array('line' => $line); |
| 2037 | - $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 2037 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 2038 | 2038 | if ($reshook < 0) { |
| 2039 | 2039 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 2040 | 2040 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | } |
| 2090 | 2090 | } |
| 2091 | 2091 | if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) { |
| 2092 | - $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>' . $line->product_ref . '</b> - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
| 2092 | + $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>'.$line->product_ref.'</b> - '.$line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
| 2093 | 2093 | } elseif (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) { |
| 2094 | 2094 | $htmlforlines .= $form->textwithpicto($line->product_ref ? '<b>'.$line->product_ref.'<b>' : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
| 2095 | 2095 | } else { |
@@ -2147,7 +2147,7 @@ discard block |
||
| 2147 | 2147 | |
| 2148 | 2148 | // complete line by hook |
| 2149 | 2149 | $parameters = array('line' => $line); |
| 2150 | - $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 2150 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
| 2151 | 2151 | if ($reshook < 0) { |
| 2152 | 2152 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 2153 | 2153 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object); |
| 144 | 144 | if (!empty($hookmanager->resPrint)) { |
| 145 | 145 | print $hookmanager->resPrint; |
| 146 | - return; // Receipt page can be called by the takepos/send.php page that use ob_start/end so we must use return and not exit to stop page |
|
| 146 | + return; // Receipt page can be called by the takepos/send.php page that use ob_start/end so we must use return and not exit to stop page |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | <?php |
| 222 | 222 | // Invoice Ref |
| 223 | 223 | if (getDolGlobalString('TAKEPOS_RECEIPT_NAME')) { |
| 224 | - print getDolGlobalString('TAKEPOS_RECEIPT_NAME') . " "; |
|
| 224 | + print getDolGlobalString('TAKEPOS_RECEIPT_NAME')." "; |
|
| 225 | 225 | } else { |
| 226 | 226 | print $langs->trans("InvoiceRef")." "; |
| 227 | 227 | } |
@@ -281,10 +281,10 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | if ($object->status == $object::STATUS_CLOSED) { |
| 283 | 283 | if ($isADuplicata) { |
| 284 | - print '<br><b>*** DUPLICATA***</b>'; // Hard coded string |
|
| 284 | + print '<br><b>*** DUPLICATA***</b>'; // Hard coded string |
|
| 285 | 285 | } |
| 286 | 286 | } else { |
| 287 | - print '<br><b>*** '.strtoupper($langs->trans("TemporaryReceipt")).' ***</b>'; // Hard coded string |
|
| 287 | + print '<br><b>*** '.strtoupper($langs->trans("TemporaryReceipt")).' ***</b>'; // Hard coded string |
|
| 288 | 288 | } |
| 289 | 289 | ?> |
| 290 | 290 | </p> |
@@ -313,13 +313,13 @@ discard block |
||
| 313 | 313 | if ($action == 'without_details') { |
| 314 | 314 | $qty = GETPOSTINT('qty') > 0 ? GETPOSTINT('qty') : 1; |
| 315 | 315 | print '<tr>'; |
| 316 | - print '<td>' . GETPOST('label', 'alphanohtml') . '</td>'; |
|
| 317 | - print '<td class="right">' . $qty . '</td>'; |
|
| 318 | - print '<td class="right">' . price(price2num($object->total_ttc / $qty, 'MU'), 1) . '</td>'; |
|
| 316 | + print '<td>'.GETPOST('label', 'alphanohtml').'</td>'; |
|
| 317 | + print '<td class="right">'.$qty.'</td>'; |
|
| 318 | + print '<td class="right">'.price(price2num($object->total_ttc / $qty, 'MU'), 1).'</td>'; |
|
| 319 | 319 | if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { |
| 320 | - print '<td class="right">' . price($object->total_ht, 1) . '</td>'; |
|
| 320 | + print '<td class="right">'.price($object->total_ht, 1).'</td>'; |
|
| 321 | 321 | } |
| 322 | - print '<td class="right">' . price($object->total_ttc, 1) . '</td>'; |
|
| 322 | + print '<td class="right">'.price($object->total_ttc, 1).'</td>'; |
|
| 323 | 323 | print '</tr>'; |
| 324 | 324 | } else { |
| 325 | 325 | foreach ($object->lines as $line) { |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) { |
| 484 | 484 | echo '<tr>'; |
| 485 | 485 | echo '<td class="right">'; |
| 486 | - echo $langs->trans("Change"); // ChangeBack ? |
|
| 486 | + echo $langs->trans("Change"); // ChangeBack ? |
|
| 487 | 487 | echo '</td>'; |
| 488 | 488 | echo '<td class="right">'; |
| 489 | 489 | echo price($row->pos_change, 1, '', 1, - 1, - 1, $currency); |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | $errors = 0; |
| 76 | 76 | $errorforhistory = 0; |
| 77 | 77 | $static_object = new Target($this->db); |
| 78 | - $filter = ''; // TODO Replace this with a search with filter on $action trigger to avoid to filter later. |
|
| 78 | + $filter = ''; // TODO Replace this with a search with filter on $action trigger to avoid to filter later. |
|
| 79 | 79 | $target_url = $static_object->fetchAll('', '', 0, 0, $filter); |
| 80 | 80 | |
| 81 | 81 | if (is_numeric($target_url) && $target_url < 0) { |
| 82 | - dol_syslog("Error Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); |
|
| 82 | + dol_syslog("Error Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); |
|
| 83 | 83 | $this->errors = array_merge($this->errors, $static_object->errors); |
| 84 | 84 | return -1; |
| 85 | 85 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $nbPosts++; |
| 131 | 131 | } else { |
| 132 | 132 | $errormsg = "The WebHook for ".$action." failed to get URL ".$tmpobject->url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""); |
| 133 | - $errorforhistory ++; |
|
| 133 | + $errorforhistory++; |
|
| 134 | 134 | |
| 135 | 135 | if ($tmpobject->type == Target::TYPE_BLOCKING) { |
| 136 | 136 | $errors++; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $dbhistory->close(); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id." -> nbPost=".$nbPosts); |
|
| 179 | + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id." -> nbPost=".$nbPosts); |
|
| 180 | 180 | |
| 181 | 181 | if (!empty($errors)) { |
| 182 | 182 | return $errors * -1; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * \remarks To run this script as CLI: phpunit filename.php |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -global $conf,$user,$langs,$db; |
|
| 28 | +global $conf, $user, $langs, $db; |
|
| 29 | 29 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 30 | 30 | //require_once 'PHPUnit/Autoload.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function testDDLCreateTable() |
| 58 | 58 | { |
| 59 | - global $conf,$user,$langs,$db; |
|
| 59 | + global $conf, $user, $langs, $db; |
|
| 60 | 60 | $conf = $this->savconf; |
| 61 | 61 | $user = $this->savuser; |
| 62 | 62 | $langs = $this->savlangs; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function testDDLUpdateField() |
| 93 | 93 | { |
| 94 | - global $conf,$user,$langs,$db; |
|
| 94 | + global $conf, $user, $langs, $db; |
|
| 95 | 95 | $conf = $this->savconf; |
| 96 | 96 | $user = $this->savuser; |
| 97 | 97 | $langs = $this->savlangs; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function testGetNextAutoIncrementId() |
| 136 | 136 | { |
| 137 | - global $conf,$user,$langs,$db; |
|
| 137 | + global $conf, $user, $langs, $db; |
|
| 138 | 138 | $conf = $this->savconf; |
| 139 | 139 | $user = $this->savuser; |
| 140 | 140 | $langs = $this->savlangs; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | print __METHOD__.' db->type = '.$db->type."\n"; |
| 144 | 144 | $result = $db->getNextAutoIncrementId(MAIN_DB_PREFIX.'blockedlog'); |
| 145 | - $this->assertGreaterThan(0, $result); // Must be strictlyhigher than 0 |
|
| 145 | + $this->assertGreaterThan(0, $result); // Must be strictlyhigher than 0 |
|
| 146 | 146 | print __METHOD__." result=".$result."\n"; |
| 147 | 147 | } |
| 148 | 148 | } |