@@ -39,10 +39,11 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * States the payment i the given year |
41 | 41 | * |
42 | - * @param object $year Accounting Year object |
|
42 | + * @param Year $year Accounting Year object |
|
43 | 43 | * @param integer $voucher_number |
44 | 44 | * @param string $voucher_date |
45 | 45 | * @param integer $state_account_number |
46 | + * @param Stub_Translation $translation |
|
46 | 47 | * |
47 | 48 | * @return boolean true on succes or false. |
48 | 49 | */ |
@@ -136,7 +137,7 @@ discard block |
||
136 | 137 | /** |
137 | 138 | * returns possible payment types |
138 | 139 | * |
139 | - * @return array payment types |
|
140 | + * @return string[] payment types |
|
140 | 141 | * |
141 | 142 | */ |
142 | 143 | public static function getTypes() |
@@ -149,7 +150,7 @@ discard block |
||
149 | 150 | /** |
150 | 151 | * returns the possible types payments can be for. |
151 | 152 | * |
152 | - * @return array payment for types |
|
153 | + * @return string[] payment for types |
|
153 | 154 | */ |
154 | 155 | private static function getPaymentForTypes() |
155 | 156 | { |
@@ -127,7 +127,7 @@ |
||
127 | 127 | } |
128 | 128 | |
129 | 129 | $db = new DB_sql; |
130 | - $db->query("UPDATE invoice_payment SET date_stated = NOW(), voucher_id = ".$voucher->get('id').' WHERE id = '. $this->id.' AND intranet_id = '.$this->kernel->intranet->getId()); |
|
130 | + $db->query("UPDATE invoice_payment SET date_stated = NOW(), voucher_id = ".$voucher->get('id').' WHERE id = '.$this->id.' AND intranet_id = '.$this->kernel->intranet->getId()); |
|
131 | 131 | |
132 | 132 | $this->load(); |
133 | 133 | return true; |
@@ -17,6 +17,9 @@ discard block |
||
17 | 17 | parent::__construct($kernel, 'invoice', $id); |
18 | 18 | } |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $status |
|
22 | + */ |
|
20 | 23 | function setStatus($status) |
21 | 24 | { |
22 | 25 | if ($status == 'cancelled') { |
@@ -58,7 +61,7 @@ discard block |
||
58 | 61 | /** |
59 | 62 | * returns DebtorAccount object |
60 | 63 | * |
61 | - * @return object DebtorAccount |
|
64 | + * @return DebtorAccount DebtorAccount |
|
62 | 65 | */ |
63 | 66 | public function getDebtorAccount() |
64 | 67 | { |
@@ -150,6 +153,10 @@ discard block |
||
150 | 153 | * @param object year stating year |
151 | 154 | * @param integer voucher_number |
152 | 155 | * @param string voucher_date |
156 | + * @param Year $year |
|
157 | + * @param integer $voucher_number |
|
158 | + * @param string $voucher_date |
|
159 | + * @param Stub_Translation $translation |
|
153 | 160 | * @return boolean true or false |
154 | 161 | */ |
155 | 162 | function state($year, $voucher_number, $voucher_date, $translation) |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $db = new DB_Sql; |
34 | 34 | $sql = "SELECT id FROM debtor |
35 | - WHERE type=3 AND status=1 AND active = 1 AND due_date < NOW() AND intranet_id = ".$this->kernel->intranet->get("id")." AND contact_id = " . $contact_id; |
|
35 | + WHERE type=3 AND status=1 AND active = 1 AND due_date < NOW() AND intranet_id = ".$this->kernel->intranet->get("id")." AND contact_id = ".$contact_id; |
|
36 | 36 | $db->query($sql); |
37 | 37 | |
38 | 38 | return $db->numRows(); |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | for ($i = 0, $max = count($items); $i < $max; $i++) { |
130 | 130 | $product = new Product($this->kernel, $items[$i]['product_id']); |
131 | 131 | if ($product->get('state_account_id') == 0) { |
132 | - $this->error->set('Produktet ' . $product->get('name') . ' ved ikke hvor den skal bogf�res'); |
|
132 | + $this->error->set('Produktet '.$product->get('name').' ved ikke hvor den skal bogf�res'); |
|
133 | 133 | } else { |
134 | 134 | require_once 'Intraface/modules/accounting/Account.php'; |
135 | 135 | $account = Account::factory($year, $product->get('state_account_id')); |
136 | 136 | if ($account->get('id') == 0 || $account->get('type') != 'operating') { |
137 | - $this->error->set('Ugyldig konto for bogføring af produktet ' . $product->get('name')); |
|
137 | + $this->error->set('Ugyldig konto for bogføring af produktet '.$product->get('name')); |
|
138 | 138 | $return = false; |
139 | 139 | } |
140 | 140 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $debet_account_number = $debet_account->get('number'); |
208 | 208 | $voucher = Voucher::factory($year, $voucher_number); |
209 | 209 | |
210 | - $amount = $item['quantity'] * $item['price']->getAsIso(2); |
|
210 | + $amount = $item['quantity']*$item['price']->getAsIso(2); |
|
211 | 211 | |
212 | 212 | // hvis bel�bet er mindre end nul, skal konti byttes om og bel�bet skal g�res positivt |
213 | 213 | if ($amount < 0) { |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | 'debet_account_number' => $debet_account_number, |
225 | 225 | 'credit_account_number' => $credit_account_number, |
226 | 226 | 'vat_off' => 1, |
227 | - 'text' => $text . ' - ' . $item['name'] |
|
227 | + 'text' => $text.' - '.$item['name'] |
|
228 | 228 | ); |
229 | 229 | |
230 | 230 | if ($credit_account->get('vat') == 'out') { |
231 | - $total_with_vat += $item["quantity"] * $item["price"]->getAsIso(2); |
|
231 | + $total_with_vat += $item["quantity"]*$item["price"]->getAsIso(2); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | if (!$voucher->saveInDaybook($input_values, true)) { |
@@ -241,16 +241,16 @@ discard block |
||
241 | 241 | if ($total_with_vat > 0) { |
242 | 242 | $voucher = Voucher::factory($year, $voucher_number); |
243 | 243 | $credit_account = new Account($year, $year->getSetting('vat_out_account_id')); |
244 | - $debet_account = new Account($year, $year->getSetting('debtor_account_id')); |
|
244 | + $debet_account = new Account($year, $year->getSetting('debtor_account_id')); |
|
245 | 245 | $input_values = array( |
246 | 246 | 'voucher_number' => $voucher_number, |
247 | 247 | 'reference' => $this->get('number'), |
248 | 248 | 'date' => $voucher_date, |
249 | - 'amount' => number_format($total_with_vat * $this->kernel->setting->get('intranet', 'vatpercent') / 100, 2, ",", "."), // opm�rksom p� at vat bliver rigtig defineret |
|
249 | + 'amount' => number_format($total_with_vat*$this->kernel->setting->get('intranet', 'vatpercent')/100, 2, ",", "."), // opm�rksom p� at vat bliver rigtig defineret |
|
250 | 250 | 'debet_account_number' => $debet_account->get('number'), |
251 | 251 | 'credit_account_number' => $credit_account->get('number'), |
252 | 252 | 'vat_off' => 1, |
253 | - 'text' => $text . ' - ' . $credit_account->get('name') |
|
253 | + 'text' => $text.' - '.$credit_account->get('name') |
|
254 | 254 | ); |
255 | 255 | if (!$voucher->saveInDaybook($input_values, true)) { |
256 | 256 | $this->error->merge($voucher->error->getMessage()); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | require_once 'Intraface/modules/accounting/VoucherFile.php'; |
261 | 261 | $voucher_file = new VoucherFile($voucher); |
262 | - if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'invoice','belong_to_id'=>$this->get('id')))) { |
|
262 | + if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'invoice', 'belong_to_id'=>$this->get('id')))) { |
|
263 | 263 | $this->error->merge($voucher_file->error->getMessage()); |
264 | 264 | $this->error->set('Filen blev ikke overflyttet'); |
265 | 265 | } |
@@ -360,10 +360,11 @@ discard block |
||
360 | 360 | /** |
361 | 361 | * States the payment i the given year |
362 | 362 | * |
363 | - * @param object $year Accounting Year object |
|
363 | + * @param Year $year Accounting Year object |
|
364 | 364 | * @param integer $voucher_number |
365 | 365 | * @param string $voucher_date |
366 | 366 | * @param integer $state_account_number |
367 | + * @param Stub_Translation $translation |
|
367 | 368 | * |
368 | 369 | * @return boolean true on succes or false. |
369 | 370 | */ |
@@ -454,7 +455,7 @@ discard block |
||
454 | 455 | /** |
455 | 456 | * returns possible payment types |
456 | 457 | * |
457 | - * @return array payment types |
|
458 | + * @return string[] payment types |
|
458 | 459 | * |
459 | 460 | */ |
460 | 461 | public static function getTypes() |
@@ -469,7 +470,7 @@ discard block |
||
469 | 470 | /** |
470 | 471 | * returns the possible types payments can be for. |
471 | 472 | * |
472 | - * @return array payment for types |
|
473 | + * @return string[] payment for types |
|
473 | 474 | */ |
474 | 475 | private static function getPaymentForTypes() |
475 | 476 | { |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | |
49 | 49 | public function load() |
50 | 50 | { |
51 | - $result = $this->db->query('SELECT id, amount, type, description, payment_date, payment_for_id, DATE_FORMAT(payment_date, "%d-%m-%Y") AS dk_payment_date, date_stated, voucher_id FROM invoice_payment ' . |
|
52 | - 'WHERE intranet_id = '.$this->kernel->intranet->get('id').' ' . |
|
53 | - 'AND payment_for = '.$this->payment_for_type_id.' ' . |
|
54 | - 'AND payment_for_id = '.$this->payment_for_id.' ' . |
|
55 | - 'AND type IN ('.implode(',', array_keys($this->getTypes())).')' . |
|
51 | + $result = $this->db->query('SELECT id, amount, type, description, payment_date, payment_for_id, DATE_FORMAT(payment_date, "%d-%m-%Y") AS dk_payment_date, date_stated, voucher_id FROM invoice_payment '. |
|
52 | + 'WHERE intranet_id = '.$this->kernel->intranet->get('id').' '. |
|
53 | + 'AND payment_for = '.$this->payment_for_type_id.' '. |
|
54 | + 'AND payment_for_id = '.$this->payment_for_id.' '. |
|
55 | + 'AND type IN ('.implode(',', array_keys($this->getTypes())).')'. |
|
56 | 56 | 'AND id = '.$this->id); |
57 | 57 | |
58 | 58 | if (PEAR::isError($result)) { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | $types = $this->getPaymentForTypes(); |
430 | 430 | // translation is needed! |
431 | - $text = $translation->get('Payment') . ' ' . $this->get('description') . ' ('.$translation->get($types[$this->payment_for_type_id]).' #'.$this->payment_for->get('number') . ')'; |
|
431 | + $text = $translation->get('Payment').' '.$this->get('description').' ('.$translation->get($types[$this->payment_for_type_id]).' #'.$this->payment_for->get('number').')'; |
|
432 | 432 | |
433 | 433 | $input_values = array( |
434 | 434 | 'voucher_number' => $voucher_number, |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | |
447 | 447 | $db = new DB_sql; |
448 | - $db->query("UPDATE invoice_payment SET date_stated = NOW(), voucher_id = ".$voucher->get('id') . " WHERE intranet_id = " . $this->kernel->intranet->getId() . ' AND id = ' . $this->id); |
|
448 | + $db->query("UPDATE invoice_payment SET date_stated = NOW(), voucher_id = ".$voucher->get('id')." WHERE intranet_id = ".$this->kernel->intranet->getId().' AND id = '.$this->id); |
|
449 | 449 | |
450 | 450 | $this->load(); |
451 | 451 | return true; |
@@ -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 |