2017 © Pedro PelĆ”ez
 

package invoices

Empty

image

pixiucz/invoices

Empty

  • Monday, December 4, 2017
  • by pixiu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 149 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 19 Versions
  • 0 % Grown

The README.md

Installation

  • Require package via composer
composer require pixiucz/invoices
  • And then register InvoicesServiceProvider in your config\app.php (laravel) or in boot method of your October's Plugin.php
Pixiucz\Invoices\InvoicesServiceProvider::class,
  • Once installed, you are required to run migrations ā€“ either by running
php artisan migrate

or using provided cli command, (*1)

php artisan invoices:migrate

(this command will migrate only packageā€™s table) - You have to create at least one named pattern, that will be used on invoices. You can create pattern using, (*2)

php artisan invoices:makePattern ā€œname_of_patternā€ ā€œpatternā€
  • Your pattern have to be string with two slots -> {year} where correct year will be inserted and {number} for invoice number.
    • Example: php artisan invoices:makePattern "eshop" "My-eshop-invoice-{year}/{number}"

Basic usage

  • Once instantiated, InvoiceGenerator provides public method generateInvoice
  • This method requires two parameters, two other are optional
  1. String name of pattern (invoice line) (required)
  2. Array of all variables that you want to be printed in provided tempalte. (required)
  3. String path to your htm file that will serve as template. This template should use Twig syntax and at very least define {{ invoice_number }} where generated invoice number will be printed. (optional)
  4. int invoice number, this will bypass inner invoice number generator (optional)
  • Method returns array with 'invoice_number' and rendered 'pdf' key-value pairs.

Example

$invoice = $invoiceGenerator->generateInvoice("eshop", $templateVariables);

Format of array with variables (all optional)

  • Company
    • name
    • zip
    • address
    • ico
    • dic
    • ic_dph
    • bank
    • account_number
    • iban
    • swift
  • delivery_address
    • first_name
    • last_name
    • address
    • zip
    • city
    • country
  • billing_address
    • first_name
    • last_name
    • address
    • zip
    • city
    • country
    • ic
    • dic
  • updated_at
  • variants
    • variant
      • ean
      • name
      • quantity
      • price
      • price_without_tax
      • sum_without_tax
      • tax
      • sum
    • ā€¦
  • delivery_option
    • name
    • price
    • price_without_tax
    • tax
  • sum
    • sum_without_tax
    • sum_tax_only
    • sum
  • currency (currency symbol)
  • status [ā€˜canceledā€™, ā€˜refundedā€™] -> leave empty when neither of these

The Versions

04/12 2017

dev-master

9999999-dev

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

04/12 2017

1.13

1.13.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

28/11 2017

1.12

1.12.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

22/11 2017

1.11

1.11.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

22/11 2017

1.10

1.10.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

22/11 2017

dev-Refactoring

dev-Refactoring

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

16/08 2017

1.09

1.09.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

11/08 2017

1.08

1.08.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

09/08 2017

1.06

1.06.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

04/08 2017

1.05

1.05.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

04/08 2017

dev-Fixes_for_1_03

dev-Fixes_for_1_03

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

04/08 2017

1.04

1.04.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

03/08 2017

1.03

1.03.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

02/08 2017

0.0.1

0.0.1.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

02/08 2017

0.1.0

0.1.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

02/08 2017

1.02

1.02.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

02/08 2017

1.01

1.01.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

02/08 2017

dev-readme

dev-readme

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz

02/08 2017

1.0

1.0.0.0

Empty

  Sources   Download

MIT

The Requires

 

by Pixiucz