@@ -188,10 +188,10 @@ |
||
188 | 188 | $sqlsearchpackage .= ' WHERE entity IN (' . getEntity('product_fournisseur_price') . ")"; |
189 | 189 | $sqlsearchpackage .= " AND fk_product = " . ((int) $objp->fk_product); |
190 | 190 | $sqlsearchpackage .= " AND ref_fourn = '" . $this->db->escape($objp->ref_supplier) . "'"; |
191 | - $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
192 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
191 | + $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
192 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
193 | 193 | $sqlsearchpackage .= " AND fk_soc = " . ((int) $objp->socid); |
194 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
194 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
195 | 195 | $sqlsearchpackage .= " LIMIT 1"; |
196 | 196 | |
197 | 197 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | } |
777 | 777 | } |
778 | 778 | |
779 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
779 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
780 | 780 | /** |
781 | 781 | * Mise a jour de l'objet ligne de commande en base |
782 | 782 | * |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | */ |
785 | 785 | public function update_total() |
786 | 786 | { |
787 | - // phpcs:enable |
|
787 | + // phpcs:enable |
|
788 | 788 | $this->db->begin(); |
789 | 789 | |
790 | 790 | // Mise a jour ligne en base |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | { |
401 | 401 | global $user; |
402 | 402 | |
403 | - dol_syslog(get_only_class($this) . "::deleteline rowid=" . ((int)$this->id), LOG_DEBUG); |
|
403 | + dol_syslog(get_only_class($this) . "::deleteline rowid=" . ((int) $this->id), LOG_DEBUG); |
|
404 | 404 | |
405 | 405 | $error = 0; |
406 | 406 | |
@@ -691,8 +691,7 @@ discard block |
||
691 | 691 | $sql .= " " . ($this->fk_parent_line > 0 ? "'" . $this->db->escape($this->fk_parent_line) . "'" : "null") . ","; |
692 | 692 | $product_label |
693 | 693 | = !empty($this->product_label) |
694 | - ? $this->product_label : |
|
695 | - (!empty($this->label) ? $this->label : null); |
|
694 | + ? $this->product_label : (!empty($this->label) ? $this->label : null); |
|
696 | 695 | $sql .= " " . (!empty($product_label) ? "'" . $this->db->escape($product_label) . "'" : "null") . ","; |
697 | 696 | $sql .= " '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "',"; |
698 | 697 | $sql .= " '" . $this->db->escape($this->ref_supplier) . "',"; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $this->ref_supplier = $obj->ref_supplier; |
524 | 524 | $this->socid = $obj->fk_soc; |
525 | 525 | $this->fourn_id = $obj->fk_soc; |
526 | - $this->statut = $obj->status; // deprecated |
|
526 | + $this->statut = $obj->status; // deprecated |
|
527 | 527 | $this->status = $obj->status; |
528 | 528 | $this->billed = $obj->billed; |
529 | 529 | $this->user_author_id = $obj->user_author_id; |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $this->fk_project = $obj->fk_project; |
555 | 555 | $this->cond_reglement_id = $obj->fk_cond_reglement; |
556 | 556 | $this->cond_reglement_code = $obj->cond_reglement_code; |
557 | - $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
557 | + $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
558 | 558 | $this->cond_reglement_label = $obj->cond_reglement_label; |
559 | 559 | $this->cond_reglement_doc = $obj->cond_reglement_doc; |
560 | 560 | $this->fk_account = $obj->fk_account; |
@@ -687,10 +687,10 @@ discard block |
||
687 | 687 | $sqlsearchpackage .= ' WHERE entity IN (' . getEntity('product_fournisseur_price') . ")"; |
688 | 688 | $sqlsearchpackage .= " AND fk_product = " . ((int) $objp->fk_product); |
689 | 689 | $sqlsearchpackage .= " AND ref_fourn = '" . $this->db->escape($objp->ref_supplier) . "'"; |
690 | - $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
691 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
690 | + $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
691 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
692 | 692 | $sqlsearchpackage .= " AND fk_soc = " . ((int) $this->socid); |
693 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
693 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
694 | 694 | $sqlsearchpackage .= " LIMIT 1"; |
695 | 695 | |
696 | 696 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -1626,10 +1626,10 @@ discard block |
||
1626 | 1626 | $line->date_end, |
1627 | 1627 | $line->array_options, |
1628 | 1628 | $line->fk_unit, |
1629 | - $line->multicurrency_subprice, // pu_ht_devise |
|
1630 | - $line->origin, // origin |
|
1631 | - $line->origin_id, // origin_id |
|
1632 | - $line->rang, // rang |
|
1629 | + $line->multicurrency_subprice, // pu_ht_devise |
|
1630 | + $line->origin, // origin |
|
1631 | + $line->origin_id, // origin_id |
|
1632 | + $line->rang, // rang |
|
1633 | 1633 | $line->special_code |
1634 | 1634 | ); |
1635 | 1635 | if ($result < 0) { |
@@ -2003,7 +2003,7 @@ discard block |
||
2003 | 2003 | $this->db->begin(); |
2004 | 2004 | |
2005 | 2005 | $product_type = $type; |
2006 | - $label = ''; // deprecated |
|
2006 | + $label = ''; // deprecated |
|
2007 | 2007 | |
2008 | 2008 | if ($fk_product > 0) { |
2009 | 2009 | if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) { // Not the common case |
@@ -2146,7 +2146,7 @@ discard block |
||
2146 | 2146 | $this->line->total_localtax2 = $total_localtax2; |
2147 | 2147 | $this->line->total_ttc = $total_ttc; |
2148 | 2148 | $this->line->product_type = $type; |
2149 | - $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
2149 | + $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
2150 | 2150 | $this->line->origin = $origin; |
2151 | 2151 | $this->line->origin_id = $origin_id; |
2152 | 2152 | $this->line->fk_unit = $fk_unit; |
@@ -3353,7 +3353,7 @@ discard block |
||
3353 | 3353 | global $conf, $langs; |
3354 | 3354 | |
3355 | 3355 | if (!dol_strlen($modele)) { |
3356 | - $modele = ''; // No doc template/generation by default |
|
3356 | + $modele = ''; // No doc template/generation by default |
|
3357 | 3357 | |
3358 | 3358 | if (!empty($this->model_pdf)) { |
3359 | 3359 | $modele = $this->model_pdf; |
@@ -336,7 +336,7 @@ |
||
336 | 336 | } elseif ($mode == 'mon' || $mode == 'EX_MON') { |
337 | 337 | $sql .= " AND DATE_FORMAT(d.date, '%Y-%m') = '" . dol_print_date($this->date, '%Y-%m') . "'"; // @todo DATE_FORMAT is forbidden |
338 | 338 | } elseif ($mode == 'year' || $mode == 'EX_YEA') { |
339 | - $sql .= " AND DATE_FORMAT(d.date, '%Y') = '" . dol_print_date($this->date, '%Y') . "'"; // @todo DATE_FORMAT is forbidden |
|
339 | + $sql .= " AND DATE_FORMAT(d.date, '%Y') = '" . dol_print_date($this->date, '%Y') . "'"; // @todo DATE_FORMAT is forbidden |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | dol_syslog('ExpenseReportLine::getExpAmount'); |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | */ |
250 | 250 | public $fk_user_approve; |
251 | 251 | |
252 | - public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) |
|
253 | - public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) |
|
252 | + public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) |
|
253 | + public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) |
|
254 | 254 | |
255 | 255 | /** |
256 | 256 | * Draft status |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | $this->total_tva = 0; |
342 | 342 | $this->total_localtax1 = 0; |
343 | 343 | $this->total_localtax2 = 0; |
344 | - $this->localtax1 = 0; // For backward compatibility |
|
345 | - $this->localtax2 = 0; // For backward compatibility |
|
344 | + $this->localtax1 = 0; // For backward compatibility |
|
345 | + $this->localtax2 = 0; // For backward compatibility |
|
346 | 346 | $this->modepaymentid = 0; |
347 | 347 | |
348 | 348 | // List of language codes for status |
@@ -699,8 +699,8 @@ discard block |
||
699 | 699 | $this->total_ht = $obj->total_ht; |
700 | 700 | $this->total_tva = $obj->total_tva; |
701 | 701 | $this->total_ttc = $obj->total_ttc; |
702 | - $this->localtax1 = $obj->total_localtax1; // For backward compatibility |
|
703 | - $this->localtax2 = $obj->total_localtax2; // For backward compatibility |
|
702 | + $this->localtax1 = $obj->total_localtax1; // For backward compatibility |
|
703 | + $this->localtax2 = $obj->total_localtax2; // For backward compatibility |
|
704 | 704 | $this->total_localtax1 = $obj->total_localtax1; |
705 | 705 | $this->total_localtax2 = $obj->total_localtax2; |
706 | 706 | |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | |
1168 | 1168 | $deplig->rule_warning_message = $objp->rule_warning_message; |
1169 | 1169 | |
1170 | - $deplig->rang = $objp->rang; |
|
1170 | + $deplig->rang = $objp->rang; |
|
1171 | 1171 | |
1172 | 1172 | $this->lines[$i] = $deplig; |
1173 | 1173 | |
@@ -1963,8 +1963,8 @@ discard block |
||
1963 | 1963 | $this->line = new ExpenseReportLine($this->db); |
1964 | 1964 | |
1965 | 1965 | // We don't know seller and buyer for expense reports |
1966 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
1967 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
1966 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
1967 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
1968 | 1968 | $buyer = new Societe($this->db); |
1969 | 1969 | |
1970 | 1970 | $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); |
@@ -2046,8 +2046,8 @@ discard block |
||
2046 | 2046 | |
2047 | 2047 | // We don't know seller and buyer for expense reports |
2048 | 2048 | if (!is_object($seller)) { |
2049 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2050 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
2049 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2050 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
2051 | 2051 | } |
2052 | 2052 | |
2053 | 2053 | $expensereportrule = new ExpenseReportRule($db); |
@@ -2131,8 +2131,8 @@ discard block |
||
2131 | 2131 | |
2132 | 2132 | // We don't know seller and buyer for expense reports |
2133 | 2133 | if (!is_object($seller)) { |
2134 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2135 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
2134 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2135 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
2136 | 2136 | } |
2137 | 2137 | |
2138 | 2138 | $expenseik = new ExpenseReportIk($this->db); |
@@ -2226,10 +2226,10 @@ discard block |
||
2226 | 2226 | $type = 0; // TODO What if type is service ? |
2227 | 2227 | |
2228 | 2228 | // We don't know seller and buyer for expense reports |
2229 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2230 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
2231 | - $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2232 | - $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2229 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2230 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
2231 | + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2232 | + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2233 | 2233 | $buyer = new Societe($this->db); |
2234 | 2234 | |
2235 | 2235 | $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | } |
767 | 767 | } |
768 | 768 | |
769 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
769 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
770 | 770 | /** |
771 | 771 | * Classify the expense report as paid |
772 | 772 | * |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | */ |
780 | 780 | public function set_paid($id, $fuser, $notrigger = 0) |
781 | 781 | { |
782 | - // phpcs:enable |
|
782 | + // phpcs:enable |
|
783 | 783 | dol_syslog(get_only_class($this) . "::set_paid is deprecated, use setPaid instead", LOG_NOTICE); |
784 | 784 | return $this->setPaid($id, $fuser, $notrigger); |
785 | 785 | } |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | return $this->LibStatut($this->status, $mode); |
846 | 846 | } |
847 | 847 | |
848 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
848 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
849 | 849 | /** |
850 | 850 | * Returns the label of a status |
851 | 851 | * |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | */ |
856 | 856 | public function LibStatut($status, $mode = 0) |
857 | 857 | { |
858 | - // phpcs:enable |
|
858 | + // phpcs:enable |
|
859 | 859 | global $langs; |
860 | 860 | |
861 | 861 | $labelStatus = $langs->transnoentitiesnoconv($this->labelStatus[$status]); |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | return 1; |
986 | 986 | } |
987 | 987 | |
988 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
988 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
989 | 989 | /** |
990 | 990 | * fetch_line_by_project |
991 | 991 | * |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | */ |
996 | 996 | public function fetch_line_by_project($projectid, $user) |
997 | 997 | { |
998 | - // phpcs:enable |
|
998 | + // phpcs:enable |
|
999 | 999 | global $langs; |
1000 | 1000 | |
1001 | 1001 | $langs->load('trips'); |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | return 0; |
1088 | 1088 | } |
1089 | 1089 | |
1090 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1090 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1091 | 1091 | /** |
1092 | 1092 | * fetch_lines |
1093 | 1093 | * |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | */ |
1096 | 1096 | public function fetch_lines() |
1097 | 1097 | { |
1098 | - // phpcs:enable |
|
1098 | + // phpcs:enable |
|
1099 | 1099 | $this->lines = array(); |
1100 | 1100 | |
1101 | 1101 | $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,'; |
@@ -1425,7 +1425,7 @@ discard block |
||
1425 | 1425 | } |
1426 | 1426 | } |
1427 | 1427 | |
1428 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1428 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1429 | 1429 | /** |
1430 | 1430 | * set_save_from_refuse |
1431 | 1431 | * |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | */ |
1435 | 1435 | public function set_save_from_refuse($fuser) |
1436 | 1436 | { |
1437 | - // phpcs:enable |
|
1437 | + // phpcs:enable |
|
1438 | 1438 | // Sélection de la date de début de la NDF |
1439 | 1439 | $sql = 'SELECT date_debut'; |
1440 | 1440 | $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element; |
@@ -1576,7 +1576,7 @@ discard block |
||
1576 | 1576 | return 0; |
1577 | 1577 | } |
1578 | 1578 | |
1579 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1579 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1580 | 1580 | /** |
1581 | 1581 | * set_unpaid |
1582 | 1582 | * |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | */ |
1589 | 1589 | public function set_unpaid($fuser, $notrigger = 0) |
1590 | 1590 | { |
1591 | - // phpcs:enable |
|
1591 | + // phpcs:enable |
|
1592 | 1592 | dol_syslog(get_only_class($this) . "::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE); |
1593 | 1593 | return $this->setUnpaid($fuser, $notrigger); |
1594 | 1594 | } |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | return 0; |
1645 | 1645 | } |
1646 | 1646 | |
1647 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1647 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1648 | 1648 | /** |
1649 | 1649 | * set_cancel |
1650 | 1650 | * |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | */ |
1656 | 1656 | public function set_cancel($fuser, $detail, $notrigger = 0) |
1657 | 1657 | { |
1658 | - // phpcs:enable |
|
1658 | + // phpcs:enable |
|
1659 | 1659 | $error = 0; |
1660 | 1660 | $this->date_cancel = $this->db->idate(dol_now()); |
1661 | 1661 | if ($this->status != self::STATUS_CANCELED) { |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | return $result; |
1879 | 1879 | } |
1880 | 1880 | |
1881 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1881 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1882 | 1882 | /** |
1883 | 1883 | * Update total of an expense report when you add a line. |
1884 | 1884 | * |
@@ -1888,7 +1888,7 @@ discard block |
||
1888 | 1888 | */ |
1889 | 1889 | public function update_totaux_add($ligne_total_ht, $ligne_total_tva) |
1890 | 1890 | { |
1891 | - // phpcs:enable |
|
1891 | + // phpcs:enable |
|
1892 | 1892 | $this->total_ht += (float) $ligne_total_ht; |
1893 | 1893 | $this->total_tva += (float) $ligne_total_tva; |
1894 | 1894 | $this->total_ttc += $this->total_tva; |
@@ -2374,7 +2374,7 @@ discard block |
||
2374 | 2374 | return 1; |
2375 | 2375 | } |
2376 | 2376 | |
2377 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2377 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2378 | 2378 | /** |
2379 | 2379 | * periode_existe |
2380 | 2380 | * |
@@ -2387,7 +2387,7 @@ discard block |
||
2387 | 2387 | { |
2388 | 2388 | global $conf; |
2389 | 2389 | |
2390 | - // phpcs:enable |
|
2390 | + // phpcs:enable |
|
2391 | 2391 | $sql = "SELECT rowid, date_debut, date_fin"; |
2392 | 2392 | $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; |
2393 | 2393 | $sql .= " WHERE entity = " . ((int) $conf->entity); // not shared, only for the current entity |
@@ -2428,7 +2428,7 @@ discard block |
||
2428 | 2428 | } |
2429 | 2429 | |
2430 | 2430 | |
2431 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2431 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2432 | 2432 | /** |
2433 | 2433 | * Return list of people with permission to validate expense reports. |
2434 | 2434 | * Search for permission "approve expense report" |
@@ -2437,7 +2437,7 @@ discard block |
||
2437 | 2437 | */ |
2438 | 2438 | public function fetch_users_approver_expensereport() |
2439 | 2439 | { |
2440 | - // phpcs:enable |
|
2440 | + // phpcs:enable |
|
2441 | 2441 | $users_validator = array(); |
2442 | 2442 | |
2443 | 2443 | $sql = "SELECT DISTINCT ur.fk_user"; |
@@ -2563,7 +2563,7 @@ discard block |
||
2563 | 2563 | } |
2564 | 2564 | } |
2565 | 2565 | |
2566 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2566 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2567 | 2567 | /** |
2568 | 2568 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
2569 | 2569 | * |
@@ -2573,7 +2573,7 @@ discard block |
||
2573 | 2573 | */ |
2574 | 2574 | public function load_board($user, $option = 'topay') |
2575 | 2575 | { |
2576 | - // phpcs:enable |
|
2576 | + // phpcs:enable |
|
2577 | 2577 | global $conf, $langs; |
2578 | 2578 | |
2579 | 2579 | if ($user->socid) { |
@@ -643,15 +643,15 @@ discard block |
||
643 | 643 | */ |
644 | 644 | |
645 | 645 | /** |
646 | - * Close a shipment (Classify it as "Delivered") |
|
647 | - * |
|
648 | - * @param int $id Expedition ID |
|
649 | - * @param int $notrigger Disabled triggers |
|
650 | - * |
|
651 | - * @url POST {id}/close |
|
652 | - * |
|
653 | - * @return object |
|
654 | - */ |
|
646 | + * Close a shipment (Classify it as "Delivered") |
|
647 | + * |
|
648 | + * @param int $id Expedition ID |
|
649 | + * @param int $notrigger Disabled triggers |
|
650 | + * |
|
651 | + * @url POST {id}/close |
|
652 | + * |
|
653 | + * @return object |
|
654 | + */ |
|
655 | 655 | public function close($id, $notrigger = 0) |
656 | 656 | { |
657 | 657 | if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) { |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | return $this->_cleanObjectDatas($this->shipment); |
684 | 684 | } |
685 | 685 | |
686 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
686 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
687 | 687 | /** |
688 | 688 | * Clean sensible object datas |
689 | 689 | * |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | */ |
693 | 693 | protected function _cleanObjectDatas($object) |
694 | 694 | { |
695 | - // phpcs:enable |
|
695 | + // phpcs:enable |
|
696 | 696 | $object = parent::_cleanObjectDatas($object); |
697 | 697 | |
698 | 698 | unset($object->canvas); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
286 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
286 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
287 | 287 | /** |
288 | 288 | * Update total duration into llx_fichinter |
289 | 289 | * |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function update_total() |
293 | 293 | { |
294 | - // phpcs:enable |
|
294 | + // phpcs:enable |
|
295 | 295 | global $conf; |
296 | 296 | |
297 | 297 | $this->db->begin(); |
@@ -52,19 +52,19 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public $fk_fichinter; |
54 | 54 | |
55 | - public $desc; // Description ligne |
|
55 | + public $desc; // Description ligne |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @var int Date of intervention |
59 | 59 | */ |
60 | - public $date; // Date intervention |
|
60 | + public $date; // Date intervention |
|
61 | 61 | /** |
62 | 62 | * @var int Date of intervention |
63 | 63 | * @deprecated |
64 | 64 | */ |
65 | - public $datei; // Date intervention |
|
65 | + public $datei; // Date intervention |
|
66 | 66 | |
67 | - public $duration; // Duration of intervention |
|
67 | + public $duration; // Duration of intervention |
|
68 | 68 | public $rang = 0; |
69 | 69 | public $tva_tx; |
70 | 70 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->id = $objp->rowid; |
123 | 123 | $this->fk_fichinter = $objp->fk_fichinter; |
124 | 124 | $this->date = $this->db->jdate($objp->date); |
125 | - $this->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
125 | + $this->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
126 | 126 | $this->desc = $objp->description; |
127 | 127 | $this->duration = $objp->duree; |
128 | 128 | $this->rang = $objp->rang; |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | return $this->LibStatut((isset($this->statut) ? $this->statut : $this->status), $mode); |
835 | 835 | } |
836 | 836 | |
837 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
837 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
838 | 838 | /** |
839 | 839 | * Returns the label of a status |
840 | 840 | * |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | */ |
845 | 845 | public function LibStatut($status, $mode = 0) |
846 | 846 | { |
847 | - // phpcs:enable |
|
847 | + // phpcs:enable |
|
848 | 848 | // Init/load array of translation of status |
849 | 849 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
850 | 850 | global $langs; |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | } |
1199 | 1199 | } |
1200 | 1200 | |
1201 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1201 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1202 | 1202 | /** |
1203 | 1203 | * Defines a delivery date of intervention |
1204 | 1204 | * |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | */ |
1209 | 1209 | public function set_date_delivery($user, $date_delivery) |
1210 | 1210 | { |
1211 | - // phpcs:enable |
|
1211 | + // phpcs:enable |
|
1212 | 1212 | if ($user->hasRight('ficheinter', 'creer')) { |
1213 | 1213 | $sql = "UPDATE " . MAIN_DB_PREFIX . "fichinter "; |
1214 | 1214 | $sql .= " SET datei = '" . $this->db->idate($date_delivery) . "'"; |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | return 0; |
1229 | 1229 | } |
1230 | 1230 | |
1231 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1231 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1232 | 1232 | /** |
1233 | 1233 | * Define the label of the intervention |
1234 | 1234 | * |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | */ |
1239 | 1239 | public function set_description($user, $description) |
1240 | 1240 | { |
1241 | - // phpcs:enable |
|
1241 | + // phpcs:enable |
|
1242 | 1242 | if ($user->hasRight('ficheinter', 'creer')) { |
1243 | 1243 | $sql = "UPDATE " . MAIN_DB_PREFIX . "fichinter "; |
1244 | 1244 | $sql .= " SET description = '" . $this->db->escape($description) . "',"; |
@@ -1259,7 +1259,7 @@ discard block |
||
1259 | 1259 | } |
1260 | 1260 | |
1261 | 1261 | |
1262 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1262 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1263 | 1263 | /** |
1264 | 1264 | * Link intervention to a contract |
1265 | 1265 | * |
@@ -1269,7 +1269,7 @@ discard block |
||
1269 | 1269 | */ |
1270 | 1270 | public function set_contrat($user, $contractid) |
1271 | 1271 | { |
1272 | - // phpcs:enable |
|
1272 | + // phpcs:enable |
|
1273 | 1273 | if ($user->hasRight('ficheinter', 'creer')) { |
1274 | 1274 | $sql = "UPDATE " . MAIN_DB_PREFIX . "fichinter "; |
1275 | 1275 | $sql .= " SET fk_contrat = " . ((int) $contractid); |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | return 1; |
1467 | 1467 | } |
1468 | 1468 | |
1469 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1469 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1470 | 1470 | /** |
1471 | 1471 | * Load array lines ->lines |
1472 | 1472 | * |
@@ -1474,7 +1474,7 @@ discard block |
||
1474 | 1474 | */ |
1475 | 1475 | public function fetch_lines() |
1476 | 1476 | { |
1477 | - // phpcs:enable |
|
1477 | + // phpcs:enable |
|
1478 | 1478 | $this->lines = array(); |
1479 | 1479 | |
1480 | 1480 | $sql = "SELECT rowid, fk_fichinter, description, duree, date, rang"; |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | /** |
200 | 200 | * No signature |
201 | 201 | */ |
202 | - const STATUS_NO_SIGNATURE = 0; |
|
202 | + const STATUS_NO_SIGNATURE = 0; |
|
203 | 203 | |
204 | 204 | /** |
205 | 205 | * Signed by sender |
206 | 206 | */ |
207 | - const STATUS_SIGNED_SENDER = 1; |
|
207 | + const STATUS_SIGNED_SENDER = 1; |
|
208 | 208 | |
209 | 209 | /** |
210 | 210 | * Signed by receiver |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | /** |
215 | 215 | * Signed by all |
216 | 216 | */ |
217 | - const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
217 | + const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) |
|
218 | 218 | |
219 | 219 | |
220 | 220 | /** |
@@ -1406,7 +1406,7 @@ discard block |
||
1406 | 1406 | $line->fk_fichinter = $fichinterid; |
1407 | 1407 | $line->desc = $desc; |
1408 | 1408 | $line->date = $date_intervention; |
1409 | - $line->datei = $date_intervention; // For backward compatibility |
|
1409 | + $line->datei = $date_intervention; // For backward compatibility |
|
1410 | 1410 | $line->duration = $duration; |
1411 | 1411 | |
1412 | 1412 | if (is_array($array_options) && count($array_options) > 0) { |
@@ -1503,7 +1503,7 @@ discard block |
||
1503 | 1503 | //For invoicing we calculing hours |
1504 | 1504 | $line->qty = round($objp->duree / 3600, 2); |
1505 | 1505 | $line->date = $this->db->jdate($objp->date); |
1506 | - $line->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
1506 | + $line->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
1507 | 1507 | $line->rang = $objp->rang; |
1508 | 1508 | $line->product_type = 1; |
1509 | 1509 | $line->fetch_optionals(); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | $sql = "SELECT t.rowid"; |
244 | 244 | $sql .= " FROM " . MAIN_DB_PREFIX . "projet as t"; |
245 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
245 | + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
246 | 246 | if ($category > 0) { |
247 | 247 | $sql .= ", " . MAIN_DB_PREFIX . "categorie_project as c"; |
248 | 248 | } |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | if ($search_sale == -2) { |
256 | 256 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)"; |
257 | 257 | } elseif ($search_sale > 0) { |
258 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
258 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | // Select projects of given category |
262 | 262 | if ($category > 0) { |
263 | - $sql .= " AND c.fk_categorie = " . ((int)$category) . " AND c.fk_project = t.rowid "; |
|
263 | + $sql .= " AND c.fk_categorie = " . ((int) $category) . " AND c.fk_project = t.rowid "; |
|
264 | 264 | } |
265 | 265 | // Add sql filters |
266 | 266 | if ($sqlfilters) { |