@@ -277,7 +277,9 @@ discard block |
||
277 | 277 | $permissiontodelete = $user->hasRight('societe', 'supprimer'); |
278 | 278 | $permissiontoadd = $user->hasRight('societe', 'creer'); |
279 | 279 | |
280 | -if (!$permissiontoread) accessforbidden(); |
|
280 | +if (!$permissiontoread) { |
|
281 | + accessforbidden(); |
|
282 | +} |
|
281 | 283 | |
282 | 284 | |
283 | 285 | /* |
@@ -921,7 +923,9 @@ discard block |
||
921 | 923 | if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { |
922 | 924 | $arrayofmassactions = array(); |
923 | 925 | } |
924 | -if ($contextpage != 'poslist') $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
|
926 | +if ($contextpage != 'poslist') { |
|
927 | + $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
|
928 | +} |
|
925 | 929 | |
926 | 930 | print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">'; |
927 | 931 | if ($optioncss != '') { |
@@ -163,7 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | $parameters=array(); |
165 | 165 | $reshook=$hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
166 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
166 | +if ($reshook < 0) { |
|
167 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
168 | +} |
|
167 | 169 | |
168 | 170 | if (empty($reshook)) { |
169 | 171 | // Action to record a payment on a TakePOS invoice |
@@ -532,7 +534,10 @@ discard block |
||
532 | 534 | if (!empty($conf->global->TAKEPOS_GROUP_SAME_PRODUCT)) { |
533 | 535 | foreach ($invoice->lines as $line) { |
534 | 536 | if ($line->product_ref == $prod->ref) { |
535 | - if ($line->special_code==4) continue; // If this line is sended to printer create new line |
|
537 | + if ($line->special_code==4) { |
|
538 | + continue; |
|
539 | + } |
|
540 | + // If this line is sended to printer create new line |
|
536 | 541 | // check if qty in stock |
537 | 542 | if (getDolGlobalString('TAKEPOS_QTY_IN_STOCK') && (($line->qty + $qty) > $prod->stock_reel)) { |
538 | 543 | $invoice->error = $langs->trans('NotEnoughInStock'); |
@@ -571,8 +576,9 @@ discard block |
||
571 | 576 | if ($pf->find_min_price_product_fournisseur($idproduct, $qty) > 0) { |
572 | 577 | $line['fk_fournprice'] = $pf->product_fourn_price_id; |
573 | 578 | $line['pa_ht'] = $pf->fourn_unitprice_with_discount; |
574 | - if (getDolGlobalString('PRODUCT_CHARGES') && $pf->fourn_charges > 0) |
|
575 | - $line['pa_ht'] += $pf->fourn_charges / $pf->fourn_qty; |
|
579 | + if (getDolGlobalString('PRODUCT_CHARGES') && $pf->fourn_charges > 0) { |
|
580 | + $line['pa_ht'] += $pf->fourn_charges / $pf->fourn_qty; |
|
581 | + } |
|
576 | 582 | } |
577 | 583 | } |
578 | 584 | } |
@@ -580,7 +586,9 @@ discard block |
||
580 | 586 | // complete line by hook |
581 | 587 | $parameters = array('prod' => $prod, 'line' => $line); |
582 | 588 | $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
583 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
589 | + if ($reshook < 0) { |
|
590 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
591 | + } |
|
584 | 592 | |
585 | 593 | |
586 | 594 | if (empty($reshook)) { |
@@ -634,9 +642,11 @@ discard block |
||
634 | 642 | $desc = GETPOST('addnote', 'alpha'); |
635 | 643 | if ($idline==0) { |
636 | 644 | $invoice->update_note($desc, '_public'); |
637 | - } else foreach ($invoice->lines as $line) { |
|
645 | + } else { |
|
646 | + foreach ($invoice->lines as $line) { |
|
638 | 647 | if ($line->id == $idline) { |
639 | 648 | $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $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); |
649 | + } |
|
640 | 650 | } |
641 | 651 | } |
642 | 652 | $invoice->fetch($placeid); |
@@ -989,7 +999,10 @@ discard block |
||
989 | 999 | <script type="text/javascript"> |
990 | 1000 | var selectedline=0; |
991 | 1001 | var selectedtext=""; |
992 | -<?php if ($action=="valid") echo "var place=0;";?> // Set to default place after close sale |
|
1002 | +<?php if ($action=="valid") { |
|
1003 | + echo "var place=0;"; |
|
1004 | +} |
|
1005 | +?> // Set to default place after close sale |
|
993 | 1006 | var placeid=<?php echo ($placeid > 0 ? $placeid : 0); ?>; |
994 | 1007 | $(document).ready(function() { |
995 | 1008 | var idoflineadded = <?php echo (empty($idoflineadded) ? 0 : $idoflineadded); ?>; |
@@ -1388,7 +1401,9 @@ discard block |
||
1388 | 1401 | // complete header by hook |
1389 | 1402 | $parameters=array(); |
1390 | 1403 | $reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
1391 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1404 | +if ($reshook < 0) { |
|
1405 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1406 | +} |
|
1392 | 1407 | print $hookmanager->resPrint; |
1393 | 1408 | |
1394 | 1409 | if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { |
@@ -1552,7 +1567,9 @@ discard block |
||
1552 | 1567 | // complete line by hook |
1553 | 1568 | $parameters=array('line' => $line); |
1554 | 1569 | $reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
1555 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1570 | + if ($reshook < 0) { |
|
1571 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1572 | + } |
|
1556 | 1573 | $htmlsupplements[$line->fk_parent_line] .= $hookmanager->resPrint; |
1557 | 1574 | |
1558 | 1575 | if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { |
@@ -1646,7 +1663,9 @@ discard block |
||
1646 | 1663 | // complete line by hook |
1647 | 1664 | $parameters=array('line' => $line); |
1648 | 1665 | $reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
1649 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1666 | + if ($reshook < 0) { |
|
1667 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1668 | + } |
|
1650 | 1669 | $htmlforlines .= $hookmanager->resPrint; |
1651 | 1670 | |
1652 | 1671 | $htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>'; |