Giter VIP home page Giter VIP logo

kohana-bill's Introduction

Utiliser Bill

##Installation

  1. git submodule add https://github.com/shadowhand/dompdf.git vendor
  2. cd vendor && git submodule update --init

Pour chaque produits

  • Si le prix (price) est précisé, il sera pris en compte dans les totaux de l'ensemble des produits.
  • Si la quantité (quantity) est précié, elle sera prise en compte leur du calcul des totaux.
  • Si la tva (vat) est précisé, elle sera prise en compte, sinon ce sera la tva par défaut précisée dans le fichier de configuration qui sera prise en compte.

Exemple d'utilisation

Dans votre controller :

$dest = array(
	'name' => 'Company Name',
	'contact' => 'Mr. Contact',
);

$product1 = array(
	'name' => 'product 1',
	'description' => 'description of the first product',
	'quantity' => '3',
	'price' => '1',
);

$product2 = array(
	'name' => 'product 2',
	'description' => 'description of the second product',
	'quantity' => '5',
	'price' => '2',
	'tva' => '6',
);

$infos = array(
		'fact_nb' => '007',
		'client_nb' => '008',
		'date' => '24/01/2012',
		'object' => 'Object of the bill',
);

$pdf = Bill::factory();

$pdf->dest($dest);

$pdf->item($product1);
$pdf->item($product2);

$pdf->infos($infos);

// Use the PDF as the request response
$this->response->body($pdf);

// Display the PDF in the browser as "my_bill.pdf"
// Remove "inline = TRUE" to force the PDF to be downloaded
$this->response->send_file(TRUE, 'facture.pdf', array('inline' => TRUE));

kohana-bill's People

Contributors

krapaille avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mauclair

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.