@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | return $this->LibStatut($this->status, $mode); |
459 | 459 | }*/ |
460 | 460 | |
461 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
461 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
462 | 462 | /** |
463 | 463 | * Return the label of a given status |
464 | 464 | * |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | */ |
469 | 469 | public function LibStatut($status, $mode = 0) |
470 | 470 | { |
471 | - // phpcs:enable |
|
471 | + // phpcs:enable |
|
472 | 472 | global $langs; |
473 | 473 | |
474 | 474 | if ($mode == 0) { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | if (!empty($_facrec->frequency)) { // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence. |
533 | 533 | $this->socid = $_facrec->socid; |
534 | 534 | } |
535 | - $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
535 | + $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
536 | 536 | |
537 | 537 | // Fields coming from GUI. |
538 | 538 | // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | |
816 | 816 | // Complete vat rate with code |
817 | 817 | $vatrate = $newinvoiceline->tva_tx; |
818 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) { |
|
818 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) { |
|
819 | 819 | $vatrate .= ' (' . $newinvoiceline->vat_src_code . ')'; |
820 | 820 | } |
821 | 821 | |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | $buyprice, |
1048 | 1048 | $_facrec->lines[$i]->label, |
1049 | 1049 | empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, |
1050 | - 100, // situation percent is undefined on recurring invoice lines |
|
1050 | + 100, // situation percent is undefined on recurring invoice lines |
|
1051 | 1051 | '', |
1052 | 1052 | $_facrec->lines[$i]->fk_unit, |
1053 | 1053 | $_facrec->lines[$i]->multicurrency_subprice, |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | |
1158 | 1158 | $facture->origin = $this->origin; |
1159 | 1159 | $facture->origin_id = $this->origin_id; |
1160 | - $facture->fk_account = $this->fk_account; |
|
1160 | + $facture->fk_account = $this->fk_account; |
|
1161 | 1161 | |
1162 | 1162 | $facture->lines = $this->lines; // Array of lines of invoice |
1163 | 1163 | $facture->situation_counter = $this->situation_counter; |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | { |
1632 | 1632 | global $conf, $langs, $hookmanager, $action; |
1633 | 1633 | |
1634 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
1634 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
1635 | 1635 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
1636 | 1636 | return null; |
1637 | 1637 | } |
@@ -2192,7 +2192,7 @@ discard block |
||
2192 | 2192 | $this->fk_project = $obj->fk_project; |
2193 | 2193 | $this->project = null; // Clear if another value was already set by fetch_projet |
2194 | 2194 | |
2195 | - $this->statut = $obj->status; // deprecated |
|
2195 | + $this->statut = $obj->status; // deprecated |
|
2196 | 2196 | $this->status = $obj->status; |
2197 | 2197 | |
2198 | 2198 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -3202,7 +3202,7 @@ discard block |
||
3202 | 3202 | return -1; |
3203 | 3203 | } |
3204 | 3204 | if ( |
3205 | - (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3205 | + (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3206 | 3206 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
3207 | 3207 | ) { |
3208 | 3208 | $this->date = dol_now(); |
@@ -5695,14 +5695,14 @@ discard block |
||
5695 | 5695 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5696 | 5696 | $sql .= ", " . MAIN_DB_PREFIX . "c_paiement as cp"; |
5697 | 5697 | } |
5698 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5699 | - $sql .= " AND f.fk_statut = " . self::STATUS_VALIDATED; // Only validated status |
|
5698 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
5699 | + $sql .= " AND f.fk_statut = " . self::STATUS_VALIDATED; // Only validated status |
|
5700 | 5700 | if ($datetouse == 'invoicedate') { |
5701 | 5701 | $sql .= " AND f.datef = '" . $this->db->idate($tmpidate, 'gmt') . "'"; |
5702 | 5702 | } else { |
5703 | 5703 | $sql .= " AND f.date_lim_reglement = '" . $this->db->idate($tmpidate, 'gmt') . "'"; |
5704 | 5704 | } |
5705 | - $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // One batch process only one company (no sharing) |
|
5705 | + $sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // One batch process only one company (no sharing) |
|
5706 | 5706 | if (!empty($paymentmode) && $paymentmode != 'all') { |
5707 | 5707 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '" . $this->db->escape($paymentmode) . "'"; |
5708 | 5708 | } |
@@ -5920,7 +5920,7 @@ discard block |
||
5920 | 5920 | $actioncomm->create($user); |
5921 | 5921 | } |
5922 | 5922 | |
5923 | - $this->db->commit(); // We always commit |
|
5923 | + $this->db->commit(); // We always commit |
|
5924 | 5924 | } |
5925 | 5925 | |
5926 | 5926 | if ($errormesg) { |
@@ -5962,7 +5962,7 @@ discard block |
||
5962 | 5962 | // get date of last validated invoices of same type |
5963 | 5963 | $sql = "SELECT datef"; |
5964 | 5964 | $sql .= " FROM " . MAIN_DB_PREFIX . "facture"; |
5965 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
5965 | + $sql .= " WHERE type = " . (int) $this->type; |
|
5966 | 5966 | $sql .= " AND date_valid IS NOT NULL"; |
5967 | 5967 | $sql .= " AND entity IN (" . getEntity('invoice') . ")"; |
5968 | 5968 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -2268,7 +2268,7 @@ discard block |
||
2268 | 2268 | } |
2269 | 2269 | |
2270 | 2270 | |
2271 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2271 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2272 | 2272 | /** |
2273 | 2273 | * Load all detailed lines into this->lines |
2274 | 2274 | * |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | */ |
2280 | 2280 | public function fetch_lines($only_product = 0, $loadalsotranslation = 0) |
2281 | 2281 | { |
2282 | - // phpcs:enable |
|
2282 | + // phpcs:enable |
|
2283 | 2283 | $this->lines = array(); |
2284 | 2284 | |
2285 | 2285 | $sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,'; |
@@ -2568,7 +2568,7 @@ discard block |
||
2568 | 2568 | } |
2569 | 2569 | |
2570 | 2570 | |
2571 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2571 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2572 | 2572 | /** |
2573 | 2573 | * Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount) |
2574 | 2574 | * |
@@ -2577,7 +2577,7 @@ discard block |
||
2577 | 2577 | */ |
2578 | 2578 | public function insert_discount($idremise) |
2579 | 2579 | { |
2580 | - // phpcs:enable |
|
2580 | + // phpcs:enable |
|
2581 | 2581 | global $conf, $langs; |
2582 | 2582 | |
2583 | 2583 | include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; |
@@ -2665,7 +2665,7 @@ discard block |
||
2665 | 2665 | } |
2666 | 2666 | } |
2667 | 2667 | |
2668 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2668 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2669 | 2669 | /** |
2670 | 2670 | * Set customer ref |
2671 | 2671 | * |
@@ -2675,7 +2675,7 @@ discard block |
||
2675 | 2675 | */ |
2676 | 2676 | public function set_ref_client($ref_client, $notrigger = 0) |
2677 | 2677 | { |
2678 | - // phpcs:enable |
|
2678 | + // phpcs:enable |
|
2679 | 2679 | global $user; |
2680 | 2680 | |
2681 | 2681 | $error = 0; |
@@ -2915,7 +2915,7 @@ discard block |
||
2915 | 2915 | } |
2916 | 2916 | } |
2917 | 2917 | |
2918 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2918 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2919 | 2919 | /** |
2920 | 2920 | * Tag the invoice as paid completely (if close_code is filled) => this->fk_statut=2, this->paye=1 |
2921 | 2921 | * or partially (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 |
@@ -2929,7 +2929,7 @@ discard block |
||
2929 | 2929 | */ |
2930 | 2930 | public function set_paid($user, $close_code = '', $close_note = '') |
2931 | 2931 | { |
2932 | - // phpcs:enable |
|
2932 | + // phpcs:enable |
|
2933 | 2933 | dol_syslog(get_class($this) . "::set_paid is deprecated, use setPaid instead", LOG_NOTICE); |
2934 | 2934 | return $this->setPaid($user, $close_code, $close_note); |
2935 | 2935 | } |
@@ -2996,7 +2996,7 @@ discard block |
||
2996 | 2996 | } |
2997 | 2997 | |
2998 | 2998 | |
2999 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
2999 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
3000 | 3000 | /** |
3001 | 3001 | * Tags the invoice as incompletely paid and call the trigger BILL_UNPAYED |
3002 | 3002 | * This method is used when a direct debit (fr:prelevement) is refused |
@@ -3009,7 +3009,7 @@ discard block |
||
3009 | 3009 | */ |
3010 | 3010 | public function set_unpaid($user) |
3011 | 3011 | { |
3012 | - // phpcs:enable |
|
3012 | + // phpcs:enable |
|
3013 | 3013 | dol_syslog(get_class($this) . "::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE); |
3014 | 3014 | return $this->setUnpaid($user); |
3015 | 3015 | } |
@@ -3059,7 +3059,7 @@ discard block |
||
3059 | 3059 | } |
3060 | 3060 | |
3061 | 3061 | |
3062 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
3062 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
3063 | 3063 | /** |
3064 | 3064 | * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL |
3065 | 3065 | * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because |
@@ -3074,7 +3074,7 @@ discard block |
||
3074 | 3074 | */ |
3075 | 3075 | public function set_canceled($user, $close_code = '', $close_note = '') |
3076 | 3076 | { |
3077 | - // phpcs:enable |
|
3077 | + // phpcs:enable |
|
3078 | 3078 | dol_syslog(get_class($this) . "::set_canceled is deprecated, use setCanceled instead", LOG_NOTICE); |
3079 | 3079 | return $this->setCanceled($user, $close_code, $close_note); |
3080 | 3080 | } |
@@ -4303,7 +4303,7 @@ discard block |
||
4303 | 4303 | } |
4304 | 4304 | } |
4305 | 4305 | |
4306 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4306 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4307 | 4307 | /** |
4308 | 4308 | * Update invoice line with percentage |
4309 | 4309 | * |
@@ -4314,7 +4314,7 @@ discard block |
||
4314 | 4314 | */ |
4315 | 4315 | public function update_percent($line, $percent, $update_price = true) |
4316 | 4316 | { |
4317 | - // phpcs:enable |
|
4317 | + // phpcs:enable |
|
4318 | 4318 | global $mysoc, $user; |
4319 | 4319 | |
4320 | 4320 | // Progress should never be changed for discount lines |
@@ -4411,7 +4411,7 @@ discard block |
||
4411 | 4411 | } |
4412 | 4412 | } |
4413 | 4413 | |
4414 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4414 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4415 | 4415 | /** |
4416 | 4416 | * Set percent discount |
4417 | 4417 | * |
@@ -4424,7 +4424,7 @@ discard block |
||
4424 | 4424 | */ |
4425 | 4425 | public function set_remise($user, $remise, $notrigger = 0) |
4426 | 4426 | { |
4427 | - // phpcs:enable |
|
4427 | + // phpcs:enable |
|
4428 | 4428 | dol_syslog(get_class($this) . "::set_remise is deprecated, use setDiscount instead", LOG_NOTICE); |
4429 | 4429 | // @phan-suppress-next-line PhanDeprecatedFunction |
4430 | 4430 | return $this->setDiscount($user, $remise, $notrigger); |
@@ -4493,7 +4493,7 @@ discard block |
||
4493 | 4493 | } |
4494 | 4494 | |
4495 | 4495 | |
4496 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4496 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4497 | 4497 | /** |
4498 | 4498 | * Set absolute discount |
4499 | 4499 | * |
@@ -4705,7 +4705,7 @@ discard block |
||
4705 | 4705 | } |
4706 | 4706 | |
4707 | 4707 | |
4708 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4708 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4709 | 4709 | /** |
4710 | 4710 | * Return list of invoices (eventually filtered on a user) into an array |
4711 | 4711 | * |
@@ -4721,7 +4721,7 @@ discard block |
||
4721 | 4721 | */ |
4722 | 4722 | public function liste_array($shortlist = 0, $draft = 0, $excluser = null, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'f.datef,f.rowid', $sortorder = 'DESC') |
4723 | 4723 | { |
4724 | - // phpcs:enable |
|
4724 | + // phpcs:enable |
|
4725 | 4725 | global $user; |
4726 | 4726 | |
4727 | 4727 | $ga = array(); |
@@ -4785,7 +4785,7 @@ discard block |
||
4785 | 4785 | } |
4786 | 4786 | |
4787 | 4787 | |
4788 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4788 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4789 | 4789 | /** |
4790 | 4790 | * Return list of invoices qualified to be replaced by another invoice. |
4791 | 4791 | * Invoices matching the following rules are returned: |
@@ -4796,7 +4796,7 @@ discard block |
||
4796 | 4796 | */ |
4797 | 4797 | public function list_replacable_invoices($socid = 0) |
4798 | 4798 | { |
4799 | - // phpcs:enable |
|
4799 | + // phpcs:enable |
|
4800 | 4800 | global $conf; |
4801 | 4801 | |
4802 | 4802 | $return = array(); |
@@ -4839,7 +4839,7 @@ discard block |
||
4839 | 4839 | } |
4840 | 4840 | |
4841 | 4841 | |
4842 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4842 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4843 | 4843 | /** |
4844 | 4844 | * Return list of invoices qualified to be corrected by a credit note. |
4845 | 4845 | * Invoices matching the following rules are returned: |
@@ -4850,7 +4850,7 @@ discard block |
||
4850 | 4850 | */ |
4851 | 4851 | public function list_qualified_avoir_invoices($socid = 0) |
4852 | 4852 | { |
4853 | - // phpcs:enable |
|
4853 | + // phpcs:enable |
|
4854 | 4854 | global $conf; |
4855 | 4855 | |
4856 | 4856 | $return = array(); |
@@ -4916,7 +4916,7 @@ discard block |
||
4916 | 4916 | } |
4917 | 4917 | |
4918 | 4918 | |
4919 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4919 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
4920 | 4920 | /** |
4921 | 4921 | * Load indicators for dashboard (this->nbtodo and this->nbtodolate) |
4922 | 4922 | * |
@@ -4925,7 +4925,7 @@ discard block |
||
4925 | 4925 | */ |
4926 | 4926 | public function load_board($user) |
4927 | 4927 | { |
4928 | - // phpcs:enable |
|
4928 | + // phpcs:enable |
|
4929 | 4929 | global $conf, $langs; |
4930 | 4930 | |
4931 | 4931 | $clause = " WHERE"; |
@@ -5278,7 +5278,7 @@ discard block |
||
5278 | 5278 | } |
5279 | 5279 | } |
5280 | 5280 | |
5281 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
5281 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
5282 | 5282 | /** |
5283 | 5283 | * Checks if the invoice is the first of a cycle |
5284 | 5284 | * |
@@ -5286,11 +5286,11 @@ discard block |
||
5286 | 5286 | */ |
5287 | 5287 | public function is_first() |
5288 | 5288 | { |
5289 | - // phpcs:enable |
|
5289 | + // phpcs:enable |
|
5290 | 5290 | return ($this->situation_counter == 1); |
5291 | 5291 | } |
5292 | 5292 | |
5293 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
5293 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
5294 | 5294 | /** |
5295 | 5295 | * Returns an array containing the previous situations as Facture objects |
5296 | 5296 | * |
@@ -5298,7 +5298,7 @@ discard block |
||
5298 | 5298 | */ |
5299 | 5299 | public function get_prev_sits() |
5300 | 5300 | { |
5301 | - // phpcs:enable |
|
5301 | + // phpcs:enable |
|
5302 | 5302 | global $conf; |
5303 | 5303 | |
5304 | 5304 | $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture'; |
@@ -5367,7 +5367,7 @@ discard block |
||
5367 | 5367 | } |
5368 | 5368 | } |
5369 | 5369 | |
5370 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
5370 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
5371 | 5371 | /** |
5372 | 5372 | * Checks if the invoice is the last in its cycle |
5373 | 5373 | * |
@@ -5375,7 +5375,7 @@ discard block |
||
5375 | 5375 | */ |
5376 | 5376 | public function is_last_in_cycle() |
5377 | 5377 | { |
5378 | - // phpcs:enable |
|
5378 | + // phpcs:enable |
|
5379 | 5379 | global $conf; |
5380 | 5380 | |
5381 | 5381 | if (!empty($this->situation_cycle_ref)) { |
@@ -738,8 +738,8 @@ |
||
738 | 738 | |
739 | 739 | // if dolibarr currency != bank currency then we received an amount in customer currency (currently I don't manage the case : my currency is USD, the customer currency is EUR and he paid me in GBP. Seems no sense for me) |
740 | 740 | if (isModEnabled('multicurrency') && $conf->currency != $acc->currency_code) { |
741 | - $totalamount = $this->multicurrency_amount; // We will insert into llx_bank.amount in foreign currency |
|
742 | - $totalamount_main_currency = $this->amount; // We will also save the amount in main currency into column llx_bank.amount_main_currency |
|
741 | + $totalamount = $this->multicurrency_amount; // We will insert into llx_bank.amount in foreign currency |
|
742 | + $totalamount_main_currency = $this->amount; // We will also save the amount in main currency into column llx_bank.amount_main_currency |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | if ($mode == 'payment_supplier') { |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | } |
887 | 887 | |
888 | 888 | |
889 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
889 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
890 | 890 | /** |
891 | 891 | * Mise a jour du lien entre le paiement et la ligne generee dans llx_bank |
892 | 892 | * |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | */ |
896 | 896 | public function update_fk_bank($id_bank) |
897 | 897 | { |
898 | - // phpcs:enable |
|
898 | + // phpcs:enable |
|
899 | 899 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' set fk_bank = ' . ((int) $id_bank); |
900 | 900 | $sql .= " WHERE rowid = " . ((int) $this->id); |
901 | 901 | |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | } |
911 | 911 | } |
912 | 912 | |
913 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
913 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
914 | 914 | /** |
915 | 915 | * Updates the payment date |
916 | 916 | * |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | */ |
920 | 920 | public function update_date($date) |
921 | 921 | { |
922 | - // phpcs:enable |
|
922 | + // phpcs:enable |
|
923 | 923 | $error = 0; |
924 | 924 | |
925 | 925 | if (!empty($date) && $this->statut != 1) { |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | return -1; //no date given or already validated |
968 | 968 | } |
969 | 969 | |
970 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
970 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
971 | 971 | /** |
972 | 972 | * Updates the payment number |
973 | 973 | * |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | */ |
977 | 977 | public function update_num($num_payment) |
978 | 978 | { |
979 | - // phpcs:enable |
|
979 | + // phpcs:enable |
|
980 | 980 | if (!empty($num_payment) && $this->statut != 1) { |
981 | 981 | $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element; |
982 | 982 | $sql .= " SET num_paiement = '" . $this->db->escape($num_payment) . "'"; |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | return $this->LibStatut($this->statut, $mode); |
1374 | 1374 | } |
1375 | 1375 | |
1376 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1376 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1377 | 1377 | /** |
1378 | 1378 | * Return the label of a given status |
1379 | 1379 | * |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | */ |
1384 | 1384 | public function LibStatut($status, $mode = 0) |
1385 | 1385 | { |
1386 | - // phpcs:enable |
|
1386 | + // phpcs:enable |
|
1387 | 1387 | global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage |
1388 | 1388 | |
1389 | 1389 | $langs->load('compta'); |
@@ -1425,7 +1425,7 @@ discard block |
||
1425 | 1425 | return ''; |
1426 | 1426 | } |
1427 | 1427 | |
1428 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1428 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1429 | 1429 | /** |
1430 | 1430 | * Load the third party of object, from id into this->thirdparty. |
1431 | 1431 | * For payments, take the thirdparty linked to the first invoice found. This is enough because payments are done on invoices of the same thirdparty. |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | */ |
1436 | 1436 | public function fetch_thirdparty($force_thirdparty_id = 0) |
1437 | 1437 | { |
1438 | - // phpcs:enable |
|
1438 | + // phpcs:enable |
|
1439 | 1439 | |
1440 | 1440 | if (empty($force_thirdparty_id)) { |
1441 | 1441 | $billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first supplier invoice to get him |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
148 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
149 | 149 | /** |
150 | 150 | * Return list of event types: array(id=>label) or array(code=>label) |
151 | 151 | * |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0) |
161 | 161 | { |
162 | - // phpcs:enable |
|
162 | + // phpcs:enable |
|
163 | 163 | global $langs, $conf, $user; |
164 | 164 | $langs->load("commercial"); |
165 | 165 |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | } |
264 | 264 | } |
265 | 265 | // For the case type is not 'system...' neither 'module', we just check module is on |
266 | - if (! in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) { |
|
266 | + if (!in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) { |
|
267 | 267 | $tmpmodule = $obj->module; |
268 | 268 | //var_dump($tmpmodule); |
269 | 269 | if ($tmpmodule && isset($conf->$tmpmodule) && isModEnabled($tmpmodule)) { |
@@ -351,10 +351,10 @@ discard block |
||
351 | 351 | $idorcode = 'all'; |
352 | 352 | } |
353 | 353 | $TType = $TSystem[$idorcode]; |
354 | - if (! empty($TSystemAuto[$idorcode])) { |
|
354 | + if (!empty($TSystemAuto[$idorcode])) { |
|
355 | 355 | $TType = array_merge($TType, $TSystemAuto[$idorcode]); |
356 | 356 | } |
357 | - if (! empty($TModule[$idorcode])) { |
|
357 | + if (!empty($TModule[$idorcode])) { |
|
358 | 358 | $TType = array_merge($TType, $TModule[$idorcode]); |
359 | 359 | } |
360 | 360 | $this->liste_array = $TType; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
268 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
269 | 269 | /** |
270 | 270 | * Load object in memory from the database |
271 | 271 | * |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | public function fetch_by_mailing($id = 0) |
276 | 276 | { |
277 | - // phpcs:enable |
|
277 | + // phpcs:enable |
|
278 | 278 | global $langs; |
279 | 279 | $sql = "SELECT"; |
280 | 280 | $sql .= " t.rowid,"; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | |
329 | 329 | |
330 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
330 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
331 | 331 | /** |
332 | 332 | * Load object in memory from the database |
333 | 333 | * |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | */ |
338 | 338 | public function fetch_by_element($id = 0, $type_element = 'mailing') |
339 | 339 | { |
340 | - // phpcs:enable |
|
340 | + // phpcs:enable |
|
341 | 341 | global $langs; |
342 | 342 | $sql = "SELECT"; |
343 | 343 | $sql .= " t.rowid,"; |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | |
521 | 521 | |
522 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
522 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
523 | 523 | /** |
524 | 524 | * Load object in memory from database |
525 | 525 | * |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | */ |
529 | 529 | public function query_thirdparty($arrayquery) |
530 | 530 | { |
531 | - // phpcs:enable |
|
531 | + // phpcs:enable |
|
532 | 532 | global $langs, $conf, $extrafields; |
533 | 533 | |
534 | 534 | $sql = "SELECT"; |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | } |
677 | 677 | } |
678 | 678 | |
679 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
679 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
680 | 680 | /** |
681 | 681 | * Load object in memory from database |
682 | 682 | * |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | */ |
687 | 687 | public function query_contact($arrayquery, $withThirdpartyFilter = 0) |
688 | 688 | { |
689 | - // phpcs:enable |
|
689 | + // phpcs:enable |
|
690 | 690 | global $langs, $conf; |
691 | 691 | |
692 | 692 | $sql = "SELECT"; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | return $this->LibStatut($this->status, $mode); |
227 | 227 | } |
228 | 228 | |
229 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
229 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
230 | 230 | /** |
231 | 231 | * Return the status |
232 | 232 | * |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public static function LibStatut($status, $mode = 0) |
238 | 238 | { |
239 | - // phpcs:enable |
|
239 | + // phpcs:enable |
|
240 | 240 | global $langs; |
241 | 241 | |
242 | 242 | $labelStatus = $langs->transnoentitiesnoconv('ToDo'); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | } |
87 | 87 | |
88 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
88 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
89 | 89 | /** |
90 | 90 | * Read text file, icalender text file |
91 | 91 | * |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function read_file($file) |
96 | 96 | { |
97 | - // phpcs:enable |
|
97 | + // phpcs:enable |
|
98 | 98 | $this->file = $file; |
99 | 99 | $file_text = ''; |
100 | 100 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | return $file_text; // return all text |
112 | 112 | } |
113 | 113 | |
114 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
114 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
115 | 115 | /** |
116 | 116 | * Returns the number of calendar events |
117 | 117 | * |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function get_event_count() |
121 | 121 | { |
122 | - // phpcs:enable |
|
122 | + // phpcs:enable |
|
123 | 123 | return $this->event_count; |
124 | 124 | } |
125 | 125 | |
126 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
126 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
127 | 127 | /** |
128 | 128 | * Returns the number of to do |
129 | 129 | * |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function get_todo_count() |
133 | 133 | { |
134 | - // phpcs:enable |
|
134 | + // phpcs:enable |
|
135 | 135 | return $this->todo_count; |
136 | 136 | } |
137 | 137 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | return $this->cal; |
262 | 262 | } |
263 | 263 | |
264 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
264 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
265 | 265 | /** |
266 | 266 | * Add to $this->ical array one value and key. |
267 | 267 | * |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function add_to_array($type, $key, $value) |
274 | 274 | { |
275 | - // phpcs:enable |
|
275 | + // phpcs:enable |
|
276 | 276 | |
277 | 277 | //print 'type='.$type.' key='.$key.' value='.$value.'<br>'."\n"; |
278 | 278 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $this->last_key = $key; |
325 | 325 | } |
326 | 326 | |
327 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
327 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
328 | 328 | /** |
329 | 329 | * Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value"); |
330 | 330 | * |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | */ |
334 | 334 | public function retun_key_value($text) |
335 | 335 | { |
336 | - // phpcs:enable |
|
336 | + // phpcs:enable |
|
337 | 337 | /* |
338 | 338 | preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches); |
339 | 339 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | return explode(':', $text, 2); |
350 | 350 | } |
351 | 351 | |
352 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
352 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
353 | 353 | /** |
354 | 354 | * Parse RRULE return array |
355 | 355 | * |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function ical_rrule($value) |
360 | 360 | { |
361 | - // phpcs:enable |
|
361 | + // phpcs:enable |
|
362 | 362 | $result = array(); |
363 | 363 | $rrule = explode(';', $value); |
364 | 364 | foreach ($rrule as $line) { |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | return $result; |
369 | 369 | } |
370 | 370 | |
371 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
371 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
372 | 372 | /** |
373 | 373 | * Return Unix time from ical date time format (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) |
374 | 374 | * |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | */ |
378 | 378 | public function ical_date_to_unix($ical_date) |
379 | 379 | { |
380 | - // phpcs:enable |
|
380 | + // phpcs:enable |
|
381 | 381 | $ical_date = str_replace('T', '', $ical_date); |
382 | 382 | $ical_date = str_replace('Z', '', $ical_date); |
383 | 383 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | return $ntime; // ntime is a GTM time |
394 | 394 | } |
395 | 395 | |
396 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
396 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
397 | 397 | /** |
398 | 398 | * Return unix date from iCal date format |
399 | 399 | * |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | */ |
404 | 404 | public function ical_dt_date($key, $value) |
405 | 405 | { |
406 | - // phpcs:enable |
|
406 | + // phpcs:enable |
|
407 | 407 | $return_value = array(); |
408 | 408 | |
409 | 409 | // Analyse TZID |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | return array($key, $return_value); |
425 | 425 | } |
426 | 426 | |
427 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
427 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
428 | 428 | /** |
429 | 429 | * Return sorted eventlist as array or false if calendar is empty |
430 | 430 | * |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | */ |
433 | 433 | public function get_sort_event_list() |
434 | 434 | { |
435 | - // phpcs:enable |
|
435 | + // phpcs:enable |
|
436 | 436 | $temp = $this->get_event_list(); |
437 | 437 | if (!empty($temp)) { |
438 | 438 | usort($temp, array(&$this, "ical_dtstart_compare")); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | } |
443 | 443 | } |
444 | 444 | |
445 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
445 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
446 | 446 | /** |
447 | 447 | * Compare two unix timestamp |
448 | 448 | * |
@@ -452,11 +452,11 @@ discard block |
||
452 | 452 | */ |
453 | 453 | public function ical_dtstart_compare($a, $b) |
454 | 454 | { |
455 | - // phpcs:enable |
|
455 | + // phpcs:enable |
|
456 | 456 | return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']); |
457 | 457 | } |
458 | 458 | |
459 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
459 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
460 | 460 | /** |
461 | 461 | * Return eventlist array (not sorted eventlist array) |
462 | 462 | * |
@@ -464,11 +464,11 @@ discard block |
||
464 | 464 | */ |
465 | 465 | public function get_event_list() |
466 | 466 | { |
467 | - // phpcs:enable |
|
467 | + // phpcs:enable |
|
468 | 468 | return (empty($this->cal['VEVENT']) ? array() : $this->cal['VEVENT']); |
469 | 469 | } |
470 | 470 | |
471 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
471 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
472 | 472 | /** |
473 | 473 | * Return freebusy array (not sort eventlist array) |
474 | 474 | * |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | */ |
477 | 477 | public function get_freebusy_list() |
478 | 478 | { |
479 | - // phpcs:enable |
|
479 | + // phpcs:enable |
|
480 | 480 | return (empty($this->cal['VFREEBUSY']) ? array() : $this->cal['VFREEBUSY']); |
481 | 481 | } |
482 | 482 | |
483 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
483 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
484 | 484 | /** |
485 | 485 | * Return to do array (not sorted todo array) |
486 | 486 | * |
@@ -488,11 +488,11 @@ discard block |
||
488 | 488 | */ |
489 | 489 | public function get_todo_list() |
490 | 490 | { |
491 | - // phpcs:enable |
|
491 | + // phpcs:enable |
|
492 | 492 | return $this->cal['VTODO']; |
493 | 493 | } |
494 | 494 | |
495 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
495 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
496 | 496 | /** |
497 | 497 | * Return base calendar data |
498 | 498 | * |
@@ -500,11 +500,11 @@ discard block |
||
500 | 500 | */ |
501 | 501 | public function get_calender_data() |
502 | 502 | { |
503 | - // phpcs:enable |
|
503 | + // phpcs:enable |
|
504 | 504 | return $this->cal['VCALENDAR']; |
505 | 505 | } |
506 | 506 | |
507 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
507 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
508 | 508 | /** |
509 | 509 | * Return array with all data |
510 | 510 | * |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | */ |
513 | 513 | public function get_all_data() |
514 | 514 | { |
515 | - // phpcs:enable |
|
515 | + // phpcs:enable |
|
516 | 516 | return $this->cal; |
517 | 517 | } |
518 | 518 | } |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | public $fin_validite; // code |
195 | 195 | public $user_author_id; // label |
196 | 196 | /** |
197 | - * @deprecated |
|
198 | - * @see $total_ht |
|
199 | - */ |
|
197 | + * @deprecated |
|
198 | + * @see $total_ht |
|
199 | + */ |
|
200 | 200 | public $price; // label doc |
201 | 201 | /** |
202 | 202 | * @deprecated |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public $tva; // code |
206 | 206 | /** |
207 | - * @deprecated |
|
208 | - * @see $total_ttc |
|
209 | - */ |
|
207 | + * @deprecated |
|
208 | + * @see $total_ttc |
|
209 | + */ |
|
210 | 210 | public $total; // label |
211 | 211 | public $cond_reglement_code; |
212 | 212 | public $cond_reglement; |
@@ -226,14 +226,14 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public $availability_id; // id |
228 | 228 | /** |
229 | - * @var int availability ID |
|
230 | - * @deprecated |
|
231 | - * @see $availability_id |
|
232 | - */ |
|
229 | + * @var int availability ID |
|
230 | + * @deprecated |
|
231 | + * @see $availability_id |
|
232 | + */ |
|
233 | 233 | public $fk_availability; // code |
234 | 234 | /** |
235 | - * @var string availability code |
|
236 | - */ |
|
235 | + * @var string availability code |
|
236 | + */ |
|
237 | 237 | public $availability_code; // label |
238 | 238 | /** |
239 | 239 | * @var string availability label |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 900), |
339 | 339 | ); |
340 | 340 | /** |
341 | - * {@inheritdoc} |
|
342 | - */ |
|
341 | + * {@inheritdoc} |
|
342 | + */ |
|
343 | 343 | protected $table_ref_field = 'ref'; // Todo rename into STATUS_CLOSE ? |
344 | 344 | |
345 | 345 | /** |
@@ -191,23 +191,23 @@ discard block |
||
191 | 191 | * @var integer|string $delivery_date ; |
192 | 192 | */ |
193 | 193 | public $delivery_date; |
194 | - public $fin_validite; // code |
|
195 | - public $user_author_id; // label |
|
194 | + public $fin_validite; // code |
|
195 | + public $user_author_id; // label |
|
196 | 196 | /** |
197 | 197 | * @deprecated |
198 | 198 | * @see $total_ht |
199 | 199 | */ |
200 | - public $price; // label doc |
|
200 | + public $price; // label doc |
|
201 | 201 | /** |
202 | 202 | * @deprecated |
203 | 203 | * @see $total_tva |
204 | 204 | */ |
205 | - public $tva; // code |
|
205 | + public $tva; // code |
|
206 | 206 | /** |
207 | 207 | * @deprecated |
208 | 208 | * @see $total_ttc |
209 | 209 | */ |
210 | - public $total; // label |
|
210 | + public $total; // label |
|
211 | 211 | public $cond_reglement_code; |
212 | 212 | public $cond_reglement; |
213 | 213 | public $cond_reglement_doc; |
@@ -224,17 +224,17 @@ discard block |
||
224 | 224 | /** |
225 | 225 | * @var int availability ID |
226 | 226 | */ |
227 | - public $availability_id; // id |
|
227 | + public $availability_id; // id |
|
228 | 228 | /** |
229 | 229 | * @var int availability ID |
230 | 230 | * @deprecated |
231 | 231 | * @see $availability_id |
232 | 232 | */ |
233 | - public $fk_availability; // code |
|
233 | + public $fk_availability; // code |
|
234 | 234 | /** |
235 | 235 | * @var string availability code |
236 | 236 | */ |
237 | - public $availability_code; // label |
|
237 | + public $availability_code; // label |
|
238 | 238 | /** |
239 | 239 | * @var string availability label |
240 | 240 | */ |
@@ -513,14 +513,14 @@ discard block |
||
513 | 513 | |
514 | 514 | if (!empty($ref)) { |
515 | 515 | if (!empty($forceentity)) { |
516 | - $sql .= " WHERE p.entity = " . (int)$forceentity; // Check only the current entity because we may have the same reference in several entities |
|
516 | + $sql .= " WHERE p.entity = " . (int) $forceentity; // Check only the current entity because we may have the same reference in several entities |
|
517 | 517 | } else { |
518 | 518 | $sql .= " WHERE p.entity IN (" . getEntity('propal') . ")"; |
519 | 519 | } |
520 | 520 | $sql .= " AND p.ref='" . $this->db->escape($ref) . "'"; |
521 | 521 | } else { |
522 | 522 | // Don't use entity if you use rowid |
523 | - $sql .= " WHERE p.rowid = " . ((int)$rowid); |
|
523 | + $sql .= " WHERE p.rowid = " . ((int) $rowid); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | $this->ref_customer = $obj->ref_client; |
538 | 538 | $this->ref_ext = $obj->ref_ext; |
539 | 539 | |
540 | - $this->total = $obj->total_ttc; // TODO deprecated |
|
540 | + $this->total = $obj->total_ttc; // TODO deprecated |
|
541 | 541 | $this->total_ttc = $obj->total_ttc; |
542 | 542 | $this->total_ht = $obj->total_ht; |
543 | 543 | $this->total_tva = $obj->total_tva; |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | $this->note_private = $obj->note_private; |
557 | 557 | $this->note_public = $obj->note_public; |
558 | 558 | |
559 | - $this->status = (int)$obj->fk_statut; |
|
559 | + $this->status = (int) $obj->fk_statut; |
|
560 | 560 | $this->statut = $this->status; // deprecated |
561 | 561 | |
562 | 562 | $this->datec = $this->db->jdate($obj->datec); // TODO deprecated |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; |
590 | 590 | $this->deposit_percent = $obj->deposit_percent; |
591 | 591 | |
592 | - $this->extraparams = !empty($obj->extraparams) ? (array)json_decode($obj->extraparams, true) : array(); |
|
592 | + $this->extraparams = !empty($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array(); |
|
593 | 593 | |
594 | 594 | $this->user_author_id = $obj->fk_user_author; |
595 | 595 | $this->user_validation_id = $obj->fk_user_valid; |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | $sql .= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; |
656 | 656 | $sql .= ' FROM ' . MAIN_DB_PREFIX . 'propaldet as d'; |
657 | 657 | $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product as p ON (d.fk_product = p.rowid)'; |
658 | - $sql .= ' WHERE d.fk_propal = ' . ((int)$this->id); |
|
658 | + $sql .= ' WHERE d.fk_propal = ' . ((int) $this->id); |
|
659 | 659 | if ($only_product) { |
660 | 660 | $sql .= ' AND p.fk_product_type = 0'; |
661 | 661 | } |
@@ -875,10 +875,10 @@ discard block |
||
875 | 875 | |
876 | 876 | // Clean parameters |
877 | 877 | $remise_percent = price2num($remise_percent); |
878 | - $qty = (float)price2num($qty); |
|
878 | + $qty = (float) price2num($qty); |
|
879 | 879 | $pu = price2num($pu); |
880 | 880 | $pu_ht_devise = price2num($pu_ht_devise); |
881 | - if (!preg_match('/\((.*)\)/', (string)$txtva)) { |
|
881 | + if (!preg_match('/\((.*)\)/', (string) $txtva)) { |
|
882 | 882 | $txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' |
883 | 883 | } |
884 | 884 | $txlocaltax1 = price2num($txlocaltax1); |
@@ -939,9 +939,9 @@ discard block |
||
939 | 939 | // Anciens indicateurs: $price, $remise (a ne plus utiliser) |
940 | 940 | $price = $pu; |
941 | 941 | $remise = 0; |
942 | - if ((float)$remise_percent > 0) { |
|
943 | - $remise = round(((float)$pu * (float)$remise_percent / 100), 2); |
|
944 | - $price = (float)$pu - $remise; |
|
942 | + if ((float) $remise_percent > 0) { |
|
943 | + $remise = round(((float) $pu * (float) $remise_percent / 100), 2); |
|
944 | + $price = (float) $pu - $remise; |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | //Fetch current line from the database and then clone the object and set it in $oldline property |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | $sql .= " note_public=" . (isset($this->note_public) ? "'" . $this->db->escape($this->note_public) . "'" : "null") . ","; |
1100 | 1100 | $sql .= " model_pdf=" . (isset($this->model_pdf) ? "'" . $this->db->escape($this->model_pdf) . "'" : "null") . ","; |
1101 | 1101 | $sql .= " import_key=" . (isset($this->import_key) ? "'" . $this->db->escape($this->import_key) . "'" : "null"); |
1102 | - $sql .= " WHERE rowid=" . ((int)$this->id); |
|
1102 | + $sql .= " WHERE rowid=" . ((int) $this->id); |
|
1103 | 1103 | |
1104 | 1104 | $this->db->begin(); |
1105 | 1105 | |
@@ -1218,8 +1218,8 @@ discard block |
||
1218 | 1218 | // Delete extrafields of lines and lines |
1219 | 1219 | if (!$error && !empty($this->table_element_line)) { |
1220 | 1220 | $tabletodelete = $this->table_element_line; |
1221 | - $sqlef = "DELETE FROM " . MAIN_DB_PREFIX . $tabletodelete . "_extrafields WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . $tabletodelete . " WHERE " . $this->fk_element . " = " . ((int)$this->id) . ")"; |
|
1222 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $tabletodelete . " WHERE " . $this->fk_element . " = " . ((int)$this->id); |
|
1221 | + $sqlef = "DELETE FROM " . MAIN_DB_PREFIX . $tabletodelete . "_extrafields WHERE fk_object IN (SELECT rowid FROM " . MAIN_DB_PREFIX . $tabletodelete . " WHERE " . $this->fk_element . " = " . ((int) $this->id) . ")"; |
|
1222 | + $sql = "DELETE FROM " . MAIN_DB_PREFIX . $tabletodelete . " WHERE " . $this->fk_element . " = " . ((int) $this->id); |
|
1223 | 1223 | if (!$this->db->query($sqlef) || !$this->db->query($sql)) { |
1224 | 1224 | $error++; |
1225 | 1225 | $this->error = $this->db->lasterror(); |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | |
1256 | 1256 | // Delete main record |
1257 | 1257 | if (!$error) { |
1258 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int)$this->id); |
|
1258 | + $sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int) $this->id); |
|
1259 | 1259 | $res = $this->db->query($sql); |
1260 | 1260 | if (!$res) { |
1261 | 1261 | $error++; |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | } |
1292 | 1292 | } |
1293 | 1293 | if (file_exists($dir)) { |
1294 | - $res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables |
|
1294 | + $res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables |
|
1295 | 1295 | if (!$res) { |
1296 | 1296 | $this->error = 'ErrorFailToDeleteDir'; |
1297 | 1297 | $this->errors[] = $this->error; |
@@ -1612,15 +1612,15 @@ discard block |
||
1612 | 1612 | $sql .= ", '" . $this->db->idate($this->date) . "'"; |
1613 | 1613 | $sql .= ", '" . $this->db->idate($now) . "'"; |
1614 | 1614 | $sql .= ", '(PROV)'"; |
1615 | - $sql .= ", " . ($user->id > 0 ? ((int)$user->id) : "NULL"); |
|
1615 | + $sql .= ", " . ($user->id > 0 ? ((int) $user->id) : "NULL"); |
|
1616 | 1616 | $sql .= ", '" . $this->db->escape($this->note_private) . "'"; |
1617 | 1617 | $sql .= ", '" . $this->db->escape($this->note_public) . "'"; |
1618 | 1618 | $sql .= ", '" . $this->db->escape($this->model_pdf) . "'"; |
1619 | 1619 | $sql .= ", " . ($this->fin_validite != '' ? "'" . $this->db->idate($this->fin_validite) . "'" : "NULL"); |
1620 | - $sql .= ", " . ($this->cond_reglement_id > 0 ? ((int)$this->cond_reglement_id) : 'NULL'); |
|
1620 | + $sql .= ", " . ($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : 'NULL'); |
|
1621 | 1621 | $sql .= ", " . (!empty($this->deposit_percent) ? "'" . $this->db->escape($this->deposit_percent) . "'" : 'NULL'); |
1622 | - $sql .= ", " . ($this->mode_reglement_id > 0 ? ((int)$this->mode_reglement_id) : 'NULL'); |
|
1623 | - $sql .= ", " . ($this->fk_account > 0 ? ((int)$this->fk_account) : 'NULL'); |
|
1622 | + $sql .= ", " . ($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : 'NULL'); |
|
1623 | + $sql .= ", " . ($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); |
|
1624 | 1624 | $sql .= ", '" . $this->db->escape($this->ref_client) . "'"; |
1625 | 1625 | $sql .= ", '" . $this->db->escape($this->ref_ext) . "'"; |
1626 | 1626 | $sql .= ", " . (empty($delivery_date) ? "NULL" : "'" . $this->db->idate($delivery_date) . "'"); |
@@ -1629,12 +1629,12 @@ discard block |
||
1629 | 1629 | $sql .= ", " . $this->availability_id; |
1630 | 1630 | $sql .= ", " . $this->demand_reason_id; |
1631 | 1631 | $sql .= ", " . ($this->fk_project ? $this->fk_project : "null"); |
1632 | - $sql .= ", " . (int)$this->fk_incoterms; |
|
1632 | + $sql .= ", " . (int) $this->fk_incoterms; |
|
1633 | 1633 | $sql .= ", '" . $this->db->escape($this->location_incoterms) . "'"; |
1634 | 1634 | $sql .= ", " . setEntity($this); |
1635 | - $sql .= ", " . (int)$this->fk_multicurrency; |
|
1635 | + $sql .= ", " . (int) $this->fk_multicurrency; |
|
1636 | 1636 | $sql .= ", '" . $this->db->escape($this->multicurrency_code) . "'"; |
1637 | - $sql .= ", " . (float)$this->multicurrency_tx; |
|
1637 | + $sql .= ", " . (float) $this->multicurrency_tx; |
|
1638 | 1638 | $sql .= ")"; |
1639 | 1639 | |
1640 | 1640 | dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | |
1645 | 1645 | if ($this->id) { |
1646 | 1646 | $this->ref = '(PROV' . $this->id . ')'; |
1647 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . "propal SET ref='" . $this->db->escape($this->ref) . "' WHERE rowid=" . ((int)$this->id); |
|
1647 | + $sql = 'UPDATE ' . MAIN_DB_PREFIX . "propal SET ref='" . $this->db->escape($this->ref) . "' WHERE rowid=" . ((int) $this->id); |
|
1648 | 1648 | |
1649 | 1649 | dol_syslog(get_class($this) . "::create", LOG_DEBUG); |
1650 | 1650 | $resql = $this->db->query($sql); |
@@ -1689,7 +1689,7 @@ discard block |
||
1689 | 1689 | for ($i = 0; $i < $num; $i++) { |
1690 | 1690 | if (!is_object($this->lines[$i])) { // If this->lines is not array of objects, coming from REST API |
1691 | 1691 | // Convert into object this->lines[$i]. |
1692 | - $line = (object)$this->lines[$i]; |
|
1692 | + $line = (object) $this->lines[$i]; |
|
1693 | 1693 | } else { |
1694 | 1694 | $line = $this->lines[$i]; |
1695 | 1695 | } |
@@ -1882,11 +1882,11 @@ discard block |
||
1882 | 1882 | } |
1883 | 1883 | |
1884 | 1884 | $remise_percent = price2num($remise_percent); |
1885 | - $qty = (float)price2num($qty); |
|
1885 | + $qty = (float) price2num($qty); |
|
1886 | 1886 | $pu_ht = price2num($pu_ht); |
1887 | 1887 | $pu_ht_devise = price2num($pu_ht_devise); |
1888 | 1888 | $pu_ttc = price2num($pu_ttc); |
1889 | - if (!preg_match('/\((.*)\)/', (string)$txtva)) { |
|
1889 | + if (!preg_match('/\((.*)\)/', (string) $txtva)) { |
|
1890 | 1890 | $txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1' |
1891 | 1891 | } |
1892 | 1892 | $txlocaltax1 = price2num($txlocaltax1); |
@@ -1968,9 +1968,9 @@ discard block |
||
1968 | 1968 | // Anciens indicateurs: $price, $remise (a ne plus utiliser) |
1969 | 1969 | $price = $pu; |
1970 | 1970 | $remise = 0; |
1971 | - if ((float)$remise_percent > 0) { |
|
1972 | - $remise = round(((float)$pu * (float)$remise_percent / 100), 2); |
|
1973 | - $price = (float)$pu - $remise; |
|
1971 | + if ((float) $remise_percent > 0) { |
|
1972 | + $remise = round(((float) $pu * (float) $remise_percent / 100), 2); |
|
1973 | + $price = (float) $pu - $remise; |
|
1974 | 1974 | } |
1975 | 1975 | |
1976 | 1976 | // Insert line |
@@ -2121,8 +2121,8 @@ discard block |
||
2121 | 2121 | |
2122 | 2122 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal"; |
2123 | 2123 | $sql .= " SET ref = '" . $this->db->escape($num) . "',"; |
2124 | - $sql .= " fk_statut = " . self::STATUS_VALIDATED . ", date_valid='" . $this->db->idate($now) . "', fk_user_valid=" . ((int)$user->id); |
|
2125 | - $sql .= " WHERE rowid = " . ((int)$this->id) . " AND fk_statut = " . self::STATUS_DRAFT; |
|
2124 | + $sql .= " fk_statut = " . self::STATUS_VALIDATED . ", date_valid='" . $this->db->idate($now) . "', fk_user_valid=" . ((int) $user->id); |
|
2125 | + $sql .= " WHERE rowid = " . ((int) $this->id) . " AND fk_statut = " . self::STATUS_DRAFT; |
|
2126 | 2126 | |
2127 | 2127 | dol_syslog(get_class($this) . "::valid", LOG_DEBUG); |
2128 | 2128 | $resql = $this->db->query($sql); |
@@ -2148,7 +2148,7 @@ discard block |
||
2148 | 2148 | if (preg_match('/^[\(]?PROV/i', $this->ref)) { |
2149 | 2149 | // Now we rename also files into index |
2150 | 2150 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'propale/" . $this->db->escape($this->newref) . "'"; |
2151 | - $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'propale/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity); |
|
2151 | + $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'propale/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity); |
|
2152 | 2152 | $resql = $this->db->query($sql); |
2153 | 2153 | if (!$resql) { |
2154 | 2154 | $error++; |
@@ -2219,12 +2219,12 @@ discard block |
||
2219 | 2219 | $file = $classname . ".php"; |
2220 | 2220 | |
2221 | 2221 | // Include file with class |
2222 | - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); |
|
2222 | + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
|
2223 | 2223 | foreach ($dirmodels as $reldir) { |
2224 | 2224 | $dir = dol_buildpath($reldir . "core/modules/propale/"); |
2225 | 2225 | |
2226 | 2226 | // Load file with numbering class (if found) |
2227 | - $mybool = ((bool)@include_once $dir . $file) || $mybool; |
|
2227 | + $mybool = ((bool) @include_once $dir . $file) || $mybool; |
|
2228 | 2228 | } |
2229 | 2229 | |
2230 | 2230 | if (!$mybool) { |
@@ -2275,7 +2275,7 @@ discard block |
||
2275 | 2275 | $this->db->begin(); |
2276 | 2276 | |
2277 | 2277 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal SET datep = '" . $this->db->idate($date) . "'"; |
2278 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2278 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2279 | 2279 | |
2280 | 2280 | dol_syslog(__METHOD__, LOG_DEBUG); |
2281 | 2281 | $resql = $this->db->query($sql); |
@@ -2334,7 +2334,7 @@ discard block |
||
2334 | 2334 | $this->db->begin(); |
2335 | 2335 | |
2336 | 2336 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal SET fin_validite = " . ($date_end_validity != '' ? "'" . $this->db->idate($date_end_validity) . "'" : 'null'); |
2337 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2337 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2338 | 2338 | |
2339 | 2339 | dol_syslog(__METHOD__, LOG_DEBUG); |
2340 | 2340 | |
@@ -2409,7 +2409,7 @@ discard block |
||
2409 | 2409 | |
2410 | 2410 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal "; |
2411 | 2411 | $sql .= " SET date_livraison = " . ($delivery_date != '' ? "'" . $this->db->idate($delivery_date) . "'" : 'null'); |
2412 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2412 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2413 | 2413 | |
2414 | 2414 | dol_syslog(__METHOD__, LOG_DEBUG); |
2415 | 2415 | $resql = $this->db->query($sql); |
@@ -2465,8 +2465,8 @@ discard block |
||
2465 | 2465 | $this->db->begin(); |
2466 | 2466 | |
2467 | 2467 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal"; |
2468 | - $sql .= " SET fk_availability = " . ((int)$id); |
|
2469 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2468 | + $sql .= " SET fk_availability = " . ((int) $id); |
|
2469 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2470 | 2470 | |
2471 | 2471 | dol_syslog(__METHOD__ . ' availability(' . $id . ')', LOG_DEBUG); |
2472 | 2472 | $resql = $this->db->query($sql); |
@@ -2527,8 +2527,8 @@ discard block |
||
2527 | 2527 | $this->db->begin(); |
2528 | 2528 | |
2529 | 2529 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal "; |
2530 | - $sql .= " SET fk_input_reason = " . ((int)$id); |
|
2531 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2530 | + $sql .= " SET fk_input_reason = " . ((int) $id); |
|
2531 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2532 | 2532 | |
2533 | 2533 | dol_syslog(__METHOD__, LOG_DEBUG); |
2534 | 2534 | $resql = $this->db->query($sql); |
@@ -2591,7 +2591,7 @@ discard block |
||
2591 | 2591 | $this->db->begin(); |
2592 | 2592 | |
2593 | 2593 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal SET ref_client = " . (empty($ref_client) ? 'NULL' : "'" . $this->db->escape($ref_client) . "'"); |
2594 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2594 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2595 | 2595 | |
2596 | 2596 | dol_syslog(__METHOD__ . ' $this->id=' . $this->id . ', ref_client=' . $ref_client, LOG_DEBUG); |
2597 | 2597 | $resql = $this->db->query($sql); |
@@ -2646,12 +2646,12 @@ discard block |
||
2646 | 2646 | $error = 0; |
2647 | 2647 | |
2648 | 2648 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal"; |
2649 | - $sql .= " SET fk_statut = " . ((int)$status) . ","; |
|
2649 | + $sql .= " SET fk_statut = " . ((int) $status) . ","; |
|
2650 | 2650 | if (!empty($note)) { |
2651 | 2651 | $sql .= " note_private = '" . $this->db->escape($note) . "',"; |
2652 | 2652 | } |
2653 | 2653 | $sql .= " date_cloture=NULL, fk_user_cloture=NULL"; |
2654 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2654 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2655 | 2655 | |
2656 | 2656 | $this->db->begin(); |
2657 | 2657 | |
@@ -2729,17 +2729,17 @@ discard block |
||
2729 | 2729 | } |
2730 | 2730 | |
2731 | 2731 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal"; |
2732 | - $sql .= " SET fk_statut = " . ((int)$status) . ", note_private = '" . $this->db->escape($newprivatenote) . "', date_signature='" . $this->db->idate($date_signature) . "', fk_user_signature=" . $fk_user_signature; |
|
2733 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2732 | + $sql .= " SET fk_statut = " . ((int) $status) . ", note_private = '" . $this->db->escape($newprivatenote) . "', date_signature='" . $this->db->idate($date_signature) . "', fk_user_signature=" . $fk_user_signature; |
|
2733 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2734 | 2734 | |
2735 | 2735 | $resql = $this->db->query($sql); |
2736 | 2736 | if ($resql) { |
2737 | 2737 | // Status self::STATUS_REFUSED by default |
2738 | 2738 | $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf); |
2739 | - $trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger() |
|
2739 | + $trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger() |
|
2740 | 2740 | |
2741 | 2741 | if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED |
2742 | - $trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger() |
|
2742 | + $trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger() |
|
2743 | 2743 | $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL') ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf; |
2744 | 2744 | |
2745 | 2745 | // The connected company is classified as a client |
@@ -2820,7 +2820,7 @@ discard block |
||
2820 | 2820 | $sql .= " c.datec, c.date_valid as datev, c.date_signature, c.date_cloture,"; |
2821 | 2821 | $sql .= " c.fk_user_author, c.fk_user_valid, c.fk_user_signature, c.fk_user_cloture"; |
2822 | 2822 | $sql .= " FROM " . MAIN_DB_PREFIX . "propal as c"; |
2823 | - $sql .= " WHERE c.rowid = " . ((int)$id); |
|
2823 | + $sql .= " WHERE c.rowid = " . ((int) $id); |
|
2824 | 2824 | |
2825 | 2825 | $result = $this->db->query($sql); |
2826 | 2826 | |
@@ -2911,8 +2911,8 @@ discard block |
||
2911 | 2911 | $newprivatenote = dol_concatdesc($this->note_private, $note); |
2912 | 2912 | |
2913 | 2913 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'propal SET fk_statut = ' . self::STATUS_BILLED . ", "; |
2914 | - $sql .= " note_private = '" . $this->db->escape($newprivatenote) . "', date_cloture='" . $this->db->idate($now) . "', fk_user_cloture=" . ((int)$user->id); |
|
2915 | - $sql .= ' WHERE rowid = ' . ((int)$this->id) . ' AND fk_statut = ' . ((int)self::STATUS_SIGNED); |
|
2914 | + $sql .= " note_private = '" . $this->db->escape($newprivatenote) . "', date_cloture='" . $this->db->idate($now) . "', fk_user_cloture=" . ((int) $user->id); |
|
2915 | + $sql .= ' WHERE rowid = ' . ((int) $this->id) . ' AND fk_statut = ' . ((int) self::STATUS_SIGNED); |
|
2916 | 2916 | |
2917 | 2917 | dol_syslog(__METHOD__, LOG_DEBUG); |
2918 | 2918 | $resql = $this->db->query($sql); |
@@ -2986,8 +2986,8 @@ discard block |
||
2986 | 2986 | |
2987 | 2987 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal"; |
2988 | 2988 | $sql .= " SET fk_statut = " . self::STATUS_CANCELED . ","; |
2989 | - $sql .= " fk_user_modif = " . ((int)$user->id); |
|
2990 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
2989 | + $sql .= " fk_user_modif = " . ((int) $user->id); |
|
2990 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
2991 | 2991 | |
2992 | 2992 | dol_syslog(get_class($this) . "::cancel", LOG_DEBUG); |
2993 | 2993 | if ($this->db->query($sql)) { |
@@ -3045,7 +3045,7 @@ discard block |
||
3045 | 3045 | $sql = "UPDATE " . MAIN_DB_PREFIX . "propal"; |
3046 | 3046 | $sql .= " SET fk_statut = " . self::STATUS_DRAFT; |
3047 | 3047 | $sql .= ", online_sign_ip = NULL , online_sign_name = NULL"; |
3048 | - $sql .= " WHERE rowid = " . ((int)$this->id); |
|
3048 | + $sql .= " WHERE rowid = " . ((int) $this->id); |
|
3049 | 3049 | |
3050 | 3050 | $resql = $this->db->query($sql); |
3051 | 3051 | if (!$resql) { |
@@ -3120,18 +3120,18 @@ discard block |
||
3120 | 3120 | if ($search_sale == -2) { |
3121 | 3121 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)"; |
3122 | 3122 | } elseif ($search_sale > 0) { |
3123 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
3123 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
3124 | 3124 | } |
3125 | 3125 | } |
3126 | 3126 | // Search on socid |
3127 | 3127 | if ($socid) { |
3128 | - $sql .= " AND p.fk_soc = " . ((int)$socid); |
|
3128 | + $sql .= " AND p.fk_soc = " . ((int) $socid); |
|
3129 | 3129 | } |
3130 | 3130 | if ($draft) { |
3131 | - $sql .= " AND p.fk_statut = " . ((int)self::STATUS_DRAFT); |
|
3131 | + $sql .= " AND p.fk_statut = " . ((int) self::STATUS_DRAFT); |
|
3132 | 3132 | } |
3133 | 3133 | if ($notcurrentuser > 0) { |
3134 | - $sql .= " AND p.fk_user_author <> " . ((int)$user->id); |
|
3134 | + $sql .= " AND p.fk_user_author <> " . ((int) $user->id); |
|
3135 | 3135 | } |
3136 | 3136 | $sql .= $this->db->order($sortfield, $sortorder); |
3137 | 3137 | $sql .= $this->db->plimit($limit, $offset); |
@@ -3269,8 +3269,8 @@ discard block |
||
3269 | 3269 | $this->db->begin(); |
3270 | 3270 | |
3271 | 3271 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'propal'; |
3272 | - $sql .= ' SET fk_availability = ' . ((int)$availability_id); |
|
3273 | - $sql .= ' WHERE rowid=' . ((int)$this->id); |
|
3272 | + $sql .= ' SET fk_availability = ' . ((int) $availability_id); |
|
3273 | + $sql .= ' WHERE rowid=' . ((int) $this->id); |
|
3274 | 3274 | |
3275 | 3275 | dol_syslog(__METHOD__ . ' availability(' . $availability_id . ')', LOG_DEBUG); |
3276 | 3276 | $resql = $this->db->query($sql); |
@@ -3332,8 +3332,8 @@ discard block |
||
3332 | 3332 | $this->db->begin(); |
3333 | 3333 | |
3334 | 3334 | $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'propal'; |
3335 | - $sql .= ' SET fk_input_reason = ' . ((int)$demand_reason_id); |
|
3336 | - $sql .= ' WHERE rowid=' . ((int)$this->id); |
|
3335 | + $sql .= ' SET fk_input_reason = ' . ((int) $demand_reason_id); |
|
3336 | + $sql .= ' WHERE rowid=' . ((int) $this->id); |
|
3337 | 3337 | |
3338 | 3338 | dol_syslog(__METHOD__ . ' demand_reason(' . $demand_reason_id . ')', LOG_DEBUG); |
3339 | 3339 | $resql = $this->db->query($sql); |
@@ -3409,7 +3409,7 @@ discard block |
||
3409 | 3409 | if ($search_sale == -2) { |
3410 | 3410 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)"; |
3411 | 3411 | } elseif ($search_sale > 0) { |
3412 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
3412 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
3413 | 3413 | } |
3414 | 3414 | } |
3415 | 3415 | |
@@ -3585,7 +3585,7 @@ discard block |
||
3585 | 3585 | if ($search_sale == -2) { |
3586 | 3586 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)"; |
3587 | 3587 | } elseif ($search_sale > 0) { |
3588 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
3588 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
3589 | 3589 | } |
3590 | 3590 | } |
3591 | 3591 |
@@ -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 |