Ejemplo n.º 1
0
 public function getFilename()
 {
     if (!$this->filename) {
         $this->filename = preg_replace('/[^a-z0-9_-]/i', '', $this->invoice->getSellerName()) . '_' . $this->invoice->getNumber() . '_' . $this->getTemplate();
     }
     return $this->filename;
 }
Ejemplo n.º 2
0
 protected function getInvoice(array $data)
 {
     $invoice = new Model\Invoice();
     $seller = new Model\Seller();
     $seller->setName('KnpLabs France');
     $seller->setAddress($data['address']['seller']['street'], $data['address']['seller']['city'], $data['address']['seller']['zipcode'], $data['address']['seller']['country']);
     $invoice->setSeller($seller);
     $buyer = new Model\Buyer();
     $buyer->setName('Marek Nowak');
     $buyer->setAddress($data['address']['buyer']['street'], $data['address']['buyer']['city'], $data['address']['buyer']['zipcode'], $data['address']['buyer']['country']);
     $invoice->setBuyer($buyer);
     $tax = new Model\Tax('TAX 23%', 23);
     $entry = new Model\Entry();
     $entry->setDescription('Entry #1');
     $entry->setUnitPrice(666);
     $entry->addTax($tax);
     $invoice->setDate('2011-12-08');
     $invoice->addEntry($entry);
     return $invoice;
 }