@@ -1,4 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page |
3 | 3 | global $dolibarr_main_data_root; |
4 | -if (empty($dolibarr_main_data_root)) require './page148.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page148.tpl.php'; |
|
4 | +if (empty($dolibarr_main_data_root)) { |
|
5 | + require './page148.tpl.php'; |
|
6 | +} else { |
|
7 | + require $dolibarr_main_data_root.'/website/'.$website->ref.'/page148.tpl.php'; |
|
8 | +} |
@@ -134,10 +134,12 @@ discard block |
||
134 | 134 | $rest_index = 0; |
135 | 135 | $opts = getopt($short_options, $long_options, $rest_index); |
136 | 136 | |
137 | - foreach ($opts as $opt => $arg) switch ($opt) { |
|
137 | + foreach ($opts as $opt => $arg) { |
|
138 | + switch ($opt) { |
|
138 | 139 | case 'c': |
139 | 140 | case 'config': |
140 | 141 | $conffile = $arg; |
142 | + } |
|
141 | 143 | $conffiletoshow = $arg; |
142 | 144 | break; |
143 | 145 | case 'h': |
@@ -151,8 +153,9 @@ discard block |
||
151 | 153 | return strlen($arg) >= 2 && $arg[0] == '-'; |
152 | 154 | }); |
153 | 155 | $parsed_options = array_map(function ($arg) { |
154 | - if (strlen($arg) > 1) |
|
155 | - return "--" . $arg; |
|
156 | + if (strlen($arg) > 1) { |
|
157 | + return "--" . $arg; |
|
158 | + } |
|
156 | 159 | return "-" . $arg; |
157 | 160 | }, array_keys($opts)); |
158 | 161 |
@@ -116,7 +116,10 @@ discard block |
||
116 | 116 | |
117 | 117 | // Get source company |
118 | 118 | $this->emetteur = $mysoc; |
119 | - if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined |
|
119 | + if (empty($this->emetteur->country_code)) { |
|
120 | + $this->emetteur->country_code = substr($langs->defaultlang, -2); |
|
121 | + } |
|
122 | + // By default, if was not defined |
|
120 | 123 | |
121 | 124 | // Define position of columns |
122 | 125 | $this->posxdesc = $this->marge_gauche + 1; |
@@ -148,9 +151,13 @@ discard block |
||
148 | 151 | // phpcs:enable |
149 | 152 | global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines; |
150 | 153 | |
151 | - if (!is_object($outputlangs)) $outputlangs = $langs; |
|
154 | + if (!is_object($outputlangs)) { |
|
155 | + $outputlangs = $langs; |
|
156 | + } |
|
152 | 157 | // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO |
153 | - if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output = 'ISO-8859-1'; |
|
158 | + if (!empty($conf->global->MAIN_USE_FPDF)) { |
|
159 | + $outputlangs->charset_output = 'ISO-8859-1'; |
|
160 | + } |
|
154 | 161 | |
155 | 162 | // Load translation files required by the page |
156 | 163 | $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); |
@@ -176,7 +183,9 @@ discard block |
||
176 | 183 | $objphoto = new Product($this->db); |
177 | 184 | |
178 | 185 | for ($i = 0; $i < $nblines; $i++) { |
179 | - if (empty($object->lines[$i]->fk_product)) continue; |
|
186 | + if (empty($object->lines[$i]->fk_product)) { |
|
187 | + continue; |
|
188 | + } |
|
180 | 189 | |
181 | 190 | $objphoto->fetch($object->lines[$i]->fk_product); |
182 | 191 | //var_dump($objphoto->ref);exit; |
@@ -211,7 +220,9 @@ discard block |
||
211 | 220 | } |
212 | 221 | } |
213 | 222 | |
214 | - if ($realpath && $arephoto) $realpatharray[$i] = $realpath; |
|
223 | + if ($realpath && $arephoto) { |
|
224 | + $realpatharray[$i] = $realpath; |
|
225 | + } |
|
215 | 226 | } |
216 | 227 | } |
217 | 228 | |
@@ -296,7 +307,9 @@ discard block |
||
296 | 307 | |
297 | 308 | // New page |
298 | 309 | $pdf->AddPage(); |
299 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
310 | + if (!empty($tplidx)) { |
|
311 | + $pdf->useTemplate($tplidx); |
|
312 | + } |
|
300 | 313 | $pagenb++; |
301 | 314 | $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); |
302 | 315 | $pdf->SetFont('', '', $default_font_size - 1); |
@@ -334,7 +347,9 @@ discard block |
||
334 | 347 | $salereparray = $object->thirdparty->getSalesRepresentatives($user); |
335 | 348 | $salerepobj = new User($this->db); |
336 | 349 | $salerepobj->fetch($salereparray[0]['id']); |
337 | - if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); |
|
350 | + if (!empty($salerepobj->signature)) { |
|
351 | + $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); |
|
352 | + } |
|
338 | 353 | } |
339 | 354 | } |
340 | 355 | |
@@ -371,8 +386,12 @@ discard block |
||
371 | 386 | while ($pagenb < $pageposafternote) { |
372 | 387 | $pdf->AddPage(); |
373 | 388 | $pagenb++; |
374 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
375 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
389 | + if (!empty($tplidx)) { |
|
390 | + $pdf->useTemplate($tplidx); |
|
391 | + } |
|
392 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
393 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
394 | + } |
|
376 | 395 | // $this->_pagefoot($pdf,$object,$outputlangs,1); |
377 | 396 | $pdf->setTopMargin($tab_top_newpage); |
378 | 397 | // The only function to edit the bottom margin of current page to set it. |
@@ -425,8 +444,12 @@ discard block |
||
425 | 444 | |
426 | 445 | // apply note frame to last page |
427 | 446 | $pdf->setPage($pageposafternote); |
428 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
429 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
447 | + if (!empty($tplidx)) { |
|
448 | + $pdf->useTemplate($tplidx); |
|
449 | + } |
|
450 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
451 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
452 | + } |
|
430 | 453 | $height_note = $posyafter - $tab_top_newpage; |
431 | 454 | $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); |
432 | 455 | } else // No pagebreak |
@@ -443,8 +466,12 @@ discard block |
||
443 | 466 | $pagenb++; |
444 | 467 | $pageposafternote++; |
445 | 468 | $pdf->setPage($pageposafternote); |
446 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
447 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
469 | + if (!empty($tplidx)) { |
|
470 | + $pdf->useTemplate($tplidx); |
|
471 | + } |
|
472 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
473 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
474 | + } |
|
448 | 475 | |
449 | 476 | $posyafter = $tab_top_newpage; |
450 | 477 | } |
@@ -477,7 +504,9 @@ discard block |
||
477 | 504 | |
478 | 505 | // Define size of image if we need it |
479 | 506 | $imglinesize = array(); |
480 | - if (!empty($realpatharray[$i])) $imglinesize = pdf_getSizeForImage($realpatharray[$i]); |
|
507 | + if (!empty($realpatharray[$i])) { |
|
508 | + $imglinesize = pdf_getSizeForImage($realpatharray[$i]); |
|
509 | + } |
|
481 | 510 | |
482 | 511 | $pdf->setTopMargin($tab_top_newpage); |
483 | 512 | $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. |
@@ -491,15 +520,19 @@ discard block |
||
491 | 520 | // We start with Photo of product line |
492 | 521 | if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page |
493 | 522 | $pdf->AddPage('', '', true); |
494 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
523 | + if (!empty($tplidx)) { |
|
524 | + $pdf->useTemplate($tplidx); |
|
525 | + } |
|
495 | 526 | $pdf->setPage($pageposbefore + 1); |
496 | 527 | |
497 | 528 | $curY = $tab_top_newpage; |
498 | 529 | |
499 | 530 | // Allows data in the first page if description is long enough to break in multiples pages |
500 | - if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) |
|
501 | - $showpricebeforepagebreak = 1; |
|
502 | - else $showpricebeforepagebreak = 0; |
|
531 | + if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { |
|
532 | + $showpricebeforepagebreak = 1; |
|
533 | + } else { |
|
534 | + $showpricebeforepagebreak = 0; |
|
535 | + } |
|
503 | 536 | } |
504 | 537 | |
505 | 538 | if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { |
@@ -534,16 +567,20 @@ discard block |
||
534 | 567 | if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text |
535 | 568 | if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page |
536 | 569 | $pdf->AddPage('', '', true); |
537 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
570 | + if (!empty($tplidx)) { |
|
571 | + $pdf->useTemplate($tplidx); |
|
572 | + } |
|
538 | 573 | //if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
539 | 574 | $pdf->setPage($pageposafter + 1); |
540 | 575 | } |
541 | 576 | } else { |
542 | 577 | // We found a page break |
543 | 578 | // Allows data in the first page if description is long enough to break in multiples pages |
544 | - if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) |
|
545 | - $showpricebeforepagebreak = 1; |
|
546 | - else $showpricebeforepagebreak = 0; |
|
579 | + if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { |
|
580 | + $showpricebeforepagebreak = 1; |
|
581 | + } else { |
|
582 | + $showpricebeforepagebreak = 0; |
|
583 | + } |
|
547 | 584 | } |
548 | 585 | } else // No pagebreak |
549 | 586 | { |
@@ -637,8 +674,11 @@ discard block |
||
637 | 674 | |
638 | 675 | |
639 | 676 | // Collection of totals by value of vat in $this->tva["rate"] = total_tva |
640 | - if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva; |
|
641 | - else $tvaligne = $object->lines[$i]->total_tva; |
|
677 | + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { |
|
678 | + $tvaligne = $object->lines[$i]->multicurrency_total_tva; |
|
679 | + } else { |
|
680 | + $tvaligne = $object->lines[$i]->total_tva; |
|
681 | + } |
|
642 | 682 | |
643 | 683 | $localtax1ligne = $object->lines[$i]->total_localtax1; |
644 | 684 | $localtax2ligne = $object->lines[$i]->total_localtax2; |
@@ -678,8 +718,12 @@ discard block |
||
678 | 718 | } |
679 | 719 | } |
680 | 720 | |
681 | - if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate .= '*'; |
|
682 | - if (!isset($this->tva[$vatrate])) $this->tva[$vatrate] = 0; |
|
721 | + if (($object->lines[$i]->info_bits & 0x01) == 0x01) { |
|
722 | + $vatrate .= '*'; |
|
723 | + } |
|
724 | + if (!isset($this->tva[$vatrate])) { |
|
725 | + $this->tva[$vatrate] = 0; |
|
726 | + } |
|
683 | 727 | $this->tva[$vatrate] += $tvaligne; |
684 | 728 | |
685 | 729 | // Add line |
@@ -704,7 +748,9 @@ discard block |
||
704 | 748 | $pagenb++; |
705 | 749 | $pdf->setPage($pagenb); |
706 | 750 | $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
707 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
751 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
752 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
753 | + } |
|
708 | 754 | } |
709 | 755 | if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { |
710 | 756 | if ($pagenb == $pageposafter) { |
@@ -715,16 +761,22 @@ discard block |
||
715 | 761 | $this->_pagefoot($pdf, $object, $outputlangs, 1); |
716 | 762 | // New page |
717 | 763 | $pdf->AddPage(); |
718 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
764 | + if (!empty($tplidx)) { |
|
765 | + $pdf->useTemplate($tplidx); |
|
766 | + } |
|
719 | 767 | $pagenb++; |
720 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
768 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
769 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
770 | + } |
|
721 | 771 | } |
722 | 772 | } |
723 | 773 | |
724 | 774 | // Show square |
725 | - if ($pagenb == $pageposbeforeprintlines) |
|
726 | - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); |
|
727 | - else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); |
|
775 | + if ($pagenb == $pageposbeforeprintlines) { |
|
776 | + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); |
|
777 | + } else { |
|
778 | + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); |
|
779 | + } |
|
728 | 780 | $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; |
729 | 781 | |
730 | 782 | // Affiche zone infos |
@@ -744,7 +796,9 @@ discard block |
||
744 | 796 | |
745 | 797 | // Pied de page |
746 | 798 | $this->_pagefoot($pdf, $object, $outputlangs); |
747 | - if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); |
|
799 | + if (method_exists($pdf, 'AliasNbPages')) { |
|
800 | + $pdf->AliasNbPages(); |
|
801 | + } |
|
748 | 802 | |
749 | 803 | $pdf->Close(); |
750 | 804 | |
@@ -943,7 +997,10 @@ discard block |
||
943 | 997 | if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { |
944 | 998 | if (!empty($object->fk_account) || !empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { |
945 | 999 | $bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); |
946 | - if (!empty($object->fk_bank)) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank |
|
1000 | + if (!empty($object->fk_bank)) { |
|
1001 | + $bankid = $object->fk_bank; |
|
1002 | + } |
|
1003 | + // For backward compatibility when object->fk_account is forced with object->fk_bank |
|
947 | 1004 | $account = new Account($this->db); |
948 | 1005 | $account->fetch($bankid); |
949 | 1006 | |
@@ -1029,7 +1086,9 @@ discard block |
||
1029 | 1086 | //$depositsamount=$object->getSumDepositsUsed(); |
1030 | 1087 | //print "x".$creditnoteamount."-".$depositsamount;exit; |
1031 | 1088 | $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); |
1032 | - if (!empty($object->paye)) $resteapayer = 0; |
|
1089 | + if (!empty($object->paye)) { |
|
1090 | + $resteapayer = 0; |
|
1091 | + } |
|
1033 | 1092 | |
1034 | 1093 | if ($deja_regle > 0) { |
1035 | 1094 | // Already paid + Deposits |
@@ -1077,7 +1136,9 @@ discard block |
||
1077 | 1136 | |
1078 | 1137 | // Force to disable hidetop and hidebottom |
1079 | 1138 | $hidebottom = 0; |
1080 | - if ($hidetop) $hidetop = -1; |
|
1139 | + if ($hidetop) { |
|
1140 | + $hidetop = -1; |
|
1141 | + } |
|
1081 | 1142 | |
1082 | 1143 | $currency = !empty($currency) ? $currency : $conf->currency; |
1083 | 1144 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
@@ -1152,7 +1213,9 @@ discard block |
||
1152 | 1213 | if (!getDolGlobalInt('PDF_DISABLE_MYCOMPANY_LOGO')) { |
1153 | 1214 | if ($this->emetteur->logo) { |
1154 | 1215 | $logodir = $conf->mycompany->dir_output; |
1155 | - if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; |
|
1216 | + if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
|
1217 | + $logodir = $conf->mycompany->multidir_output[$object->entity]; |
|
1218 | + } |
|
1156 | 1219 | if (!getDolGlobalInt('MAIN_PDF_USE_LARGE_LOGO')) { |
1157 | 1220 | $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; |
1158 | 1221 | } else { |
@@ -1293,18 +1356,28 @@ discard block |
||
1293 | 1356 | $result = $object->fetch_contact($arrayidcontact[0]); |
1294 | 1357 | } |
1295 | 1358 | |
1296 | - if ($usecontact) $thirdparty = $object->contact; |
|
1297 | - else $thirdparty = $this->emetteur; |
|
1359 | + if ($usecontact) { |
|
1360 | + $thirdparty = $object->contact; |
|
1361 | + } else { |
|
1362 | + $thirdparty = $this->emetteur; |
|
1363 | + } |
|
1298 | 1364 | |
1299 | - if (!empty($thirdparty)) $carac_emetteur_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
|
1365 | + if (!empty($thirdparty)) { |
|
1366 | + $carac_emetteur_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
|
1367 | + } |
|
1300 | 1368 | |
1301 | - if ($usecontact) $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, $object->contact, 1, 'targetwithdetails', $object); |
|
1302 | - else $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); |
|
1369 | + if ($usecontact) { |
|
1370 | + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, $object->contact, 1, 'targetwithdetails', $object); |
|
1371 | + } else { |
|
1372 | + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); |
|
1373 | + } |
|
1303 | 1374 | |
1304 | 1375 | // Show sender |
1305 | 1376 | $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; |
1306 | 1377 | $posx = $this->marge_gauche; |
1307 | - if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->page_largeur - $this->marge_droite - 80; |
|
1378 | + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) { |
|
1379 | + $posx = $this->page_largeur - $this->marge_droite - 80; |
|
1380 | + } |
|
1308 | 1381 | |
1309 | 1382 | $hautcadre = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40; |
1310 | 1383 | $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82; |
@@ -1348,16 +1421,23 @@ discard block |
||
1348 | 1421 | $thirdparty = $object->thirdparty; |
1349 | 1422 | } |
1350 | 1423 | |
1351 | - if (!empty($thirdparty)) $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
|
1424 | + if (!empty($thirdparty)) { |
|
1425 | + $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
|
1426 | + } |
|
1352 | 1427 | |
1353 | 1428 | $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); |
1354 | 1429 | |
1355 | 1430 | // Show recipient |
1356 | 1431 | $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; |
1357 | - if ($this->page_largeur < 210) $widthrecbox = 84; // To work with US executive format |
|
1432 | + if ($this->page_largeur < 210) { |
|
1433 | + $widthrecbox = 84; |
|
1434 | + } |
|
1435 | + // To work with US executive format |
|
1358 | 1436 | $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; |
1359 | 1437 | $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; |
1360 | - if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche; |
|
1438 | + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) { |
|
1439 | + $posx = $this->marge_gauche; |
|
1440 | + } |
|
1361 | 1441 | |
1362 | 1442 | // Show recipient frame |
1363 | 1443 | $pdf->SetTextColor(0, 0, 0); |
@@ -1414,7 +1414,9 @@ |
||
1414 | 1414 | global $conf, $langs, $hookmanager, $mysoc; |
1415 | 1415 | |
1416 | 1416 | $ltrdirection = 'L'; |
1417 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1417 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1418 | + $ltrdirection = 'R'; |
|
1419 | + } |
|
1418 | 1420 | |
1419 | 1421 | // Load traductions files required by page |
1420 | 1422 | $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); |
@@ -1176,7 +1176,9 @@ |
||
1176 | 1176 | global $langs, $conf, $mysoc; |
1177 | 1177 | |
1178 | 1178 | $ltrdirection = 'L'; |
1179 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1179 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1180 | + $ltrdirection = 'R'; |
|
1181 | + } |
|
1180 | 1182 | |
1181 | 1183 | // Load translation files required by the page |
1182 | 1184 | $outputlangs->loadLangs(array("main", "supplier_proposal", "companies", "bills", "sendings")); |
@@ -1086,7 +1086,9 @@ |
||
1086 | 1086 | // So it inits or erases the $stripearrayofkeysbyenv |
1087 | 1087 | $stripe = new Stripe($this->db); |
1088 | 1088 | |
1089 | - if (empty($savstripearrayofkeysbyenv)) $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; |
|
1089 | + if (empty($savstripearrayofkeysbyenv)) { |
|
1090 | + $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; |
|
1091 | + } |
|
1090 | 1092 | dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
1091 | 1093 | dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
1092 | 1094 |
@@ -1316,7 +1316,9 @@ |
||
1316 | 1316 | $extrafields = $this->extrafieldsCache; |
1317 | 1317 | |
1318 | 1318 | $extrafieldOutputContent = ''; |
1319 | - if (isset($object->array_options[$extrafieldOptionsKey])) $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element); |
|
1319 | + if (isset($object->array_options[$extrafieldOptionsKey])) { |
|
1320 | + $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element); |
|
1321 | + } |
|
1320 | 1322 | |
1321 | 1323 | // TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ... |
1322 | 1324 | if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link') { |
@@ -260,7 +260,9 @@ discard block |
||
260 | 260 | // Unset all old modules values |
261 | 261 | if (!empty($this->modules)) { |
262 | 262 | foreach ($this->modules as $m) { |
263 | - if (isset($this->$m)) unset($this->$m); |
|
263 | + if (isset($this->$m)) { |
|
264 | + unset($this->$m); |
|
265 | + } |
|
264 | 266 | } |
265 | 267 | } |
266 | 268 | |
@@ -685,15 +687,23 @@ discard block |
||
685 | 687 | // If module lot/serial enabled, we force the inc/dec mode to STOCK_CALCULATE_ON_SHIPMENT_CLOSE and STOCK_CALCULATE_ON_RECEPTION_CLOSE |
686 | 688 | $this->global->STOCK_CALCULATE_ON_BILL = 0; |
687 | 689 | $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0; |
688 | - if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1; |
|
689 | - if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1; |
|
690 | + if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) { |
|
691 | + $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1; |
|
692 | + } |
|
693 | + if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { |
|
694 | + $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1; |
|
695 | + } |
|
690 | 696 | $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0; |
691 | 697 | $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0; |
692 | 698 | if (!isModEnabled('reception')) { |
693 | 699 | $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1; |
694 | 700 | } else { |
695 | - if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1; |
|
696 | - if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1; |
|
701 | + if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) { |
|
702 | + $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1; |
|
703 | + } |
|
704 | + if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { |
|
705 | + $this->global->STOCK_CALCULATE_ON_RECEPTION = 1; |
|
706 | + } |
|
697 | 707 | } |
698 | 708 | } |
699 | 709 |
@@ -23,11 +23,22 @@ |
||
23 | 23 | * \brief File to return Ajax response on third parties request |
24 | 24 | */ |
25 | 25 | |
26 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal |
|
27 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); |
|
28 | -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); |
|
29 | -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
30 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
26 | +if (!defined('NOTOKENRENEWAL')) { |
|
27 | + define('NOTOKENRENEWAL', 1); |
|
28 | +} |
|
29 | +// Disables token renewal |
|
30 | +if (!defined('NOREQUIREMENU')) { |
|
31 | + define('NOREQUIREMENU', '1'); |
|
32 | +} |
|
33 | +if (!defined('NOREQUIREHTML')) { |
|
34 | + define('NOREQUIREHTML', '1'); |
|
35 | +} |
|
36 | +if (!defined('NOREQUIREAJAX')) { |
|
37 | + define('NOREQUIREAJAX', '1'); |
|
38 | +} |
|
39 | +if (!defined('NOREQUIRESOC')) { |
|
40 | + define('NOREQUIRESOC', '1'); |
|
41 | +} |
|
31 | 42 | |
32 | 43 | // Load Dolibarr environment |
33 | 44 | require '../../main.inc.php'; |