@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 367 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 368 | 368 | /** |
| 369 | 369 | * Activate a contract line |
| 370 | 370 | * |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | public function active_line($user, $line_id, $date_start, $date_end = '', $comment = '') |
| 379 | 379 | { |
| 380 | - // phpcs:enable |
|
| 380 | + // phpcs:enable |
|
| 381 | 381 | $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date_start, $date_end, $comment); |
| 382 | 382 | if ($result < 0) { |
| 383 | 383 | $this->error = $this->lines[$this->lines_id_index_mapper[$line_id]]->error; |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | |
| 390 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 390 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 391 | 391 | /** |
| 392 | 392 | * Close a contract line |
| 393 | 393 | * |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | */ |
| 400 | 400 | public function close_line($user, $line_id, $date_end, $comment = '') |
| 401 | 401 | { |
| 402 | - // phpcs:enable |
|
| 402 | + // phpcs:enable |
|
| 403 | 403 | $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); |
| 404 | 404 | if ($result < 0) { |
| 405 | 405 | $this->error = $this->lines[$this->lines_id_index_mapper[$line_id]]->error; |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | } |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 824 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 825 | 825 | /** |
| 826 | 826 | * Load lines array into this->lines. |
| 827 | 827 | * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | */ |
| 834 | 834 | public function fetch_lines($only_services = 0, $loadalsotranslation = 0, $noextrafields = 0) |
| 835 | 835 | { |
| 836 | - // phpcs:enable |
|
| 836 | + // phpcs:enable |
|
| 837 | 837 | $this->nbofservices = 0; |
| 838 | 838 | $this->nbofserviceswait = 0; |
| 839 | 839 | $this->nbofservicesopened = 0; |
@@ -1964,7 +1964,7 @@ discard block |
||
| 1964 | 1964 | } |
| 1965 | 1965 | |
| 1966 | 1966 | |
| 1967 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1967 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1968 | 1968 | /** |
| 1969 | 1969 | * Update statut of contract according to services |
| 1970 | 1970 | * |
@@ -1974,7 +1974,7 @@ discard block |
||
| 1974 | 1974 | */ |
| 1975 | 1975 | public function update_statut($user) |
| 1976 | 1976 | { |
| 1977 | - // phpcs:enable |
|
| 1977 | + // phpcs:enable |
|
| 1978 | 1978 | dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); |
| 1979 | 1979 | |
| 1980 | 1980 | // If draft, we keep it (should not happen) |
@@ -2006,7 +2006,7 @@ discard block |
||
| 2006 | 2006 | return $this->LibStatut($this->statut, $mode); |
| 2007 | 2007 | } |
| 2008 | 2008 | |
| 2009 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2009 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2010 | 2010 | /** |
| 2011 | 2011 | * Return the label of a given contrat status |
| 2012 | 2012 | * |
@@ -2016,7 +2016,7 @@ discard block |
||
| 2016 | 2016 | */ |
| 2017 | 2017 | public function LibStatut($status, $mode) |
| 2018 | 2018 | { |
| 2019 | - // phpcs:enable |
|
| 2019 | + // phpcs:enable |
|
| 2020 | 2020 | global $langs; |
| 2021 | 2021 | |
| 2022 | 2022 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -2226,7 +2226,7 @@ discard block |
||
| 2226 | 2226 | } |
| 2227 | 2227 | } |
| 2228 | 2228 | |
| 2229 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2229 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2230 | 2230 | /** |
| 2231 | 2231 | * Return list of line rowid |
| 2232 | 2232 | * |
@@ -2235,7 +2235,7 @@ discard block |
||
| 2235 | 2235 | */ |
| 2236 | 2236 | public function array_detail($status = -1) |
| 2237 | 2237 | { |
| 2238 | - // phpcs:enable |
|
| 2238 | + // phpcs:enable |
|
| 2239 | 2239 | $tab = array(); |
| 2240 | 2240 | |
| 2241 | 2241 | $sql = "SELECT cd.rowid"; |
@@ -2307,7 +2307,7 @@ discard block |
||
| 2307 | 2307 | } |
| 2308 | 2308 | |
| 2309 | 2309 | |
| 2310 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2310 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2311 | 2311 | /** |
| 2312 | 2312 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
| 2313 | 2313 | * |
@@ -2317,7 +2317,7 @@ discard block |
||
| 2317 | 2317 | */ |
| 2318 | 2318 | public function load_board($user, $mode) |
| 2319 | 2319 | { |
| 2320 | - // phpcs:enable |
|
| 2320 | + // phpcs:enable |
|
| 2321 | 2321 | global $conf, $langs; |
| 2322 | 2322 | |
| 2323 | 2323 | $this->from = " FROM " . MAIN_DB_PREFIX . "contrat as c"; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | return $this->LibStatut($this->statut, $mode, ((!empty($this->date_end)) ? ($this->date_end < dol_now() ? 1 : 0) : -1)); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 244 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 245 | 245 | /** |
| 246 | 246 | * Return label of a contract line status |
| 247 | 247 | * |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public static function LibStatut($status, $mode, $expired = -1, $moreatt = '') |
| 255 | 255 | { |
| 256 | - // phpcs:enable |
|
| 256 | + // phpcs:enable |
|
| 257 | 257 | global $langs; |
| 258 | 258 | $langs->load("contracts"); |
| 259 | 259 | |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
| 691 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 691 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 692 | 692 | /** |
| 693 | 693 | * Update in database the fields total_xxx of lines |
| 694 | 694 | * Used by migration process |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | */ |
| 698 | 698 | public function update_total() |
| 699 | 699 | { |
| 700 | - // phpcs:enable |
|
| 700 | + // phpcs:enable |
|
| 701 | 701 | $this->db->begin(); |
| 702 | 702 | |
| 703 | 703 | // Mise a jour ligne en base |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 818 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 819 | 819 | /** |
| 820 | 820 | * Activate a contract line |
| 821 | 821 | * |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | */ |
| 828 | 828 | public function active_line($user, $date, $date_end = '', $comment = '') |
| 829 | 829 | { |
| 830 | - // phpcs:enable |
|
| 830 | + // phpcs:enable |
|
| 831 | 831 | $error = 0; |
| 832 | 832 | |
| 833 | 833 | $this->db->begin(); |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | } |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 876 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 877 | 877 | /** |
| 878 | 878 | * Close a contract line |
| 879 | 879 | * |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | */ |
| 886 | 886 | public function close_line($user, $date_end_real, $comment = '', $notrigger = 0) |
| 887 | 887 | { |
| 888 | - // phpcs:enable |
|
| 888 | + // phpcs:enable |
|
| 889 | 889 | $this->date_cloture = $date_end_real; |
| 890 | 890 | $this->date_end_real = $date_end_real; |
| 891 | 891 | $this->user_closing_id = $user->id; |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | } |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 668 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 669 | 669 | /** |
| 670 | 670 | * Update DB line fields total_xxx |
| 671 | 671 | * Used by migration |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | */ |
| 675 | 675 | public function update_total() |
| 676 | 676 | { |
| 677 | - // phpcs:enable |
|
| 677 | + // phpcs:enable |
|
| 678 | 678 | $this->db->begin(); |
| 679 | 679 | |
| 680 | 680 | // Mise a jour ligne en base |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | |
| 413 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 413 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 414 | 414 | /** |
| 415 | 415 | * Add line into array ->lines |
| 416 | 416 | * $this->thirdparty should be loaded |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | */ |
| 425 | 425 | public function add_product($idproduct, $qty, $remise_percent = 0) |
| 426 | 426 | { |
| 427 | - // phpcs:enable |
|
| 427 | + // phpcs:enable |
|
| 428 | 428 | global $conf, $mysoc; |
| 429 | 429 | |
| 430 | 430 | if (!$qty) { |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | return 1; |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 478 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 479 | 479 | /** |
| 480 | 480 | * Adding line of fixed discount in the proposal in DB |
| 481 | 481 | * |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | */ |
| 485 | 485 | public function insert_discount($idremise) |
| 486 | 486 | { |
| 487 | - // phpcs:enable |
|
| 487 | + // phpcs:enable |
|
| 488 | 488 | global $langs; |
| 489 | 489 | |
| 490 | 490 | include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; |
@@ -1826,7 +1826,7 @@ discard block |
||
| 1826 | 1826 | } |
| 1827 | 1827 | |
| 1828 | 1828 | |
| 1829 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1829 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 1830 | 1830 | /** |
| 1831 | 1831 | * Load array lines |
| 1832 | 1832 | * |
@@ -1837,7 +1837,7 @@ discard block |
||
| 1837 | 1837 | */ |
| 1838 | 1838 | public function fetch_lines($only_product = 0, $loadalsotranslation = 0, $sqlforgedfilters = '') |
| 1839 | 1839 | { |
| 1840 | - // phpcs:enable |
|
| 1840 | + // phpcs:enable |
|
| 1841 | 1841 | $this->lines = array(); |
| 1842 | 1842 | |
| 1843 | 1843 | $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | } |
| 2087 | 2087 | |
| 2088 | 2088 | |
| 2089 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2089 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2090 | 2090 | /** |
| 2091 | 2091 | * Define proposal date |
| 2092 | 2092 | * |
@@ -2097,7 +2097,7 @@ discard block |
||
| 2097 | 2097 | */ |
| 2098 | 2098 | public function set_date($user, $date, $notrigger = 0) |
| 2099 | 2099 | { |
| 2100 | - // phpcs:enable |
|
| 2100 | + // phpcs:enable |
|
| 2101 | 2101 | if (empty($date)) { |
| 2102 | 2102 | $this->error = 'ErrorBadParameter'; |
| 2103 | 2103 | dol_syslog(get_class($this) . "::set_date " . $this->error, LOG_ERR); |
@@ -2150,7 +2150,7 @@ discard block |
||
| 2150 | 2150 | return -1; |
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2153 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2154 | 2154 | /** |
| 2155 | 2155 | * Define end validity date |
| 2156 | 2156 | * |
@@ -2161,7 +2161,7 @@ discard block |
||
| 2161 | 2161 | */ |
| 2162 | 2162 | public function set_echeance($user, $date_end_validity, $notrigger = 0) |
| 2163 | 2163 | { |
| 2164 | - // phpcs:enable |
|
| 2164 | + // phpcs:enable |
|
| 2165 | 2165 | if ($user->hasRight('propal', 'creer')) { |
| 2166 | 2166 | $error = 0; |
| 2167 | 2167 | |
@@ -2209,7 +2209,7 @@ discard block |
||
| 2209 | 2209 | return -1; |
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2212 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2213 | 2213 | /** |
| 2214 | 2214 | * Set delivery date |
| 2215 | 2215 | * |
@@ -2221,7 +2221,7 @@ discard block |
||
| 2221 | 2221 | */ |
| 2222 | 2222 | public function set_date_livraison($user, $delivery_date, $notrigger = 0) |
| 2223 | 2223 | { |
| 2224 | - // phpcs:enable |
|
| 2224 | + // phpcs:enable |
|
| 2225 | 2225 | return $this->setDeliveryDate($user, $delivery_date, $notrigger); |
| 2226 | 2226 | } |
| 2227 | 2227 | |
@@ -2281,7 +2281,7 @@ discard block |
||
| 2281 | 2281 | return -1; |
| 2282 | 2282 | } |
| 2283 | 2283 | |
| 2284 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2284 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2285 | 2285 | /** |
| 2286 | 2286 | * Set delivery |
| 2287 | 2287 | * |
@@ -2292,7 +2292,7 @@ discard block |
||
| 2292 | 2292 | */ |
| 2293 | 2293 | public function set_availability($user, $id, $notrigger = 0) |
| 2294 | 2294 | { |
| 2295 | - // phpcs:enable |
|
| 2295 | + // phpcs:enable |
|
| 2296 | 2296 | if ($user->hasRight('propal', 'creer') && $this->statut >= self::STATUS_DRAFT) { |
| 2297 | 2297 | $error = 0; |
| 2298 | 2298 | |
@@ -2344,7 +2344,7 @@ discard block |
||
| 2344 | 2344 | } |
| 2345 | 2345 | } |
| 2346 | 2346 | |
| 2347 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2347 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2348 | 2348 | /** |
| 2349 | 2349 | * Set source of demand |
| 2350 | 2350 | * |
@@ -2355,7 +2355,7 @@ discard block |
||
| 2355 | 2355 | */ |
| 2356 | 2356 | public function set_demand_reason($user, $id, $notrigger = 0) |
| 2357 | 2357 | { |
| 2358 | - // phpcs:enable |
|
| 2358 | + // phpcs:enable |
|
| 2359 | 2359 | if ($user->hasRight('propal', 'creer') && $this->statut >= self::STATUS_DRAFT) { |
| 2360 | 2360 | $error = 0; |
| 2361 | 2361 | |
@@ -2409,7 +2409,7 @@ discard block |
||
| 2409 | 2409 | } |
| 2410 | 2410 | } |
| 2411 | 2411 | |
| 2412 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2412 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2413 | 2413 | /** |
| 2414 | 2414 | * Set customer reference number |
| 2415 | 2415 | * |
@@ -2420,7 +2420,7 @@ discard block |
||
| 2420 | 2420 | */ |
| 2421 | 2421 | public function set_ref_client($user, $ref_client, $notrigger = 0) |
| 2422 | 2422 | { |
| 2423 | - // phpcs:enable |
|
| 2423 | + // phpcs:enable |
|
| 2424 | 2424 | if ($user->hasRight('propal', 'creer')) { |
| 2425 | 2425 | $error = 0; |
| 2426 | 2426 | |
@@ -2772,7 +2772,7 @@ discard block |
||
| 2772 | 2772 | } |
| 2773 | 2773 | } |
| 2774 | 2774 | |
| 2775 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2775 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2776 | 2776 | /** |
| 2777 | 2777 | * Set draft status |
| 2778 | 2778 | * |
@@ -2782,7 +2782,7 @@ discard block |
||
| 2782 | 2782 | */ |
| 2783 | 2783 | public function setDraft($user, $notrigger = 0) |
| 2784 | 2784 | { |
| 2785 | - // phpcs:enable |
|
| 2785 | + // phpcs:enable |
|
| 2786 | 2786 | $error = 0; |
| 2787 | 2787 | |
| 2788 | 2788 | // Protection |
@@ -2835,7 +2835,7 @@ discard block |
||
| 2835 | 2835 | } |
| 2836 | 2836 | |
| 2837 | 2837 | |
| 2838 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2838 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2839 | 2839 | /** |
| 2840 | 2840 | * Return list of proposal (eventually filtered on user) into an array |
| 2841 | 2841 | * |
@@ -2851,7 +2851,7 @@ discard block |
||
| 2851 | 2851 | */ |
| 2852 | 2852 | public function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datep', $sortorder = 'DESC') |
| 2853 | 2853 | { |
| 2854 | - // phpcs:enable |
|
| 2854 | + // phpcs:enable |
|
| 2855 | 2855 | global $user; |
| 2856 | 2856 | |
| 2857 | 2857 | $ga = array(); |
@@ -2928,7 +2928,7 @@ discard block |
||
| 2928 | 2928 | return $this->InvoiceArrayList($this->id); |
| 2929 | 2929 | } |
| 2930 | 2930 | |
| 2931 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2931 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 2932 | 2932 | /** |
| 2933 | 2933 | * Returns an array with id and ref of related invoices |
| 2934 | 2934 | * |
@@ -2937,7 +2937,7 @@ discard block |
||
| 2937 | 2937 | */ |
| 2938 | 2938 | public function InvoiceArrayList($id) |
| 2939 | 2939 | { |
| 2940 | - // phpcs:enable |
|
| 2940 | + // phpcs:enable |
|
| 2941 | 2941 | $ga = array(); |
| 2942 | 2942 | $linkedInvoices = array(); |
| 2943 | 2943 | |
@@ -3185,7 +3185,7 @@ discard block |
||
| 3185 | 3185 | } |
| 3186 | 3186 | } |
| 3187 | 3187 | |
| 3188 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3188 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3189 | 3189 | /** |
| 3190 | 3190 | * Change source demand |
| 3191 | 3191 | * |
@@ -3196,7 +3196,7 @@ discard block |
||
| 3196 | 3196 | */ |
| 3197 | 3197 | public function demand_reason($demand_reason_id, $notrigger = 0) |
| 3198 | 3198 | { |
| 3199 | - // phpcs:enable |
|
| 3199 | + // phpcs:enable |
|
| 3200 | 3200 | global $user; |
| 3201 | 3201 | |
| 3202 | 3202 | if ($this->status >= self::STATUS_DRAFT) { |
@@ -3306,7 +3306,7 @@ discard block |
||
| 3306 | 3306 | return $this->LibStatut($this->statut, $mode); |
| 3307 | 3307 | } |
| 3308 | 3308 | |
| 3309 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3309 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3310 | 3310 | /** |
| 3311 | 3311 | * Return label of a status (draft, validated, ...) |
| 3312 | 3312 | * |
@@ -3316,7 +3316,7 @@ discard block |
||
| 3316 | 3316 | */ |
| 3317 | 3317 | public function LibStatut($status, $mode = 1) |
| 3318 | 3318 | { |
| 3319 | - // phpcs:enable |
|
| 3319 | + // phpcs:enable |
|
| 3320 | 3320 | global $conf, $hookmanager; |
| 3321 | 3321 | |
| 3322 | 3322 | // Init/load array of translation of status |
@@ -3364,7 +3364,7 @@ discard block |
||
| 3364 | 3364 | } |
| 3365 | 3365 | |
| 3366 | 3366 | |
| 3367 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3367 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 3368 | 3368 | /** |
| 3369 | 3369 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
| 3370 | 3370 | * |
@@ -3374,7 +3374,7 @@ discard block |
||
| 3374 | 3374 | */ |
| 3375 | 3375 | public function load_board($user, $mode) |
| 3376 | 3376 | { |
| 3377 | - // phpcs:enable |
|
| 3377 | + // phpcs:enable |
|
| 3378 | 3378 | global $conf, $langs; |
| 3379 | 3379 | |
| 3380 | 3380 | $clause = " WHERE"; |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | public $fk_user_approve; |
| 231 | 231 | |
| 232 | - public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) |
|
| 233 | - public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) |
|
| 232 | + public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) |
|
| 233 | + public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) |
|
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | 236 | * @var array |
@@ -331,8 +331,8 @@ discard block |
||
| 331 | 331 | $this->total_tva = 0; |
| 332 | 332 | $this->total_localtax1 = 0; |
| 333 | 333 | $this->total_localtax2 = 0; |
| 334 | - $this->localtax1 = 0; // For backward compatibility |
|
| 335 | - $this->localtax2 = 0; // For backward compatibility |
|
| 334 | + $this->localtax1 = 0; // For backward compatibility |
|
| 335 | + $this->localtax2 = 0; // For backward compatibility |
|
| 336 | 336 | $this->modepaymentid = 0; |
| 337 | 337 | |
| 338 | 338 | // List of language codes for status |
@@ -689,8 +689,8 @@ discard block |
||
| 689 | 689 | $this->total_ht = $obj->total_ht; |
| 690 | 690 | $this->total_tva = $obj->total_tva; |
| 691 | 691 | $this->total_ttc = $obj->total_ttc; |
| 692 | - $this->localtax1 = $obj->total_localtax1; // For backward compatibility |
|
| 693 | - $this->localtax2 = $obj->total_localtax2; // For backward compatibility |
|
| 692 | + $this->localtax1 = $obj->total_localtax1; // For backward compatibility |
|
| 693 | + $this->localtax2 = $obj->total_localtax2; // For backward compatibility |
|
| 694 | 694 | $this->total_localtax1 = $obj->total_localtax1; |
| 695 | 695 | $this->total_localtax2 = $obj->total_localtax2; |
| 696 | 696 | |
@@ -1157,7 +1157,7 @@ discard block |
||
| 1157 | 1157 | |
| 1158 | 1158 | $deplig->rule_warning_message = $objp->rule_warning_message; |
| 1159 | 1159 | |
| 1160 | - $deplig->rang = $objp->rang; |
|
| 1160 | + $deplig->rang = $objp->rang; |
|
| 1161 | 1161 | |
| 1162 | 1162 | $this->lines[$i] = $deplig; |
| 1163 | 1163 | |
@@ -1953,8 +1953,8 @@ discard block |
||
| 1953 | 1953 | $this->line = new ExpenseReportLine($this->db); |
| 1954 | 1954 | |
| 1955 | 1955 | // We don't know seller and buyer for expense reports |
| 1956 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 1957 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
| 1956 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 1957 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
| 1958 | 1958 | $buyer = new Societe($this->db); |
| 1959 | 1959 | |
| 1960 | 1960 | $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); |
@@ -2036,8 +2036,8 @@ discard block |
||
| 2036 | 2036 | |
| 2037 | 2037 | // We don't know seller and buyer for expense reports |
| 2038 | 2038 | if (!is_object($seller)) { |
| 2039 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 2040 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
| 2039 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 2040 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
| 2041 | 2041 | } |
| 2042 | 2042 | |
| 2043 | 2043 | $expensereportrule = new ExpenseReportRule($db); |
@@ -2121,8 +2121,8 @@ discard block |
||
| 2121 | 2121 | |
| 2122 | 2122 | // We don't know seller and buyer for expense reports |
| 2123 | 2123 | if (!is_object($seller)) { |
| 2124 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 2125 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
| 2124 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 2125 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
| 2126 | 2126 | } |
| 2127 | 2127 | |
| 2128 | 2128 | $expenseik = new ExpenseReportIk($this->db); |
@@ -2216,10 +2216,10 @@ discard block |
||
| 2216 | 2216 | $type = 0; // TODO What if type is service ? |
| 2217 | 2217 | |
| 2218 | 2218 | // We don't know seller and buyer for expense reports |
| 2219 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 2220 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
| 2221 | - $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
| 2222 | - $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
| 2219 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
| 2220 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
| 2221 | + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
| 2222 | + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
| 2223 | 2223 | $buyer = new Societe($this->db); |
| 2224 | 2224 | |
| 2225 | 2225 | $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); |
@@ -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'); |
@@ -2230,7 +2230,7 @@ discard block |
||
| 2230 | 2230 | |
| 2231 | 2231 | // Permit to add user company information on each printed document by setting SHOW_SOCINFO_ON_PRINT |
| 2232 | 2232 | if (getDolGlobalString('SHOW_SOCINFO_ON_PRINT') && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'aZ09'))) { |
| 2233 | - $parameters = []; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2233 | + $parameters = []; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2234 | 2234 | $reshook = $hookmanager->executeHooks('showSocinfoOnPrint', $parameters); |
| 2235 | 2235 | if (empty($reshook)) { |
| 2236 | 2236 | print '<!-- Begin show mysoc info header -->' . "\n"; |
@@ -2537,7 +2537,7 @@ discard block |
||
| 2537 | 2537 | $forceping = GETPOST('forceping', 'alpha'); |
| 2538 | 2538 | if (($_SERVER['PHP_SELF'] == DOL_URL_ROOT . '/index.php') || $forceping) { |
| 2539 | 2539 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
| 2540 | - $hash_unique_id = dol_hash('dolibarr' . $conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 2540 | + $hash_unique_id = dol_hash('dolibarr' . $conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 2541 | 2541 | |
| 2542 | 2542 | if ( |
| 2543 | 2543 | !getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
@@ -2634,7 +2634,7 @@ discard block |
||
| 2634 | 2634 | } |
| 2635 | 2635 | } |
| 2636 | 2636 | |
| 2637 | - $parameters = []; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2637 | + $parameters = []; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 2638 | 2638 | $reshook = $hookmanager->executeHooks('beforeBodyClose', $parameters); // Note that $action and $object may have been modified by some hooks |
| 2639 | 2639 | if ($reshook > 0) { |
| 2640 | 2640 | print $hookmanager->resPrint; |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | public $fields = [ |
| 42 | 42 | 'ref' => ['type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'showoncombobox' => 1, 'noteditable' => 1], |
| 43 | 43 | 'fk_product' => ['type' => 'integer:Product:product/class/product.class.php:0', 'label' => 'Product', 'enabled' => '$conf->product->enabled', 'visible' => 1, 'position' => 35, 'notnull' => 1, 'index' => 1, 'comment' => "Product to produce", 'css' => 'maxwidth300', 'csslist' => 'tdoverflowmax100', 'picto' => 'product'], |
| 44 | - 'ref_customer' => ['type' => 'varchar(128)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1,], |
|
| 45 | - 'datec' => ['type' => 'datetime', 'label' => 'AppliedPricesFrom', 'enabled' => 1, 'visible' => 1, 'position' => 500, 'notnull' => 1,], |
|
| 44 | + 'ref_customer' => ['type' => 'varchar(128)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, ], |
|
| 45 | + 'datec' => ['type' => 'datetime', 'label' => 'AppliedPricesFrom', 'enabled' => 1, 'visible' => 1, 'position' => 500, 'notnull' => 1, ], |
|
| 46 | 46 | 'price_base_type' => ['type' => 'varchar(255)', 'label' => 'PriceBase', 'enabled' => 1, 'visible' => 1, 'position' => 11, 'notnull' => -1, 'comment' => 'Price Base Type'], |
| 47 | 47 | 'tva_tx' => ['type' => 'decimal(20,6)', 'label' => 'VAT', 'enabled' => 1, 'visible' => 1, 'position' => 12, 'notnull' => -1, 'comment' => 'TVA Tax Rate'], |
| 48 | 48 | 'price' => ['type' => 'decimal(20,6)', 'label' => 'HT', 'enabled' => 1, 'visible' => 1, 'position' => 8, 'notnull' => -1, 'comment' => 'Price HT'], |
@@ -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); |