@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | function renderHtml() |
| 16 | 16 | { |
| 17 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/product'); |
|
| 17 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/product'); |
|
| 18 | 18 | return $smarty->render($this); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | |
| 14 | 14 | function renderHtml() |
| 15 | 15 | { |
| 16 | - $this->document->setTitle('Set stock for variations for product ' . $this->getProduct()->get('name')); |
|
| 16 | + $this->document->setTitle('Set stock for variations for product '.$this->getProduct()->get('name')); |
|
| 17 | 17 | |
| 18 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/variations'); |
|
| 18 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/variations'); |
|
| 19 | 19 | return $smarty->render($this, array('variations' => $this->getProduct()->getVariations(), 'product' => $this->context->getProduct())); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | |
| 124 | 124 | function loadItem($id = 0) |
| 125 | 125 | { |
| 126 | - $this->item = new ProcurementItem($this, (int)$id); |
|
| 126 | + $this->item = new ProcurementItem($this, (int)$id); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | function update($input) |
@@ -280,6 +280,9 @@ discard block |
||
| 280 | 280 | return true; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | + /** |
|
| 284 | + * @param string $dk_paid_date |
|
| 285 | + */ |
|
| 283 | 286 | function setPaid($dk_paid_date) |
| 284 | 287 | { |
| 285 | 288 | if ($this->get('id') == 0) { |
@@ -369,6 +372,11 @@ discard block |
||
| 369 | 372 | * |
| 370 | 373 | * @param object year year object |
| 371 | 374 | * @param integer voucher_number |
| 375 | + * @param Year $year |
|
| 376 | + * @param integer $voucher_number |
|
| 377 | + * @param string $voucher_date |
|
| 378 | + * @param integer $credit_account_id |
|
| 379 | + * @param Stub_Translation $translation |
|
| 372 | 380 | * |
| 373 | 381 | * @return boolean |
| 374 | 382 | */ |
@@ -685,7 +693,7 @@ discard block |
||
| 685 | 693 | * |
| 686 | 694 | * @todo: duplicate in Procurement class |
| 687 | 695 | * |
| 688 | - * @return array status types |
|
| 696 | + * @return string[] status types |
|
| 689 | 697 | */ |
| 690 | 698 | private function getStatusTypes() |
| 691 | 699 | { |
@@ -700,7 +708,7 @@ discard block |
||
| 700 | 708 | * returns the possible regions where procurement is bought |
| 701 | 709 | * @todo: duplicate in Procurement class |
| 702 | 710 | * |
| 703 | - * @return array possible regions |
|
| 711 | + * @return string[] possible regions |
|
| 704 | 712 | */ |
| 705 | 713 | public function getRegionTypes() |
| 706 | 714 | { |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | |
| 417 | - $text = $translation->get('procurement').'# ' . $this->get('number') . ': ' . $this->get('description'); |
|
| 417 | + $text = $translation->get('procurement').'# '.$this->get('number').': '.$this->get('description'); |
|
| 418 | 418 | require_once 'Intraface/modules/accounting/Voucher.php'; |
| 419 | 419 | $voucher = Voucher::factory($year, $voucher_number); |
| 420 | 420 | $voucher->save(array( |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $credit_total += $amount; |
| 434 | 434 | |
| 435 | 435 | if (!empty($line['text'])) { |
| 436 | - $line_text = $text. ' - ' . $line['text']; |
|
| 436 | + $line_text = $text.' - '.$line['text']; |
|
| 437 | 437 | } else { |
| 438 | 438 | $line_text = $text; |
| 439 | 439 | } |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | $voucher_date->convert2db(); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | - $db->query("UPDATE procurement SET date_stated = '".$voucher_date->get()."', voucher_id = ".intval($voucher_number)." WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 490 | + $db->query("UPDATE procurement SET date_stated = '".$voucher_date->get()."', voucher_id = ".intval($voucher_number)." WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 491 | 491 | return 1; |
| 492 | 492 | } |
| 493 | 493 | |
@@ -570,15 +570,15 @@ discard block |
||
| 570 | 570 | $total = 0; |
| 571 | 571 | $vat = 0; |
| 572 | 572 | foreach ($debet_accounts as $key => $debet_account) { |
| 573 | - if ($validator->isNumeric($debet_account['amount'], 'Ugyldig beløb i linje ' . ($key + 1) . ' "' . $debet_account['text'] . '"', 'greater_than_zero')) { |
|
| 573 | + if ($validator->isNumeric($debet_account['amount'], 'Ugyldig beløb i linje '.($key + 1).' "'.$debet_account['text'].'"', 'greater_than_zero')) { |
|
| 574 | 574 | $amount = new Intraface_Amount($debet_account['amount']); |
| 575 | 575 | $amount->convert2db(); |
| 576 | 576 | $total += $amount->get(); |
| 577 | 577 | |
| 578 | - $validator->isString($debet_account['text'], 'Ugyldig tekst i linje ' . ($key + 1) . ' "' . $debet_account['text'] . '"', '', 'allow_empty'); |
|
| 578 | + $validator->isString($debet_account['text'], 'Ugyldig tekst i linje '.($key + 1).' "'.$debet_account['text'].'"', '', 'allow_empty'); |
|
| 579 | 579 | |
| 580 | 580 | if (empty($debet_account['state_account_id'])) { |
| 581 | - $this->error->set('Linje ' . ($key + 1) . ' "' . $debet_account['text'] . '" ved ikke hvor den skal bogføres'); |
|
| 581 | + $this->error->set('Linje '.($key + 1).' "'.$debet_account['text'].'" ved ikke hvor den skal bogføres'); |
|
| 582 | 582 | } else { |
| 583 | 583 | require_once 'Intraface/modules/accounting/Account.php'; |
| 584 | 584 | $account = Account::factory($year, $debet_account['state_account_id']); |
@@ -586,9 +586,9 @@ discard block |
||
| 586 | 586 | // @todo check this. I changed it to make sure that we are able to state varekøb til videresalg |
| 587 | 587 | // || $account->get('type') != 'operating' |
| 588 | 588 | if ($account->get('id') == 0) { |
| 589 | - $this->error->set('Ugyldig konto for bogføring af linje ' . ($key + 1) . ' "' . $debet_account['text'] . '"'); |
|
| 589 | + $this->error->set('Ugyldig konto for bogføring af linje '.($key + 1).' "'.$debet_account['text'].'"'); |
|
| 590 | 590 | } elseif ($account->get('vat') == 'in') { |
| 591 | - $vat += $amount->get() / 100 * $account->get('vat_percent'); |
|
| 591 | + $vat += $amount->get()/100*$account->get('vat_percent'); |
|
| 592 | 592 | } |
| 593 | 593 | } |
| 594 | 594 | } |
@@ -605,8 +605,8 @@ discard block |
||
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | if (round($vat, 2) != $this->get('vat')) { |
| 608 | - $expected = number_format($this->get('vat') * 4, 2, ',', '.'); |
|
| 609 | - $this->error->set('Momsen af de beløb du bogfører på konti med moms stemmer ikke overens med momsen på det samlede indkøb (vi forventede '.number_format($vat, 2, ',', '.').' i moms og det samlede beløb burde have været ' . $expected . '). Har du fået alle varer med? Har du husket at skrive beløbet uden moms for varerne?'); |
|
| 608 | + $expected = number_format($this->get('vat')*4, 2, ',', '.'); |
|
| 609 | + $this->error->set('Momsen af de beløb du bogfører på konti med moms stemmer ikke overens med momsen på det samlede indkøb (vi forventede '.number_format($vat, 2, ',', '.').' i moms og det samlede beløb burde have været '.$expected.'). Har du fået alle varer med? Har du husket at skrive beløbet uden moms for varerne?'); |
|
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | |
@@ -635,15 +635,15 @@ discard block |
||
| 635 | 635 | $total = 0; |
| 636 | 636 | $vat = 0; |
| 637 | 637 | foreach ($debet_accounts as $key => $debet_account) { |
| 638 | - if ($validator->isNumeric($debet_account['amount'], 'Ugyldig beløb i linje ' . ($key + 1) . ' "' . $debet_account['text'] . '"', 'greater_than_zero')) { |
|
| 638 | + if ($validator->isNumeric($debet_account['amount'], 'Ugyldig beløb i linje '.($key + 1).' "'.$debet_account['text'].'"', 'greater_than_zero')) { |
|
| 639 | 639 | $amount = new Intraface_Amount($debet_account['amount']); |
| 640 | 640 | $amount->convert2db(); |
| 641 | 641 | $total += $amount->get(); |
| 642 | 642 | |
| 643 | - $validator->isString($debet_account['text'], 'Ugyldig tekst i linje ' . ($key + 1) . ' "' . $debet_account['text'] . '"', '', 'allow_empty'); |
|
| 643 | + $validator->isString($debet_account['text'], 'Ugyldig tekst i linje '.($key + 1).' "'.$debet_account['text'].'"', '', 'allow_empty'); |
|
| 644 | 644 | |
| 645 | 645 | if (empty($debet_account['state_account_id'])) { |
| 646 | - $this->error->set('Linje ' . ($key + 1) . ' "' . $debet_account['text'] . '" ved ikke hvor den skal bogføres'); |
|
| 646 | + $this->error->set('Linje '.($key + 1).' "'.$debet_account['text'].'" ved ikke hvor den skal bogføres'); |
|
| 647 | 647 | } else { |
| 648 | 648 | require_once 'Intraface/modules/accounting/Account.php'; |
| 649 | 649 | $account = Account::factory($year, $debet_account['state_account_id']); |
@@ -651,9 +651,9 @@ discard block |
||
| 651 | 651 | // @todo check this. I changed it to make sure that we are able to state varekøb til videresalg |
| 652 | 652 | // || $account->get('type') != 'operating' |
| 653 | 653 | if ($account->get('id') == 0) { |
| 654 | - $this->error->set('Ugyldig konto for bogføring af linje ' . ($key + 1) . ' "' . $debet_account['text'] . '"'); |
|
| 654 | + $this->error->set('Ugyldig konto for bogføring af linje '.($key + 1).' "'.$debet_account['text'].'"'); |
|
| 655 | 655 | } elseif ($account->get('vat') == 'in') { |
| 656 | - $vat += $amount->get() / 100 * $account->get('vat_percent'); |
|
| 656 | + $vat += $amount->get()/100*$account->get('vat_percent'); |
|
| 657 | 657 | } |
| 658 | 658 | } |
| 659 | 659 | } |
@@ -670,8 +670,8 @@ discard block |
||
| 670 | 670 | |
| 671 | 671 | if (round($vat, 2) != $this->get('vat')) { |
| 672 | 672 | $expected_vat = number_format($vat, 2, ',', '.'); |
| 673 | - $expected_value = number_format($this->get('vat') * 4, 2, ',', '.'); |
|
| 674 | - $this->error->set('Momsen af de beløb du bogfører på konti med moms stemmer ikke overens med momsen på det samlede indkøb (vi forventede ' . $expected_vat . ' i moms og det samlede beløb burde have været ' . $expected_value . '). Har du fået alle varer med? Har du husket at skrive beløbet uden moms for varerne?'); |
|
| 673 | + $expected_value = number_format($this->get('vat')*4, 2, ',', '.'); |
|
| 674 | + $this->error->set('Momsen af de beløb du bogfører på konti med moms stemmer ikke overens med momsen på det samlede indkøb (vi forventede '.$expected_vat.' i moms og det samlede beløb burde have været '.$expected_value.'). Har du fået alle varer med? Har du husket at skrive beløbet uden moms for varerne?'); |
|
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | if ($this->error->isError()) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'procurements' => $procurements |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
| 70 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
| 71 | 71 | return $smarty->render($this, $data); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'gateway' => $this->getProcurementGateway() |
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/procurement-edit'); |
|
| 85 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/procurement-edit'); |
|
| 86 | 86 | return $smarty->render($this, $data); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | if (isset($_GET['change_product'])) { |
| 68 | 68 | $redirect = Intraface_Redirect::factory($this->getKernel(), 'go'); |
| 69 | - $url = $redirect->setDestination(NET_SCHEME . NET_HOST . $this->url('selectproduct'), NET_SCHEME . NET_HOST . $this->url()); |
|
| 69 | + $url = $redirect->setDestination(NET_SCHEME.NET_HOST.$this->url('selectproduct'), NET_SCHEME.NET_HOST.$this->url()); |
|
| 70 | 70 | $redirect->askParameter('product_id'); |
| 71 | 71 | return new k_SeeOther($url); |
| 72 | 72 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $data = array('procurement' => $procurement, 'values' => $values); |
| 83 | 83 | |
| 84 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/item-edit'); |
|
| 84 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/item-edit'); |
|
| 85 | 85 | return $tpl->render($this, $data); |
| 86 | 86 | |
| 87 | 87 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $currency_iso_code = 'DKK'; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' ' . $amount)); |
|
| 16 | + $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' '.$amount)); |
|
| 17 | 17 | } |
| 18 | 18 | return $table->getTable(); |
| 19 | 19 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public function getAmount() |
| 91 | 91 | { |
| 92 | - return new Ilib_Variable_Float($this->getQuantity()->getAsIso(2) * $this->getProductPriceObject()->getPriceIncludingVat($this->getProduct())->getAsIso(2), 'iso'); |
|
| 92 | + return new Ilib_Variable_Float($this->getQuantity()->getAsIso(2)*$this->getProductPriceObject()->getPriceIncludingVat($this->getProduct())->getAsIso(2), 'iso'); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | public function getQuantity() |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 'kernel' => $this->context->getKernel(), |
| 59 | 59 | 'scan_in_contact' => $scan_in_contact); |
| 60 | 60 | |
| 61 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/settings'); |
|
| 61 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/settings'); |
|
| 62 | 62 | return $smarty->render($this, $data); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $contact_module = $this->context->getKernel()->useModule('contact'); |
| 116 | 116 | |
| 117 | 117 | $redirect = Intraface_Redirect::factory($this->context->getKernel(), 'go'); |
| 118 | - $url = $redirect->setDestination(NET_SCHEME . NET_HOST . $this->url('contact'), $debtor_module->getPath()."settings"); |
|
| 118 | + $url = $redirect->setDestination(NET_SCHEME.NET_HOST.$this->url('contact'), $debtor_module->getPath()."settings"); |
|
| 119 | 119 | $redirect->askParameter('contact_id'); |
| 120 | 120 | $redirect->setIdentifier('contact'); |
| 121 | 121 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | function renderHtml() |
| 18 | 18 | { |
| 19 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/payment'); |
|
| 19 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/payment'); |
|
| 20 | 20 | return $smarty->render($this); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $payment = $this->getModel(); |
| 26 | 26 | if ($id = $payment->update($_POST)) { |
| 27 | 27 | if ($this->getKernel()->user->hasModuleAccess('accounting')) { |
| 28 | - return new k_SeeOther($this->url($id . '/state')); |
|
| 28 | + return new k_SeeOther($this->url($id.'/state')); |
|
| 29 | 29 | } else { |
| 30 | 30 | return new k_SeeOther($this->url('../')); |
| 31 | 31 | } |