/**
  * Construct currencies admin controller
  *
  * @param Request $request
  * @return CurrenciesAdminController
  */
 function __construct($request)
 {
     parent::__construct($request);
     $currency_id = $this->request->getId('currency_id');
     if ($currency_id) {
         $this->active_currency = Currencies::findById($currency_id);
     }
     // if
     if (!instance_of($this->active_currency, 'Currency')) {
         $this->active_currency = new Currency();
     }
     // if
     $add_currency_url = assemble_url('admin_currencies_add');
     $this->wireframe->addBreadCrumb(lang('Currencies'), assemble_url('admin_currencies'));
     $this->wireframe->addPageAction(lang('New Currency'), $add_currency_url);
     $this->smarty->assign(array('active_currency' => $this->active_currency, 'add_currency_url' => $add_currency_url));
     js_assign('invoicing_precision', INVOICE_PRECISION);
 }
Ejemplo n.º 2
0
 /**
  * Return invoice currency
  *
  * @param void
  * @return Currency
  */
 function getCurrency()
 {
     if ($this->currency === false) {
         $this->currency = Currencies::findById($this->getCurrencyId());
     }
     // if
     return $this->currency;
 }