@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * Dolibarr version of the loaded document |
78 | 78 | * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' |
79 | 79 | */ |
80 | - public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
80 | + public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * @var int height for info total |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies")); |
292 | 292 | } |
293 | 293 | |
294 | - if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
294 | + if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
295 | 295 | setEventMessage($langs->trans('WarningsObjectIsNotASituation'), 'warnings'); |
296 | 296 | return 1; |
297 | 297 | } |
@@ -410,15 +410,15 @@ discard block |
||
410 | 410 | $pdf->SetAutoPageBreak(1, 0); |
411 | 411 | |
412 | 412 | // compute height for situation invoices |
413 | - $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part |
|
413 | + $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part |
|
414 | 414 | if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) { |
415 | 415 | $this->heightforinfotot += 4 * ($nbpayments + 3); |
416 | 416 | } |
417 | 417 | if ($nbprevsituation > 0) { |
418 | 418 | $this->heightforinfotot += 4 * ($nbprevsituation + 3); |
419 | 419 | } |
420 | - $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page |
|
421 | - $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
420 | + $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page |
|
421 | + $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
422 | 422 | |
423 | 423 | if (class_exists('TCPDF')) { |
424 | 424 | $pdf->setPrintHeader(false); |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
433 | 433 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
434 | 434 | } |
435 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
435 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
436 | 436 | $this->tplidx = $pdf->importPage(1); |
437 | 437 | } |
438 | 438 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
525 | 525 | |
526 | 526 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
527 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
527 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
528 | 528 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
529 | 529 | |
530 | 530 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | if (!isset($this->tva[$vatrate])) { |
1035 | 1035 | $this->tva[$vatrate] = 0; |
1036 | 1036 | } |
1037 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
1037 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
1038 | 1038 | $vatcode = $object->lines[$i]->vat_src_code; |
1039 | 1039 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { |
1040 | 1040 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; |
@@ -1334,8 +1334,8 @@ discard block |
||
1334 | 1334 | $posy = $pdf->GetY() + 4; |
1335 | 1335 | } |
1336 | 1336 | |
1337 | - $posxval = 52; // Position of values of properties shown on left side |
|
1338 | - $posxend = 110; // End of x for text on left side |
|
1337 | + $posxval = 52; // Position of values of properties shown on left side |
|
1338 | + $posxend = 110; // End of x for text on left side |
|
1339 | 1339 | if ($this->page_largeur < 210) { // To work with US executive format |
1340 | 1340 | $posxend -= 10; |
1341 | 1341 | } |
@@ -1365,7 +1365,7 @@ discard block |
||
1365 | 1365 | |
1366 | 1366 | $pdf->SetFont('', '', $default_font_size - 2); |
1367 | 1367 | $pdf->SetXY($posxval, $posy); |
1368 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1368 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1369 | 1369 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
1370 | 1370 | |
1371 | 1371 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1699,7 +1699,7 @@ discard block |
||
1699 | 1699 | if (($object->lines[$i]->info_bits & 0x01) == 0x01) { |
1700 | 1700 | $vatrate .= '*'; |
1701 | 1701 | } |
1702 | - if (! isset($tvas[$vatrate])) { |
|
1702 | + if (!isset($tvas[$vatrate])) { |
|
1703 | 1703 | $tvas[$vatrate] = 0; |
1704 | 1704 | } |
1705 | 1705 | $tvas[$vatrate] += $tvaligne; |
@@ -1967,7 +1967,7 @@ discard block |
||
1967 | 1967 | if (empty($hidetop)) { |
1968 | 1968 | // Show category of operations |
1969 | 1969 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
1970 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1970 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1971 | 1971 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
1972 | 1972 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
1973 | 1973 | } |
@@ -1987,7 +1987,7 @@ discard block |
||
1987 | 1987 | $pdf->SetFont('', '', $default_font_size - 1); |
1988 | 1988 | |
1989 | 1989 | // Output Rect |
1990 | - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
|
1990 | + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
|
1991 | 1991 | |
1992 | 1992 | // situation invoice |
1993 | 1993 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -2027,7 +2027,7 @@ discard block |
||
2027 | 2027 | $pdf->SetFont('', '', $default_font_size - 1); |
2028 | 2028 | |
2029 | 2029 | if (empty($hidetop)) { |
2030 | - $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 |
|
2030 | + $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 |
|
2031 | 2031 | } |
2032 | 2032 | } |
2033 | 2033 | |
@@ -2597,7 +2597,7 @@ discard block |
||
2597 | 2597 | 'overtitle' => array( |
2598 | 2598 | 'textkey' => 'Chantier', // use lang key is useful in somme case with module |
2599 | 2599 | 'align' => 'C', |
2600 | - 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
2600 | + 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
2601 | 2601 | 'width' => 18 |
2602 | 2602 | ), |
2603 | 2603 | ); |
@@ -2622,13 +2622,13 @@ discard block |
||
2622 | 2622 | ), |
2623 | 2623 | 'border-left' => true, // add left line separator |
2624 | 2624 | 'overtitle' => array( |
2625 | - 'textkey' => 'S'.$derniere_situation->situation_counter . ' - ' . dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
2625 | + 'textkey' => 'S'.$derniere_situation->situation_counter.' - '.dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
2626 | 2626 | 'align' => 'C', |
2627 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2627 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2628 | 2628 | 'width' => 10 + 15 //current width + amount cell width |
2629 | 2629 | ), |
2630 | 2630 | ); |
2631 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
2631 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
2632 | 2632 | $this->cols['prev_progress']['status'] = true; |
2633 | 2633 | } |
2634 | 2634 | |
@@ -2643,7 +2643,7 @@ discard block |
||
2643 | 2643 | ), |
2644 | 2644 | 'border-left' => true, // add left line separator |
2645 | 2645 | ); |
2646 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
2646 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
2647 | 2647 | $this->cols['prev_progress_amount']['status'] = true; |
2648 | 2648 | } |
2649 | 2649 | |
@@ -2658,9 +2658,9 @@ discard block |
||
2658 | 2658 | ), |
2659 | 2659 | 'border-left' => true, // add left line separator |
2660 | 2660 | 'overtitle' => array( |
2661 | - 'textkey' => 'S'.$object->situation_counter . ' - ' . dol_print_date($object->date, "%d/%m/%Y"), |
|
2661 | + 'textkey' => 'S'.$object->situation_counter.' - '.dol_print_date($object->date, "%d/%m/%Y"), |
|
2662 | 2662 | 'align' => 'C', |
2663 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2663 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2664 | 2664 | 'width' => 10 + 15 |
2665 | 2665 | ), |
2666 | 2666 | ); |
@@ -2783,7 +2783,7 @@ discard block |
||
2783 | 2783 | |
2784 | 2784 | // Output Rect |
2785 | 2785 | // KEEPTHIS => Affiche les bords extérieurs |
2786 | - $this->printRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
|
2786 | + $this->printRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
|
2787 | 2787 | |
2788 | 2788 | $pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height); |
2789 | 2789 | if (empty($hidetop)) { |
@@ -2840,7 +2840,7 @@ discard block |
||
2840 | 2840 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 24 + $i); |
2841 | 2841 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("TotalHT").' '.$TVatInfo['label'], '', 'L'); |
2842 | 2842 | |
2843 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
2843 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
2844 | 2844 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 28 + $i); |
2845 | 2845 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("VAT").' '.$TVatInfo['label'], '', 'L'); |
2846 | 2846 | } else { |
@@ -2904,7 +2904,7 @@ discard block |
||
2904 | 2904 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['HT'], 0, '', 1, -1, 2), '', 'R'); |
2905 | 2905 | |
2906 | 2906 | // Total TVA |
2907 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
2907 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
2908 | 2908 | $pdf->SetXY($x, $tab_top + 28 + $i); |
2909 | 2909 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['TVA'], 0, '', 1, -1, 2), '', 'R'); |
2910 | 2910 | } else { |
@@ -2984,7 +2984,7 @@ discard block |
||
2984 | 2984 | |
2985 | 2985 | $TDataSituation = array(); |
2986 | 2986 | |
2987 | - if (! empty($facDerniereSituation)) { |
|
2987 | + if (!empty($facDerniereSituation)) { |
|
2988 | 2988 | $TDataSituation['derniere_situation'] = $facDerniereSituation; |
2989 | 2989 | $TDataSituation['date_derniere_situation'] = $facDerniereSituation->date; |
2990 | 2990 | } |
@@ -2993,9 +2993,9 @@ discard block |
||
2993 | 2993 | $retenue_garantie_anterieure = 0; |
2994 | 2994 | // Init tous les champs à 0 |
2995 | 2995 | $TDataSituation['cumul_anterieur'] = array( |
2996 | - 'HT' => 0, //montant HT normal |
|
2997 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
2998 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
2996 | + 'HT' => 0, //montant HT normal |
|
2997 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
2998 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
2999 | 2999 | 'retenue_garantie' => 0, |
3000 | 3000 | 'travaux_sup' => 0, |
3001 | 3001 | 'HTnet' => 0, //montant HT |
@@ -3025,7 +3025,7 @@ discard block |
||
3025 | 3025 | $isFirstSituation = false; |
3026 | 3026 | if (!empty($l->fk_prev_id)) { |
3027 | 3027 | $prevSituationPercent = $l->get_prev_progress($previousInvoice->id, true); |
3028 | - } elseif (! array_key_exists($i + 1, $TPreviousInvoices)) { |
|
3028 | + } elseif (!array_key_exists($i + 1, $TPreviousInvoices)) { |
|
3029 | 3029 | $isFirstSituation = true; |
3030 | 3030 | } |
3031 | 3031 | |
@@ -3035,7 +3035,7 @@ discard block |
||
3035 | 3035 | |
3036 | 3036 | //1ere ligne |
3037 | 3037 | $amounttva = $calc_ht * ($ltvatx / 100); |
3038 | - if (! isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
3038 | + if (!isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
3039 | 3039 | $TDataSituation['cumul_anterieur'][$ltvatx]['HT'] = $calc_ht; |
3040 | 3040 | $TDataSituation['cumul_anterieur'][$ltvatx]['TVA'] = $amounttva; |
3041 | 3041 | } else { |
@@ -3047,14 +3047,14 @@ discard block |
||
3047 | 3047 | //le grand total de TVA |
3048 | 3048 | // $TDataSituation['cumul_anterieur']['TVA'] += $amounttva; |
3049 | 3049 | |
3050 | - if (empty($l->fk_prev_id) && ! $isFirstSituation) { |
|
3050 | + if (empty($l->fk_prev_id) && !$isFirstSituation) { |
|
3051 | 3051 | // TODO: à clarifier, mais pour moi, un facture de situation précédente qui a des progressions à 0% c'est pas logique |
3052 | 3052 | $TDataSituation['cumul_anterieur']['travaux_sup'] += $calc_ht; |
3053 | 3053 | } |
3054 | 3054 | } |
3055 | 3055 | } |
3056 | 3056 | |
3057 | - if (! empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
3057 | + if (!empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
3058 | 3058 | $retenue_garantie_anterieure += $previousInvoice->getRetainedWarrantyAmount(); |
3059 | 3059 | } |
3060 | 3060 | |
@@ -3068,7 +3068,7 @@ discard block |
||
3068 | 3068 | // print json_encode($facDerniereSituation->lines);exit; |
3069 | 3069 | $TDataSituation['current'] = $this->btpGetInvoiceAmounts($object->id); |
3070 | 3070 | |
3071 | - if (! empty($facDerniereSituation->lines)) { |
|
3071 | + if (!empty($facDerniereSituation->lines)) { |
|
3072 | 3072 | $TFacLinesKey = array_keys($facDerniereSituation->lines); |
3073 | 3073 | $TObjectLinesKey = array_keys($object->lines); |
3074 | 3074 | $TDiffKey = array_diff($TObjectLinesKey, $TFacLinesKey); |
@@ -3234,7 +3234,7 @@ discard block |
||
3234 | 3234 | */ |
3235 | 3235 | public function btpGetInvoiceAmounts($id, $forceReadFromDB = false) |
3236 | 3236 | { |
3237 | - global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes; |
|
3237 | + global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes; |
|
3238 | 3238 | |
3239 | 3239 | $object = new Facture($db); |
3240 | 3240 | $object->fetch($id); |
@@ -3252,16 +3252,16 @@ discard block |
||
3252 | 3252 | $facDerniereSituation = $TPreviousInvoices[0]; |
3253 | 3253 | |
3254 | 3254 | $ret = array( |
3255 | - 'HT' => 0, //montant HT normal |
|
3255 | + 'HT' => 0, //montant HT normal |
|
3256 | 3256 | 'HTnet' => 0, //montant HT |
3257 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
3258 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
3257 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
3258 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
3259 | 3259 | 'retenue_garantie' => 0, |
3260 | 3260 | 'travaux_sup' => 0, |
3261 | 3261 | 'total_a_payer' => 0 //montant "a payer" sur la facture |
3262 | 3262 | ); |
3263 | 3263 | |
3264 | - if (! empty($facDerniereSituation)) { |
|
3264 | + if (!empty($facDerniereSituation)) { |
|
3265 | 3265 | $ret['derniere_situation'] = $facDerniereSituation; |
3266 | 3266 | $ret['date_derniere_situation'] = $facDerniereSituation->date; |
3267 | 3267 | } |
@@ -3393,14 +3393,14 @@ discard block |
||
3393 | 3393 | $label = $outputlangs->transnoentities("SituationInvoiceTotalProposal"); |
3394 | 3394 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', 0, 1, $posx, $posy + 1); |
3395 | 3395 | |
3396 | - $amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0))); |
|
3396 | + $amount = price($sign * ($total_ht + (!empty($propal->remise) ? $propal->remise : 0))); |
|
3397 | 3397 | $pdf->MultiCell($width2, 3, $amount, 0, 'R', 0, 1, $posx + $width, $posy + 1); |
3398 | 3398 | |
3399 | 3399 | $pdf->SetFont('', '', $default_font_size - 1); |
3400 | 3400 | |
3401 | 3401 | // Output Rect |
3402 | 3402 | $pdf->SetDrawColor(128, 128, 128); |
3403 | - $this->printRect($pdf, $posx, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 6); // Rect prend une longueur en 3eme param et 4eme param |
|
3403 | + $this->printRect($pdf, $posx, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 6); // Rect prend une longueur en 3eme param et 4eme param |
|
3404 | 3404 | |
3405 | 3405 | $posy += 4; |
3406 | 3406 | } elseif (count($orders)) { |
@@ -3435,7 +3435,7 @@ discard block |
||
3435 | 3435 | |
3436 | 3436 | $force_to_zero = false; |
3437 | 3437 | |
3438 | - $idinv = 0;//count($previousinvoices); |
|
3438 | + $idinv = 0; //count($previousinvoices); |
|
3439 | 3439 | while ($idinv < count($previousinvoices)) { |
3440 | 3440 | $invoice = $previousinvoices[$idinv]; |
3441 | 3441 | |
@@ -3457,7 +3457,7 @@ discard block |
||
3457 | 3457 | $force_to_zero = true; |
3458 | 3458 | } |
3459 | 3459 | |
3460 | - $ref .= ' - '. $invoice->ref; |
|
3460 | + $ref .= ' - '.$invoice->ref; |
|
3461 | 3461 | $ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')'; |
3462 | 3462 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', 0); |
3463 | 3463 | |
@@ -3488,7 +3488,7 @@ discard block |
||
3488 | 3488 | if (($invoice->lines[$i]->info_bits & 0x01) == 0x01) { |
3489 | 3489 | $vatrate .= '*'; |
3490 | 3490 | } |
3491 | - if (! isset($tvas[$vatrate])) { |
|
3491 | + if (!isset($tvas[$vatrate])) { |
|
3492 | 3492 | $tvas[$vatrate] = 0; |
3493 | 3493 | } |
3494 | 3494 | $tvas[$vatrate] += $tvaligne; |
@@ -3666,7 +3666,7 @@ discard block |
||
3666 | 3666 | $pdf->SetXY($posx + $width4, $posy + $height * $index + $y); |
3667 | 3667 | $pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', 0); |
3668 | 3668 | $pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y); |
3669 | - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']); |
|
3669 | + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$payment['type']); |
|
3670 | 3670 | |
3671 | 3671 | $pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', 0); |
3672 | 3672 | $pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y); |
@@ -3696,7 +3696,7 @@ discard block |
||
3696 | 3696 | $this->_pagehead($pdf, $object, 0, $outputlangs); |
3697 | 3697 | } |
3698 | 3698 | $pdf->setPage($pageposafter + 1); |
3699 | - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
3699 | + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
3700 | 3700 | |
3701 | 3701 | $posy = $this->tab_top_newpage + 1; |
3702 | 3702 | } else { |
@@ -3728,7 +3728,7 @@ discard block |
||
3728 | 3728 | |
3729 | 3729 | $posy += 10; |
3730 | 3730 | |
3731 | - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
3731 | + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
3732 | 3732 | |
3733 | 3733 | $pdf->SetTextColor(0, 0, 60); |
3734 | 3734 | $pdf->SetFont('', '', $default_font_size - 1); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'type' => 'info', |
107 | 107 | ); |
108 | 108 | } else { |
109 | - $keyforprovider = ''; // @FIXME |
|
109 | + $keyforprovider = ''; // @FIXME |
|
110 | 110 | |
111 | 111 | $this->google_id = getDolGlobalString('OAUTH_GOOGLE_ID'); |
112 | 112 | $this->google_secret = getDolGlobalString('OAUTH_GOOGLE_SECRET'); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | global $conf; |
249 | 249 | $ret = array(); |
250 | 250 | |
251 | - $keyforprovider = ''; // @FIXME |
|
251 | + $keyforprovider = ''; // @FIXME |
|
252 | 252 | |
253 | 253 | // Token storage |
254 | 254 | $storage = new DoliStorage($this->db, $conf, $keyforprovider); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | 'contentType' => $contenttype, |
391 | 391 | ); |
392 | 392 | |
393 | - $keyforprovider = ''; // @FIXME |
|
393 | + $keyforprovider = ''; // @FIXME |
|
394 | 394 | |
395 | 395 | // Dolibarr Token storage |
396 | 396 | $storage = new DoliStorage($this->db, $conf, $keyforprovider); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $error = 0; |
443 | 443 | $html = ''; |
444 | 444 | |
445 | - $keyforprovider = ''; // @FIXME |
|
445 | + $keyforprovider = ''; // @FIXME |
|
446 | 446 | |
447 | 447 | // Token storage |
448 | 448 | $storage = new DoliStorage($this->db, $conf, $keyforprovider); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | // access type needed to have oauth provider refreshing token |
142 | 142 | // also note that a refresh token is sent only after a prompt |
143 | 143 | if (method_exists($apiService, 'setAccessType')) { |
144 | - $apiService->setAccessType('offline'); // Most generic OAUTH provider does not provide AccessType online/offline. They are mostly offline. |
|
144 | + $apiService->setAccessType('offline'); // Most generic OAUTH provider does not provide AccessType online/offline. They are mostly offline. |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | if (!getDolGlobalString($keyforparamid)) { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | // Set approval_prompt. Note: A refresh token will be provided only if prompt is done. |
186 | 186 | if ($forlogin) { |
187 | - $approval_prompt = getDolGlobalString('OAUTH_'.$genericstring.'_FORCE_PROMPT_ON_LOGIN', 'auto'); // Can be 'force' |
|
187 | + $approval_prompt = getDolGlobalString('OAUTH_'.$genericstring.'_FORCE_PROMPT_ON_LOGIN', 'auto'); // Can be 'force' |
|
188 | 188 | if (method_exists($apiService, 'setApprouvalPrompt')) { |
189 | 189 | $apiService->setApprouvalPrompt($approval_prompt); |
190 | 190 | } |
@@ -328,10 +328,10 @@ discard block |
||
328 | 328 | $entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1); |
329 | 329 | |
330 | 330 | // Delete the old token |
331 | - $storage->clearToken($genericstring); // Delete the token called ("Generic-".$storage->keyforprovider) |
|
331 | + $storage->clearToken($genericstring); // Delete the token called ("Generic-".$storage->keyforprovider) |
|
332 | 332 | |
333 | 333 | $tmpuser = new User($db); |
334 | - $res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1); // Load user. Can load with email_oauth2. |
|
334 | + $res = $tmpuser->fetch(0, '', '', 0, $entitytosearchuser, $useremail, 0, 1); // Load user. Can load with email_oauth2. |
|
335 | 335 | |
336 | 336 | if ($res > 0) { |
337 | 337 | $username = $tmpuser->login; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * \brief File containing class for advanced numbering model of Evaluation |
28 | 28 | */ |
29 | 29 | |
30 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/hrm/modules_evaluation.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/hrm/modules_evaluation.php'; |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
286 | 286 | // Set path to the background PDF File |
287 | 287 | if (!getDolGlobalString('MAIN_DISABLE_FPDI') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { |
288 | - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
288 | + $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
289 | 289 | $tplidx = $pdf->importPage(1); |
290 | 290 | } |
291 | 291 | |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs) |
839 | 839 | { |
840 | 840 | global $conf, $mysoc; |
841 | - '@phan-var-force Commande|Propal|Facture $object'; // availability_code,... does not exist on Facture. |
|
841 | + '@phan-var-force Commande|Propal|Facture $object'; // availability_code,... does not exist on Facture. |
|
842 | 842 | |
843 | 843 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
844 | 844 | |
@@ -1433,7 +1433,7 @@ discard block |
||
1433 | 1433 | // Show recipient |
1434 | 1434 | $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; |
1435 | 1435 | if ($this->page_largeur < 210) { |
1436 | - $widthrecbox = 84; // To work with US executive format |
|
1436 | + $widthrecbox = 84; // To work with US executive format |
|
1437 | 1437 | } |
1438 | 1438 | $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; |
1439 | 1439 | $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $pdfa = false; // PDF-1.3 |
184 | 184 | if (getDolGlobalString('PDF_USE_A')) { |
185 | - $pdfa = getDolGlobalString('PDF_USE_A'); // PDF/A-1 ou PDF/A-3 |
|
185 | + $pdfa = getDolGlobalString('PDF_USE_A'); // PDF/A-1 ou PDF/A-3 |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | if (!getDolGlobalString('MAIN_DISABLE_TCPDI') && class_exists('TCPDI')) { |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | $stringaddress .= ($stringaddress ? "\n" : '').$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof6); |
538 | 538 | } |
539 | 539 | if (getDolGlobalString('PDF_ADD_MORE_AFTER_SOURCE_ADDRESS')) { |
540 | - $stringaddress .= ($stringaddress ? "\n" : '') . getDolGlobalString('PDF_ADD_MORE_AFTER_SOURCE_ADDRESS'); |
|
540 | + $stringaddress .= ($stringaddress ? "\n" : '').getDolGlobalString('PDF_ADD_MORE_AFTER_SOURCE_ADDRESS'); |
|
541 | 541 | } |
542 | 542 | } |
543 | 543 | |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | if ($usecontact && is_object($targetcontact) && getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT')) { |
650 | 650 | $targetcontact->fetch_thirdparty(); |
651 | 651 | if (!empty($targetcontact->thirdparty->id) && $targetcontact->thirdparty->tva_intra) { |
652 | - $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("VATIntraShort") . ': ' . $outputlangs->convToOutputCharset($targetcontact->thirdparty->tva_intra); |
|
652 | + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcontact->thirdparty->tva_intra); |
|
653 | 653 | } |
654 | 654 | } elseif (!empty($targetcompany->tva_intra)) { |
655 | 655 | $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra); |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | |
737 | 737 | // Add a background image on document only if good setup of const |
738 | 738 | if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF') && (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF') != '-1')) { // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image |
739 | - $filepath = $conf->mycompany->dir_output.'/logos/' . getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF'); |
|
739 | + $filepath = $conf->mycompany->dir_output.'/logos/'.getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF'); |
|
740 | 740 | if (file_exists($filepath)) { |
741 | 741 | $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image |
742 | 742 | if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) { |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | $outputlangs->load("dict"); |
1026 | 1026 | $line = ''; |
1027 | 1027 | $reg = array(); |
1028 | - $marginwithfooter = 0; // Return value |
|
1028 | + $marginwithfooter = 0; // Return value |
|
1029 | 1029 | |
1030 | 1030 | $dims = $pdf->getPageDimensions(); |
1031 | 1031 | |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof5); |
1157 | 1157 | } |
1158 | 1158 | // Prof Id 6 |
1159 | - if (!empty($fromcompany->idprof6) && $fromcompany->idprof6) { |
|
1159 | + if (!empty($fromcompany->idprof6) && $fromcompany->idprof6) { |
|
1160 | 1160 | $field = $outputlangs->transcountrynoentities("ProfId6", $fromcompany->country_code); |
1161 | 1161 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
1162 | 1162 | $field = $reg[1]; |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof6); |
1165 | 1165 | } |
1166 | 1166 | // Prof Id 7 |
1167 | - if (!empty($fromcompany->idprof7) && $fromcompany->idprof7) { |
|
1167 | + if (!empty($fromcompany->idprof7) && $fromcompany->idprof7) { |
|
1168 | 1168 | $field = $outputlangs->transcountrynoentities("ProfId7", $fromcompany->country_code); |
1169 | 1169 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
1170 | 1170 | $field = $reg[1]; |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof7); |
1173 | 1173 | } |
1174 | 1174 | // Prof Id 8 |
1175 | - if (!empty($fromcompany->idprof8) && $fromcompany->idprof8) { |
|
1175 | + if (!empty($fromcompany->idprof8) && $fromcompany->idprof8) { |
|
1176 | 1176 | $field = $outputlangs->transcountrynoentities("ProfId8", $fromcompany->country_code); |
1177 | 1177 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
1178 | 1178 | $field = $reg[1]; |
@@ -1180,7 +1180,7 @@ discard block |
||
1180 | 1180 | $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof8); |
1181 | 1181 | } |
1182 | 1182 | // Prof Id 9 |
1183 | - if (!empty($fromcompany->idprof9) && $fromcompany->idprof9) { |
|
1183 | + if (!empty($fromcompany->idprof9) && $fromcompany->idprof9) { |
|
1184 | 1184 | $field = $outputlangs->transcountrynoentities("ProfId9", $fromcompany->country_code); |
1185 | 1185 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
1186 | 1186 | $field = $reg[1]; |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof9); |
1189 | 1189 | } |
1190 | 1190 | // Prof Id 10 |
1191 | - if (!empty($fromcompany->idprof10) && $fromcompany->idprof10) { |
|
1191 | + if (!empty($fromcompany->idprof10) && $fromcompany->idprof10) { |
|
1192 | 1192 | $field = $outputlangs->transcountrynoentities("ProfId10", $fromcompany->country_code); |
1193 | 1193 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
1194 | 1194 | $field = $reg[1]; |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof10); |
1197 | 1197 | } |
1198 | 1198 | // IntraCommunautary VAT |
1199 | - if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra != '') { |
|
1199 | + if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra != '') { |
|
1200 | 1200 | $line4 .= ($line4 ? " - " : "").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra); |
1201 | 1201 | } |
1202 | 1202 | |
@@ -1365,7 +1365,7 @@ discard block |
||
1365 | 1365 | |
1366 | 1366 | $pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages(); |
1367 | 1367 | $fontRenderCorrection = 0; |
1368 | - if (in_array(pdf_getPDFFont($outputlangs), array('freemono', 'DejaVuSans'))) { |
|
1368 | + if (in_array(pdf_getPDFFont($outputlangs), array('freemono', 'DejaVuSans'))) { |
|
1369 | 1369 | $fontRenderCorrection = 10; |
1370 | 1370 | } |
1371 | 1371 | $pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0, 'R', 0); |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | |
1463 | 1463 | if (getDolGlobalString('MARGIN_TOP_ZERO_UL')) { |
1464 | 1464 | $pdf->setListIndentWidth(5); |
1465 | - $TMarginList = ['ul' => [['h' => 0.1, ],['h' => 0.1, ]], 'li' => [['h' => 0.1, ],],]; |
|
1465 | + $TMarginList = ['ul' => [['h' => 0.1, ], ['h' => 0.1, ]], 'li' => [['h' => 0.1, ], ], ]; |
|
1466 | 1466 | $pdf->setHtmlVSpace($TMarginList); |
1467 | 1467 | } |
1468 | 1468 | |
@@ -1504,7 +1504,7 @@ discard block |
||
1504 | 1504 | $prodser = new Product($db); |
1505 | 1505 | |
1506 | 1506 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { |
1507 | - include_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; |
|
1507 | + include_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; |
|
1508 | 1508 | } |
1509 | 1509 | } |
1510 | 1510 | |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); |
1552 | 1552 | } |
1553 | 1553 | |
1554 | - $libelleproduitservice = ''; // Default value |
|
1554 | + $libelleproduitservice = ''; // Default value |
|
1555 | 1555 | if (!getDolGlobalString('PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES')) { |
1556 | 1556 | // Description short of product line |
1557 | 1557 | $libelleproduitservice = $label; |
@@ -1585,8 +1585,7 @@ discard block |
||
1585 | 1585 | $libelleproduitservice = dol_concatdesc( |
1586 | 1586 | dol_concatdesc($libelleproduitservice, " * ".$subprodval[3]), |
1587 | 1587 | (!empty($qtyText) ? |
1588 | - $outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText : |
|
1589 | - $outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1]) |
|
1588 | + $outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText : $outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1]) |
|
1590 | 1589 | ); |
1591 | 1590 | } |
1592 | 1591 | } else { |
@@ -1594,8 +1593,7 @@ discard block |
||
1594 | 1593 | $libelleproduitservice = dol_concatdesc( |
1595 | 1594 | dol_concatdesc($libelleproduitservice, " * ".$subprodval[5].(($subprodval[5] && $subprodval[3]) ? ' - ' : '').$subprodval[3]), |
1596 | 1595 | (!empty($qtyText) ? |
1597 | - $outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText : |
|
1598 | - $outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1]) |
|
1596 | + $outputlangs->trans('Qty').':'.$qtyText.' x '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1].'= '.$outputlangs->trans('QtyTot').':'.$subprodval[1] * $qtyText : $outputlangs->trans('Qty').' '.$outputlangs->trans('AssociatedProducts').':'.$subprodval[1]) |
|
1599 | 1597 | ); |
1600 | 1598 | } |
1601 | 1599 | } |
@@ -1698,11 +1696,11 @@ discard block |
||
1698 | 1696 | break; |
1699 | 1697 | |
1700 | 1698 | case 2: |
1701 | - $ref_prodserv = $productCustomerPrice->ref_customer . ' (' . $outputlangs->transnoentitiesnoconv('InternalRef') . ' ' . $ref_prodserv . ')'; |
|
1699 | + $ref_prodserv = $productCustomerPrice->ref_customer.' ('.$outputlangs->transnoentitiesnoconv('InternalRef').' '.$ref_prodserv.')'; |
|
1702 | 1700 | break; |
1703 | 1701 | |
1704 | 1702 | default: |
1705 | - $ref_prodserv = $ref_prodserv . ' (' . $outputlangs->transnoentitiesnoconv('RefCustomer') . ' ' . $productCustomerPrice->ref_customer . ')'; |
|
1703 | + $ref_prodserv = $ref_prodserv.' ('.$outputlangs->transnoentitiesnoconv('RefCustomer').' '.$productCustomerPrice->ref_customer.')'; |
|
1706 | 1704 | } |
1707 | 1705 | } |
1708 | 1706 | } |
@@ -2549,7 +2547,7 @@ discard block |
||
2549 | 2547 | } |
2550 | 2548 | } |
2551 | 2549 | |
2552 | - if (! is_object($order)) { |
|
2550 | + if (!is_object($order)) { |
|
2553 | 2551 | $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref)); |
2554 | 2552 | } else { |
2555 | 2553 | $object->note_public = dol_concatdesc($object->note_public, $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '')); |
@@ -2572,7 +2570,7 @@ discard block |
||
2572 | 2570 | } |
2573 | 2571 | } |
2574 | 2572 | |
2575 | - if (! is_object($order)) { |
|
2573 | + if (!is_object($order)) { |
|
2576 | 2574 | $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); |
2577 | 2575 | if (empty($linkedobjects[$objecttype]['ref_value'])) { |
2578 | 2576 | $linkedobjects[$objecttype]['ref_value'] = ''; |
@@ -2674,7 +2672,7 @@ discard block |
||
2674 | 2672 | if (isset($hookmanager->resArray['linetotalremise'])) { |
2675 | 2673 | return $hookmanager->resArray['linetotalremise']; |
2676 | 2674 | } else { |
2677 | - return (float) $hookmanager->resPrint; // For backward compatibility |
|
2675 | + return (float) $hookmanager->resPrint; // For backward compatibility |
|
2678 | 2676 | } |
2679 | 2677 | } |
2680 | 2678 | } |
@@ -274,22 +274,22 @@ discard block |
||
274 | 274 | // Edit .sql file |
275 | 275 | if ($moduletype == 'internal') { |
276 | 276 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'; |
277 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
277 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
278 | 278 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql'; |
279 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
279 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
280 | 280 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
281 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
281 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
282 | 282 | $pathoffiletoeditsrc = '/../install/mysql/tables/llx_'.strtolower($module).'.sql'; |
283 | 283 | } |
284 | 284 | } |
285 | 285 | } |
286 | 286 | } else { |
287 | 287 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'; |
288 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
288 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
289 | 289 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'-'.strtolower($module).'.sql'; |
290 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
290 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
291 | 291 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
292 | - if (! dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
292 | + if (!dol_is_file($readdir.$pathoffiletoeditsrc)) { |
|
293 | 293 | $pathoffiletoeditsrc = '/sql/llx_'.strtolower($module).'.sql'; |
294 | 294 | } |
295 | 295 | } |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | { |
728 | 728 | |
729 | 729 | // stock all properties in array |
730 | - $attributesUnique = array('type','label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default' , 'foreignkey', 'arrayofkeyval', 'alwayseditable','validate', 'searchall','comment', 'isameasure', 'css', 'cssview','csslist', 'help', 'showoncombobox','picto' ); |
|
730 | + $attributesUnique = array('type', 'label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default', 'foreignkey', 'arrayofkeyval', 'alwayseditable', 'validate', 'searchall', 'comment', 'isameasure', 'css', 'cssview', 'csslist', 'help', 'showoncombobox', 'picto'); |
|
731 | 731 | |
732 | 732 | $start = "public \$fields = array("; |
733 | 733 | $end = ");"; |
@@ -797,8 +797,8 @@ discard block |
||
797 | 797 | $valuesModif[$attUnique] = $values[$attUnique]; |
798 | 798 | } |
799 | 799 | } |
800 | - $table .= "|*" . $field[0] . "*|"; |
|
801 | - $table .= implode("|", $valuesModif) . "\n"; |
|
800 | + $table .= "|*".$field[0]."*|"; |
|
801 | + $table .= implode("|", $valuesModif)."\n"; |
|
802 | 802 | } |
803 | 803 | |
804 | 804 | // end table |
@@ -829,13 +829,13 @@ discard block |
||
829 | 829 | |
830 | 830 | $str = file_get_contents($file); |
831 | 831 | |
832 | - $search = '/' . preg_quote($start, '/') . '(.*?)' . preg_quote($end, '/') . '/s'; |
|
832 | + $search = '/'.preg_quote($start, '/').'(.*?)'.preg_quote($end, '/').'/s'; |
|
833 | 833 | $new_contents = preg_replace($search, '', $str); |
834 | 834 | file_put_contents($file, $new_contents); |
835 | 835 | |
836 | 836 | //perms If Exist |
837 | 837 | $perms = "|*".strtolower($objectname)."*|"; |
838 | - $search_pattern_perms = '/' . preg_quote($perms, '/') . '.*?\n/'; |
|
838 | + $search_pattern_perms = '/'.preg_quote($perms, '/').'.*?\n/'; |
|
839 | 839 | $new_contents = preg_replace($search_pattern_perms, '', $new_contents); |
840 | 840 | file_put_contents($file, $new_contents); |
841 | 841 | } |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | $string = "[options='header',grid=rows,width=60%,caption=Organisation]\n"; |
908 | 908 | $string .= "|===\n"; |
909 | 909 | // header for table |
910 | - $header = array($langs->trans('Objects'),$langs->trans('Permission')); |
|
910 | + $header = array($langs->trans('Objects'), $langs->trans('Permission')); |
|
911 | 911 | foreach ($header as $h) { |
912 | 912 | $string .= "|".$h; |
913 | 913 | } |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | } |
990 | 990 | |
991 | 991 | $now = dol_now(); |
992 | - $content = file($file); // $content is an array |
|
992 | + $content = file($file); // $content is an array |
|
993 | 993 | |
994 | 994 | $includeClass = "dol_include_once\(\'\/\w+\/class\/\w+\.class\.php\'\);"; |
995 | 995 | $props = 'public\s+\$\w+;'; |
@@ -1001,23 +1001,23 @@ discard block |
||
1001 | 1001 | if (preg_match('/'.$varcommented.'/', $lineContent)) { |
1002 | 1002 | $lineContent = ''; |
1003 | 1003 | foreach ($objects as $objectname) { |
1004 | - $lineContent .= "\t * @var ".$objectname." \$".strtolower($objectname)." {@type ".$objectname."}". PHP_EOL; |
|
1004 | + $lineContent .= "\t * @var ".$objectname." \$".strtolower($objectname)." {@type ".$objectname."}".PHP_EOL; |
|
1005 | 1005 | } |
1006 | 1006 | //var_dump($lineContent);exit; |
1007 | 1007 | } elseif (preg_match('/'.$props.'/', $lineContent)) { |
1008 | 1008 | $lineContent = ''; |
1009 | 1009 | foreach ($objects as $objectname) { |
1010 | - $lineContent .= "\t/*".PHP_EOL."\t * @var mixed TODO: set type".PHP_EOL."\t */".PHP_EOL."\tpublic \$".strtolower($objectname).";". PHP_EOL; |
|
1010 | + $lineContent .= "\t/*".PHP_EOL."\t * @var mixed TODO: set type".PHP_EOL."\t */".PHP_EOL."\tpublic \$".strtolower($objectname).";".PHP_EOL; |
|
1011 | 1011 | } |
1012 | 1012 | } elseif (preg_match('/'.$constructObj.'/', $lineContent)) { |
1013 | 1013 | $lineContent = ''; |
1014 | 1014 | foreach ($objects as $objectname) { |
1015 | - $lineContent .= "\t\t\$this->".strtolower($objectname)." = new ".$objectname."(\$this->db);". PHP_EOL; |
|
1015 | + $lineContent .= "\t\t\$this->".strtolower($objectname)." = new ".$objectname."(\$this->db);".PHP_EOL; |
|
1016 | 1016 | } |
1017 | 1017 | } elseif (preg_match('/'.$includeClass.'/', $lineContent)) { |
1018 | 1018 | $lineContent = ''; |
1019 | 1019 | foreach ($objects as $objectname) { |
1020 | - $lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($objectname).".class.php');". PHP_EOL; |
|
1020 | + $lineContent .= "dol_include_once('/".strtolower($modulename)."/class/".strtolower($objectname).".class.php');".PHP_EOL; |
|
1021 | 1021 | } |
1022 | 1022 | } |
1023 | 1023 | } |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | return -1; |
1072 | 1072 | } |
1073 | 1073 | |
1074 | - $content = file($file); // $content is an array |
|
1074 | + $content = file($file); // $content is an array |
|
1075 | 1075 | |
1076 | 1076 | $includeClass = "dol_include_once\(\'\/\w+\/class\/".strtolower($objectname)."\.class\.php\'\);"; |
1077 | 1077 | $props = 'public\s+\$'.strtolower($objectname); |
@@ -1240,33 +1240,33 @@ discard block |
||
1240 | 1240 | * @param bool|string|int $val |
1241 | 1241 | * @return string|int |
1242 | 1242 | */ |
1243 | - static function ($val) use ($module) { |
|
1243 | + static function($val) use ($module) { |
|
1244 | 1244 | return is_bool($val) ? "isModEnabled('$module')" : $val; |
1245 | 1245 | }, |
1246 | 1246 | $value |
1247 | 1247 | ); |
1248 | - $dicData .= "array(" . implode(", ", $conditions) . ")"; |
|
1248 | + $dicData .= "array(".implode(", ", $conditions).")"; |
|
1249 | 1249 | } elseif ($key === 'tabhelp') { |
1250 | 1250 | $helpItems = array(); |
1251 | 1251 | foreach ($value as $helpValue) { |
1252 | 1252 | $helpItems[] = "array('code' => \$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')"; |
1253 | 1253 | } |
1254 | - $dicData .= "array(" . implode(",", $helpItems) . ")"; |
|
1254 | + $dicData .= "array(".implode(",", $helpItems).")"; |
|
1255 | 1255 | } else { |
1256 | 1256 | if (is_array($value)) { |
1257 | - $dicData .= "array(" . implode( |
|
1257 | + $dicData .= "array(".implode( |
|
1258 | 1258 | ",", |
1259 | 1259 | array_map( |
1260 | 1260 | /** |
1261 | 1261 | * @param string $val |
1262 | 1262 | * @return string |
1263 | 1263 | */ |
1264 | - static function ($val) { |
|
1264 | + static function($val) { |
|
1265 | 1265 | return "'$val'"; |
1266 | 1266 | }, |
1267 | 1267 | $value |
1268 | 1268 | ) |
1269 | - ) . ")"; |
|
1269 | + ).")"; |
|
1270 | 1270 | } else { |
1271 | 1271 | $dicData .= "'$value'"; |
1272 | 1272 | } |
@@ -1355,7 +1355,7 @@ discard block |
||
1355 | 1355 | $dictionnaires['tabfieldvalue'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); |
1356 | 1356 | $dictionnaires['tabfieldinsert'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); |
1357 | 1357 | $dictionnaires['tabrowid'][] = $primaryKey; |
1358 | - $dictionnaires['tabcond'][] = isModEnabled('$modulename'); // @phan-suppress-current-line UnknownModuleName |
|
1358 | + $dictionnaires['tabcond'][] = isModEnabled('$modulename'); // @phan-suppress-current-line UnknownModuleName |
|
1359 | 1359 | $dictionnaires['tabhelp'][] = (array_key_exists('code', $columns) ? array('code' => $langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip') : ''); |
1360 | 1360 | |
1361 | 1361 | // Build the dictionary string |
@@ -1409,7 +1409,7 @@ discard block |
||
1409 | 1409 | |
1410 | 1410 | // build format asciidoc for urls in table |
1411 | 1411 | if (!$error) { |
1412 | - $asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n"; // phpcs:ignore |
|
1412 | + $asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n"; // phpcs:ignore |
|
1413 | 1413 | foreach ($groupedUrls as $objectName => $urls) { |
1414 | 1414 | $urlsList = implode(" +\n*", $urls); |
1415 | 1415 | $asciiDocTable .= "|$objectName | \n*$urlsList +\n"; |
@@ -1442,9 +1442,9 @@ discard block |
||
1442 | 1442 | |
1443 | 1443 | foreach ($allFilesAndDirs as $item) { |
1444 | 1444 | if ($item != '.' && $item != '..') { |
1445 | - if ($type == 1 && is_file($path . DIRECTORY_SEPARATOR . $item) && strpos($item, '.back') === false) { |
|
1445 | + if ($type == 1 && is_file($path.DIRECTORY_SEPARATOR.$item) && strpos($item, '.back') === false) { |
|
1446 | 1446 | $count++; |
1447 | - } elseif ($type == 2 && is_dir($path . DIRECTORY_SEPARATOR . $item)) { |
|
1447 | + } elseif ($type == 2 && is_dir($path.DIRECTORY_SEPARATOR.$item)) { |
|
1448 | 1448 | $count++; |
1449 | 1449 | } |
1450 | 1450 | } |
@@ -144,7 +144,7 @@ |
||
144 | 144 | $labellang = ($objp->lang ? $langs->trans('Language_'.$objp->lang) : ''); |
145 | 145 | $this->info_box_contents[$i][$r] = array( |
146 | 146 | 'td' => 'class="tdoverflowmax100"', |
147 | - 'text' => picto_from_langcode($objp->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang, |
|
147 | + 'text' => picto_from_langcode($objp->lang, 'class="paddingrightonly saturatemedium opacitylow"').$labellang, |
|
148 | 148 | 'asis' => 1, |
149 | 149 | ); |
150 | 150 | $r++; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $colorseriesstat = array(); |
81 | 81 | if ($user->hasRight('ticket', 'read')) { |
82 | 82 | $sql = "SELECT ctt.rowid, ctt.label, ctt.code"; |
83 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_type as ctt"; |
|
83 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type as ctt"; |
|
84 | 84 | $sql .= " WHERE ctt.active = 1"; |
85 | 85 | $sql .= $this->db->order('ctt.rowid', 'ASC'); |
86 | 86 | $resql = $this->db->query($sql); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $dataseries = array(); |
113 | 113 | $data = array(); |
114 | 114 | $sql = "SELECT t.type_code, COUNT(t.type_code) as nb"; |
115 | - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; |
|
115 | + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; |
|
116 | 116 | $sql .= " WHERE t.fk_statut <> 8"; |
117 | 117 | $sql .= " GROUP BY t.type_code"; |
118 | 118 | $resql = $this->db->query($sql); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | foreach ($listofoppcode as $rowid => $code) { |
128 | 128 | $dataseries[] = array( |
129 | - 'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_type', 'code', 'label', $code), |
|
129 | + 'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort'.$code, 'c_ticket_type', 'code', 'label', $code), |
|
130 | 130 | 'data' => (empty($data[$code]) ? 0 : $data[$code]) |
131 | 131 | ); |
132 | 132 | } |