@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * Creates the keywords object |
52 | 52 | * |
53 | - * @return object |
|
53 | + * @return Keyword |
|
54 | 54 | */ |
55 | 55 | public function getKeywords() |
56 | 56 | { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * Constructor |
30 | 30 | * |
31 | - * @param object $file_handler |
|
31 | + * @param FileHandler $file_handler |
|
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | * |
142 | 142 | * @param float $width Width |
143 | 143 | * @param float $height Height |
144 | - * @param float $offset_x offset x |
|
145 | - * @param float $offset_y offset y |
|
144 | + * @param integer $offset_x offset x |
|
145 | + * @param integer $offset_y offset y |
|
146 | 146 | * |
147 | 147 | * @return string new file name |
148 | 148 | */ |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | - /** |
|
3 | - * Image handler. Klarer h�ndtering af billeder. |
|
4 | - * |
|
5 | - * @package Intraface |
|
6 | - * @author: Sune |
|
7 | - * @version: 1.0 |
|
8 | - * |
|
9 | - */ |
|
2 | + /** |
|
3 | + * Image handler. Klarer h�ndtering af billeder. |
|
4 | + * |
|
5 | + * @package Intraface |
|
6 | + * @author: Sune |
|
7 | + * @version: 1.0 |
|
8 | + * |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | class ImageHandler extends Intraface_Standard |
12 | 12 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->image_library = IMAGE_LIBRARY; |
55 | 55 | |
56 | 56 | if ($this->file_handler->get('is_image') != 1) { |
57 | - throw new Exception("Filtypen " . $file_handler->get('mime_type') . " er ikke et billede, og kan derfor ikke manipuleres i ImageHandler"); |
|
57 | + throw new Exception("Filtypen ".$file_handler->get('mime_type')." er ikke et billede, og kan derfor ikke manipuleres i ImageHandler"); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $this->tempdir_path = $this->file_handler->getTemporaryDirectory(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $image = Image_Transform::factory($this->image_library); |
82 | 82 | if (PEAR::isError($image)) { |
83 | - throw new Exception($image->getMessage() . $image->getUserInfo()); |
|
83 | + throw new Exception($image->getMessage().$image->getUserInfo()); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ($this->tmp_file_name != null && file_exists($this->tmp_file_name)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $image = Image_Transform::factory($this->image_library); |
152 | 152 | if (PEAR::isError($image)) { |
153 | - throw new Exception($image->getMessage() . $image->getUserInfo()); |
|
153 | + throw new Exception($image->getMessage().$image->getUserInfo()); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | if ($this->tmp_file_name != null && file_exists($this->tmp_file_name)) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $result = $image->crop($width, $height, $offset_x, $offset_y); |
169 | 169 | |
170 | 170 | if (PEAR::isError($result)) { |
171 | - throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: " . $result->getMessage()); |
|
171 | + throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: ".$result->getMessage()); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $file_type = $this->file_handler->get('file_type'); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param object $file_handler File handler object |
35 | 35 | * @param integer $id Optional id |
36 | 36 | * |
37 | - * @return void |
|
37 | + * @return string |
|
38 | 38 | */ |
39 | 39 | function __construct($file_handler, $id = 0) |
40 | 40 | { |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * Factory |
67 | 67 | * |
68 | - * @param object $file_handler File handler |
|
69 | - * @param string $type the instance type |
|
68 | + * @param FileHandler $file_handler File handler |
|
70 | 69 | * @param array $param one or more of crop_width, crop_height, crop_offset_x, crop_offset_y |
70 | + * @param string $type_name |
|
71 | 71 | * |
72 | - * @return object |
|
72 | + * @return InstanceHandler |
|
73 | 73 | */ |
74 | 74 | function factory($file_handler, $type_name, $param = array()) |
75 | 75 | { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | type_key = ".$type['type_key'].", |
124 | 124 | file_size = ".(int)$file_size.", |
125 | 125 | width = ".(int)$width.", |
126 | - height = ".(int)$height.", " . |
|
126 | + height = ".(int)$height.", ". |
|
127 | 127 | "crop_parameter = \"".safeToDb($crop_param_string)."\""); |
128 | 128 | |
129 | 129 | $id = $db->insertedId(); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | //$this->value['predefined_size'] = $db->f('predefined_size'); |
188 | 188 | $this->value['server_file_name'] = $db->f('server_file_name'); |
189 | 189 | $this->value['file_size'] = $db->f('file_size'); |
190 | - $this->value['file_path'] = $this->instance_path . $db->f('server_file_name'); |
|
190 | + $this->value['file_path'] = $this->instance_path.$db->f('server_file_name'); |
|
191 | 191 | |
192 | 192 | $this->value['last_modified'] = filemtime($this->get('file_path')); |
193 | 193 | // $this->value['file_uri'] = FILE_VIEWER.'?id='.$this->get('id').'&type='.$this->get('type').'&name=/'.urlencode($this->file_handler->get('file_name')); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | /** |
35 | 35 | * Constructor |
36 | 36 | * |
37 | - * @param object $file_handler |
|
37 | + * @param object $filehandler |
|
38 | 38 | * @param string $file_name the name of the temporary file. |
39 | 39 | */ |
40 | 40 | public function __construct($filehandler, $file_name = null) |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @var string $file_path |
26 | 26 | */ |
27 | - private $file_path ; |
|
27 | + private $file_path; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @var string $file_dir |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if (strlen($file_name) > 50) { |
116 | 116 | $extension = strrchr($file_name, '.'); |
117 | 117 | if ($extension !== false && (strlen($extension) == 4 || strlen($extension) == 5)) { |
118 | - $file_name = substr($file_name, 0, 50-strlen($extension)).$extension; |
|
118 | + $file_name = substr($file_name, 0, 50 - strlen($extension)).$extension; |
|
119 | 119 | } else { |
120 | 120 | $file_name = substr($file_name, 0, 50); |
121 | 121 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | * then the filehandler->save method should rather accept some kind of file object which this |
71 | 71 | * object could generate? |
72 | 72 | * |
73 | - * @param object $file_handler A filehandler |
|
73 | + * @param FileHandler $file_handler A filehandler |
|
74 | 74 | * |
75 | 75 | * @return void |
76 | 76 | */ |
@@ -288,7 +288,7 @@ |
||
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | |
291 | - $ext = substr($file, strrpos($file, ".")+1); |
|
291 | + $ext = substr($file, strrpos($file, ".") + 1); |
|
292 | 292 | |
293 | 293 | if (strlen($ext) < 3 || strlen($ext) > 4) { |
294 | 294 | $this->file_handler->error->set("Filen \"".$file."\" har ikke en gyldig endelse, f.eks. .pdf"); |
@@ -85,6 +85,9 @@ |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param string $module_name |
|
90 | + */ |
|
88 | 91 | public function registerModule($module_name) |
89 | 92 | { |
90 | 93 | $gateway = new Intraface_ModuleGateway(MDB2::singleton(DB_DSN)); |
@@ -15,6 +15,9 @@ discard block |
||
15 | 15 | parent::__construct($kernel, 'credit_note', $id); |
16 | 16 | } |
17 | 17 | |
18 | + /** |
|
19 | + * @param string $status |
|
20 | + */ |
|
18 | 21 | function setStatus($status) |
19 | 22 | { |
20 | 23 | $return = parent::setStatus($status); |
@@ -37,6 +40,9 @@ discard block |
||
37 | 40 | } |
38 | 41 | } |
39 | 42 | |
43 | + /** |
|
44 | + * @return boolean |
|
45 | + */ |
|
40 | 46 | function readyForState($year, $check_products = 'check_products') |
41 | 47 | { |
42 | 48 | if (!is_object($year)) { |
@@ -94,6 +100,14 @@ discard block |
||
94 | 100 | |
95 | 101 | } |
96 | 102 | |
103 | + /** |
|
104 | + * @param Year $year |
|
105 | + * @param integer $voucher_number |
|
106 | + * @param string $voucher_date |
|
107 | + * @param Stub_Translation $translation |
|
108 | + * |
|
109 | + * @return boolean |
|
110 | + */ |
|
97 | 111 | function state($year, $voucher_number, $voucher_date, $translation) |
98 | 112 | { |
99 | 113 | if (!is_object($year)) { |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | for ($i = 0, $max = count($items); $i < $max; $i++) { |
79 | 79 | $product = new Product($this->kernel, $items[$i]['product_id']); |
80 | 80 | if ($product->get('state_account_id') == 0) { |
81 | - $this->error->set('Produktet ' . $product->get('name') . ' ved ikke hvor den skal bogf�res'); |
|
81 | + $this->error->set('Produktet '.$product->get('name').' ved ikke hvor den skal bogf�res'); |
|
82 | 82 | } else { |
83 | 83 | require_once 'Intraface/modules/accounting/Account.php'; |
84 | 84 | $account = Account::factory($year, $product->get('state_account_id')); |
85 | 85 | if ($account->get('id') == 0 || $account->get('type') != 'operating') { |
86 | - $this->error->set('Ugyldig konto for bogf�ring af produktet ' . $product->get('name')); |
|
86 | + $this->error->set('Ugyldig konto for bogf�ring af produktet '.$product->get('name')); |
|
87 | 87 | $return = false; |
88 | 88 | } |
89 | 89 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $voucher->save(array( |
134 | 134 | 'voucher_number' => $voucher_number, |
135 | 135 | 'date' => $voucher_date, |
136 | - 'text' => 'Kreditnota #' . $this->get('number') |
|
136 | + 'text' => 'Kreditnota #'.$this->get('number') |
|
137 | 137 | )); |
138 | 138 | |
139 | 139 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $credit_account_number = $credit_account->get('number'); |
149 | 149 | $voucher = Voucher::factory($year, $voucher_number); |
150 | 150 | |
151 | - $amount = $item['quantity'] * $item['price']->getAsIso(2); |
|
151 | + $amount = $item['quantity']*$item['price']->getAsIso(2); |
|
152 | 152 | |
153 | 153 | // hvis bel�bet er mindre end nul, skal konti byttes om og bel�bet skal g�res positivt |
154 | 154 | if ($amount < 0) { |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | 'debet_account_number' => $debet_account_number, |
166 | 166 | 'credit_account_number' => $credit_account_number, |
167 | 167 | 'vat_off' => 1, |
168 | - 'text' => $text.' #' . $this->get('number') . ' - ' . $item['name'] |
|
168 | + 'text' => $text.' #'.$this->get('number').' - '.$item['name'] |
|
169 | 169 | ); |
170 | 170 | if ($debet_account->get('vat') == 'out') { |
171 | - $total_with_vat += $item["quantity"] * $item["price"]->getAsIso(2); |
|
171 | + $total_with_vat += $item["quantity"]*$item["price"]->getAsIso(2); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | if (!$voucher->saveInDaybook($input_values, true)) { |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | 'voucher_number' => $voucher_number, |
186 | 186 | 'reference' => $this->get('number'), |
187 | 187 | 'date' => $voucher_date, |
188 | - 'amount' => number_format($total_with_vat * $this->kernel->setting->get('intranet', 'vatpercent') / 100, 2, ",", "."), // opm�rksom p� at vat bliver rigtig defineret |
|
188 | + 'amount' => number_format($total_with_vat*$this->kernel->setting->get('intranet', 'vatpercent')/100, 2, ",", "."), // opm�rksom p� at vat bliver rigtig defineret |
|
189 | 189 | 'debet_account_number' => $debet_account->get('number'), |
190 | 190 | 'credit_account_number' => $credit_account->get('number'), |
191 | 191 | 'vat_off' => 1, |
192 | - 'text' => $text.' #' . $this->get('number') . ' - ' . $debet_account->get('name') |
|
192 | + 'text' => $text.' #'.$this->get('number').' - '.$debet_account->get('name') |
|
193 | 193 | ); |
194 | 194 | if (!$voucher->saveInDaybook($input_values, true)) { |
195 | 195 | $this->error->merge($voucher->error->getMessage()); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | require_once 'Intraface/modules/accounting/VoucherFile.php'; |
200 | 200 | $voucher_file = new VoucherFile($voucher); |
201 | - if (!$voucher_file->save(array('description' => $text.' #' . $this->get('number'), 'belong_to'=>'credit_note','belong_to_id'=>$this->get('id')))) { |
|
201 | + if (!$voucher_file->save(array('description' => $text.' #'.$this->get('number'), 'belong_to'=>'credit_note', 'belong_to_id'=>$this->get('id')))) { |
|
202 | 202 | $this->error->merge($voucher_file->error->getMessage()); |
203 | 203 | $this->error->set('Filen blev ikke overflyttet'); |
204 | 204 | } |
@@ -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 | } |