@@ -19,6 +19,9 @@ discard block |
||
| 19 | 19 | $this->dbquery = $this->getDBQuery(); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | + /** |
|
| 23 | + * @param string|null $id |
|
| 24 | + */ |
|
| 22 | 25 | function findById($id) |
| 23 | 26 | { |
| 24 | 27 | $db = new DB_Sql; |
@@ -113,7 +116,7 @@ discard block |
||
| 113 | 116 | /** |
| 114 | 117 | * returns possible payment types |
| 115 | 118 | * |
| 116 | - * @return array payment types |
|
| 119 | + * @return string[] payment types |
|
| 117 | 120 | * |
| 118 | 121 | */ |
| 119 | 122 | public static function getTypes() |
@@ -128,7 +131,7 @@ discard block |
||
| 128 | 131 | /** |
| 129 | 132 | * returns the possible types payments can be for. |
| 130 | 133 | * |
| 131 | - * @return array payment for types |
|
| 134 | + * @return string[] payment for types |
|
| 132 | 135 | */ |
| 133 | 136 | private static function getPaymentForTypes() |
| 134 | 137 | { |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | function findById($id) |
| 23 | 23 | { |
| 24 | 24 | $db = new DB_Sql; |
| 25 | - $db->query('SELECT * FROM invoice_payment WHERE id = ' . $id); |
|
| 25 | + $db->query('SELECT * FROM invoice_payment WHERE id = '.$id); |
|
| 26 | 26 | |
| 27 | 27 | if (!$db->nextRecord()) { |
| 28 | 28 | return false; |
@@ -11,6 +11,9 @@ |
||
| 11 | 11 | private $db; |
| 12 | 12 | public $error; |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param Reminder $reminder |
|
| 16 | + */ |
|
| 14 | 17 | function __construct($reminder, $id = 0) |
| 15 | 18 | {
|
| 16 | 19 | $this->reminder = $reminder; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ($line == "") { |
| 62 | 62 | $this->doc->setY('-'.$this->doc->get('font_spacing')); |
| 63 | 63 | |
| 64 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
| 64 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
| 65 | 65 | $this->doc->nextPage(true); |
| 66 | 66 | } |
| 67 | 67 | } else { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
| 73 | 73 | |
| 74 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
| 74 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
| 75 | 75 | $this->doc->nextPage(true); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $this->doc->setY('-20'); // space to product list |
| 84 | 84 | |
| 85 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 3) { |
|
| 85 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*3) { |
|
| 86 | 86 | $this->doc->nextPage(true); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->doc->addText($apointX["text"], $this->doc->get('y'), $this->doc->get("font_size"), "Beskrivelse"); |
| 97 | 97 | $this->doc->addText($apointX["invoice_date"], $this->doc->get('y'), $this->doc->get("font_size"), "Dato"); |
| 98 | 98 | $this->doc->addText($apointX["due_date"], $this->doc->get('y'), $this->doc->get("font_size"), "Forfaldsdato"); |
| 99 | - $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") -3, $this->doc->get('y'), $this->doc->get("font_size"), "Bel�b"); |
|
| 99 | + $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") - 3, $this->doc->get('y'), $this->doc->get("font_size"), "Bel�b"); |
|
| 100 | 100 | |
| 101 | 101 | $this->doc->setY('-'.($this->doc->get("font_spacing") - $this->doc->get("font_size"))); |
| 102 | 102 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
| 130 | 130 | $total += $items[$i]["arrears"]; |
| 131 | 131 | |
| 132 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
| 132 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
| 133 | 133 | $this->doc->nextPage(true); |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
| 155 | 155 | $total += $items[$i]["reminder_fee"]; |
| 156 | 156 | |
| 157 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
| 157 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
| 158 | 158 | $this->doc->nextPage(true); |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
| 176 | 176 | $total += $reminder->get("reminder_fee"); |
| 177 | 177 | |
| 178 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
| 178 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
| 179 | 179 | $this->doc->nextPage(true); |
| 180 | 180 | } |
| 181 | 181 | } |
@@ -36,6 +36,9 @@ discard block |
||
| 36 | 36 | return $this->dbquery; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $type |
|
| 41 | + */ |
|
| 39 | 42 | function getItems($type = null) |
| 40 | 43 | { |
| 41 | 44 | $this->loadItem(); |
@@ -297,7 +300,8 @@ discard block |
||
| 297 | 300 | /** |
| 298 | 301 | * Sets status for the reminder |
| 299 | 302 | * |
| 300 | - * @return true / false |
|
| 303 | + * @param string $status |
|
| 304 | + * @return boolean / false |
|
| 301 | 305 | */ |
| 302 | 306 | function setStatus($status) |
| 303 | 307 | { |
@@ -356,7 +360,7 @@ discard block |
||
| 356 | 360 | /** |
| 357 | 361 | * returns DebtorAccount object |
| 358 | 362 | * |
| 359 | - * @return object DebtorAccount |
|
| 363 | + * @return DebtorAccount DebtorAccount |
|
| 360 | 364 | */ |
| 361 | 365 | public function getDebtorAccount() |
| 362 | 366 | { |
@@ -575,6 +579,11 @@ discard block |
||
| 575 | 579 | * @param object year stating year |
| 576 | 580 | * @param integer voucher_number |
| 577 | 581 | * @param string voucher_date |
| 582 | + * @param Year $year |
|
| 583 | + * @param integer $voucher_number |
|
| 584 | + * @param string $voucher_date |
|
| 585 | + * @param integer $credit_account_number |
|
| 586 | + * @param Stub_Translation $translation |
|
| 578 | 587 | * @return boolean true or false |
| 579 | 588 | */ |
| 580 | 589 | function state($year, $voucher_number, $voucher_date, $credit_account_number, $translation) |
@@ -687,7 +696,7 @@ discard block |
||
| 687 | 696 | /** |
| 688 | 697 | * returns possible status types |
| 689 | 698 | * |
| 690 | - * @return array possible status types |
|
| 699 | + * @return string[] possible status types |
|
| 691 | 700 | */ |
| 692 | 701 | private static function getStatusTypes() |
| 693 | 702 | { |
@@ -702,7 +711,7 @@ discard block |
||
| 702 | 711 | /** |
| 703 | 712 | * returns possible payment methods |
| 704 | 713 | * |
| 705 | - * @return array possible payment methods |
|
| 714 | + * @return string[] possible payment methods |
|
| 706 | 715 | */ |
| 707 | 716 | private static function getPaymentMethods() |
| 708 | 717 | { |
@@ -722,9 +722,9 @@ |
||
| 722 | 722 | function getPaymentInformation() |
| 723 | 723 | { |
| 724 | 724 | $info = array('bank_name' => $this->kernel->setting->get("intranet", "bank_name"), |
| 725 | - 'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"), |
|
| 726 | - 'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"), |
|
| 727 | - 'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number") |
|
| 725 | + 'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"), |
|
| 726 | + 'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"), |
|
| 727 | + 'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number") |
|
| 728 | 728 | ); |
| 729 | 729 | |
| 730 | 730 | return $info; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | function isNumberFree($number) |
| 128 | 128 | { |
| 129 | - $sql = "SELECT id FROM invoice_reminder WHERE number = ".intval($number)." AND id != ".$this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'); |
|
| 129 | + $sql = "SELECT id FROM invoice_reminder WHERE number = ".intval($number)." AND id != ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'); |
|
| 130 | 130 | $this->db->query($sql); |
| 131 | 131 | if ($this->db->nextRecord()) { |
| 132 | 132 | return false; |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | $db = new Db_Sql; |
| 342 | - $db->query("UPDATE invoice_reminder SET status = ".$status_id.", ".$sql." WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 342 | + $db->query("UPDATE invoice_reminder SET status = ".$status_id.", ".$sql." WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 343 | 343 | $this->load(); |
| 344 | 344 | return true; |
| 345 | 345 | } |
@@ -477,14 +477,14 @@ discard block |
||
| 477 | 477 | } |
| 478 | 478 | $db = new DB_Sql; |
| 479 | 479 | $db->query("SELECT id |
| 480 | - FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=" . $contact_id); |
|
| 480 | + FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=".$contact_id); |
|
| 481 | 481 | return $db->numRows(); |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | function isFilledIn() |
| 485 | 485 | { |
| 486 | 486 | $db = new DB_Sql; |
| 487 | - $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 487 | + $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 488 | 488 | return $db->numRows(); |
| 489 | 489 | } |
| 490 | 490 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | { |
| 501 | 501 | // FIXME - check on date |
| 502 | 502 | $db = new DB_Sql; |
| 503 | - $db->query("UPDATE invoice_reminder SET date_stated = '" . $voucher_date . "', voucher_id = '".$voucher_id."' WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 503 | + $db->query("UPDATE invoice_reminder SET date_stated = '".$voucher_date."', voucher_id = '".$voucher_id."' WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 504 | 504 | return true; |
| 505 | 505 | } |
| 506 | 506 | |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | |
| 648 | 648 | require_once 'Intraface/modules/accounting/VoucherFile.php'; |
| 649 | 649 | $voucher_file = new VoucherFile($voucher); |
| 650 | - if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'reminder','belong_to_id'=>$this->get('id')))) { |
|
| 650 | + if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'reminder', 'belong_to_id'=>$this->get('id')))) { |
|
| 651 | 651 | $this->error->merge($voucher_file->error->getMessage()); |
| 652 | 652 | $this->error->set('Filen blev ikke overflyttet'); |
| 653 | 653 | } |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | class OnlinePaymentDefault extends OnlinePayment |
| 10 | 10 | {
|
| 11 | + /** |
|
| 12 | + * @param integer $id |
|
| 13 | + */ |
|
| 11 | 14 | function __construct($kernel, $id) {
|
| 12 | 15 | |
| 13 | 16 | parent::__construct($kernel, $id); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | function findById($id) |
| 26 | 26 | { |
| 27 | - require_once dirname(__FILE__) . '/Reminder.php'; |
|
| 27 | + require_once dirname(__FILE__).'/Reminder.php'; |
|
| 28 | 28 | return new Reminder($this->kernel, $id); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | $db = new DB_Sql; |
| 41 | 41 | $db->query("SELECT id |
| 42 | - FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=" . $contact_id); |
|
| 42 | + FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=".$contact_id); |
|
| 43 | 43 | return $db->numRows(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | function setNewContactId($old_contact_id, $new_contact_id) |
| 47 | 47 | { |
| 48 | 48 | $db = new DB_Sql; |
| 49 | - $db->query('UPDATE invoice_reminder SET contact_id = ' . $new_contact_id . ' WHERE contact_id = ' . $old_contact_id); |
|
| 49 | + $db->query('UPDATE invoice_reminder SET contact_id = '.$new_contact_id.' WHERE contact_id = '.$old_contact_id); |
|
| 50 | 50 | return true; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | function isFilledIn() |
| 158 | 158 | { |
| 159 | 159 | $db = new DB_Sql; |
| 160 | - $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 160 | + $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 161 | 161 | return $db->numRows(); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -298,6 +298,10 @@ discard block |
||
| 298 | 298 | return $this->id; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | + /** |
|
| 302 | + * @param string $belong_to |
|
| 303 | + * @param integer $belong_to_id |
|
| 304 | + */ |
|
| 301 | 305 | function changeBelongTo($belong_to, $belong_to_id) |
| 302 | 306 | { |
| 303 | 307 | if ($this->id == 0) { |
@@ -321,6 +325,9 @@ discard block |
||
| 321 | 325 | |
| 322 | 326 | } |
| 323 | 327 | |
| 328 | + /** |
|
| 329 | + * @param string $status |
|
| 330 | + */ |
|
| 324 | 331 | function setStatus($status) |
| 325 | 332 | { |
| 326 | 333 | if ($this->id == 0) { |
@@ -582,7 +589,7 @@ discard block |
||
| 582 | 589 | /** |
| 583 | 590 | * returns the possible status types |
| 584 | 591 | * |
| 585 | - * @return array with status types |
|
| 592 | + * @return string[] with status types |
|
| 586 | 593 | */ |
| 587 | 594 | static function getStatusTypes() |
| 588 | 595 | { |
@@ -598,7 +605,7 @@ discard block |
||
| 598 | 605 | /** |
| 599 | 606 | * returns possible belong to types |
| 600 | 607 | * |
| 601 | - * @return array with belong to types |
|
| 608 | + * @return string[] with belong to types |
|
| 602 | 609 | */ |
| 603 | 610 | private function getBelongToTypes() |
| 604 | 611 | { |
@@ -611,7 +618,7 @@ discard block |
||
| 611 | 618 | /** |
| 612 | 619 | * returns the implemented providers |
| 613 | 620 | * |
| 614 | - * @return array with providers |
|
| 621 | + * @return string[] with providers |
|
| 615 | 622 | */ |
| 616 | 623 | static function getImplementedProviders() |
| 617 | 624 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @param array $input (belong_to, belong_to_id, transaction_number, transaction_status, amount) |
| 134 | 134 | * |
| 135 | 135 | * @return integer |
| 136 | - */ |
|
| 136 | + */ |
|
| 137 | 137 | public function save($input) |
| 138 | 138 | { |
| 139 | 139 | $input = safeToDb($input); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if ($input['transaction_status'] == $this->transaction_status_authorized) { |
| 166 | - $status_key = 2; |
|
| 166 | + $status_key = 2; |
|
| 167 | 167 | } else { |
| 168 | 168 | $status_key = 1; |
| 169 | 169 | } |
@@ -664,7 +664,7 @@ |
||
| 664 | 664 | |
| 665 | 665 | function getStatus() |
| 666 | 666 | { |
| 667 | - $status = $this->getStatusTypes(); |
|
| 667 | + $status = $this->getStatusTypes(); |
|
| 668 | 668 | return $status[$this->value['status_key']]; |
| 669 | 669 | } |
| 670 | 670 | } |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | class OnlinePaymentDefault extends OnlinePayment |
| 10 | 10 | {
|
| 11 | + /** |
|
| 12 | + * @param integer $id |
|
| 13 | + */ |
|
| 11 | 14 | function __construct($kernel, $id) {
|
| 12 | 15 | |
| 13 | 16 | parent::__construct($kernel, $id); |
@@ -142,8 +142,8 @@ |
||
| 142 | 142 | |
| 143 | 143 | function getSettings() |
| 144 | 144 | { |
| 145 | - $this->value['password'] = $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.password'); |
|
| 146 | - $this->value['merchant_id'] = $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.merchant_id'); |
|
| 145 | + $this->value['password'] = $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.password'); |
|
| 146 | + $this->value['merchant_id'] = $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.merchant_id'); |
|
| 147 | 147 | return $this->value; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -58,6 +58,8 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @param object Procurement |
| 60 | 60 | * @param integer item id |
| 61 | + * @param Procurement $procurement |
|
| 62 | + * @param integer $id |
|
| 61 | 63 | * @return void |
| 62 | 64 | */ |
| 63 | 65 | public function __construct($procurement, $id) |
@@ -201,7 +203,7 @@ discard block |
||
| 201 | 203 | /** |
| 202 | 204 | * Gets the tax percent on the individual product |
| 203 | 205 | * |
| 204 | - * @return float |
|
| 206 | + * @return integer |
|
| 205 | 207 | */ |
| 206 | 208 | public function getProductTaxPercent() |
| 207 | 209 | { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $product = new Product($this->procurement->kernel, $input["product_id"], $input['product_detail_id']); |
| 235 | 235 | |
| 236 | 236 | if (!is_object($product) || $product->get('id') == 0) { |
| 237 | - $this->error->set("Ugyldigt produkt"); |
|
| 237 | + $this->error->set("Ugyldigt produkt"); |
|
| 238 | 238 | } else { |
| 239 | 239 | $product_detail_id = $product->get("detail_id"); |
| 240 | 240 | } |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $product = new Product($this->procurement->kernel, $product_id); |
| 348 | 348 | |
| 349 | 349 | if (!is_object($product) || $product->get('id') == 0) { |
| 350 | - throw new Excetion('Invalid product id'); |
|
| 350 | + throw new Excetion('Invalid product id'); |
|
| 351 | 351 | } else { |
| 352 | 352 | $product_detail_id = $product->get("detail_id"); |
| 353 | 353 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $this->procurement = $procurement; |
| 66 | 66 | $this->error = new Intraface_Error; |
| 67 | - $this->id = (int) $id; |
|
| 67 | + $this->id = (int)$id; |
|
| 68 | 68 | |
| 69 | 69 | if ($this->id > 0) { |
| 70 | 70 | $this->load(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | $db->query("SELECT procurement_item.* FROM procurement_item |
| 88 | 88 | INNER JOIN procurement ON procurement_item.procurement_id = procurement.id |
| 89 | - WHERE procurement_item.id = " . $this->id . " AND procurement.id = " . $this->procurement->get('id') . " AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id")); |
|
| 89 | + WHERE procurement_item.id = " . $this->id." AND procurement.id = ".$this->procurement->get('id')." AND procurement_item.intranet_id = ".$this->procurement->kernel->intranet->get("id")); |
|
| 90 | 90 | if ($db->nextRecord()) { |
| 91 | 91 | $this->value["id"] = $db->f("id"); |
| 92 | 92 | $this->value["product_id"] = $db->f("product_id"); |
@@ -282,20 +282,20 @@ discard block |
||
| 282 | 282 | exit; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - $sql = "product_id = " . $product->getId() . ", |
|
| 286 | - product_detail_id = " . $product_detail_id . ", |
|
| 287 | - product_variation_id = " . $variation_id . ", |
|
| 288 | - product_variation_detail_id = " . $variation_detail_id . ", |
|
| 289 | - quantity = " . $input["quantity"] . ", |
|
| 285 | + $sql = "product_id = ".$product->getId().", |
|
| 286 | + product_detail_id = " . $product_detail_id.", |
|
| 287 | + product_variation_id = " . $variation_id.", |
|
| 288 | + product_variation_detail_id = " . $variation_detail_id.", |
|
| 289 | + quantity = " . $input["quantity"].", |
|
| 290 | 290 | unit_purchase_price = " . $input["unit_purchase_price"]; |
| 291 | 291 | |
| 292 | 292 | $db = new DB_Sql; |
| 293 | 293 | |
| 294 | 294 | if ($this->id == 0) { |
| 295 | - $db->query("INSERT INTO procurement_item SET " . $sql . ", intranet_id = " . $this->procurement->kernel->intranet->get("id") . ", procurement_id = " . $this->procurement->get("id") . ", active = 1"); |
|
| 295 | + $db->query("INSERT INTO procurement_item SET ".$sql.", intranet_id = ".$this->procurement->kernel->intranet->get("id").", procurement_id = ".$this->procurement->get("id").", active = 1"); |
|
| 296 | 296 | $this->id = $db->InsertedId(); |
| 297 | 297 | } else { |
| 298 | - $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id")); |
|
| 298 | + $db->query("UPDATE procurement_item SET ".$sql." WHERE id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")." AND intranet_id = ".$this->procurement->kernel->intranet->get("id")); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | return $this->id; |
@@ -323,10 +323,10 @@ discard block |
||
| 323 | 323 | return false; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - $sql = "unit_purchase_price = " . $unit_purchase_price->get(); |
|
| 326 | + $sql = "unit_purchase_price = ".$unit_purchase_price->get(); |
|
| 327 | 327 | |
| 328 | 328 | $db = new DB_Sql; |
| 329 | - $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id")); |
|
| 329 | + $db->query("UPDATE procurement_item SET ".$sql." WHERE id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")." AND intranet_id = ".$this->procurement->kernel->intranet->get("id")); |
|
| 330 | 330 | return true; |
| 331 | 331 | } |
| 332 | 332 | |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | product_variation_detail_id = ".$variation_detail_id; |
| 377 | 377 | |
| 378 | 378 | $db = new DB_Sql; |
| 379 | - $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id")); |
|
| 379 | + $db->query("UPDATE procurement_item SET ".$sql." WHERE id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")." AND intranet_id = ".$this->procurement->kernel->intranet->get("id")); |
|
| 380 | 380 | |
| 381 | 381 | return true; |
| 382 | 382 | } |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | public function delete() |
| 389 | 389 | { |
| 390 | 390 | $db = new DB_Sql; |
| 391 | - $db->query("UPDATE procurement_item SET active = 0 WHERE intranet_id = " . $this->procurement->kernel->intranet->get('id') . " AND id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id")); |
|
| 391 | + $db->query("UPDATE procurement_item SET active = 0 WHERE intranet_id = ".$this->procurement->kernel->intranet->get('id')." AND id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")); |
|
| 392 | 392 | $this->id = 0; |
| 393 | 393 | |
| 394 | 394 | return 1; |
@@ -402,13 +402,13 @@ discard block |
||
| 402 | 402 | public function getList() |
| 403 | 403 | { |
| 404 | 404 | $db = new DB_Sql; |
| 405 | - $db->query("SELECT * FROM procurement_item WHERE active = 1 AND intranet_id = " . $this->procurement->kernel->intranet->get("id") . " AND procurement_id = " . $this->procurement->get("id") . " ORDER BY id ASC"); |
|
| 405 | + $db->query("SELECT * FROM procurement_item WHERE active = 1 AND intranet_id = ".$this->procurement->kernel->intranet->get("id")." AND procurement_id = ".$this->procurement->get("id")." ORDER BY id ASC"); |
|
| 406 | 406 | $i = 0; |
| 407 | - $item = array (); |
|
| 407 | + $item = array(); |
|
| 408 | 408 | |
| 409 | 409 | if ($this->procurement->get("price_items") > 0) { |
| 410 | 410 | // calculates shipment etc per item price kr |
| 411 | - $calculated = $this->procurement->get("price_shipment_etc") / $this->procurement->get("price_items"); |
|
| 411 | + $calculated = $this->procurement->get("price_shipment_etc")/$this->procurement->get("price_items"); |
|
| 412 | 412 | } else { |
| 413 | 413 | $calculated = 0; |
| 414 | 414 | } |
@@ -424,17 +424,17 @@ discard block |
||
| 424 | 424 | $item[$i]["unit"] = $unit['plural']; |
| 425 | 425 | } |
| 426 | 426 | $item[$i]["unit_purchase_price"] = $db->f("unit_purchase_price"); |
| 427 | - $item[$i]["calculated_unit_price"] = $db->f("unit_purchase_price") + $db->f("unit_purchase_price") * $calculated; |
|
| 427 | + $item[$i]["calculated_unit_price"] = $db->f("unit_purchase_price") + $db->f("unit_purchase_price")*$calculated; |
|
| 428 | 428 | $item[$i]["quantity"] = $db->f("quantity"); |
| 429 | 429 | $item[$i]["vat"] = $product->get("vat"); |
| 430 | 430 | $item[$i]["product_id"] = $product->get("id"); |
| 431 | - $item[$i]["amount"] = $db->f("quantity") * $db->f("unit_purchase_price"); |
|
| 431 | + $item[$i]["amount"] = $db->f("quantity")*$db->f("unit_purchase_price"); |
|
| 432 | 432 | |
| 433 | 433 | if ($product->get('has_variation')) { |
| 434 | 434 | $variation = $product->getVariation($db->f('product_variation_id')); |
| 435 | 435 | $detail = $variation->getDetail($db->f('product_variation_detail_id')); |
| 436 | 436 | $item[$i]["name"] = $product->get("name").' - '.$variation->getName(); |
| 437 | - $item[$i]["number"]= $product->get("number").'.'.$variation->getNumber(); |
|
| 437 | + $item[$i]["number"] = $product->get("number").'.'.$variation->getNumber(); |
|
| 438 | 438 | $item[$i]["price"] = $detail->getPrice($product); |
| 439 | 439 | } else { |
| 440 | 440 | $item[$i]["name"] = $product->get("name"); |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | */ |
| 452 | 452 | public function getQuantity($status, $product_id, $product_variation_id, $from_date = "") |
| 453 | 453 | { |
| 454 | - if (!in_array($status, array ( |
|
| 454 | + if (!in_array($status, array( |
|
| 455 | 455 | 'ordered', |
| 456 | 456 | 'delivered' |
| 457 | 457 | ))) { |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | FROM procurement_item INNER JOIN procurement |
| 466 | 466 | ON procurement_item.procurement_id = procurement.id |
| 467 | 467 | WHERE procurement_item.active = 1 AND procurement.active = 1 |
| 468 | - AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id") . " AND procurement.intranet_id = " . $this->procurement->kernel->intranet->get("id") . " |
|
| 469 | - AND procurement_item.product_id = " . $product_id . " AND procurement.status_key = 0 |
|
| 468 | + AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id")." AND procurement.intranet_id = ".$this->procurement->kernel->intranet->get("id")." |
|
| 469 | + AND procurement_item.product_id = " . $product_id." AND procurement.status_key = 0 |
|
| 470 | 470 | AND procurement_item.product_variation_id = ".$product_variation_id); |
| 471 | 471 | $db->nextRecord(); // a post will always be present |
| 472 | 472 | return intval($db->f("on_order")); |
@@ -476,11 +476,11 @@ discard block |
||
| 476 | 476 | FROM procurement_item INNER JOIN procurement |
| 477 | 477 | ON procurement_item.procurement_id = procurement.id |
| 478 | 478 | WHERE procurement_item.active = 1 AND procurement.active = 1 |
| 479 | - AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id") . " AND procurement.intranet_id = " . $this->procurement->kernel->intranet->get("id") . " |
|
| 480 | - AND procurement_item.product_id = " . $product_id . " |
|
| 479 | + AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id")." AND procurement.intranet_id = ".$this->procurement->kernel->intranet->get("id")." |
|
| 480 | + AND procurement_item.product_id = " . $product_id." |
|
| 481 | 481 | AND procurement_item.product_variation_id = ".$product_variation_id." |
| 482 | 482 | AND procurement.status_key = 1 |
| 483 | - AND procurement.date_recieved > \"" . $from_date . "\""); |
|
| 483 | + AND procurement.date_recieved > \"" . $from_date."\""); |
|
| 484 | 484 | $db->nextRecord(); // a post will always be present |
| 485 | 485 | return intval($db->f("stock_in")); |
| 486 | 486 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * |
| 76 | 76 | * @param object Product |
| 77 | 77 | * |
| 78 | - * @return object Ilib_Variable_Float with price |
|
| 78 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price |
|
| 79 | 79 | */ |
| 80 | 80 | public function getPrice($product) |
| 81 | 81 | { |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | * @todo Product should not be given as parameter, but defined as relation. Product needs to be made in doctrine |
| 93 | 93 | * |
| 94 | 94 | * @param object $currency Intraface_modules_currency_Currency |
| 95 | - * @param integer $exchange_rage_id |
|
| 95 | + * @param integer $exchange_rate_id |
|
| 96 | 96 | * @param object $product Product |
| 97 | 97 | * |
| 98 | - * @return obejct Ilib_Variable_Float with price of the variation in given currency |
|
| 98 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price of the variation in given currency |
|
| 99 | 99 | */ |
| 100 | 100 | public function getPriceInCurrency($currency, $exchange_rate_id = 0, $product) |
| 101 | 101 | { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @param object $product Product |
| 111 | 111 | * |
| 112 | - * @return object Ilib_Variable_Float with price including vat |
|
| 112 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat |
|
| 113 | 113 | */ |
| 114 | 114 | public function getPriceIncludingVat($product) |
| 115 | 115 | { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @param integer $exchange_rate_id |
| 130 | 130 | * @param object product Product |
| 131 | 131 | * |
| 132 | - * @return object Ilib_Variable_Float with price including vat in given currency |
|
| 132 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat in given currency |
|
| 133 | 133 | */ |
| 134 | 134 | public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id, $product) |
| 135 | 135 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @param object Product |
| 145 | 145 | * |
| 146 | - * @return object Ilib_Variable_Float with price |
|
| 146 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price |
|
| 147 | 147 | */ |
| 148 | 148 | public function getWeight($product) |
| 149 | 149 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function getPriceInCurrency($currency, $exchange_rate_id = 0, $product) |
| 101 | 101 | { |
| 102 | - return new Ilib_Variable_Float(round($this->getPrice($product)->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2)); |
|
| 102 | + return new Ilib_Variable_Float(round($this->getPrice($product)->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2)); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | public function getPriceIncludingVat($product) |
| 115 | 115 | { |
| 116 | 116 | if (get_class($product) == 'Intraface_modules_product_ProductDoctrine') { |
| 117 | - return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2) * (1 + $product->getDetails()->getVatPercent()->getAsIso()/100)); |
|
| 117 | + return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2)*(1 + $product->getDetails()->getVatPercent()->getAsIso()/100)); |
|
| 118 | 118 | } else { |
| 119 | - return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2) * (1 + $product->get('vat_percent')/100)); |
|
| 119 | + return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2)*(1 + $product->get('vat_percent')/100)); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id, $product) |
| 135 | 135 | { |
| 136 | - return new Ilib_Variable_Float($this->getPriceIncludingVat($product)->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100)); |
|
| 136 | + return new Ilib_Variable_Float($this->getPriceIncludingVat($product)->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * |
| 55 | 55 | * @param object $db The webshop object |
| 56 | 56 | * @param object $intranet The webshop object |
| 57 | - * @param object $webshop The webshop object |
|
| 57 | + * @param object $shop The webshop object |
|
| 58 | 58 | * @param string $session_id A session id |
| 59 | 59 | * |
| 60 | 60 | * @return void |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @param integer $product_id Product to remove |
| 105 | 105 | * @param integer $quantity How many should be removed |
| 106 | 106 | * |
| 107 | - * @return boelean |
|
| 107 | + * @return boolean |
|
| 108 | 108 | */ |
| 109 | 109 | public function remove($product_id, $product_variation_id = 0, $quantity = 1) |
| 110 | 110 | { |
@@ -122,6 +122,7 @@ discard block |
||
| 122 | 122 | * @param integer $quantity The quantity |
| 123 | 123 | * @param string $text To add description to product, not yet implemented |
| 124 | 124 | * @param integer $basketevaluation Wheter the product is from basketevaluation |
| 125 | + * @param integer $product_variation_id |
|
| 125 | 126 | * |
| 126 | 127 | * @return boolean |
| 127 | 128 | */ |
@@ -530,7 +531,7 @@ discard block |
||
| 530 | 531 | /** |
| 531 | 532 | * Gets the total weight of the basket |
| 532 | 533 | * |
| 533 | - * @return float |
|
| 534 | + * @return integer |
|
| 534 | 535 | */ |
| 535 | 536 | public function getTotalWeight() |
| 536 | 537 | { |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | $this->resetItemCache(); |
| 70 | 70 | |
| 71 | 71 | $this->conditions = array( |
| 72 | - 'session_id = ' . $this->db->quote($this->session_id, 'text'), |
|
| 73 | - 'shop_id = ' . $this->db->quote($this->webshop->getId(), 'integer'), |
|
| 74 | - 'intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer')); |
|
| 72 | + 'session_id = '.$this->db->quote($this->session_id, 'text'), |
|
| 73 | + 'shop_id = '.$this->db->quote($this->webshop->getId(), 'integer'), |
|
| 74 | + 'intranet_id = '.$this->db->quote($this->intranet->getId(), 'integer')); |
|
| 75 | 75 | |
| 76 | 76 | $this->cleanUp(); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | private function cleanUp() |
| 80 | 80 | { |
| 81 | - return $this->db->query("DELETE FROM basket WHERE DATE_ADD(date_changed, INTERVAL " . $this->db->quote(self::CLEAN_UP_AFTER, 'integer') . " HOUR) < NOW()"); |
|
| 81 | + return $this->db->query("DELETE FROM basket WHERE DATE_ADD(date_changed, INTERVAL ".$this->db->quote(self::CLEAN_UP_AFTER, 'integer')." HOUR) < NOW()"); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -165,23 +165,23 @@ discard block |
||
| 165 | 165 | FROM basket |
| 166 | 166 | WHERE product_id = ".$product_id." |
| 167 | 167 | AND product_variation_id = ".$product_variation_id." |
| 168 | - AND product_detail_id = " . $product_detail_id . " |
|
| 169 | - AND basketevaluation_product = " . $basketevaluation . " |
|
| 168 | + AND product_detail_id = " . $product_detail_id." |
|
| 169 | + AND basketevaluation_product = " . $basketevaluation." |
|
| 170 | 170 | AND " . $sql_extra); |
| 171 | 171 | |
| 172 | 172 | if ($db->nextRecord()) { |
| 173 | 173 | if ($quantity == 0) { |
| 174 | 174 | $db->query("DELETE FROM basket |
| 175 | - WHERE id = ".$db->f('id') . " |
|
| 176 | - AND basketevaluation_product = " . $basketevaluation . " |
|
| 175 | + WHERE id = ".$db->f('id')." |
|
| 176 | + AND basketevaluation_product = " . $basketevaluation." |
|
| 177 | 177 | AND " . $sql_extra); |
| 178 | 178 | } else { |
| 179 | 179 | $db->query("UPDATE basket SET |
| 180 | 180 | quantity = $quantity, |
| 181 | 181 | date_changed = NOW(), |
| 182 | 182 | text = '".$text."' |
| 183 | - WHERE id = ".$db->f('id') . " |
|
| 184 | - AND basketevaluation_product = " . $basketevaluation . " |
|
| 183 | + WHERE id = ".$db->f('id')." |
|
| 184 | + AND basketevaluation_product = " . $basketevaluation." |
|
| 185 | 185 | AND " . $sql_extra); |
| 186 | 186 | } |
| 187 | 187 | return true; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | quantity = $quantity, |
| 193 | 193 | date_changed = NOW(), |
| 194 | 194 | text = '".$text."', |
| 195 | - basketevaluation_product = " . $basketevaluation . ", |
|
| 195 | + basketevaluation_product = " . $basketevaluation.", |
|
| 196 | 196 | product_id = ".$product_id.", |
| 197 | 197 | product_variation_id = ".$product_variation_id.", |
| 198 | 198 | product_detail_id = ".$product_detail_id.", |
@@ -220,10 +220,10 @@ discard block |
||
| 220 | 220 | settype($input['email'], 'string'); |
| 221 | 221 | settype($input['phone'], 'string'); |
| 222 | 222 | |
| 223 | - $sql = "name = \"".safeToDb($input['name'])."\"," . |
|
| 224 | - "contactperson = \"".safeToDb($input['contactperson'])."\", " . |
|
| 225 | - "address = \"".safeToDb($input['address'])."\", " . |
|
| 226 | - "postcode = \"".safeToDb($input['postcode'])."\", " . |
|
| 223 | + $sql = "name = \"".safeToDb($input['name'])."\",". |
|
| 224 | + "contactperson = \"".safeToDb($input['contactperson'])."\", ". |
|
| 225 | + "address = \"".safeToDb($input['address'])."\", ". |
|
| 226 | + "postcode = \"".safeToDb($input['postcode'])."\", ". |
|
| 227 | 227 | "city = \"".safeToDb($input['city'])."\", ". |
| 228 | 228 | "country = \"".safeToDb($input['country'])."\", ". |
| 229 | 229 | "cvr = \"".safeToDb($input['cvr'])."\", ". |
@@ -305,13 +305,13 @@ discard block |
||
| 305 | 305 | $sql_extra = implode(" AND ", $this->conditions); |
| 306 | 306 | |
| 307 | 307 | $db = new DB_Sql; |
| 308 | - $db->query("SELECT id FROM basket_details WHERE " . $sql_extra. " |
|
| 308 | + $db->query("SELECT id FROM basket_details WHERE ".$sql_extra." |
|
| 309 | 309 | AND intranet_id = " . $this->intranet->getId()); |
| 310 | 310 | if ($db->nextRecord()) { |
| 311 | 311 | $db->query("UPDATE basket_details SET ".$sql.", |
| 312 | 312 | date_changed = NOW() |
| 313 | - WHERE id = ".$db->f('id') . " |
|
| 314 | - AND " . $sql_extra . " |
|
| 313 | + WHERE id = ".$db->f('id')." |
|
| 314 | + AND " . $sql_extra." |
|
| 315 | 315 | AND intranet_id = " . $this->intranet->getId()); |
| 316 | 316 | return true; |
| 317 | 317 | } else { |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $db = new DB_Sql; |
| 340 | 340 | $db->query("SELECT * |
| 341 | 341 | FROM basket_details |
| 342 | - WHERE " . $sql_extra . " |
|
| 342 | + WHERE " . $sql_extra." |
|
| 343 | 343 | AND intranet_id = " . $this->intranet->getId()); |
| 344 | 344 | if (!$db->nextRecord()) { |
| 345 | 345 | return array(); |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $db = new DB_Sql; |
| 370 | 370 | $db->query("SELECT customer_coupon |
| 371 | 371 | FROM basket_details |
| 372 | - WHERE " . $sql_extra . " |
|
| 372 | + WHERE " . $sql_extra." |
|
| 373 | 373 | AND intranet_id = " . $this->intranet->getId()); |
| 374 | 374 | if (!$db->nextRecord()) { |
| 375 | 375 | return array(); |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $db = new DB_Sql; |
| 392 | 392 | $db->query("SELECT customer_ean |
| 393 | 393 | FROM basket_details |
| 394 | - WHERE " . $sql_extra . " |
|
| 394 | + WHERE " . $sql_extra." |
|
| 395 | 395 | AND intranet_id = " . $this->intranet->getId()); |
| 396 | 396 | if (!$db->nextRecord()) { |
| 397 | 397 | return array(); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $db = new DB_Sql; |
| 414 | 414 | $db->query("SELECT customer_comment |
| 415 | 415 | FROM basket_details |
| 416 | - WHERE " . $sql_extra . " |
|
| 416 | + WHERE " . $sql_extra." |
|
| 417 | 417 | AND intranet_id = " . $this->intranet->getId()); |
| 418 | 418 | if (!$db->nextRecord()) { |
| 419 | 419 | return array(); |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $db = new DB_Sql; |
| 436 | 436 | $db->query("SELECT payment_method_key |
| 437 | 437 | FROM basket_details |
| 438 | - WHERE " . $sql_extra . " |
|
| 438 | + WHERE " . $sql_extra." |
|
| 439 | 439 | AND intranet_id = " . $this->intranet->getId()); |
| 440 | 440 | if (!$db->nextRecord() || $db->f('payment_method_key') == 0) { |
| 441 | 441 | return array(); |
@@ -460,10 +460,10 @@ discard block |
||
| 460 | 460 | $db = new DB_Sql; |
| 461 | 461 | $db->query("SELECT * |
| 462 | 462 | FROM basket |
| 463 | - WHERE " . $sql_extra . " |
|
| 464 | - AND product_id = " . $product_id . " |
|
| 463 | + WHERE " . $sql_extra." |
|
| 464 | + AND product_id = " . $product_id." |
|
| 465 | 465 | AND product_variation_id = ".$product_variation_id." |
| 466 | - AND intranet_id = " . $this->intranet->getId() . " |
|
| 466 | + AND intranet_id = " . $this->intranet->getId()." |
|
| 467 | 467 | AND quantity > 0 LIMIT 1"); |
| 468 | 468 | |
| 469 | 469 | if (!$db->nextRecord()) { |
@@ -574,9 +574,9 @@ discard block |
||
| 574 | 574 | ON product.id = basket.product_id |
| 575 | 575 | INNER JOIN product_detail |
| 576 | 576 | ON product.id = product_detail.product_id |
| 577 | - WHERE " . $sql_extra . " |
|
| 577 | + WHERE " . $sql_extra." |
|
| 578 | 578 | AND product_detail.active = 1 |
| 579 | - AND basket.intranet_id = " . $this->intranet->getId() . " |
|
| 579 | + AND basket.intranet_id = " . $this->intranet->getId()." |
|
| 580 | 580 | ORDER BY product_detail.vat DESC, basket.basketevaluation_product"); |
| 581 | 581 | |
| 582 | 582 | $i = 0; |
@@ -627,16 +627,16 @@ discard block |
||
| 627 | 627 | |
| 628 | 628 | // basket specific |
| 629 | 629 | $items[$i]['quantity'] = $db->f('quantity'); |
| 630 | - $items[$i]['totalweight'] = $items[$i]['weight'] * $db->f('quantity'); |
|
| 631 | - $items[$i]['totalprice'] = $db->f('quantity') * $items[$i]['price']; |
|
| 632 | - $items[$i]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['price_incl_vat']; |
|
| 630 | + $items[$i]['totalweight'] = $items[$i]['weight']*$db->f('quantity'); |
|
| 631 | + $items[$i]['totalprice'] = $db->f('quantity')*$items[$i]['price']; |
|
| 632 | + $items[$i]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['price_incl_vat']; |
|
| 633 | 633 | |
| 634 | - $items[$i]['currency']['DKK']['totalprice'] = $db->f('quantity') * $items[$i]['currency']['DKK']['price']; |
|
| 635 | - $items[$i]['currency']['DKK']['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['currency']['DKK']['price_incl_vat']; |
|
| 634 | + $items[$i]['currency']['DKK']['totalprice'] = $db->f('quantity')*$items[$i]['currency']['DKK']['price']; |
|
| 635 | + $items[$i]['currency']['DKK']['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['currency']['DKK']['price_incl_vat']; |
|
| 636 | 636 | if (is_object($currencies) && $currencies->count() > 0) { |
| 637 | 637 | foreach ($currencies as $currency) { |
| 638 | - $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice'] = $db->f('quantity') * $items[$i]['currency'][$currency->getType()->getIsoCode()]['price']; |
|
| 639 | - $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['currency'][$currency->getType()->getIsoCode()]['price_incl_vat']; |
|
| 638 | + $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice'] = $db->f('quantity')*$items[$i]['currency'][$currency->getType()->getIsoCode()]['price']; |
|
| 639 | + $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['currency'][$currency->getType()->getIsoCode()]['price_incl_vat']; |
|
| 640 | 640 | } |
| 641 | 641 | } |
| 642 | 642 | |
@@ -665,10 +665,10 @@ discard block |
||
| 665 | 665 | { |
| 666 | 666 | $sql_extra = implode(" AND ", $this->conditions); |
| 667 | 667 | $db = new DB_Sql; |
| 668 | - $db->query("DELETE FROM basket " . |
|
| 669 | - "WHERE basketevaluation_product = 1 " . |
|
| 670 | - "AND " . $sql_extra . " " . |
|
| 671 | - "AND intranet_id = " . $this->intranet->getId()); |
|
| 668 | + $db->query("DELETE FROM basket ". |
|
| 669 | + "WHERE basketevaluation_product = 1 ". |
|
| 670 | + "AND ".$sql_extra." ". |
|
| 671 | + "AND intranet_id = ".$this->intranet->getId()); |
|
| 672 | 672 | |
| 673 | 673 | $this->resetItemCache(); |
| 674 | 674 | |
@@ -687,8 +687,8 @@ discard block |
||
| 687 | 687 | |
| 688 | 688 | $sql_extra = implode(" AND ", $this->conditions); |
| 689 | 689 | $db = new DB_Sql; |
| 690 | - $db->query("UPDATE basket SET session_id = '' WHERE " . $sql_extra . " AND intranet_id = " . $this->intranet->getId()); |
|
| 691 | - $db->query("UPDATE basket_details SET session_id = '' WHERE " . $sql_extra . " AND intranet_id = " . $this->intranet->getId()); |
|
| 690 | + $db->query("UPDATE basket SET session_id = '' WHERE ".$sql_extra." AND intranet_id = ".$this->intranet->getId()); |
|
| 691 | + $db->query("UPDATE basket_details SET session_id = '' WHERE ".$sql_extra." AND intranet_id = ".$this->intranet->getId()); |
|
| 692 | 692 | |
| 693 | 693 | return true; |
| 694 | 694 | } |