2017 © Pedro Peláez
 

library invoice

Component for generating invoices using Nette Framework and mPDF library.

image

darkling/invoice

Component for generating invoices using Nette Framework and mPDF library.

  • Thursday, March 29, 2018
  • by Daaarkling
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Invoice to PDF

Simple tool to generate PDF invoices for Nette Framework. Based on Eciovni project., (*1)

Requirements

Installation

Easiest way to install is to use composer., (*2)

composer require darkling/invoice

Configuration

Just register extension in your config neon file., (*3)

extensions:
    - Darkling\Invoice\DI\Extension

Usage

Example below shows basic usage. You can also use it inside 'model' class, just demand IExporterFactory dependency. There are four ways which you can handle output file (browser, browser force download, string, save). If you want to change template just provide path to latte file. All should be clear from example., (*4)

// inside Presenter class

/** 
 * @var  IExporterFactory 
 * @inject 
 */
public $exporterFactory;



public function renderDefault() {

    $supplier = new Participant('Dodavatel Dodavatelovič', 'Ulička', 15, 'Městečko', '555 33');
    $supplier->setIn('562656959')->setTin('CZ562656959')->setAccountNumber('015160/15114');

    $customer = new Participant('Zákazník Zákazníkovič', 'Ulice', 51, 'Město', '333 55');

    $items[] = new Item('Item 1', 2, 100, Tax::fromPercent(21), TRUE);
    $items[] = new Item('Item 2', 1, 50, Tax::fromPercent(21), TRUE, 'kg');

    $data = new Data(1, 'Faktura', $supplier, $customer, new \DateTime('2016-01-01'), new \DateTime('2000-02-01'), $items);
    $data->setVariableSymbol('0101010')->setConstantSymbol('21212121')->setSpecificSymbol('313131313');

    $exporter = $this->exporterFactory->create($data);
    //$exporter->setTemplatePath(__DIR__ . '/path/to/your/template.latte');

    $name = __DIR__ . '/path/where/to/save/file.pdf';
    $pdf = $exporter->exportToPdf($name, Exporter::DEST_SAVE);
}

Licence

New BSD License, (*5)

The Versions

29/03 2018

dev-master

9999999-dev

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3-Clause BSD-3

The Requires

 

generator nette latte invoice mpdf

29/03 2018

2.0

2.0.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3-Clause

The Requires

 

generator nette latte invoice mpdf

09/02 2018

1.5

1.5.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3-Clause

The Requires

 

generator nette latte invoice mpdf

02/10 2017

1.4

1.4.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3

The Requires

 

generator nette latte invoice mpdf

02/10 2017

1.3

1.3.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3

The Requires

 

generator nette latte invoice mpdf

20/03 2017

1.2

1.2.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3

The Requires

 

generator nette latte invoice mpdf

13/03 2017

1.1

1.1.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3

The Requires

 

generator nette latte invoice mpdf

06/10 2016

1.0

1.0.0.0

Component for generating invoices using Nette Framework and mPDF library.

  Sources   Download

BSD-3

The Requires

 

generator nette latte invoice mpdf