Exemplo n.º 1
0
 /**
  * Generate final tax sumary
  * 
  * @return array
  */
 private function getFinalTaxSummary()
 {
     $summary = array();
     foreach ($this->data->getTaxes() as $key => $value) {
         $sum = array("name" => $value, "rate" => $key, "outTax" => 0, "tax" => 0, "withTax" => 0);
         foreach ($this->data->getItems() as $item) {
             if ($item->getTax()->inUpperDecimal() == ($key + 100) / 100) {
                 $sum["outTax"] += $item->getUnits() * $item->countUntaxedUnitValue();
                 $sum["tax"] += $item->countTaxValue();
                 $sum["withTax"] += $item->countFinalValue();
             }
         }
         $summary[] = $sum;
     }
     return $summary;
 }
Exemplo n.º 2
0
 /**
  * Generates symbols into template.
  *
  * @param ITemplate $template
  * @return void
  */
 private function generateSymbols(ITemplate $template)
 {
     $template->variableSymbol = $this->data->getVariableSymbol();
     $template->specificSymbol = $this->data->getSpecificSymbol();
     $template->constantSymbol = $this->data->getConstantSymbol();
 }