All Projects → rimiti → Invoice It

rimiti / Invoice It

Licence: mit
📃 Generate your orders or your invoices and export them in html, pdf or buffer easily.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Invoice It

Pyreportjasper
Python Reporting with JasperReports
Stars: ✭ 77 (+11.59%)
Mutual labels:  invoice, pdf
Invoices
Generate PDF invoices for your customers in laravel
Stars: ✭ 298 (+331.88%)
Mutual labels:  invoice, pdf
Mustangproject
Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
Stars: ✭ 98 (+42.03%)
Mutual labels:  invoice, pdf
Invoice As A Service
💰 Simple invoicing service (REST API): from JSON to PDF
Stars: ✭ 106 (+53.62%)
Mutual labels:  invoice, pdf
Url To Pdf Api
Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
Stars: ✭ 6,544 (+9384.06%)
Mutual labels:  invoice, pdf
Resumake.io
📝 A website for automatically generating elegant LaTeX resumes.
Stars: ✭ 2,277 (+3200%)
Mutual labels:  pdf, generator
Quickbill
Create unlimited invoices for free.
Stars: ✭ 278 (+302.9%)
Mutual labels:  invoice, pdf
Net Core Docx Html To Pdf Converter
.NET Core library to create custom reports based on Word docx or HTML documents and convert to PDF
Stars: ✭ 133 (+92.75%)
Mutual labels:  pdf, generator
Easybook
Book publishing as easy as it should be (built with Symfony components)
Stars: ✭ 744 (+978.26%)
Mutual labels:  pdf, generator
Pdfgenerator
A simple generator of PDF written in Swift.
Stars: ✭ 629 (+811.59%)
Mutual labels:  pdf, generator
Tppdf
TPPDF is a simple-to-use PDF builder for iOS
Stars: ✭ 444 (+543.48%)
Mutual labels:  pdf, generator
Swift Template
A template based module generator for Swift projects.
Stars: ✭ 34 (-50.72%)
Mutual labels:  module, generator
Sao Nm
Scaffold out a node module.
Stars: ✭ 30 (-56.52%)
Mutual labels:  module, generator
Vipera
Project is now called Swift template, check the link ➡️
Stars: ✭ 57 (-17.39%)
Mutual labels:  module, generator
Readme Md Generator
📄 CLI that generates beautiful README.md files
Stars: ✭ 9,184 (+13210.14%)
Mutual labels:  generator
Scanbot Sdk Example Android
Document scanning SDK example apps for the Scanbot SDK for Android.
Stars: ✭ 67 (-2.9%)
Mutual labels:  pdf
Guaka
The smartest and most beautiful (POSIX compliant) Command line framework for Swift 🤖
Stars: ✭ 1,145 (+1559.42%)
Mutual labels:  generator
Icongenerator
🍱 A macOS app to generate app icons
Stars: ✭ 1,144 (+1557.97%)
Mutual labels:  generator
Ttpassgen
密码生成 flexible and scriptable password dictionary generator which can support brute-force、combination、complex rule mode etc...
Stars: ✭ 68 (-1.45%)
Mutual labels:  generator
Komada
Komada: Croatian for `pieces`, is a modular bot system including reloading modules and easy to use custom commands.
Stars: ✭ 67 (-2.9%)
Mutual labels:  module

invoice-it

Dependencies Code Climate score Code Climate coverage Code Climate coverage Build Status MIT License PRs Welcome

Generate your orders and you invoices and export them easily. If you want some examples, check tests.

Install

$ npm install @rimiti/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

import invoiceIt from '@rimiti/invoice-it';

From require

const invoiceIt = require('@rimiti/invoice-it').default;

Order

To generate an order:

import invoiceIt from '@rimiti/invoice-it';

  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: '[email protected]'
  };

  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: '[email protected]',
    website: 'www.dimsolution.com'
  };

  const order = invoiceIt.create(recipient, emitter);

You can also use getter / setters like that

const order = invoiceIt.create();

order.recipient.company_name = 'Receiver company';
order.recipient.first_name = 'Will';
order.recipient.last_name = 'Jameson';
order.recipient.street_number = '20';
order.recipient.street_name = 'Rue Victor Hugo';
order.recipient.zip_code = '77340';
order.recipient.city = 'Pontault-Combault';
order.recipient.country = 'France';
order.recipient.phone = '06 00 00 00 00';
order.recipient.mail = '[email protected]';

order.emitter.name = 'Dim Solution';
order.emitter.street_number = '15';
order.emitter.street_name = 'Rue Jean Jaures';
order.emitter.zip_code = '75012';
order.emitter.city = 'Paris';
order.emitter.country = 'France';
order.emitter.phone = '01 00 00 00 00';
order.emitter.mail = '[email protected]';
order.emitter.website = 'www.dimsolution.com';

Return order object

order.getOrder();

Return html order

order.getOrder().toHTML();

Save html order into file (default filepath: 'order.html')

