承接 kinulab/facturx 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kinulab/facturx

最新稳定版本:v1.0.13

Composer 安装命令:

composer require kinulab/facturx

包简介

A comprehensible PHP library to write Factur-X/ZUGFeRD XML files

README 文档

README

This library aims to simplify the generation of Factur-X / ZUGFeRD XML files.

For the moment, this library only generate minimal format.

Installation

composer require kinulab/facturx

Usage

require 'vendor/autoload.php';

$invoice = new \Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice(
    \Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::PROFILE_MINIMUM
);
$invoice->setInvoiceNumber("FC123456789");
$invoice->setInvoiceType(Kinulab\Facturx\CrossIndustryInvoice\CrossIndustryInvoice::INVOICE_TYPE_COMMERCIAL_INVOICE);
$invoice->setIssueDate( new \DateTime('today') );
$invoice->setDueDate( (new \DateTime('today'))->modify('+30 days') );
$invoice->setSeller( new \Kinulab\Facturx\CrossIndustryInvoice\LegalEntity() );
$invoice->setBuyer( new \Kinulab\Facturx\CrossIndustryInvoice\LegalEntity() );
$invoice->setCurrencyCode('EUR');
$invoice->setTaxBasisTotalAmount(100);
$invoice->setTaxTotalAmount(5.61);
$invoice->setGrandTotalAmount( 105.61 );
$invoice->setDuePayableAmount( 105.61 );

$seller = $invoice->getSeller();
$seller->setName('My Company Name');
$seller->setSiret('XXXXXX');
$seller->setVatIdentifier( 'XXXXX');
$seller->setAddress( new \Kinulab\Facturx\CrossIndustryInvoice\Address() );

$sellerAddress = $seller->getAddress();
$sellerAddress->setCountryId('FR');

$buyer = $invoice->getBuyer();
$buyer->setName('The Client');
$buyer->setVatIdentifier("ABC123");

// This is the XML that must be added to the PDF
$xml = \Kinulab\Facturx\CrossIndustryInvoice\XmlWriter::write($invoice);
$pdfFile = './raw-pdf-invoice/invoice-FC123456789.pdf'; // my invoice in PDF format

$facturx = new \Atgp\FacturX\Facturx();
$electronicInvoice = $facturx->generateFacturxFromFiles($pdfFile, $xml);
// $electronicInvoice is your invoice in Factur-x/ZUGFeRD format

file_put_contents('./facturx-invoice/invoice-FC123456789.pdf', $electronicInvoice);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固