@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | $error = 0; |
| 88 | 88 | $this->db->begin(); |
| 89 | 89 | |
| 90 | - if (! $error) { |
|
| 91 | - if (! $notrigger) { |
|
| 90 | + if (!$error) { |
|
| 91 | + if (!$notrigger) { |
|
| 92 | 92 | // Call triggers |
| 93 | 93 | $result = $this->call_trigger('LINESUPPLIERBILLREC_DELETE', $user); |
| 94 | 94 | if ($result < 0) { |
@@ -98,14 +98,14 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if (! $error) { |
|
| 101 | + if (!$error) { |
|
| 102 | 102 | $result = $this->deleteExtraFields(); |
| 103 | 103 | if ($result < 0) { |
| 104 | 104 | $error++; |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if (! $error) { |
|
| 108 | + if (!$error) { |
|
| 109 | 109 | $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . ' WHERE rowid=' . (int) $this->id; |
| 110 | 110 | |
| 111 | 111 | $res = $this->db->query($sql); |
@@ -188,10 +188,10 @@ |
||
| 188 | 188 | $sqlsearchpackage .= ' WHERE entity IN (' . getEntity('product_fournisseur_price') . ")"; |
| 189 | 189 | $sqlsearchpackage .= " AND fk_product = " . ((int) $objp->fk_product); |
| 190 | 190 | $sqlsearchpackage .= " AND ref_fourn = '" . $this->db->escape($objp->ref_supplier) . "'"; |
| 191 | - $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
| 192 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
| 191 | + $sqlsearchpackage .= " AND quantity <= " . ((float) $objp->qty); // required to be qualified |
|
| 192 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= " . ((float) $objp->qty) . ")"; // required to be qualified |
|
| 193 | 193 | $sqlsearchpackage .= " AND fk_soc = " . ((int) $objp->socid); |
| 194 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 194 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 195 | 195 | $sqlsearchpackage .= " LIMIT 1"; |
| 196 | 196 | |
| 197 | 197 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | } |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 779 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 780 | 780 | /** |
| 781 | 781 | * Mise a jour de l'objet ligne de commande en base |
| 782 | 782 | * |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | */ |
| 785 | 785 | public function update_total() |
| 786 | 786 | { |
| 787 | - // phpcs:enable |
|
| 787 | + // phpcs:enable |
|
| 788 | 788 | $this->db->begin(); |
| 789 | 789 | |
| 790 | 790 | // Mise a jour ligne en base |
@@ -694,8 +694,7 @@ |
||
| 694 | 694 | $sql .= " " . ($this->fk_parent_line > 0 ? "'" . $this->db->escape($this->fk_parent_line) . "'" : "null") . ","; |
| 695 | 695 | $product_label |
| 696 | 696 | = !empty($this->product_label) |
| 697 | - ? $this->product_label : |
|
| 698 | - (!empty($this->label) ? $this->label : null); |
|
| 697 | + ? $this->product_label : (!empty($this->label) ? $this->label : null); |
|
| 699 | 698 | $sql .= " " . (!empty($product_label) ? "'" . $this->db->escape($product_label) . "'" : "null") . ","; |
| 700 | 699 | $sql .= " '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "',"; |
| 701 | 700 | $sql .= " '" . $this->db->escape($this->ref_supplier) . "',"; |
@@ -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'); |
@@ -174,43 +174,43 @@ |
||
| 174 | 174 | public $product_type = 0; |
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | - * @var int rang of line |
|
| 178 | - */ |
|
| 177 | + * @var int rang of line |
|
| 178 | + */ |
|
| 179 | 179 | public $rang; |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * @var float weight |
|
| 183 | - */ |
|
| 182 | + * @var float weight |
|
| 183 | + */ |
|
| 184 | 184 | public $weight; |
| 185 | 185 | public $weight_units; |
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | - * @var float length |
|
| 189 | - */ |
|
| 188 | + * @var float length |
|
| 189 | + */ |
|
| 190 | 190 | public $length; |
| 191 | 191 | public $length_units; |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | - * @var float width |
|
| 195 | - */ |
|
| 194 | + * @var float width |
|
| 195 | + */ |
|
| 196 | 196 | public $width; |
| 197 | 197 | public $width_units; |
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | - * @var float height |
|
| 201 | - */ |
|
| 200 | + * @var float height |
|
| 201 | + */ |
|
| 202 | 202 | public $height; |
| 203 | 203 | public $height_units; |
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | - * @var float surface |
|
| 207 | - */ |
|
| 206 | + * @var float surface |
|
| 207 | + */ |
|
| 208 | 208 | public $surface; |
| 209 | 209 | public $surface_units; |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * @var float volume |
|
| 213 | - */ |
|
| 212 | + * @var float volume |
|
| 213 | + */ |
|
| 214 | 214 | public $volume; |
| 215 | 215 | public $volume_units; |
| 216 | 216 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @var int |
| 83 | 83 | * @deprecated |
| 84 | 84 | */ |
| 85 | - public $line_id; // deprecated |
|
| 85 | + public $line_id; // deprecated |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * @var int ID Duplicate of origin_id (using origin_id is better) |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @var string |
| 117 | 117 | * @deprecated Use instead origin_type = element_type to guess the line of origin of the shipment line. |
| 118 | 118 | */ |
| 119 | - public $fk_origin; // Example: 'orderline' |
|
| 119 | + public $fk_origin; // Example: 'orderline' |
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * @var int Id of shipment |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 286 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 287 | 287 | /** |
| 288 | 288 | * Update total duration into llx_fichinter |
| 289 | 289 | * |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function update_total() |
| 293 | 293 | { |
| 294 | - // phpcs:enable |
|
| 294 | + // phpcs:enable |
|
| 295 | 295 | global $conf; |
| 296 | 296 | |
| 297 | 297 | $this->db->begin(); |
@@ -52,19 +52,19 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public $fk_fichinter; |
| 54 | 54 | |
| 55 | - public $desc; // Description ligne |
|
| 55 | + public $desc; // Description ligne |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * @var int Date of intervention |
| 59 | 59 | */ |
| 60 | - public $date; // Date intervention |
|
| 60 | + public $date; // Date intervention |
|
| 61 | 61 | /** |
| 62 | 62 | * @var int Date of intervention |
| 63 | 63 | * @deprecated |
| 64 | 64 | */ |
| 65 | - public $datei; // Date intervention |
|
| 65 | + public $datei; // Date intervention |
|
| 66 | 66 | |
| 67 | - public $duration; // Duration of intervention |
|
| 67 | + public $duration; // Duration of intervention |
|
| 68 | 68 | public $rang = 0; |
| 69 | 69 | public $tva_tx; |
| 70 | 70 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $this->id = $objp->rowid; |
| 123 | 123 | $this->fk_fichinter = $objp->fk_fichinter; |
| 124 | 124 | $this->date = $this->db->jdate($objp->date); |
| 125 | - $this->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
| 125 | + $this->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
| 126 | 126 | $this->desc = $objp->description; |
| 127 | 127 | $this->duration = $objp->duree; |
| 128 | 128 | $this->rang = $objp->rang; |