order.getOrder().toHTML().toFile('./order.html')
  .then(() => {
      console.log('HTML file created.');
  });

Save html order into file (default filepath: 'order.pdf')

order.getOrder().toPDF().toFile('./order.pdf')
  .then(() => {
     console.log('PDF file created.');
  });

Invoice

To generate an invoice:

import invoiceIt from '@rimiti/invoice-it';

  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: '[email protected]'
  };

  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: '[email protected]',
    website: 'www.dimsolution.com'
  };

  const invoice = invoiceIt.create(recipient, emitter);

You can also use getter / setters like that

const invoice = invoiceIt.create();

invoice.recipient.company_name = 'Receiver company';
invoice.recipient.first_name = 'Will';
invoice.recipient.last_name = 'Jameson';
invoice.recipient.street_number = '20';
invoice.recipient.street_name = 'Rue Victor Hugo';
invoice.recipient.zip_code = '77340';
invoice.recipient.city = 'Pontault-Combault';
invoice.recipient.country = 'France';
invoice.recipient.phone = '06 00 00 00 00';
invoice.recipient.mail = '[email protected]';

invoice.emitter.name = 'Dim Solution';
invoice.emitter.street_number = '15';
invoice.emitter.street_name = 'Rue Jean Jaures';
invoice.emitter.zip_code = '75012';
invoice.emitter.city = 'Paris';
invoice.emitter.country = 'France';
invoice.emitter.phone = '01 00 00 00 00';
invoice.emitter.mail = '[email protected]';
invoice.emitter.website = 'www.dimsolution.com';

Return invoice object

invoice.getInvoice();

Return html invoice

invoice.getInvoice().toHTML();

Save html invoice into file (default filepath: 'invoice.html')

invoice.getInvoice().toHTML().toFile('./invoice.html')
  .then(() => {
      console.log('HTML file created.');
  });

Save html invoice into file (default filepath: 'invoice.pdf')

invoice.getInvoice().toPDF().toFile('./invoice.pdf')
  .then(() => {
      console.log('PDF file created.');
  });

Add custom fields to invoice

const paymentId = {
  key: 'invoice_header_paymentId_value',
  value: paymentRef
};
const phrases = ['invoice_header_payment_reference', paymentId];
invoice.getInvoice(phrases).toPDF()

Customization

All below globals attributes are totally customizable from the .configure() method or from setters:

From .configure()

The configure method can override all default attributes presents in this file.

Customization example:

To generate and export in PDF an invoice with: - Logo url: http://example.com/logo.png - Date format: YYYY-MM-DD - Your invoice pattern: INVOICE-1901_00001 - Invoice note: It's my custom node!

import invoiceIt from '@rimiti/invoice-it';

invoiceIt.configure({
  global: {
    logo: 'http://example.com/logo.png',
    invoice_reference_pattern: '$prefix{INVOICE}$date{YYMM}$separator{_}$id{00000}',
    invoice_note: 'It\'s my custom node!',
    date_format: 'YYYY-MM-DD',
  },
});

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: '[email protected]'
};

const emitter = {
  name: 'Dim Solution',
  street_number: '73',
  street_name: 'Rue Jean Jaures',
  zip_code: '75012',
  city: 'Paris',
  country: 'France',
  phone: '01 00 00 00 00',
  mail: '[email protected]',
  website: 'www.dimsolution.com'
};

const invoice = invoiceIt.create(recipient, emitter);

invoice.id = 1;
order.getInvoice().toPDF().toFile();

From setters

import invoiceIt from '@rimiti/invoice-it';

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: '[email protected]'
};

const emitter = {
  name: 'Dim Solution',
  street_number: '73',
  street_name: 'Rue Jean Jaures',
  zip_code: '75012',
  city: 'Paris',
  country: 'France',
  phone: '01 00 00 00 00',
  mail: '[email protected]',
  website: 'www.dimsolution.com'
};

const invoice = invoiceIt.create(recipient, emitter);

invoice.global.logo = 'http://example.com/logo.png';
invoice.global.invoice_reference_pattern = '$prefix{INVOICE}$date{YYMM}$separator{_}$id{00000}';
invoice.global.invoice_note = 'It\'s my custom node!';
invoice.global.date_format = 'YYYY-MM-DD';
invoice.id = 1;
order.getInvoice().toPDF().toFile();

i18n

To add more language:

import invoiceIt from '@rimiti/invoice-it';

invoiceIt.configure({
  language: {
    locales: ['en', 'pl'],
    directory: `${__dirname}/path/to/locales`,
    defaultLocale: 'en'
  }
});

Scripts

Run using npm run <script> command.

clean - remove coverage data, Jest cache and transpiled files,
test - run tests with coverage,
test:watch - interactive watch mode to automatically re-run tests,
build - compile source files,
build:watch - interactive watch mode, compile sources on change.

License

MIT © Dimitri DO BAIRRO

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].