invoice-it
Generate your orders and you invoices and export them easily. If you want some examples, check tests.
Install
$ npm install invoice-it --save
Features
- Generate order / invoice
- Export to HTML / PDF / Stream
- Easy to use it
- Robust implementation with good unit test coverage.
Demonstration
Usage
Importation
From import
;
From require
const invoiceIt = ;
Order
To generate an order:
; const recipient = company_name: 'Receiver company' first_name: 'Will' last_name: 'Jameson' street_number: '20' street_name: 'Rue Victor Hugo' zip_code: '77340' city: 'Pontault-Combault' country: 'France' phone: '06 00 00 00 00' mail: 'will.jameson@test.com' ; const emitter = name: 'Dim Solution' street_number: '15' street_name: 'Rue Jean Jaures' zip_code: '75012' city: 'Paris' country: 'France' phone: '01 00 00 00 00' mail: 'contact@dimsolution.com' website: 'www.dimsolution.com' ; const order = invoiceIt;
You can also use getter / setters like that
const order = invoiceIt; orderrecipientcompany_name = 'Receiver company';orderrecipientfirst_name = 'Will';orderrecipientlast_name = 'Jameson';orderrecipientstreet_number = '20';orderrecipientstreet_name = 'Rue Victor Hugo';orderrecipientzip_code = '77340';orderrecipientcity = 'Pontault-Combault';orderrecipientcountry = 'France';orderrecipientphone = '06 00 00 00 00';orderrecipientmail = 'will.jameson@test.com'; orderemittername = 'Dim Solution';orderemitterstreet_number = '15';orderemitterstreet_name = 'Rue Jean Jaures';orderemitterzip_code = '75012';orderemittercity = 'Paris';orderemittercountry = 'France';orderemitterphone = '01 00 00 00 00';orderemittermail = 'contact@dimsolution.com';orderemitterwebsite = 'www.dimsolution.com';
Return order object
order;
Return html order
order;
Save html order into file (default filepath: 'order.html')
order ;
Save html order into file (default filepath: 'order.pdf')
order ;
Invoice
To generate an invoice:
; const recipient = company_name: 'Receiver company' first_name: 'Will' last_name: 'Jameson' street_number: '20' street_name: 'Rue Victor Hugo' zip_code: '77340' city: 'Pontault-Combault' country: 'France' phone: '06 00 00 00 00' mail: 'will.jameson@test.com' ; const emitter = name: 'Dim Solution' street_number: '15' street_name: 'Rue Jean Jaures' zip_code: '75012' city: 'Paris' country: 'France' phone: '01 00 00 00 00' mail: 'contact@dimsolution.com' website: 'www.dimsolution.com' ; const invoice = invoiceIt;
You can also use getter / setters like that
const invoice = invoiceIt; invoicerecipientcompany_name = 'Receiver company';invoicerecipientfirst_name = 'Will';invoicerecipientlast_name = 'Jameson';invoicerecipientstreet_number = '20';invoicerecipientstreet_name = 'Rue Victor Hugo';invoicerecipientzip_code = '77340';invoicerecipientcity = 'Pontault-Combault';invoicerecipientcountry = 'France';invoicerecipientphone = '06 00 00 00 00';invoicerecipientmail = 'will.jameson@test.com'; invoiceemittername = 'Dim Solution';invoiceemitterstreet_number = '15';invoiceemitterstreet_name = 'Rue Jean Jaures';invoiceemitterzip_code = '75012';invoiceemittercity = 'Paris';invoiceemittercountry = 'France';invoiceemitterphone = '01 00 00 00 00';invoiceemittermail = 'contact@dimsolution.com';invoiceemitterwebsite = 'www.dimsolution.com';
Return invoice object
invoice;
Return html invoice
invoice;
Save html invoice into file (default filepath: 'invoice.html')
invoice ;
Save html invoice into file (default filepath: 'invoice.pdf')
invoice ;
i18n
To add more language:
; invoiceIt;
Scripts
Run using npm run