protected function setVariableValues() {
 	parent::setVariableValues();    	
 	$this->setVariable('invoice', $this->payout->getInvoice());
 	$this->setVariable('affiliatenote', $this->payout->getAffiliateNote());
 	$this->setVariable('amount', $this->payout->getAmountAsText());
 	$this->setVariable('invoicenumber', $this->payout->getInvoiceNumber());
 }
Ejemplo n.º 2
0
 /**
  *
  * @service affiliate_invoice read
  * @param $fields
  */
 public function previewInvoice(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     
     $user = new Pap_Affiliates_User();
     
     $applyVat = $form->getFieldValue('applyVat');
     $payoutInvoice = $form->getFieldValue('payoutInvoice');
     
     
     $user->setId($form->getFieldValue('userid'));
     try {
         $user->load();
     } catch (Gpf_Exception $e) {
         $this->invoiceHtml = $this->_("You have to select user");
         return $this;
     }
     
     $currency = Pap_Common_Utils_CurrencyUtils::getDefaultCurrency();
     $payout = new Pap_Common_Payout($user, $currency, 1, 123456);
     $payout->setApplyVat($applyVat);
     $payout->generateInvoice($payoutInvoice);
     $this->invoiceHtml = $payout->getInvoice(); 
     return $this;
 }