@@ -35,16 +35,16 @@ |
||
35 | 35 | public function query($year) |
36 | 36 | { |
37 | 37 | $sql = 'SELECT damage.amount as amount, damage.billed as billed, damage.author_id as author, author.firstname as author_name'; |
38 | - $sql.=' FROM '.MAIN_DB_PREFIX.'bbc_flight_damages as damage'; |
|
39 | - $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'bbc_vols as flight ON flight.rowid = damage.flight_id'; |
|
40 | - $sql.=' INNER JOIN '.MAIN_DB_PREFIX.'user as author ON author.rowid = damage.author_id'; |
|
41 | - $sql.=' WHERE YEAR(damage.created_at) = '.$this->db->escape($year); |
|
38 | + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bbc_flight_damages as damage'; |
|
39 | + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bbc_vols as flight ON flight.rowid = damage.flight_id'; |
|
40 | + $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'user as author ON author.rowid = damage.author_id'; |
|
41 | + $sql .= ' WHERE YEAR(damage.created_at) = ' . $this->db->escape($year); |
|
42 | 42 | |
43 | 43 | $resql = $this->db->query($sql); |
44 | 44 | if ($resql) { |
45 | 45 | $num = $this->db->num_rows($resql); |
46 | 46 | if ($num) { |
47 | - for($i = 0; $i < $num ; $i++) { |
|
47 | + for ($i = 0; $i < $num; $i++) { |
|
48 | 48 | $properties = $this->db->fetch_array($resql); |
49 | 49 | $damage = TotalDamage::fromArray($properties); |
50 | 50 | yield $damage; |
@@ -268,12 +268,12 @@ |
||
268 | 268 | /** @var Facture $invoice */ |
269 | 269 | foreach ($order->linkedObjects['facture'] as $invoice) { |
270 | 270 | $invoiced += $invoice->total_ttc; |
271 | - if((int)$invoice->paye === 1){ |
|
271 | + if ((int) $invoice->paye === 1) { |
|
272 | 272 | $paiedInvoice++; |
273 | 273 | } |
274 | 274 | } |
275 | 275 | |
276 | 276 | return $paiedInvoice === count($order->linkedObjects['facture']) |
277 | - || (int)($order->total_ttc * 1000) <= (int)($invoiced * 1000); |
|
277 | + || (int) ($order->total_ttc * 1000) <= (int) ($invoiced * 1000); |
|
278 | 278 | } |
279 | 279 | } |
280 | 280 | \ No newline at end of file |