@@ -38,12 +38,12 @@ |
||
| 38 | 38 | accessforbidden('Auto order is not allowed'); // If Auto Order is disabled never allow access to this page (that is a NO LOGIN access) |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -$_SESSION["basiclayout"] = 1; // For the simple layout for public submission |
|
| 42 | -$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1); // Default terminal for public submission is 1 |
|
| 41 | +$_SESSION["basiclayout"] = 1; // For the simple layout for public submission |
|
| 42 | +$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1); // Default terminal for public submission is 1 |
|
| 43 | 43 | |
| 44 | 44 | define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); |
| 45 | 45 | if (GETPOSTISSET("mobilepage")) { |
| 46 | - require DOL_DOCUMENT_ROOT.'/takepos/invoice.php'; // The section with list of selected products in order |
|
| 46 | + require DOL_DOCUMENT_ROOT.'/takepos/invoice.php'; // The section with list of selected products in order |
|
| 47 | 47 | } elseif (GETPOSTISSET("genimg")) { |
| 48 | 48 | require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php'; |
| 49 | 49 | } else { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } else { |
| 140 | 140 | $object->name = GETPOST("nom", 'alphanohtml'); |
| 141 | 141 | $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml'))); |
| 142 | - $object->color = GETPOST("color", 'alphanohtml'); |
|
| 142 | + $object->color = GETPOST("color", 'alphanohtml'); |
|
| 143 | 143 | |
| 144 | 144 | // Fill array 'array_options' with data from add form |
| 145 | 145 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | if (($action == 'adduser' || $action == 'removeuser') && $permissiontoedit) { |
| 181 | 181 | if ($userid > 0) { |
| 182 | 182 | $object->fetch($id); |
| 183 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 183 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 184 | 184 | |
| 185 | 185 | $edituser = new User($db); |
| 186 | 186 | $edituser->fetch($userid); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $object->fetch($id); |
| 208 | 208 | |
| 209 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 209 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 210 | 210 | |
| 211 | 211 | $object->name = GETPOST("nom", 'alphanohtml'); |
| 212 | 212 | $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml'))); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | print '<td class="liste_titre right" width="5"> </td>'; |
| 459 | 459 | print "</tr>\n"; |
| 460 | 460 | |
| 461 | - $object->fetch($object->id, '', true); // true to force load of all users, member of the group |
|
| 461 | + $object->fetch($object->id, '', true); // true to force load of all users, member of the group |
|
| 462 | 462 | |
| 463 | 463 | if (!empty($object->members)) { |
| 464 | 464 | foreach ($object->members as $useringroup) { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $action = GETPOST('action', 'aZ09'); |
| 67 | 67 | $cancel = GETPOST('cancel', 'alpha'); |
| 68 | 68 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 69 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 69 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 70 | 70 | $confirm = GETPOST('confirm', 'alpha'); |
| 71 | 71 | $rowid = GETPOSTINT('rowid'); |
| 72 | 72 | $id = GETPOST('id') ? GETPOSTINT('id') : $rowid; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('adherent', 'creer')) { |
| 278 | 278 | $member_origin_id = GETPOSTINT('member_origin'); |
| 279 | - $member_origin = new Adherent($db); // The thirdparty that we will delete |
|
| 279 | + $member_origin = new Adherent($db); // The thirdparty that we will delete |
|
| 280 | 280 | |
| 281 | 281 | if ($member_origin_id <= 0) { |
| 282 | 282 | $langs->load('errors'); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | } |
| 336 | 336 | // Create new object |
| 337 | 337 | if ($result > 0 && !$error) { |
| 338 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 338 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 339 | 339 | |
| 340 | 340 | // Change values |
| 341 | 341 | $object->civility_id = trim(GETPOST("civility_id", 'alphanohtml')); |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $object->gender = trim(GETPOST("gender", 'alphanohtml')); |
| 345 | 345 | $object->login = trim(GETPOST("login", 'alphanohtml')); |
| 346 | 346 | if (GETPOSTISSET('pass')) { |
| 347 | - $object->pass = trim(GETPOST("pass", 'password')); // For password, we must use 'none' |
|
| 347 | + $object->pass = trim(GETPOST("pass", 'password')); // For password, we must use 'none' |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | $object->societe = trim(GETPOST("societe", 'alphanohtml')); // deprecated |
@@ -399,10 +399,10 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | // Check if we need to also synchronize password information |
| 402 | - $nosyncuserpass = 1; // no by default |
|
| 402 | + $nosyncuserpass = 1; // no by default |
|
| 403 | 403 | if (GETPOSTISSET('pass')) { |
| 404 | 404 | if ($object->user_id) { // If member is linked to a user |
| 405 | - $nosyncuserpass = 0; // We may try to sync password |
|
| 405 | + $nosyncuserpass = 0; // We may try to sync password |
|
| 406 | 406 | if ($user->id == $object->user_id) { |
| 407 | 407 | if (!$user->hasRight('user', 'self', 'password')) { |
| 408 | 408 | $nosyncuserpass = 1; // Disable synchronizing |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $email = preg_replace('/\s+/', '', GETPOST("member_email", 'aZ09arobase')); |
| 513 | 513 | $url = trim(GETPOST('url', 'url')); |
| 514 | 514 | $login = GETPOST("member_login", 'alphanohtml'); |
| 515 | - $pass = GETPOST("password", 'password'); // For password, we use 'none' |
|
| 515 | + $pass = GETPOST("password", 'password'); // For password, we use 'none' |
|
| 516 | 516 | $photo = GETPOST("photo", 'alphanohtml'); |
| 517 | 517 | $morphy = GETPOST("morphy", 'alphanohtml'); |
| 518 | 518 | $public = GETPOSTINT("public"); |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | } |
| 889 | 889 | |
| 890 | 890 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 891 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 891 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 892 | 892 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 893 | 893 | |
| 894 | 894 | // Fill array 'array_options' with data from update form |
@@ -1441,7 +1441,7 @@ discard block |
||
| 1441 | 1441 | $maxfilesizearray = getMaxFileSizeArray(); |
| 1442 | 1442 | $maxmin = $maxfilesizearray['maxmin']; |
| 1443 | 1443 | if ($maxmin > 0) { |
| 1444 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 1444 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 1445 | 1445 | } |
| 1446 | 1446 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 1447 | 1447 | print '</td></tr>'; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $object->note_public = trim($comment); |
| 181 | 181 | $object->note_private = ''; |
| 182 | 182 | $object->mail_valid = trim($mail_valid); |
| 183 | - $object->vote = $vote; // $vote is already int |
|
| 183 | + $object->vote = $vote; // $vote is already int |
|
| 184 | 184 | |
| 185 | 185 | // Fill array 'array_options' with data from add form |
| 186 | 186 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $urltogo = $backtopage ? str_replace('__ID__', (string) $id, $backtopage) : $backurlforlist; |
| 215 | 215 | $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect field created after a New on another form object creation |
| 216 | 216 | |
| 217 | - header("Location: " . $urltogo); |
|
| 217 | + header("Location: ".$urltogo); |
|
| 218 | 218 | exit; |
| 219 | 219 | } else { |
| 220 | 220 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | if ($action == 'update' && $user->hasRight('adherent', 'configurer')) { |
| 229 | 229 | $object->fetch($rowid); |
| 230 | 230 | |
| 231 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 231 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 232 | 232 | |
| 233 | 233 | $object->label = trim($label); |
| 234 | 234 | $object->morphy = trim($morphy); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $object->note_public = trim($comment); |
| 242 | 242 | $object->note_private = ''; |
| 243 | 243 | $object->mail_valid = trim($mail_valid); |
| 244 | - $object->vote = $vote; // $vote is already int. |
|
| 244 | + $object->vote = $vote; // $vote is already int. |
|
| 245 | 245 | |
| 246 | 246 | // Fill array 'array_options' with data from add form |
| 247 | 247 | $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | print '<input type="hidden" name="mode" value="'.$mode.'">'; |
| 346 | 346 | |
| 347 | 347 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 348 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 348 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 349 | 349 | $selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : ''); |
| 350 | 350 | //$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 351 | 351 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | print '<table class="border centpercent">'; |
| 548 | 548 | print '<tbody>'; |
| 549 | 549 | |
| 550 | - print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" value= "'. $label. '" autofocus="autofocus"></td></tr>'; |
|
| 550 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" value= "'.$label.'" autofocus="autofocus"></td></tr>'; |
|
| 551 | 551 | |
| 552 | 552 | print '<tr><td>'.$langs->trans("Status").'</td><td>'; |
| 553 | 553 | print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100'); |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | print '</td></tr>'; |
| 581 | 581 | |
| 582 | 582 | print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">'; |
| 583 | - print '<input name="duration_value" size="5" value="'. $duration_value .'"> '; |
|
| 583 | + print '<input name="duration_value" size="5" value="'.$duration_value.'"> '; |
|
| 584 | 584 | print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1); |
| 585 | 585 | print '</td></tr>'; |
| 586 | 586 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | |
| 832 | 832 | $query = ['rowid' => $object->id]; |
| 833 | 833 | if (!empty($mode)) { |
| 834 | - $query+= ['mode' => $mode]; |
|
| 834 | + $query += ['mode' => $mode]; |
|
| 835 | 835 | } |
| 836 | 836 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
| 837 | 837 | $query += ['contextpage' => $contextpage]; |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | if (!empty($filter)) { |
| 858 | 858 | $query += ['filter' => $filter]; |
| 859 | 859 | } |
| 860 | - $param = '&' . http_build_query($query); |
|
| 860 | + $param = '&'.http_build_query($query); |
|
| 861 | 861 | |
| 862 | 862 | if ($sall) { |
| 863 | 863 | print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $this->watermark = ''; |
| 161 | 161 | |
| 162 | 162 | if ($mysoc === null) { |
| 163 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 163 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 164 | 164 | return; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) { |
| 346 | 346 | $this->heightforinfotot += (4 * $nbpayments); |
| 347 | 347 | } |
| 348 | - $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page |
|
| 348 | + $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page |
|
| 349 | 349 | $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
| 350 | 350 | |
| 351 | 351 | $heightforqrinvoice = 0; |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) { |
| 369 | 369 | $logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity]; |
| 370 | 370 | } |
| 371 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 371 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 372 | 372 | $tplidx = $pdf->importPage(1); |
| 373 | 373 | } |
| 374 | 374 | |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
| 466 | 466 | |
| 467 | 467 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
| 468 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 468 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 469 | 469 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
| 470 | 470 | |
| 471 | 471 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs); |
| 900 | 900 | $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue); |
| 901 | 901 | |
| 902 | - $this->setAfterColsLinePositionsData('options_' . $extrafieldColKey, $pdf->GetY(), $pdf->getPage()); |
|
| 902 | + $this->setAfterColsLinePositionsData('options_'.$extrafieldColKey, $pdf->GetY(), $pdf->getPage()); |
|
| 903 | 903 | } |
| 904 | 904 | } |
| 905 | 905 | } |
@@ -978,14 +978,14 @@ discard block |
||
| 978 | 978 | if (!isset($this->tva[$vatrate])) { |
| 979 | 979 | $this->tva[$vatrate] = 0; |
| 980 | 980 | } |
| 981 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
| 981 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
| 982 | 982 | $vatcode = $object->lines[$i]->vat_src_code; |
| 983 | 983 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { |
| 984 | 984 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; |
| 985 | 985 | } |
| 986 | 986 | if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { |
| 987 | 987 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { |
| 988 | - $this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0; |
|
| 988 | + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0; |
|
| 989 | 989 | } |
| 990 | 990 | $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); |
| 991 | 991 | } else { |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | |
| 1093 | 1093 | // Add number of pages in footer |
| 1094 | 1094 | if (method_exists($pdf, 'AliasNbPages')) { |
| 1095 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 1095 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 1096 | 1096 | } |
| 1097 | 1097 | // Add terms to sale |
| 1098 | 1098 | if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) { |
@@ -1349,7 +1349,7 @@ discard block |
||
| 1349 | 1349 | foreach ($this->tva_array as $tvakey => $tvaval) { |
| 1350 | 1350 | $pdf->SetFont('', '', $default_font_size - 2); |
| 1351 | 1351 | $pdf->SetXY($this->marge_gauche, $posy); |
| 1352 | - $titre = round((float) $tvakey, 2) . "%"; |
|
| 1352 | + $titre = round((float) $tvakey, 2)."%"; |
|
| 1353 | 1353 | $pdf->MultiCell(25, 4, $titre, 0, 'L'); |
| 1354 | 1354 | |
| 1355 | 1355 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -1399,8 +1399,8 @@ discard block |
||
| 1399 | 1399 | $posy += 3; |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | - $posxval = 52; // Position of values of properties shown on left side |
|
| 1403 | - $posxend = 110; // End of x for text on left side |
|
| 1402 | + $posxval = 52; // Position of values of properties shown on left side |
|
| 1403 | + $posxend = 110; // End of x for text on left side |
|
| 1404 | 1404 | if ($this->page_largeur < 210) { // To work with US executive format |
| 1405 | 1405 | $posxend -= 10; |
| 1406 | 1406 | } |
@@ -1409,11 +1409,11 @@ discard block |
||
| 1409 | 1409 | if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) { |
| 1410 | 1410 | // All customer previous invoices |
| 1411 | 1411 | $sql = "SELECT f.rowid, f.datef, f.total_ttc"; |
| 1412 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
| 1413 | - $sql .= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
| 1414 | - $sql .= " AND f.entity IN (" . getEntity('invoice') . ")"; |
|
| 1415 | - $sql .= " AND f.datef <= '" . $this->db->idate($object->date) . "'"; |
|
| 1416 | - $sql .= " AND f.rowid < " . ((int) $object->id); |
|
| 1412 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
| 1413 | + $sql .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
| 1414 | + $sql .= " AND f.entity IN (".getEntity('invoice').")"; |
|
| 1415 | + $sql .= " AND f.datef <= '".$this->db->idate($object->date)."'"; |
|
| 1416 | + $sql .= " AND f.rowid < ".((int) $object->id); |
|
| 1417 | 1417 | $sql .= " AND f.fk_statut > 0"; |
| 1418 | 1418 | $sql .= " ORDER BY f.datef ASC"; |
| 1419 | 1419 | |
@@ -1430,11 +1430,11 @@ discard block |
||
| 1430 | 1430 | |
| 1431 | 1431 | // All payments before current date |
| 1432 | 1432 | $sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
| 1433 | - $sql_payments .= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
| 1434 | - $sql_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1435 | - $sql_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
| 1436 | - $sql_payments .= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
| 1437 | - $sql_payments .= " AND p.datep < '" . $this->db->idate($object->date) . "'"; |
|
| 1433 | + $sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
| 1434 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1435 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
| 1436 | + $sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
| 1437 | + $sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'"; |
|
| 1438 | 1438 | $sql_payments .= " ORDER BY p.datep ASC"; |
| 1439 | 1439 | |
| 1440 | 1440 | $total_payments = 0; |
@@ -1448,11 +1448,11 @@ discard block |
||
| 1448 | 1448 | |
| 1449 | 1449 | // Payments made on current invoice date (including current invoice) |
| 1450 | 1450 | $sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
| 1451 | - $sql_current_date_payments .= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
| 1452 | - $sql_current_date_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1453 | - $sql_current_date_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
| 1454 | - $sql_current_date_payments .= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
| 1455 | - $sql_current_date_payments .= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')"; |
|
| 1451 | + $sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
| 1452 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1453 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
| 1454 | + $sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
| 1455 | + $sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')"; |
|
| 1456 | 1456 | |
| 1457 | 1457 | $current_date_payments = 0; |
| 1458 | 1458 | $resql_current_date = $this->db->query($sql_current_date_payments); |
@@ -1508,7 +1508,7 @@ discard block |
||
| 1508 | 1508 | |
| 1509 | 1509 | $pdf->SetFont('', '', $default_font_size - 2); |
| 1510 | 1510 | $pdf->SetXY($posxval, $posy); |
| 1511 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 1511 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 1512 | 1512 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
| 1513 | 1513 | |
| 1514 | 1514 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1686,7 +1686,7 @@ discard block |
||
| 1686 | 1686 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
| 1687 | 1687 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
| 1688 | 1688 | |
| 1689 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
| 1689 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
| 1690 | 1690 | } |
| 1691 | 1691 | } |
| 1692 | 1692 | } |
@@ -2377,7 +2377,7 @@ discard block |
||
| 2377 | 2377 | if (empty($hidetop)) { |
| 2378 | 2378 | // Show category of operations |
| 2379 | 2379 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
| 2380 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 2380 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 2381 | 2381 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
| 2382 | 2382 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
| 2383 | 2383 | } |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | } |
| 2495 | 2495 | if ($this->situationinvoice) { |
| 2496 | 2496 | $outputlangs->loadLangs(array("other")); |
| 2497 | - $title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -"; |
|
| 2497 | + $title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -"; |
|
| 2498 | 2498 | $subtitle = $outputlangs->transnoentities("PDFSituationTitle", (string) $object->situation_counter); |
| 2499 | 2499 | } |
| 2500 | 2500 | if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { |
@@ -2779,7 +2779,7 @@ discard block |
||
| 2779 | 2779 | $idaddressshipping = $object->getIdContact('external', 'SHIPPING'); |
| 2780 | 2780 | |
| 2781 | 2781 | if (!empty($idaddressshipping)) { |
| 2782 | - $object->fetch_contact($idaddressshipping[0]); // Load $object->contact |
|
| 2782 | + $object->fetch_contact($idaddressshipping[0]); // Load $object->contact |
|
| 2783 | 2783 | $companystatic = new Societe($this->db); |
| 2784 | 2784 | $companystatic->fetch($object->contact->fk_soc); |
| 2785 | 2785 | $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); |
@@ -2791,7 +2791,7 @@ discard block |
||
| 2791 | 2791 | if (!empty($carac_client_shipping)) { |
| 2792 | 2792 | $posy += $hautcadre; |
| 2793 | 2793 | |
| 2794 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
| 2794 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
| 2795 | 2795 | |
| 2796 | 2796 | // Show shipping frame |
| 2797 | 2797 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * Dolibarr version of the loaded document |
| 79 | 79 | * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' |
| 80 | 80 | */ |
| 81 | - public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
| 81 | + public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * @var int height for info total |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $this->watermark = ''; |
| 216 | 216 | |
| 217 | 217 | if ($mysoc === null) { |
| 218 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 218 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 219 | 219 | return; |
| 220 | 220 | } |
| 221 | 221 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies", "compta")); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
| 290 | + if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
| 291 | 291 | setEventMessage($langs->trans('WarningsObjectIsNotASituation'), 'warnings'); |
| 292 | 292 | return 1; |
| 293 | 293 | } |
@@ -407,15 +407,15 @@ discard block |
||
| 407 | 407 | $pdf->setAutoPageBreak(true, 0); |
| 408 | 408 | |
| 409 | 409 | // Compute height for total, free text and footer |
| 410 | - $this->heightforinfotot = 50; // Height reserved to output the info and total part and payment part |
|
| 410 | + $this->heightforinfotot = 50; // Height reserved to output the info and total part and payment part |
|
| 411 | 411 | if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) { |
| 412 | 412 | $this->heightforinfotot += (4 * ($nbpayments + 3)); |
| 413 | 413 | } |
| 414 | 414 | if ($nbprevsituation > 0) { |
| 415 | 415 | $this->heightforinfotot += (4 * ($nbprevsituation + 3)); |
| 416 | 416 | } |
| 417 | - $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page |
|
| 418 | - $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
| 417 | + $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page |
|
| 418 | + $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
| 419 | 419 | |
| 420 | 420 | $heightforqrinvoice = 0; |
| 421 | 421 | if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') == 'bottom') { |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) { |
| 438 | 438 | $logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity]; |
| 439 | 439 | } |
| 440 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 440 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 441 | 441 | $this->tplidx = $pdf->importPage(1); |
| 442 | 442 | } |
| 443 | 443 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
| 535 | 535 | |
| 536 | 536 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
| 537 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 537 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 538 | 538 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
| 539 | 539 | |
| 540 | 540 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -1064,14 +1064,14 @@ discard block |
||
| 1064 | 1064 | if (!isset($this->tva[$vatrate])) { |
| 1065 | 1065 | $this->tva[$vatrate] = 0; |
| 1066 | 1066 | } |
| 1067 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
| 1067 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
| 1068 | 1068 | $vatcode = $object->lines[$i]->vat_src_code; |
| 1069 | 1069 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { |
| 1070 | 1070 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; |
| 1071 | 1071 | } |
| 1072 | 1072 | if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { |
| 1073 | 1073 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { |
| 1074 | - $this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0; |
|
| 1074 | + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0; |
|
| 1075 | 1075 | } |
| 1076 | 1076 | $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); |
| 1077 | 1077 | } else { |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | |
| 1170 | 1170 | // Add number of pages in footer |
| 1171 | 1171 | if (method_exists($pdf, 'AliasNbPages')) { |
| 1172 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 1172 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 1173 | 1173 | } |
| 1174 | 1174 | // Add terms to sale |
| 1175 | 1175 | if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) { |
@@ -1430,7 +1430,7 @@ discard block |
||
| 1430 | 1430 | foreach ($this->tva_array as $tvakey => $tvaval) { |
| 1431 | 1431 | $pdf->SetFont('', '', $default_font_size - 2); |
| 1432 | 1432 | $pdf->SetXY($this->marge_gauche, $posy); |
| 1433 | - $titre = round((float) $tvakey, 2) . "%"; |
|
| 1433 | + $titre = round((float) $tvakey, 2)."%"; |
|
| 1434 | 1434 | $pdf->MultiCell(25, 4, $titre, 0, 'L'); |
| 1435 | 1435 | |
| 1436 | 1436 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -1481,8 +1481,8 @@ discard block |
||
| 1481 | 1481 | } |
| 1482 | 1482 | |
| 1483 | 1483 | |
| 1484 | - $posxval = 52; // Position of values of properties shown on left side |
|
| 1485 | - $posxend = 110; // End of x for text on left side |
|
| 1484 | + $posxval = 52; // Position of values of properties shown on left side |
|
| 1485 | + $posxend = 110; // End of x for text on left side |
|
| 1486 | 1486 | if ($this->page_largeur < 210) { // To work with US executive format |
| 1487 | 1487 | $posxend -= 10; |
| 1488 | 1488 | } |
@@ -1491,11 +1491,11 @@ discard block |
||
| 1491 | 1491 | if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) { |
| 1492 | 1492 | // All customer previous invoices |
| 1493 | 1493 | $sql = "SELECT f.rowid, f.datef, f.total_ttc"; |
| 1494 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
| 1495 | - $sql .= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
| 1496 | - $sql .= " AND f.entity IN (" . getEntity('invoice') . ")"; |
|
| 1497 | - $sql .= " AND f.datef <= '" . $this->db->idate($object->date) . "'"; |
|
| 1498 | - $sql .= " AND f.rowid < " . ((int) $object->id); |
|
| 1494 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
| 1495 | + $sql .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
| 1496 | + $sql .= " AND f.entity IN (".getEntity('invoice').")"; |
|
| 1497 | + $sql .= " AND f.datef <= '".$this->db->idate($object->date)."'"; |
|
| 1498 | + $sql .= " AND f.rowid < ".((int) $object->id); |
|
| 1499 | 1499 | $sql .= " AND f.fk_statut > 0"; |
| 1500 | 1500 | $sql .= " ORDER BY f.datef ASC"; |
| 1501 | 1501 | |
@@ -1512,11 +1512,11 @@ discard block |
||
| 1512 | 1512 | |
| 1513 | 1513 | // All payments before current date |
| 1514 | 1514 | $sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
| 1515 | - $sql_payments .= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
| 1516 | - $sql_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1517 | - $sql_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
| 1518 | - $sql_payments .= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
| 1519 | - $sql_payments .= " AND p.datep < '" . $this->db->idate($object->date) . "'"; |
|
| 1515 | + $sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
| 1516 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1517 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
| 1518 | + $sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
| 1519 | + $sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'"; |
|
| 1520 | 1520 | $sql_payments .= " ORDER BY p.datep ASC"; |
| 1521 | 1521 | |
| 1522 | 1522 | $total_payments = 0; |
@@ -1530,11 +1530,11 @@ discard block |
||
| 1530 | 1530 | |
| 1531 | 1531 | // Payments made on current invoice date (including current invoice) |
| 1532 | 1532 | $sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
| 1533 | - $sql_current_date_payments .= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
| 1534 | - $sql_current_date_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1535 | - $sql_current_date_payments .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
| 1536 | - $sql_current_date_payments .= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
| 1537 | - $sql_current_date_payments .= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')"; |
|
| 1533 | + $sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
| 1534 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
| 1535 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
| 1536 | + $sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
| 1537 | + $sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')"; |
|
| 1538 | 1538 | |
| 1539 | 1539 | $current_date_payments = 0; |
| 1540 | 1540 | $resql_current_date = $this->db->query($sql_current_date_payments); |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | |
| 1591 | 1591 | $pdf->SetFont('', '', $default_font_size - 2); |
| 1592 | 1592 | $pdf->SetXY($posxval, $posy); |
| 1593 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 1593 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 1594 | 1594 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
| 1595 | 1595 | |
| 1596 | 1596 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1768,7 +1768,7 @@ discard block |
||
| 1768 | 1768 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
| 1769 | 1769 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
| 1770 | 1770 | |
| 1771 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
| 1771 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
| 1772 | 1772 | } |
| 1773 | 1773 | } |
| 1774 | 1774 | } |
@@ -1945,7 +1945,7 @@ discard block |
||
| 1945 | 1945 | if (($object->lines[$i]->info_bits & 0x01) == 0x01) { |
| 1946 | 1946 | $vatrate .= '*'; |
| 1947 | 1947 | } |
| 1948 | - if (! isset($tvas[$vatrate])) { |
|
| 1948 | + if (!isset($tvas[$vatrate])) { |
|
| 1949 | 1949 | $tvas[$vatrate] = 0; |
| 1950 | 1950 | } |
| 1951 | 1951 | $tvas[$vatrate] += $tvaligne; |
@@ -2229,7 +2229,7 @@ discard block |
||
| 2229 | 2229 | if (empty($hidetop)) { |
| 2230 | 2230 | // Show category of operations |
| 2231 | 2231 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
| 2232 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 2232 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 2233 | 2233 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
| 2234 | 2234 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
| 2235 | 2235 | } |
@@ -2249,7 +2249,7 @@ discard block |
||
| 2249 | 2249 | $pdf->SetFont('', '', $default_font_size - 1); |
| 2250 | 2250 | |
| 2251 | 2251 | // Output Rect |
| 2252 | - $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 2252 | + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 2253 | 2253 | |
| 2254 | 2254 | // situation invoice |
| 2255 | 2255 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -2289,7 +2289,7 @@ discard block |
||
| 2289 | 2289 | $pdf->SetFont('', '', $default_font_size - 1); |
| 2290 | 2290 | |
| 2291 | 2291 | if (empty($hidetop)) { |
| 2292 | - $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
| 2292 | + $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
| 2293 | 2293 | } |
| 2294 | 2294 | } |
| 2295 | 2295 | |
@@ -2652,7 +2652,7 @@ discard block |
||
| 2652 | 2652 | $idaddressshipping = $object->getIdContact('external', 'SHIPPING'); |
| 2653 | 2653 | |
| 2654 | 2654 | if (!empty($idaddressshipping)) { |
| 2655 | - $object->fetch_contact($idaddressshipping[0]); // Load $object->contact |
|
| 2655 | + $object->fetch_contact($idaddressshipping[0]); // Load $object->contact |
|
| 2656 | 2656 | $companystatic = new Societe($this->db); |
| 2657 | 2657 | $companystatic->fetch($object->contact->fk_soc); |
| 2658 | 2658 | $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); |
@@ -2664,7 +2664,7 @@ discard block |
||
| 2664 | 2664 | if (!empty($carac_client_shipping)) { |
| 2665 | 2665 | $posy += $hautcadre; |
| 2666 | 2666 | |
| 2667 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
| 2667 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
| 2668 | 2668 | |
| 2669 | 2669 | // Show shipping frame |
| 2670 | 2670 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -2874,7 +2874,7 @@ discard block |
||
| 2874 | 2874 | 'overtitle' => array( |
| 2875 | 2875 | 'textkey' => 'Chantier', // use lang key is useful in somme case with module |
| 2876 | 2876 | 'align' => 'C', |
| 2877 | - 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
| 2877 | + 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
| 2878 | 2878 | 'width' => 18 |
| 2879 | 2879 | ), |
| 2880 | 2880 | ); |
@@ -2899,13 +2899,13 @@ discard block |
||
| 2899 | 2899 | ), |
| 2900 | 2900 | 'border-left' => true, // add left line separator |
| 2901 | 2901 | 'overtitle' => array( |
| 2902 | - 'textkey' => 'S'.$derniere_situation->situation_counter . ' - ' . dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
| 2902 | + 'textkey' => 'S'.$derniere_situation->situation_counter.' - '.dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
| 2903 | 2903 | 'align' => 'C', |
| 2904 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2904 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2905 | 2905 | 'width' => 10 + 15 //current width + amount cell width |
| 2906 | 2906 | ), |
| 2907 | 2907 | ); |
| 2908 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2908 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2909 | 2909 | $this->cols['prev_progress']['status'] = true; |
| 2910 | 2910 | } |
| 2911 | 2911 | |
@@ -2920,7 +2920,7 @@ discard block |
||
| 2920 | 2920 | ), |
| 2921 | 2921 | 'border-left' => true, // add left line separator |
| 2922 | 2922 | ); |
| 2923 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2923 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2924 | 2924 | $this->cols['prev_progress_amount']['status'] = true; |
| 2925 | 2925 | } |
| 2926 | 2926 | |
@@ -2935,9 +2935,9 @@ discard block |
||
| 2935 | 2935 | ), |
| 2936 | 2936 | 'border-left' => true, // add left line separator |
| 2937 | 2937 | 'overtitle' => array( |
| 2938 | - 'textkey' => 'S'.$object->situation_counter . ' - ' . dol_print_date($object->date, "%d/%m/%Y"), |
|
| 2938 | + 'textkey' => 'S'.$object->situation_counter.' - '.dol_print_date($object->date, "%d/%m/%Y"), |
|
| 2939 | 2939 | 'align' => 'C', |
| 2940 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2940 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2941 | 2941 | 'width' => 10 + 15 |
| 2942 | 2942 | ), |
| 2943 | 2943 | ); |
@@ -3061,7 +3061,7 @@ discard block |
||
| 3061 | 3061 | |
| 3062 | 3062 | // Output Rect |
| 3063 | 3063 | // KEEPTHIS => Affiche les bords extérieurs |
| 3064 | - $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 3064 | + $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 3065 | 3065 | |
| 3066 | 3066 | $pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height); |
| 3067 | 3067 | if (empty($hidetop)) { |
@@ -3118,7 +3118,7 @@ discard block |
||
| 3118 | 3118 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 24 + $i); |
| 3119 | 3119 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("TotalHT").' '.$TVatInfo['label'], '', 'L'); |
| 3120 | 3120 | |
| 3121 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 3121 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 3122 | 3122 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 28 + $i); |
| 3123 | 3123 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("VAT").' '.$TVatInfo['label'], '', 'L'); |
| 3124 | 3124 | } else { |
@@ -3182,7 +3182,7 @@ discard block |
||
| 3182 | 3182 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['HT'], 0, '', 1, -1, 2), '', 'R'); |
| 3183 | 3183 | |
| 3184 | 3184 | // Total TVA |
| 3185 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 3185 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 3186 | 3186 | $pdf->SetXY($x, $tab_top + 28 + $i); |
| 3187 | 3187 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['TVA'], 0, '', 1, -1, 2), '', 'R'); |
| 3188 | 3188 | } else { |
@@ -3259,7 +3259,7 @@ discard block |
||
| 3259 | 3259 | |
| 3260 | 3260 | $TDataSituation = array(); |
| 3261 | 3261 | |
| 3262 | - if (! empty($facDerniereSituation)) { |
|
| 3262 | + if (!empty($facDerniereSituation)) { |
|
| 3263 | 3263 | $TDataSituation['derniere_situation'] = $facDerniereSituation; |
| 3264 | 3264 | $TDataSituation['date_derniere_situation'] = $facDerniereSituation->date; |
| 3265 | 3265 | } |
@@ -3268,9 +3268,9 @@ discard block |
||
| 3268 | 3268 | $retenue_garantie_anterieure = 0; |
| 3269 | 3269 | // Init tous les champs à 0 |
| 3270 | 3270 | $TDataSituation['cumul_anterieur'] = array( |
| 3271 | - 'HT' => 0, //montant HT normal |
|
| 3272 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3273 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3271 | + 'HT' => 0, //montant HT normal |
|
| 3272 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3273 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3274 | 3274 | 'retenue_garantie' => 0, |
| 3275 | 3275 | 'travaux_sup' => 0, |
| 3276 | 3276 | 'HTnet' => 0, //montant HT |
@@ -3300,7 +3300,7 @@ discard block |
||
| 3300 | 3300 | $isFirstSituation = false; |
| 3301 | 3301 | if (!empty($l->fk_prev_id)) { |
| 3302 | 3302 | $prevSituationPercent = $l->get_prev_progress($previousInvoice->id, true); |
| 3303 | - } elseif (! array_key_exists($i + 1, $TPreviousInvoices)) { |
|
| 3303 | + } elseif (!array_key_exists($i + 1, $TPreviousInvoices)) { |
|
| 3304 | 3304 | $isFirstSituation = true; |
| 3305 | 3305 | } |
| 3306 | 3306 | |
@@ -3310,7 +3310,7 @@ discard block |
||
| 3310 | 3310 | |
| 3311 | 3311 | //1ere ligne |
| 3312 | 3312 | $amounttva = $calc_ht * ($ltvatx / 100); |
| 3313 | - if (! isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
| 3313 | + if (!isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
| 3314 | 3314 | $TDataSituation['cumul_anterieur'][$ltvatx]['HT'] = $calc_ht; |
| 3315 | 3315 | $TDataSituation['cumul_anterieur'][$ltvatx]['TVA'] = $amounttva; |
| 3316 | 3316 | } else { |
@@ -3322,14 +3322,14 @@ discard block |
||
| 3322 | 3322 | //le grand total de TVA |
| 3323 | 3323 | // $TDataSituation['cumul_anterieur']['TVA'] += $amounttva; |
| 3324 | 3324 | |
| 3325 | - if (empty($l->fk_prev_id) && ! $isFirstSituation) { |
|
| 3325 | + if (empty($l->fk_prev_id) && !$isFirstSituation) { |
|
| 3326 | 3326 | // TODO: à clarifier, mais pour moi, un facture de situation précédente qui a des progressions à 0% c'est pas logique |
| 3327 | 3327 | $TDataSituation['cumul_anterieur']['travaux_sup'] += $calc_ht; |
| 3328 | 3328 | } |
| 3329 | 3329 | } |
| 3330 | 3330 | } |
| 3331 | 3331 | |
| 3332 | - if (! empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
| 3332 | + if (!empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
| 3333 | 3333 | $retenue_garantie_anterieure += $previousInvoice->getRetainedWarrantyAmount(); |
| 3334 | 3334 | } |
| 3335 | 3335 | |
@@ -3343,7 +3343,7 @@ discard block |
||
| 3343 | 3343 | // print json_encode($facDerniereSituation->lines);exit; |
| 3344 | 3344 | $TDataSituation['current'] = $this->btpGetInvoiceAmounts($object->id); |
| 3345 | 3345 | |
| 3346 | - if (! empty($facDerniereSituation->lines)) { |
|
| 3346 | + if (!empty($facDerniereSituation->lines)) { |
|
| 3347 | 3347 | $TFacLinesKey = array_keys($facDerniereSituation->lines); |
| 3348 | 3348 | $TObjectLinesKey = array_keys($object->lines); |
| 3349 | 3349 | $TDiffKey = array_diff($TObjectLinesKey, $TFacLinesKey); |
@@ -3553,16 +3553,16 @@ discard block |
||
| 3553 | 3553 | $facDerniereSituation = $TPreviousInvoices[0]; |
| 3554 | 3554 | |
| 3555 | 3555 | $ret = array( |
| 3556 | - 'HT' => 0, //montant HT normal |
|
| 3556 | + 'HT' => 0, //montant HT normal |
|
| 3557 | 3557 | 'HTnet' => 0, //montant HT |
| 3558 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3559 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3558 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3559 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3560 | 3560 | 'retenue_garantie' => 0, |
| 3561 | 3561 | 'travaux_sup' => 0, |
| 3562 | 3562 | 'total_a_payer' => 0 //montant "a payer" sur la facture |
| 3563 | 3563 | ); |
| 3564 | 3564 | |
| 3565 | - if (! empty($facDerniereSituation)) { |
|
| 3565 | + if (!empty($facDerniereSituation)) { |
|
| 3566 | 3566 | $ret['derniere_situation'] = $facDerniereSituation; |
| 3567 | 3567 | $ret['date_derniere_situation'] = $facDerniereSituation->date; |
| 3568 | 3568 | } |
@@ -3702,7 +3702,7 @@ discard block |
||
| 3702 | 3702 | $label = $outputlangs->transnoentities("SituationInvoiceTotalProposal"); |
| 3703 | 3703 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', false, 1, $posx, $posy + 1); |
| 3704 | 3704 | |
| 3705 | - $amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0))); |
|
| 3705 | + $amount = price($sign * ($total_ht + (!empty($propal->remise) ? $propal->remise : 0))); |
|
| 3706 | 3706 | $pdf->MultiCell($width2, 3, $amount, 0, 'R', false, 1, $posx + $width, $posy + 1); |
| 3707 | 3707 | |
| 3708 | 3708 | $pdf->SetFont('', '', $default_font_size - 1); |
@@ -3746,7 +3746,7 @@ discard block |
||
| 3746 | 3746 | |
| 3747 | 3747 | $force_to_zero = false; |
| 3748 | 3748 | |
| 3749 | - $idinv = 0;//count($previousinvoices); |
|
| 3749 | + $idinv = 0; //count($previousinvoices); |
|
| 3750 | 3750 | while ($idinv < count($previousinvoices)) { |
| 3751 | 3751 | $invoice = $previousinvoices[$idinv]; |
| 3752 | 3752 | |
@@ -3768,7 +3768,7 @@ discard block |
||
| 3768 | 3768 | $force_to_zero = true; |
| 3769 | 3769 | } |
| 3770 | 3770 | |
| 3771 | - $ref .= ' - '. $invoice->ref; |
|
| 3771 | + $ref .= ' - '.$invoice->ref; |
|
| 3772 | 3772 | $ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')'; |
| 3773 | 3773 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', false); |
| 3774 | 3774 | |
@@ -3799,7 +3799,7 @@ discard block |
||
| 3799 | 3799 | if (($invoice->lines[$i]->info_bits & 0x01) == 0x01) { |
| 3800 | 3800 | $vatrate .= '*'; |
| 3801 | 3801 | } |
| 3802 | - if (! isset($tvas[$vatrate])) { |
|
| 3802 | + if (!isset($tvas[$vatrate])) { |
|
| 3803 | 3803 | $tvas[$vatrate] = 0; |
| 3804 | 3804 | } |
| 3805 | 3805 | $tvas[$vatrate] += $tvaligne; |
@@ -3977,7 +3977,7 @@ discard block |
||
| 3977 | 3977 | $pdf->SetXY($posx + $width4, $posy + $height * $index + $y); |
| 3978 | 3978 | $pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', false); |
| 3979 | 3979 | $pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y); |
| 3980 | - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']); |
|
| 3980 | + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$payment['type']); |
|
| 3981 | 3981 | |
| 3982 | 3982 | $pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', false); |
| 3983 | 3983 | $pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y); |
@@ -4008,7 +4008,7 @@ discard block |
||
| 4008 | 4008 | $this->_pagehead($pdf, $object, 0, $outputlangs); |
| 4009 | 4009 | } |
| 4010 | 4010 | $pdf->setPage($pageposafter + 1); |
| 4011 | - $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 4011 | + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 4012 | 4012 | |
| 4013 | 4013 | $posy = $this->tab_top_newpage + 1; |
| 4014 | 4014 | } else { |
@@ -4040,7 +4040,7 @@ discard block |
||
| 4040 | 4040 | |
| 4041 | 4041 | $posy += 10; |
| 4042 | 4042 | |
| 4043 | - $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 4043 | + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 4044 | 4044 | |
| 4045 | 4045 | // If invoice was linked to propals or orders |
| 4046 | 4046 | // TODO This part is bugged because the same proposals may be split in different invoices also several proposals may have been merged into the same invoice, |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $this->watermark = ''; |
| 112 | 112 | |
| 113 | 113 | if ($mysoc === null) { |
| 114 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 114 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
| 216 | 216 | // Set path to the background PDF File |
| 217 | 217 | if (!getDolGlobalString('MAIN_DISABLE_FPDI') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { |
| 218 | - $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 218 | + $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 219 | 219 | $tplidx = $pdf->importPage(1); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $pdf->SetDrawColor(128, 128, 128); |
| 225 | 225 | |
| 226 | 226 | if (method_exists($pdf, 'AliasNbPages')) { |
| 227 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 227 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $pdf->MultiCell(0, 3, ''); // Set interline to 3 |
| 251 | 251 | $pdf->SetTextColor(0, 0, 0); |
| 252 | 252 | |
| 253 | - $tab_top = 40; // position of top tab |
|
| 253 | + $tab_top = 40; // position of top tab |
|
| 254 | 254 | $tab_top_newpage = (getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 10 : $tab_top); |
| 255 | 255 | |
| 256 | 256 | $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $nbMonths = (((int) $toYear - (int) $fromYear) * 12) + ((int) $toMonth - (int) $fromMonth) + 1; |
| 286 | 286 | $datePlusOneMonth = dol_time_plus_duree($this->fromDate, -1, 'm'); |
| 287 | 287 | $dates = []; |
| 288 | - for ($i = 0; $i < $nbMonths; $i++) { |
|
| 288 | + for ($i = 0; $i < $nbMonths; $i++) { |
|
| 289 | 289 | $datePlusOneMonth = dol_time_plus_duree($datePlusOneMonth, 1, "m"); |
| 290 | 290 | $dates[$datePlusOneMonth] = dol_print_date($datePlusOneMonth, "%B %Y"); |
| 291 | 291 | } |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | // Pagefoot |
| 533 | 533 | $this->_pagefoot($pdf, $object, $outputlangs); |
| 534 | 534 | if (method_exists($pdf, 'AliasNbPages')) { |
| 535 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 535 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | $pdf->Close(); |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | $pdf->SetXY($this->marge_gauche + 2, $nexY); |
| 662 | 662 | $pdf->SetTextColor(0, 0, 60); |
| 663 | 663 | $textDateNow = $outputlangs->transnoentities("PrintDate"); |
| 664 | - $pdf->MultiCell($w / 3, 3, $textDateNow . " : " . date('d/m/Y', dol_now()), '', 'L'); |
|
| 664 | + $pdf->MultiCell($w / 3, 3, $textDateNow." : ".date('d/m/Y', dol_now()), '', 'L'); |
|
| 665 | 665 | $nexY = max($pdf->GetY(), $nexY); |
| 666 | 666 | |
| 667 | 667 | // Page title |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | |
| 680 | 680 | $fromDate = dol_print_date($this->fromDate, 'day'); |
| 681 | 681 | $toDate = dol_print_date($this->toDate, 'day'); |
| 682 | - $textDate = $outputlangs->transnoentities("From") . " " . $fromDate . " " . $outputlangs->transnoentities("To") . " " . $toDate; |
|
| 682 | + $textDate = $outputlangs->transnoentities("From")." ".$fromDate." ".$outputlangs->transnoentities("To")." ".$toDate; |
|
| 683 | 683 | $pdf->MultiCell($w / 3, 4, $textDate, 0, 'R'); |
| 684 | 684 | $nexY = max($pdf->GetY(), $nexY); |
| 685 | 685 | |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | |
| 957 | 957 | if ($this->getColumnStatus('balance')) { |
| 958 | 958 | $solde = $credit - $debit; |
| 959 | - $soldeText = price(price2num(abs($solde), 'MT')) . ($solde >= 0 ? ' ' . $langs->trans('CreditShort') : ' ' . $langs->trans('DebitShort')); |
|
| 959 | + $soldeText = price(price2num(abs($solde), 'MT')).($solde >= 0 ? ' '.$langs->trans('CreditShort') : ' '.$langs->trans('DebitShort')); |
|
| 960 | 960 | $this->printStdColumnContent($pdf, $curY, 'balance', $soldeText); |
| 961 | 961 | $nexY = max($pdf->GetY(), $nexY); |
| 962 | 962 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $h = 0; |
| 40 | 40 | $head = array(); |
| 41 | 41 | |
| 42 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/card.php', ['id' => $object->id]); |
|
| 42 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/card.php', ['id' => $object->id]); |
|
| 43 | 43 | $head[$h][1] = $langs->trans("Member"); |
| 44 | 44 | $head[$h][2] = 'general'; |
| 45 | 45 | $h++; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { |
| 49 | 49 | $langs->load("ldap"); |
| 50 | 50 | |
| 51 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/ldap.php', ['id' => $object->id]); |
|
| 51 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/ldap.php', ['id' => $object->id]); |
|
| 52 | 52 | $head[$h][1] = $langs->trans("LDAPCard"); |
| 53 | 53 | $head[$h][2] = 'ldap'; |
| 54 | 54 | $h++; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | if ($user->hasRight('adherent', 'cotisation', 'lire')) { |
| 58 | 58 | $nbSubscription = is_array($object->subscriptions) ? count($object->subscriptions) : 0; |
| 59 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/subscription.php', ['id' => $object->id]); |
|
| 59 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/subscription.php', ['id' => $object->id]); |
|
| 60 | 60 | $head[$h][1] = $langs->trans("Subscriptions"); |
| 61 | 61 | $head[$h][2] = 'subscription'; |
| 62 | 62 | if ($nbSubscription > 0) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { |
| 69 | 69 | if ($user->hasRight('partnership', 'read')) { |
| 70 | 70 | $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; |
| 71 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/partnership/partnership_list.php', ['id' => $object->id]); |
|
| 71 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/partnership/partnership_list.php', ['id' => $object->id]); |
|
| 72 | 72 | $head[$h][1] = $langs->trans("Partnerships"); |
| 73 | 73 | $nbNote = 0; |
| 74 | 74 | $sql = "SELECT COUNT(n.rowid) as nb"; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if (!empty($object->note_public)) { |
| 106 | 106 | $nbNote++; |
| 107 | 107 | } |
| 108 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/note.php', ['id' => $object->id]); |
|
| 108 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/note.php', ['id' => $object->id]); |
|
| 109 | 109 | $head[$h][1] = $langs->trans("Note"); |
| 110 | 110 | $head[$h][2] = 'note'; |
| 111 | 111 | if ($nbNote > 0) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $upload_dir = $conf->adherent->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'member'); |
| 120 | 120 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
| 121 | 121 | $nbLinks = Link::count($db, $object->element, $object->id); |
| 122 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/document.php', ['id' => $object->id]); |
|
| 122 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/document.php', ['id' => $object->id]); |
|
| 123 | 123 | $head[$h][1] = $langs->trans('Documents'); |
| 124 | 124 | if (($nbFiles + $nbLinks) > 0) { |
| 125 | 125 | $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $h++; |
| 129 | 129 | |
| 130 | 130 | // Show agenda tab |
| 131 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/agenda.php', ['id' => $object->id]); |
|
| 131 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/agenda.php', ['id' => $object->id]); |
|
| 132 | 132 | $head[$h][1] = $langs->trans("Events"); |
| 133 | 133 | if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { |
| 134 | 134 | $nbEvent = 0; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } else { |
| 150 | 150 | dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
| 151 | 151 | } |
| 152 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 152 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | $head[$h][1] .= '/'; |
@@ -181,14 +181,14 @@ discard block |
||
| 181 | 181 | $h = 0; |
| 182 | 182 | $head = array(); |
| 183 | 183 | |
| 184 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/type.php', ['rowid' => $object->id]); |
|
| 184 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/type.php', ['rowid' => $object->id]); |
|
| 185 | 185 | $head[$h][1] = $langs->trans("MemberType"); |
| 186 | 186 | $head[$h][2] = 'card'; |
| 187 | 187 | $h++; |
| 188 | 188 | |
| 189 | 189 | // Multilangs |
| 190 | 190 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 191 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/type_translation.php', ['rowid' => $object->id]); |
|
| 191 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/type_translation.php', ['rowid' => $object->id]); |
|
| 192 | 192 | $head[$h][1] = $langs->trans("Translation"); |
| 193 | 193 | $head[$h][2] = 'translation'; |
| 194 | 194 | $h++; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { |
| 199 | 199 | $langs->load("ldap"); |
| 200 | 200 | |
| 201 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/type_ldap.php', ['rowid' => $object->id]); |
|
| 201 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/type_ldap.php', ['rowid' => $object->id]); |
|
| 202 | 202 | $head[$h][1] = $langs->trans("LDAPCard"); |
| 203 | 203 | $head[$h][2] = 'ldap'; |
| 204 | 204 | $h++; |
@@ -231,12 +231,12 @@ discard block |
||
| 231 | 231 | $h = 0; |
| 232 | 232 | $head = array(); |
| 233 | 233 | |
| 234 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/admin/member.php'); |
|
| 234 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/admin/member.php'); |
|
| 235 | 235 | $head[$h][1] = $langs->trans("Miscellaneous"); |
| 236 | 236 | $head[$h][2] = 'general'; |
| 237 | 237 | $h++; |
| 238 | 238 | |
| 239 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/admin/member_emails.php'); |
|
| 239 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/admin/member_emails.php'); |
|
| 240 | 240 | $head[$h][1] = $langs->trans("EMails"); |
| 241 | 241 | $head[$h][2] = 'emails'; |
| 242 | 242 | $h++; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
| 248 | 248 | complete_head_from_modules($conf, $langs, null, $head, $h, 'member_admin'); |
| 249 | 249 | |
| 250 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/admin/member_extrafields.php'); |
|
| 250 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/admin/member_extrafields.php'); |
|
| 251 | 251 | $head[$h][1] = $langs->trans("ExtraFieldsMember"); |
| 252 | 252 | $nbExtrafields = $extrafields->attributes['adherent']['count']; |
| 253 | 253 | if ($nbExtrafields > 0) { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $head[$h][2] = 'attributes'; |
| 257 | 257 | $h++; |
| 258 | 258 | |
| 259 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/admin/member_type_extrafields.php'); |
|
| 259 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/admin/member_type_extrafields.php'); |
|
| 260 | 260 | $head[$h][1] = $langs->trans("ExtraFieldsMemberType"); |
| 261 | 261 | $nbExtrafields = $extrafields->attributes['adherent_type']['count']; |
| 262 | 262 | if ($nbExtrafields > 0) { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $head[$h][2] = 'attributes_type'; |
| 266 | 266 | $h++; |
| 267 | 267 | |
| 268 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/admin/website.php'); |
|
| 268 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/admin/website.php'); |
|
| 269 | 269 | $head[$h][1] = $langs->trans("BlankSubscriptionForm"); |
| 270 | 270 | $head[$h][2] = 'website'; |
| 271 | 271 | $h++; |
@@ -289,32 +289,32 @@ discard block |
||
| 289 | 289 | $h = 0; |
| 290 | 290 | $head = array(); |
| 291 | 291 | |
| 292 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/stats/index.php'); |
|
| 292 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/stats/index.php'); |
|
| 293 | 293 | $head[$h][1] = $langs->trans("Subscriptions"); |
| 294 | 294 | $head[$h][2] = 'statssubscription'; |
| 295 | 295 | $h++; |
| 296 | 296 | |
| 297 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/stats/geo.php', ['mode' => 'memberbycountry']); |
|
| 297 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/stats/geo.php', ['mode' => 'memberbycountry']); |
|
| 298 | 298 | $head[$h][1] = $langs->trans("Country"); |
| 299 | 299 | $head[$h][2] = 'statscountry'; |
| 300 | 300 | $h++; |
| 301 | 301 | |
| 302 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/stats/geo.php', ['mode' => 'memberbyregion']); |
|
| 302 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/stats/geo.php', ['mode' => 'memberbyregion']); |
|
| 303 | 303 | $head[$h][1] = $langs->trans("Region"); |
| 304 | 304 | $head[$h][2] = 'statsregion'; |
| 305 | 305 | $h++; |
| 306 | 306 | |
| 307 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/stats/geo.php', ['mode' => 'memberbystate']); |
|
| 307 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/stats/geo.php', ['mode' => 'memberbystate']); |
|
| 308 | 308 | $head[$h][1] = $langs->trans("State"); |
| 309 | 309 | $head[$h][2] = 'statsstate'; |
| 310 | 310 | $h++; |
| 311 | 311 | |
| 312 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/stats/geo.php', ['mode' => 'memberbytown']); |
|
| 312 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/stats/geo.php', ['mode' => 'memberbytown']); |
|
| 313 | 313 | $head[$h][1] = $langs->trans('Town'); |
| 314 | 314 | $head[$h][2] = 'statstown'; |
| 315 | 315 | $h++; |
| 316 | 316 | |
| 317 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/stats/byproperties.php'); |
|
| 317 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/stats/byproperties.php'); |
|
| 318 | 318 | $head[$h][1] = $langs->trans('ByProperties'); |
| 319 | 319 | $head[$h][2] = 'statsbyproperties'; |
| 320 | 320 | $h++; |
@@ -343,12 +343,12 @@ discard block |
||
| 343 | 343 | $h = 0; |
| 344 | 344 | $head = array(); |
| 345 | 345 | |
| 346 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/subscription/card.php', ['rowid' => $object->id]); |
|
| 346 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/subscription/card.php', ['rowid' => $object->id]); |
|
| 347 | 347 | $head[$h][1] = $langs->trans("Subscription"); |
| 348 | 348 | $head[$h][2] = 'general'; |
| 349 | 349 | $h++; |
| 350 | 350 | |
| 351 | - $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/adherents/subscription/info.php', ['rowid' => $object->id]); |
|
| 351 | + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/adherents/subscription/info.php', ['rowid' => $object->id]); |
|
| 352 | 352 | $head[$h][1] = $langs->trans("Info"); |
| 353 | 353 | $head[$h][2] = 'info'; |
| 354 | 354 | $h++; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | return false; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - return true; // all conditions are ok to become a LNE certified version |
|
| 98 | + return true; // all conditions are ok to become a LNE certified version |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -130,13 +130,13 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | global $conf, $db; |
| 132 | 132 | |
| 133 | - $result = true; // by default restrictions are on, so we can't disable them |
|
| 133 | + $result = true; // by default restrictions are on, so we can't disable them |
|
| 134 | 134 | |
| 135 | 135 | // For the moment, we don't need this. We already have a feature that does not allow to disable the LNE rstriction by |
| 136 | 136 | // adding an inalterable event in the log. |
| 137 | 137 | if (!isModEnabled('blockedlog')) { |
| 138 | 138 | $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog"; |
| 139 | - $sql .= " WHERE entity = ".((int) $conf->entity); // Sharing entity in blocked is disallowed |
|
| 139 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Sharing entity in blocked is disallowed |
|
| 140 | 140 | if ($ignoresystem) { |
| 141 | 141 | $sql .= " AND action NOT IN ('MODULE_SET', 'MODULE_RESET')"; |
| 142 | 142 | } |