@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | accessforbidden(); |
111 | 111 | } |
112 | 112 | |
113 | -$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
|
113 | +$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
|
114 | 114 | $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php |
115 | 115 | |
116 | 116 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $langs->load("projects"); |
584 | 584 | $morehtmlref .= '<br>'; |
585 | 585 | if (0) { |
586 | - $caneditproject = false; // For static analysis |
|
586 | + $caneditproject = false; // For static analysis |
|
587 | 587 | $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); |
588 | 588 | if ($action != 'classify' && $caneditproject) { |
589 | 589 | $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> '; |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { |
644 | 644 | $disabled = 0; |
645 | 645 | }*/ |
646 | - $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. |
|
646 | + $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. |
|
647 | 647 | |
648 | 648 | // Line of orders |
649 | 649 | if ($object->statut <= CommandeFournisseur::STATUS_ACCEPTED || $object->statut >= CommandeFournisseur::STATUS_CANCELED) { |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } else { |
265 | 265 | if (!empty($this->cache_warehouses[$tab['parent_id']])) { |
266 | 266 | if (getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') !== 2 || (getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') === 2 && empty($this->cache_warehouses[$tab['parent_id']]['parent_id']))) { |
267 | - $final_label = $this->cache_warehouses[$tab['parent_id']]['label'] . ' >> ' . $final_label; |
|
267 | + $final_label = $this->cache_warehouses[$tab['parent_id']]['label'].' >> '.$final_label; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | return $this->get_parent_path($this->cache_warehouses[$tab['parent_id']], $final_label); |
@@ -304,10 +304,10 @@ discard block |
||
304 | 304 | { |
305 | 305 | global $conf, $langs, $user, $hookmanager; |
306 | 306 | |
307 | - dol_syslog(get_class($this)."::selectWarehouses " . (is_array($selected) ? 'selected is array' : $selected) . ", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG); |
|
307 | + dol_syslog(get_class($this)."::selectWarehouses ".(is_array($selected) ? 'selected is array' : $selected).", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG); |
|
308 | 308 | |
309 | 309 | $out = ''; |
310 | - if ((!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) && ($filterstatus==="warehouseinternal")) { |
|
310 | + if ((!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) && ($filterstatus === "warehouseinternal")) { |
|
311 | 311 | $filterstatus = ''; |
312 | 312 | } |
313 | 313 | if (!empty($fk_product) && $fk_product > 0) { |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | $return .= '</select>'; |
634 | 634 | } |
635 | 635 | |
636 | - $return .= ajax_combobox($name, array(), 0, 0, 'resolve', $placeholderID); // avoid to have hidden value if scale = -1 (eg DM size) |
|
636 | + $return .= ajax_combobox($name, array(), 0, 0, 'resolve', $placeholderID); // avoid to have hidden value if scale = -1 (eg DM size) |
|
637 | 637 | |
638 | 638 | return $return; |
639 | 639 | } |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | } |
840 | 840 | |
841 | 841 | if (empty($hookmanager)) { |
842 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
842 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
843 | 843 | $hookmanager = new HookManager($this->db); |
844 | 844 | } |
845 | 845 | $hookmanager->initHooks(array('productdao')); |
@@ -858,10 +858,10 @@ discard block |
||
858 | 858 | if (array_key_exists($productId, $this->cache_lot)) { |
859 | 859 | foreach ($this->cache_lot[$productId] as $id => $arraytypes) { |
860 | 860 | if (empty($fk_entrepot) || $fk_entrepot == $arraytypes['entrepot_id']) { |
861 | - $label = $arraytypes['entrepot_label'] . ' - '; |
|
861 | + $label = $arraytypes['entrepot_label'].' - '; |
|
862 | 862 | $label .= $arraytypes['batch']; |
863 | 863 | // Notice: Chrome show 1 line with value and 1 for label. Firefox show only 1 line with label |
864 | - $out .= '<option data-warehouse="'.dol_escape_htmltag($label).'" value="' . $arraytypes['batch'] . '">' . ($conf->browser->name === 'chrome' ? '' : $arraytypes['batch']) . ' (' . $langs->trans('Stock Total') . ': ' . $arraytypes['qty'] . ')</option>'; |
|
864 | + $out .= '<option data-warehouse="'.dol_escape_htmltag($label).'" value="'.$arraytypes['batch'].'">'.($conf->browser->name === 'chrome' ? '' : $arraytypes['batch']).' ('.$langs->trans('Stock Total').': '.$arraytypes['qty'].')</option>'; |
|
865 | 865 | } |
866 | 866 | } |
867 | 867 | } |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | $batch_count = 0; |
906 | 906 | global $hookmanager; |
907 | 907 | if (empty($hookmanager)) { |
908 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
908 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
909 | 909 | $hookmanager = new HookManager($this->db); |
910 | 910 | } |
911 | 911 | $hookmanager->initHooks(array('productdao')); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * \brief Page to export documents into a compressed file |
25 | 25 | */ |
26 | 26 | |
27 | -if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | - define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | +if (!defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // Load Dolibarr environment |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | |
102 | 102 | // Increase limit of time. Works only if we are not in safe mode |
103 | -$ExecTimeLimit = getDolGlobalInt('MAIN_ADMIN_TOOLS_EXPORT_FILES_EXEC_TIME_LIMIT', 1800);; // 30mn |
|
103 | +$ExecTimeLimit = getDolGlobalInt('MAIN_ADMIN_TOOLS_EXPORT_FILES_EXEC_TIME_LIMIT', 1800); ; // 30mn |
|
104 | 104 | if (!empty($ExecTimeLimit)) { |
105 | 105 | $err = error_reporting(); |
106 | 106 | error_reporting(0); // Disable all errors |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // Includes |
36 | -require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/admin/tools/ui/class/documentation.class.php'; |
|
37 | 37 | |
38 | 38 | // Load documentation translations |
39 | 39 | $langs->load('uxdocumentation'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | // Set view for menu and breadcrumb |
69 | 69 | // Menu must be set in constructor of documentation class |
70 | -$documentation->view = array('Components','Event Message'); |
|
70 | +$documentation->view = array('Components', 'Event Message'); |
|
71 | 71 | |
72 | 72 | // Output sidebar |
73 | 73 | $documentation->showSidebar(); ?> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search |
54 | 54 | $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page |
55 | 55 | $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
56 | -$mode = GETPOST('mode', 'aZ'); // mode view (kanban or common) |
|
56 | +$mode = GETPOST('mode', 'aZ'); // mode view (kanban or common) |
|
57 | 57 | |
58 | 58 | |
59 | 59 | // Load variable for pagination |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // Default sort order (if not yet defined by previous GETPOST) |
86 | 86 | if (!$sortfield) { |
87 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
87 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
88 | 88 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
89 | 89 | } |
90 | 90 | if (!$sortorder) { |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
550 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
550 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
551 | 551 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
552 | 552 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
553 | 553 | |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
643 | 643 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
644 | 644 | } |
645 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
645 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
646 | 646 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
647 | 647 | if ($key == "fk_product") { |
648 | 648 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $this->watermark = ''; |
162 | 162 | |
163 | 163 | if ($mysoc === null) { |
164 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
164 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
165 | 165 | return; |
166 | 166 | } |
167 | 167 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
364 | 364 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
365 | 365 | } |
366 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
366 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
367 | 367 | $tplidx = $pdf->importPage(1); |
368 | 368 | } |
369 | 369 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
461 | 461 | |
462 | 462 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
463 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
463 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
464 | 464 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
465 | 465 | |
466 | 466 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs); |
846 | 846 | $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue); |
847 | 847 | |
848 | - $this->setAfterColsLinePositionsData('options_' . $extrafieldColKey, $pdf->GetY(), $pdf->getPage()); |
|
848 | + $this->setAfterColsLinePositionsData('options_'.$extrafieldColKey, $pdf->GetY(), $pdf->getPage()); |
|
849 | 849 | } |
850 | 850 | } |
851 | 851 | } |
@@ -935,11 +935,11 @@ discard block |
||
935 | 935 | if (!isset($this->tva[$vatrate])) { |
936 | 936 | $this->tva[$vatrate] = 0; |
937 | 937 | } |
938 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
938 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
939 | 939 | $vatcode = $object->lines[$i]->vat_src_code; |
940 | 940 | if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { |
941 | 941 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { |
942 | - $this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0; |
|
942 | + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0; |
|
943 | 943 | } |
944 | 944 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht); |
945 | 945 | } else { |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | |
980 | 980 | // Draw table frames and columns borders |
981 | 981 | $drawTabNumbPage = $pdf->getNumPages(); |
982 | - for ($i=$pageposbeforeprintlines; $i<=$drawTabNumbPage; $i++) { |
|
982 | + for ($i = $pageposbeforeprintlines; $i <= $drawTabNumbPage; $i++) { |
|
983 | 983 | $pdf->setPage($i); |
984 | 984 | // reset page orientation each loop to override it if it was changed |
985 | 985 | $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | $drawTabTop = $this->tab_top; |
995 | 995 | } elseif (!$drawTabHideTop) { |
996 | 996 | if (getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { |
997 | - $drawTabTop-= $this->tabTitleHeight; |
|
997 | + $drawTabTop -= $this->tabTitleHeight; |
|
998 | 998 | } else { |
999 | 999 | $drawTabHideTop = 1; |
1000 | 1000 | } |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | // last page need to include document footer |
1004 | 1004 | if ($i == $pdf->getNumPages()) { |
1005 | 1005 | // remove document footer height to tab bottom position |
1006 | - $drawTabBottom-= $this->heightforfreetext + $this->heightforinfotot + $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs); |
|
1006 | + $drawTabBottom -= $this->heightforfreetext + $this->heightforinfotot + $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs); |
|
1007 | 1007 | } |
1008 | 1008 | |
1009 | 1009 | $drawTabHeight = $drawTabBottom - $drawTabTop; |
@@ -1049,7 +1049,7 @@ discard block |
||
1049 | 1049 | |
1050 | 1050 | // Add number of pages in footer |
1051 | 1051 | if (method_exists($pdf, 'AliasNbPages')) { |
1052 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
1052 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
1053 | 1053 | } |
1054 | 1054 | // Add terms to sale |
1055 | 1055 | if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) { |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | $pagecount = $pdf->setSourceFile($termsofsale); |
1062 | 1062 | for ($i = 1; $i <= $pagecount; $i++) { |
1063 | 1063 | $tplIdx = $pdf->importPage($i); |
1064 | - if ($tplIdx!==false) { |
|
1064 | + if ($tplIdx !== false) { |
|
1065 | 1065 | $s = $pdf->getTemplatesize($tplIdx); |
1066 | 1066 | $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); |
1067 | 1067 | $pdf->useTemplate($tplIdx); |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | foreach ($this->tva_array as $tvakey => $tvaval) { |
1304 | 1304 | $pdf->SetFont('', '', $default_font_size - 2); |
1305 | 1305 | $pdf->SetXY($this->marge_gauche, $posy); |
1306 | - $titre = round((float) $tvakey, 2) . "%"; |
|
1306 | + $titre = round((float) $tvakey, 2)."%"; |
|
1307 | 1307 | $pdf->MultiCell(25, 4, $titre, 0, 'L'); |
1308 | 1308 | |
1309 | 1309 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -1344,8 +1344,8 @@ discard block |
||
1344 | 1344 | $posy = $pdf->GetY() + 4; |
1345 | 1345 | } |
1346 | 1346 | |
1347 | - $posxval = 52; // Position of values of properties shown on left side |
|
1348 | - $posxend = 110; // End of x for text on left side |
|
1347 | + $posxval = 52; // Position of values of properties shown on left side |
|
1348 | + $posxend = 110; // End of x for text on left side |
|
1349 | 1349 | if ($this->page_largeur < 210) { // To work with US executive format |
1350 | 1350 | $posxend -= 10; |
1351 | 1351 | } |
@@ -1375,7 +1375,7 @@ discard block |
||
1375 | 1375 | |
1376 | 1376 | $pdf->SetFont('', '', $default_font_size - 2); |
1377 | 1377 | $pdf->SetXY($posxval, $posy); |
1378 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1378 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1379 | 1379 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
1380 | 1380 | |
1381 | 1381 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
1554 | 1554 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
1555 | 1555 | |
1556 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); |
|
1556 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); |
|
1557 | 1557 | } |
1558 | 1558 | } |
1559 | 1559 | } |
@@ -2175,7 +2175,7 @@ discard block |
||
2175 | 2175 | if (empty($hidetop)) { |
2176 | 2176 | // Show category of operations |
2177 | 2177 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
2178 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
2178 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
2179 | 2179 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
2180 | 2180 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
2181 | 2181 | } |
@@ -2291,7 +2291,7 @@ discard block |
||
2291 | 2291 | } |
2292 | 2292 | if ($this->situationinvoice) { |
2293 | 2293 | $langs->loadLangs(array("other")); |
2294 | - $title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -"; |
|
2294 | + $title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -"; |
|
2295 | 2295 | } |
2296 | 2296 | if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { |
2297 | 2297 | $title .= ' - '; |
@@ -2579,7 +2579,7 @@ discard block |
||
2579 | 2579 | if (!empty($carac_client_shipping)) { |
2580 | 2580 | $posy += $hautcadre; |
2581 | 2581 | |
2582 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
2582 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
2583 | 2583 | |
2584 | 2584 | // Show shipping frame |
2585 | 2585 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $this->atleastonediscount = 0; |
137 | 137 | |
138 | 138 | if ($mysoc === null) { |
139 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
139 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
309 | 309 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
310 | 310 | } |
311 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
311 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
312 | 312 | $tplidx = $pdf->importPage(1); |
313 | 313 | } |
314 | 314 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
360 | 360 | if (!$hidetop && getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { |
361 | 361 | // TODO : make this hidden conf the default behavior for each PDF when each PDF managed this new Display |
362 | - $tab_top_newpage+= $this->tabTitleHeight; |
|
362 | + $tab_top_newpage += $this->tabTitleHeight; |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | $nexY = $tab_top; |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | |
805 | 805 | // Add last page for document footer if there are not enough size left |
806 | 806 | $afterPosData = $this->getMaxAfterColsLinePositionsData(); |
807 | - if ($afterPosData['y'] > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot) ) { |
|
807 | + if ($afterPosData['y'] > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot)) { |
|
808 | 808 | $pdf->AddPage(); |
809 | 809 | if (!empty($tplidx)) { |
810 | 810 | $pdf->useTemplate($tplidx); |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | |
816 | 816 | // Draw table frames and columns borders |
817 | 817 | $drawTabNumbPage = $pdf->getNumPages(); |
818 | - for ($i=$pageposbeforeprintlines; $i<=$drawTabNumbPage; $i++) { |
|
818 | + for ($i = $pageposbeforeprintlines; $i <= $drawTabNumbPage; $i++) { |
|
819 | 819 | $pdf->setPage($i); |
820 | 820 | // reset page orientation each loop to override it if it was changed |
821 | 821 | $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | $drawTabTop = $tab_top; |
831 | 831 | } elseif (!$drawTabHideTop) { |
832 | 832 | if (getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { |
833 | - $drawTabTop-= $this->tabTitleHeight; |
|
833 | + $drawTabTop -= $this->tabTitleHeight; |
|
834 | 834 | } else { |
835 | 835 | $drawTabHideTop = 1; |
836 | 836 | } |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | // last page need to include document footer |
840 | 840 | if ($i == $pdf->getNumPages()) { |
841 | 841 | // remove document footer height to tab bottom position |
842 | - $drawTabBottom-= $heightforsignature + $heightforfreetext + $heightforinfotot; |
|
842 | + $drawTabBottom -= $heightforsignature + $heightforfreetext + $heightforinfotot; |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | $drawTabHeight = $drawTabBottom - $drawTabTop; |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | |
883 | 883 | // Add number of pages in footer |
884 | 884 | if (method_exists($pdf, 'AliasNbPages')) { |
885 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
885 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
886 | 886 | } |
887 | 887 | |
888 | 888 | // Add terms to sale |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | $pagecount = $pdf->setSourceFile($termsofsale); |
896 | 896 | for ($i = 1; $i <= $pagecount; $i++) { |
897 | 897 | $tplIdx = $pdf->importPage($i); |
898 | - if ($tplIdx!==false) { |
|
898 | + if ($tplIdx !== false) { |
|
899 | 899 | $s = $pdf->getTemplatesize($tplIdx); |
900 | 900 | $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); |
901 | 901 | $pdf->useTemplate($tplIdx); |
@@ -1259,11 +1259,11 @@ discard block |
||
1259 | 1259 | |
1260 | 1260 | // Total HT |
1261 | 1261 | $pdf->SetFillColor(255, 255, 255); |
1262 | - $pdf->SetXY($col1x, $tab2_top+ $tab2_hl * $index); |
|
1262 | + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
|
1263 | 1263 | $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); |
1264 | 1264 | |
1265 | 1265 | $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); |
1266 | - $pdf->SetXY($col2x, $tab2_top+ $tab2_hl * $index); |
|
1266 | + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
|
1267 | 1267 | $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); |
1268 | 1268 | |
1269 | 1269 | // Show VAT by rates and total |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $this->watermark = ''; |
130 | 130 | |
131 | 131 | if ($mysoc === null) { |
132 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
132 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
133 | 133 | return; |
134 | 134 | } |
135 | 135 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
366 | 366 | if (!$hidetop && getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { |
367 | 367 | // TODO : make this hidden conf the default behavior for each PDF when each PDF managed this new Display |
368 | - $tab_top_newpage+= $this->tabTitleHeight; |
|
368 | + $tab_top_newpage += $this->tabTitleHeight; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | |
779 | 779 | // Add last page for document footer if there are not enough size left |
780 | 780 | $afterPosData = $this->getMaxAfterColsLinePositionsData(); |
781 | - if ($afterPosData['y'] > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot) ) { |
|
781 | + if ($afterPosData['y'] > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)) { |
|
782 | 782 | $pdf->AddPage(); |
783 | 783 | if (!empty($tplidx)) { |
784 | 784 | $pdf->useTemplate($tplidx); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | |
790 | 790 | // Draw table frames and columns borders |
791 | 791 | $drawTabNumbPage = $pdf->getNumPages(); |
792 | - for ($i=$pageposbeforeprintlines; $i<=$drawTabNumbPage; $i++) { |
|
792 | + for ($i = $pageposbeforeprintlines; $i <= $drawTabNumbPage; $i++) { |
|
793 | 793 | $pdf->setPage($i); |
794 | 794 | // reset page orientation each loop to override it if it was changed |
795 | 795 | $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | $drawTabTop = $tab_top; |
805 | 805 | } elseif (!$drawTabHideTop) { |
806 | 806 | if (getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { |
807 | - $drawTabTop-= $this->tabTitleHeight; |
|
807 | + $drawTabTop -= $this->tabTitleHeight; |
|
808 | 808 | } else { |
809 | 809 | $drawTabHideTop = 1; |
810 | 810 | } |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | // last page need to include document footer |
814 | 814 | if ($i == $pdf->getNumPages()) { |
815 | 815 | // remove document footer height to tab bottom position |
816 | - $drawTabBottom-= $heightforfreetext + $heightforinfotot; |
|
816 | + $drawTabBottom -= $heightforfreetext + $heightforinfotot; |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | $drawTabHeight = $drawTabBottom - $drawTabTop; |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | |
853 | 853 | // Add number of pages in footer |
854 | 854 | if (method_exists($pdf, 'AliasNbPages')) { |
855 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
855 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | // Add terms to sale |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | $pagecount = $pdf->setSourceFile($termsofsale); |
866 | 866 | for ($i = 1; $i <= $pagecount; $i++) { |
867 | 867 | $tplIdx = $pdf->importPage($i); |
868 | - if ($tplIdx!==false) { |
|
868 | + if ($tplIdx !== false) { |
|
869 | 869 | $s = $pdf->getTemplatesize($tplIdx); |
870 | 870 | $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); |
871 | 871 | $pdf->useTemplate($tplIdx); |
@@ -1740,7 +1740,7 @@ discard block |
||
1740 | 1740 | $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
1741 | 1741 | } |
1742 | 1742 | |
1743 | - $mode = 'target'; |
|
1743 | + $mode = 'target'; |
|
1744 | 1744 | $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); |
1745 | 1745 | |
1746 | 1746 | // Show recipient |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | if (!empty($carac_client_shipping)) { |
1796 | 1796 | $posy += $hautcadre; |
1797 | 1797 | |
1798 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
1798 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
1799 | 1799 | |
1800 | 1800 | // Show shipping frame |
1801 | 1801 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * @var float |
121 | 121 | */ |
122 | - public $totalpaid; // duplicate with sumpayed |
|
122 | + public $totalpaid; // duplicate with sumpayed |
|
123 | 123 | /** |
124 | 124 | * @var int|float |
125 | 125 | */ |
126 | - public $totaldeposits; // duplicate with sumdeposit |
|
126 | + public $totaldeposits; // duplicate with sumdeposit |
|
127 | 127 | /** |
128 | 128 | * @var int|float |
129 | 129 | */ |
130 | - public $totalcreditnotes; // duplicate with sumcreditnote |
|
130 | + public $totalcreditnotes; // duplicate with sumcreditnote |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * @var int|float |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | public function getListOfPayments($filtertype = '', $multicurrency = 0, $mode = 0) |
554 | 554 | { |
555 | 555 | $retarray = array(); |
556 | - $this->error = ''; // By default no error, list can be empty. |
|
556 | + $this->error = ''; // By default no error, list can be empty. |
|
557 | 557 | |
558 | 558 | $table = 'paiement_facture'; |
559 | 559 | $table2 = 'paiement'; |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | |
574 | 574 | // List of payments |
575 | 575 | if (empty($mode) || $mode == 1) { |
576 | - $sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3 . $field4; |
|
576 | + $sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3.$field4; |
|
577 | 577 | $sql .= " FROM ".$this->db->prefix().$table." as pf, ".$this->db->prefix().$table2." as p, ".$this->db->prefix()."c_paiement as t"; |
578 | 578 | $sql .= " WHERE pf.".$field." = ".((int) $this->id); |
579 | 579 | $sql .= " AND pf.".$field2." = p.rowid"; |
@@ -829,12 +829,12 @@ discard block |
||
829 | 829 | { |
830 | 830 | $subtypeLabel = ''; |
831 | 831 | if ($table === 'facture' || $table === 'facture_fourn') { |
832 | - $sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f"; |
|
833 | - $sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
832 | + $sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f"; |
|
833 | + $sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
834 | 834 | $sql .= " WHERE f.ref = '".$this->db->escape($this->ref)."'"; |
835 | 835 | } elseif ($table === 'facture_rec' || $table === 'facture_fourn_rec') { |
836 | - $sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f"; |
|
837 | - $sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
836 | + $sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f"; |
|
837 | + $sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid"; |
|
838 | 838 | $sql .= " WHERE f.titre = '".$this->db->escape($this->title)."'"; |
839 | 839 | } else { |
840 | 840 | return -1; |
@@ -866,11 +866,11 @@ discard block |
||
866 | 866 | $effs = array(); |
867 | 867 | |
868 | 868 | $sql = "SELECT rowid, code, label as label"; |
869 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
869 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
870 | 870 | $sql .= " WHERE active = 1 AND fk_country = ".((int) $mysoc->country_id)." AND entity IN(".getEntity('c_invoice_subtype').")"; |
871 | 871 | $sql .= " ORDER by rowid, code"; |
872 | 872 | |
873 | - dol_syslog(get_class($this) . '::getArrayOfInvoiceSubtypes', LOG_DEBUG); |
|
873 | + dol_syslog(get_class($this).'::getArrayOfInvoiceSubtypes', LOG_DEBUG); |
|
874 | 874 | $resql = $this->db->query($sql); |
875 | 875 | if ($resql) { |
876 | 876 | $num = $this->db->num_rows($resql); |
@@ -1270,7 +1270,7 @@ discard block |
||
1270 | 1270 | if ($this->status > self::STATUS_DRAFT && $this->paye == 0) { |
1271 | 1271 | // Get the default payment mode for BAN payment of the third party |
1272 | 1272 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
1273 | - $bac = new CompanyBankAccount($this->db); // Table societe_rib |
|
1273 | + $bac = new CompanyBankAccount($this->db); // Table societe_rib |
|
1274 | 1274 | $result = $bac->fetch(0, '', $this->socid, 1, 'ban'); |
1275 | 1275 | if ($result <= 0 || empty($bac->id)) { |
1276 | 1276 | $this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount"); |
@@ -1284,16 +1284,16 @@ discard block |
||
1284 | 1284 | $sql .= " FROM ".$this->db->prefix()."prelevement_demande"; |
1285 | 1285 | $sql .= " WHERE rowid = ".((int) $did); |
1286 | 1286 | if ($type != 'bank-transfer' && $type != 'credit-transfer') { |
1287 | - $sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
1287 | + $sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
1288 | 1288 | } |
1289 | 1289 | if ($type != 'direct-debit') { |
1290 | 1290 | if ($sourcetype == 'salary') { |
1291 | - $sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one |
|
1291 | + $sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one |
|
1292 | 1292 | } else { |
1293 | - $sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
1293 | + $sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one |
|
1294 | 1294 | } |
1295 | 1295 | } |
1296 | - $sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0) |
|
1296 | + $sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0) |
|
1297 | 1297 | |
1298 | 1298 | dol_syslog(get_class($this)."::makeStripeSepaRequest load requests to process", LOG_DEBUG); |
1299 | 1299 | $resql = $this->db->query($sql); |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | |
1310 | 1310 | if (is_numeric($amount) && $amount != 0) { |
1311 | 1311 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; |
1312 | - $companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib |
|
1312 | + $companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib |
|
1313 | 1313 | $companypaymentmode->fetch($bac->id); |
1314 | 1314 | |
1315 | 1315 | $this->stripechargedone = 0; |
@@ -1319,11 +1319,11 @@ discard block |
||
1319 | 1319 | |
1320 | 1320 | $currency = $conf->currency; |
1321 | 1321 | |
1322 | - $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop |
|
1322 | + $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop |
|
1323 | 1323 | |
1324 | 1324 | $this->fetch_thirdparty(); |
1325 | 1325 | |
1326 | - dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=" . $this->thirdparty->id . ", thirdparty_name=" . $this->thirdparty->name . " ban id=" . $bac->id, LOG_DEBUG); |
|
1326 | + dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=".$this->thirdparty->id.", thirdparty_name=".$this->thirdparty->name." ban id=".$bac->id, LOG_DEBUG); |
|
1327 | 1327 | |
1328 | 1328 | //$alreadypayed = $this->getSommePaiement(); |
1329 | 1329 | //$amount_credit_notes_included = $this->getSumCreditNotesUsed(); |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | $amountstripe *= 100; |
1339 | 1339 | } |
1340 | 1340 | |
1341 | - $fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr. |
|
1341 | + $fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr. |
|
1342 | 1342 | if (!($fk_bank_account > 0)) { |
1343 | 1343 | $error++; |
1344 | 1344 | $errorforinvoice++; |
@@ -1399,44 +1399,44 @@ discard block |
||
1399 | 1399 | } |
1400 | 1400 | |
1401 | 1401 | //var_dump($companypaymentmode); |
1402 | - dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG); |
|
1402 | + dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=".$companypaymentmode->id." stripe_card_ref=".$companypaymentmode->stripe_card_ref." mode=".$companypaymentmode->status, LOG_DEBUG); |
|
1403 | 1403 | |
1404 | 1404 | $thirdparty = new Societe($this->db); |
1405 | 1405 | $resultthirdparty = $thirdparty->fetch($this->socid); |
1406 | 1406 | |
1407 | - include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php |
|
1407 | + include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php |
|
1408 | 1408 | // So it inits or erases the $stripearrayofkeysbyenv |
1409 | 1409 | $stripe = new Stripe($this->db); |
1410 | 1410 | |
1411 | 1411 | if (empty($savstripearrayofkeysbyenv)) { |
1412 | 1412 | $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; |
1413 | 1413 | } |
1414 | - dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
|
1414 | + dol_syslog("makeStripeSepaRequest Current Stripe environment is ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
|
1415 | 1415 | dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); |
1416 | 1416 | |
1417 | 1417 | $foundalternativestripeaccount = ''; |
1418 | 1418 | |
1419 | 1419 | // Force stripe to another value (by default this value is empty) |
1420 | - if (! empty($forcestripe)) { |
|
1420 | + if (!empty($forcestripe)) { |
|
1421 | 1421 | dol_syslog("makeStripeSepaRequest A dedicated stripe account was forced, so we switch to it."); |
1422 | 1422 | |
1423 | 1423 | $tmparray = explode('@', $forcestripe); |
1424 | - if (! empty($tmparray[1])) { |
|
1424 | + if (!empty($tmparray[1])) { |
|
1425 | 1425 | $tmparray2 = explode(':', $tmparray[1]); |
1426 | - if (! empty($tmparray2[1])) { |
|
1426 | + if (!empty($tmparray2[1])) { |
|
1427 | 1427 | $stripearrayofkeysbyenv[$servicestatus]["publishable_key"] = $tmparray2[0]; |
1428 | 1428 | $stripearrayofkeysbyenv[$servicestatus]["secret_key"] = $tmparray2[1]; |
1429 | 1429 | |
1430 | 1430 | $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus]; |
1431 | 1431 | \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); |
1432 | 1432 | |
1433 | - $foundalternativestripeaccount = $tmparray[0]; // Store the customer id |
|
1433 | + $foundalternativestripeaccount = $tmparray[0]; // Store the customer id |
|
1434 | 1434 | |
1435 | 1435 | dol_syslog("makeStripeSepaRequest We use now customer=".$foundalternativestripeaccount." publishable_key=".$stripearrayofkeys['publishable_key'], LOG_DEBUG); |
1436 | 1436 | } |
1437 | 1437 | } |
1438 | 1438 | |
1439 | - if (! $foundalternativestripeaccount) { |
|
1439 | + if (!$foundalternativestripeaccount) { |
|
1440 | 1440 | $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; |
1441 | 1441 | |
1442 | 1442 | $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; |
@@ -1451,7 +1451,7 @@ discard block |
||
1451 | 1451 | dol_syslog("makeStripeSepaRequest No dedicated Stripe Account requested, so we use global one, so ".$stripearrayofkeys['publishable_key'], LOG_DEBUG); |
1452 | 1452 | } |
1453 | 1453 | |
1454 | - $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) |
|
1454 | + $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) |
|
1455 | 1455 | |
1456 | 1456 | if ($foundalternativestripeaccount) { |
1457 | 1457 | if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | } |
1462 | 1462 | } else { |
1463 | 1463 | $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); |
1464 | - if (empty($customer) && ! empty($stripe->error)) { |
|
1464 | + if (empty($customer) && !empty($stripe->error)) { |
|
1465 | 1465 | $this->error = $stripe->error; |
1466 | 1466 | $this->errors[] = $this->error; |
1467 | 1467 | } |
@@ -1490,15 +1490,15 @@ discard block |
||
1490 | 1490 | } |
1491 | 1491 | |
1492 | 1492 | if ($stripecard) { // Can be src_... (for sepa) or pm_... (new card mode). Note that card_... (old card mode) should not happen here. |
1493 | - $FULLTAG = 'DID='.$did.'-INV=' . $this->id . '-CUS=' . $thirdparty->id; |
|
1494 | - $description = 'Stripe payment from makeStripeSepaRequest: ' . $FULLTAG . ' did='.$did.' ref=' . $this->ref; |
|
1493 | + $FULLTAG = 'DID='.$did.'-INV='.$this->id.'-CUS='.$thirdparty->id; |
|
1494 | + $description = 'Stripe payment from makeStripeSepaRequest: '.$FULLTAG.' did='.$did.' ref='.$this->ref; |
|
1495 | 1495 | |
1496 | 1496 | $stripefailurecode = ''; |
1497 | 1497 | $stripefailuremessage = ''; |
1498 | 1498 | $stripefailuredeclinecode = ''; |
1499 | 1499 | |
1500 | 1500 | // Using new SCA method |
1501 | - dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); |
|
1501 | + dol_syslog("* Create payment on SEPA ".$stripecard->id.", amounttopay=".$amounttopay.", amountstripe=".$amountstripe.", FULLTAG=".$FULLTAG, LOG_DEBUG); |
|
1502 | 1502 | |
1503 | 1503 | // Create payment intent and charge payment (confirmnow = true) |
1504 | 1504 | $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $this, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1, 1, $did); |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | $charge->failure_message = $stripe->error; |
1520 | 1520 | $charge->failure_declinecode = $stripe->declinecode; |
1521 | 1521 | $stripefailurecode = $stripe->code; |
1522 | - $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; |
|
1522 | + $stripefailuremessage = 'Action required. Contact the support at '; // . $conf->global->SELLYOURSAAS_MAIN_EMAIL; |
|
1523 | 1523 | $stripefailuredeclinecode = $stripe->declinecode; |
1524 | 1524 | } else { |
1525 | 1525 | dol_syslog(var_export($paymentintent, true), LOG_DEBUG); |
@@ -1540,7 +1540,7 @@ discard block |
||
1540 | 1540 | |
1541 | 1541 | // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) |
1542 | 1542 | if (empty($charge) || $charge->status == 'failed') { |
1543 | - dol_syslog('Failed to charge payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING); |
|
1543 | + dol_syslog('Failed to charge payment mode '.$stripecard->id.' stripefailurecode='.$stripefailurecode.' stripefailuremessage='.$stripefailuremessage.' stripefailuredeclinecode='.$stripefailuredeclinecode, LOG_WARNING); |
|
1544 | 1544 | |
1545 | 1545 | // Save a stripe payment was in error |
1546 | 1546 | $this->stripechargeerror++; |
@@ -1553,8 +1553,8 @@ discard block |
||
1553 | 1553 | $errauthenticationmessage = $langs->trans("ErrSCAAuthentication"); |
1554 | 1554 | $errmsg = $errauthenticationmessage; |
1555 | 1555 | } elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) { |
1556 | - $errmsg .= ': ' . $charge->failure_code; |
|
1557 | - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message; |
|
1556 | + $errmsg .= ': '.$charge->failure_code; |
|
1557 | + $errmsg .= ($charge->failure_message ? ' - ' : '').' '.$charge->failure_message; |
|
1558 | 1558 | if (empty($stripefailurecode)) { |
1559 | 1559 | $stripefailurecode = $charge->failure_code; |
1560 | 1560 | } |
@@ -1562,8 +1562,8 @@ discard block |
||
1562 | 1562 | $stripefailuremessage = $charge->failure_message; |
1563 | 1563 | } |
1564 | 1564 | } else { |
1565 | - $errmsg .= ': failure_code=' . $charge->failure_code; |
|
1566 | - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message; |
|
1565 | + $errmsg .= ': failure_code='.$charge->failure_code; |
|
1566 | + $errmsg .= ($charge->failure_message ? ' - ' : '').' failure_message='.$charge->failure_message; |
|
1567 | 1567 | if (empty($stripefailurecode)) { |
1568 | 1568 | $stripefailurecode = $charge->failure_code; |
1569 | 1569 | } |
@@ -1572,26 +1572,26 @@ discard block |
||
1572 | 1572 | } |
1573 | 1573 | } |
1574 | 1574 | } else { |
1575 | - $errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage; |
|
1576 | - $errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : ''); |
|
1575 | + $errmsg .= ': '.$stripefailurecode.' - '.$stripefailuremessage; |
|
1576 | + $errmsg .= ($stripefailuredeclinecode ? ' - '.$stripefailuredeclinecode : ''); |
|
1577 | 1577 | } |
1578 | 1578 | |
1579 | - $description = 'Stripe payment ERROR from makeStripeSepaRequest: ' . $FULLTAG; |
|
1580 | - $postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')'; |
|
1579 | + $description = 'Stripe payment ERROR from makeStripeSepaRequest: '.$FULLTAG; |
|
1580 | + $postactionmessages[] = $errmsg.' ('.$stripearrayofkeys['publishable_key'].')'; |
|
1581 | 1581 | |
1582 | 1582 | $this->error = $errmsg; |
1583 | 1583 | $this->errors[] = $this->error; |
1584 | 1584 | } else { |
1585 | 1585 | dol_syslog('Successfuly request '.$type.' '.$stripecard->id); |
1586 | 1586 | |
1587 | - $postactionmessages[] = 'Success to request '.$type.' (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; |
|
1587 | + $postactionmessages[] = 'Success to request '.$type.' ('.$charge->id.' with '.$stripearrayofkeys['publishable_key'].')'; |
|
1588 | 1588 | |
1589 | 1589 | // Save a stripe payment was done in real life so later we will be able to force a commit on recorded payments |
1590 | 1590 | // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. |
1591 | 1591 | $this->stripechargedone++; |
1592 | 1592 | |
1593 | 1593 | // Default description used for label of event. Will be overwrite by another value later. |
1594 | - $description = 'Stripe payment request OK (' . $charge->id . ') from makeStripeSepaRequest: ' . $FULLTAG; |
|
1594 | + $description = 'Stripe payment request OK ('.$charge->id.') from makeStripeSepaRequest: '.$FULLTAG; |
|
1595 | 1595 | } |
1596 | 1596 | |
1597 | 1597 | $object = $this; |
@@ -1600,8 +1600,8 @@ discard block |
||
1600 | 1600 | if (empty($charge) || $charge->status == 'failed') { |
1601 | 1601 | $actioncode = 'PAYMENT_STRIPE_KO'; |
1602 | 1602 | $extraparams = $stripefailurecode; |
1603 | - $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage; |
|
1604 | - $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode; |
|
1603 | + $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '').$stripefailuremessage; |
|
1604 | + $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '').$stripefailuredeclinecode; |
|
1605 | 1605 | } else { |
1606 | 1606 | $actioncode = 'PAYMENT_STRIPE_OK'; |
1607 | 1607 | $extraparams = ''; |
@@ -1609,15 +1609,15 @@ discard block |
||
1609 | 1609 | } else { |
1610 | 1610 | $error++; |
1611 | 1611 | $errorforinvoice++; |
1612 | - dol_syslog("No ban payment method found for this stripe customer " . $customer->id, LOG_WARNING); |
|
1612 | + dol_syslog("No ban payment method found for this stripe customer ".$customer->id, LOG_WARNING); |
|
1613 | 1613 | |
1614 | - $this->error = 'Failed to get direct debit payment method for stripe customer = ' . $customer->id; |
|
1614 | + $this->error = 'Failed to get direct debit payment method for stripe customer = '.$customer->id; |
|
1615 | 1615 | $this->errors[] = $this->error; |
1616 | 1616 | |
1617 | 1617 | $description = 'Failed to find or use the payment mode - no ban defined for the thirdparty account'; |
1618 | 1618 | $stripefailurecode = 'BADPAYMENTMODE'; |
1619 | 1619 | $stripefailuremessage = 'Failed to find or use the payment mode - no ban defined for the thirdparty account'; |
1620 | - $postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')'; |
|
1620 | + $postactionmessages[] = $description.' ('.$stripearrayofkeys['publishable_key'].')'; |
|
1621 | 1621 | |
1622 | 1622 | $object = $this; |
1623 | 1623 | |
@@ -1637,12 +1637,12 @@ discard block |
||
1637 | 1637 | } |
1638 | 1638 | } else { // Else of the if ($resultthirdparty > 0 && ! empty($customer)) { |
1639 | 1639 | if ($resultthirdparty <= 0) { |
1640 | - dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING); |
|
1641 | - $this->error = 'Failed to load Stripe account for thirdparty_id = ' . $thirdparty->id; |
|
1640 | + dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = '.$thirdparty->id, LOG_WARNING); |
|
1641 | + $this->error = 'Failed to load Stripe account for thirdparty_id = '.$thirdparty->id; |
|
1642 | 1642 | $this->errors[] = $this->error; |
1643 | 1643 | } else { // $customer stripe not found |
1644 | - dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); |
|
1645 | - $this->error = 'Failed to get Stripe account id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; |
|
1644 | + dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); |
|
1645 | + $this->error = 'Failed to get Stripe account id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; |
|
1646 | 1646 | $this->errors[] = $this->error; |
1647 | 1647 | } |
1648 | 1648 | $error++; |
@@ -1660,24 +1660,24 @@ discard block |
||
1660 | 1660 | } |
1661 | 1661 | |
1662 | 1662 | if ($description) { |
1663 | - dol_syslog("* Record event for credit transfer or direct debit request result - " . $description); |
|
1663 | + dol_syslog("* Record event for credit transfer or direct debit request result - ".$description); |
|
1664 | 1664 | require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
1665 | 1665 | |
1666 | 1666 | // Insert record of payment (success or error) |
1667 | 1667 | $actioncomm = new ActionComm($this->db); |
1668 | 1668 | |
1669 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
1670 | - $actioncomm->code = 'AC_' . $actioncode; |
|
1669 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
1670 | + $actioncomm->code = 'AC_'.$actioncode; |
|
1671 | 1671 | $actioncomm->label = $description; |
1672 | 1672 | $actioncomm->note_private = implode(",\n", $postactionmessages); |
1673 | 1673 | $actioncomm->fk_project = $this->fk_project; |
1674 | 1674 | $actioncomm->datep = $now; |
1675 | 1675 | $actioncomm->datef = $now; |
1676 | - $actioncomm->percentage = -1; // Not applicable |
|
1676 | + $actioncomm->percentage = -1; // Not applicable |
|
1677 | 1677 | $actioncomm->socid = $thirdparty->id; |
1678 | 1678 | $actioncomm->contactid = 0; |
1679 | - $actioncomm->authorid = $user->id; // User saving action |
|
1680 | - $actioncomm->userownerid = $user->id; // Owner of action |
|
1679 | + $actioncomm->authorid = $user->id; // User saving action |
|
1680 | + $actioncomm->userownerid = $user->id; // Owner of action |
|
1681 | 1681 | // Fields when action is a real email (content is already into note) |
1682 | 1682 | /*$actioncomm->email_msgid = $object->email_msgid; |
1683 | 1683 | $actioncomm->email_from = $object->email_from; |
@@ -1699,15 +1699,15 @@ discard block |
||
1699 | 1699 | } catch (Exception $e) { |
1700 | 1700 | $error++; |
1701 | 1701 | $errorforinvoice++; |
1702 | - dol_syslog('Error ' . $e->getMessage(), LOG_ERR); |
|
1703 | - $this->error = 'Error ' . $e->getMessage(); |
|
1702 | + dol_syslog('Error '.$e->getMessage(), LOG_ERR); |
|
1703 | + $this->error = 'Error '.$e->getMessage(); |
|
1704 | 1704 | $this->errors[] = $this->error; |
1705 | 1705 | } |
1706 | 1706 | } else { // If remain to pay is null |
1707 | 1707 | $error++; |
1708 | 1708 | $errorforinvoice++; |
1709 | - dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING); |
|
1710 | - $this->error = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; |
|
1709 | + dol_syslog("Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?", LOG_WARNING); |
|
1710 | + $this->error = "Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?"; |
|
1711 | 1711 | $this->errors[] = $this->error; |
1712 | 1712 | } |
1713 | 1713 | } |
@@ -1816,10 +1816,10 @@ discard block |
||
1816 | 1816 | |
1817 | 1817 | // Add the standard elements to the QR code |
1818 | 1818 | $lines = [ |
1819 | - 'BCD', // Service Tag (optional) |
|
1820 | - '002', // Version (optional) |
|
1821 | - '1', // Character set (optional) |
|
1822 | - 'SCT', // Identification (optional) |
|
1819 | + 'BCD', // Service Tag (optional) |
|
1820 | + '002', // Version (optional) |
|
1821 | + '1', // Character set (optional) |
|
1822 | + 'SCT', // Identification (optional) |
|
1823 | 1823 | ]; |
1824 | 1824 | |
1825 | 1825 | // Add the bank account information |
@@ -1841,7 +1841,7 @@ discard block |
||
1841 | 1841 | } |
1842 | 1842 | |
1843 | 1843 | // Add the amount and reference |
1844 | - $lines[] = 'EUR' . $totalTTCString; // Amount (optional) |
|
1844 | + $lines[] = 'EUR'.$totalTTCString; // Amount (optional) |
|
1845 | 1845 | $lines[] = ''; // Purpose (optional) |
1846 | 1846 | $lines[] = ''; // Payment reference (optional) |
1847 | 1847 | $lines[] = $this->ref; // Remittance Information (optional) |
@@ -1898,10 +1898,10 @@ discard block |
||
1898 | 1898 | $s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring; |
1899 | 1899 | $s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring; |
1900 | 1900 | $s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring; |
1901 | - $s .= ''; // Hash of xml invoice |
|
1902 | - $s .= ''; // ecda signature |
|
1903 | - $s .= ''; // ecda public key |
|
1904 | - $s .= ''; // ecda signature of public key stamp |
|
1901 | + $s .= ''; // Hash of xml invoice |
|
1902 | + $s .= ''; // ecda signature |
|
1903 | + $s .= ''; // ecda public key |
|
1904 | + $s .= ''; // ecda signature of public key stamp |
|
1905 | 1905 | |
1906 | 1906 | $s = base64_encode($s); |
1907 | 1907 | |
@@ -1969,8 +1969,8 @@ discard block |
||
1969 | 1969 | $s .= "S\n"; |
1970 | 1970 | $s .= dol_trunc($bankaccount->owner_name, 70, 'right', 'UTF-8', 1)."\n"; |
1971 | 1971 | $addresslinearray = explode("\n", $bankaccount->owner_address); |
1972 | - $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
1973 | - $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
1972 | + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
1973 | + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
1974 | 1974 | /*$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n"; |
1975 | 1975 | $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n"; |
1976 | 1976 | $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/ |
@@ -1978,8 +1978,8 @@ discard block |
||
1978 | 1978 | $s .= "S\n"; |
1979 | 1979 | $s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; |
1980 | 1980 | $addresslinearray = explode("\n", $mysoc->address); |
1981 | - $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
1982 | - $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
1981 | + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
1982 | + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
1983 | 1983 | $s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n"; |
1984 | 1984 | $s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n"; |
1985 | 1985 | $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n"; |
@@ -1999,14 +1999,14 @@ discard block |
||
1999 | 1999 | $s .= "S\n"; |
2000 | 2000 | $s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; |
2001 | 2001 | $addresslinearray = explode("\n", $this->thirdparty->address); |
2002 | - $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
2003 | - $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
2002 | + $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 |
|
2003 | + $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 |
|
2004 | 2004 | $s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1)."\n"; |
2005 | 2005 | $s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1)."\n"; |
2006 | 2006 | $s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n"; |
2007 | 2007 | // ID of payment |
2008 | - $s .= "NON\n"; // NON or QRR |
|
2009 | - $s .= "\n"; // QR Code reference if previous field is QRR |
|
2008 | + $s .= "NON\n"; // NON or QRR |
|
2009 | + $s .= "\n"; // QR Code reference if previous field is QRR |
|
2010 | 2010 | // Free text |
2011 | 2011 | if ($complementaryinfo) { |
2012 | 2012 | $s .= $complementaryinfo."\n"; |