darkling/invoice 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

darkling/invoice

Composer 安装命令:

composer require darkling/invoice

包简介

Component for generating invoices using Nette Framework and mPDF library.

README 文档

README

Simple tool to generate PDF invoices for Nette Framework. Based on Eciovni project.

Requirements

Installation

Easiest way to install is to use composer.

composer require darkling/invoice

Configuration

Just register extension in your config neon file.

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.

// 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

统计信息

  • 总下载量: 40
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-10-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固