定制 horstoeko/zugferdublbridge 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

horstoeko/zugferdublbridge

最新稳定版本:v1.0.16

Composer 安装命令:

composer require horstoeko/zugferdublbridge

包简介

Convert Factur-X/ZUGFeRD (CII-Syntax) to PEPPOL (UBL-Syntax) and visa versa

README 文档

README

Latest Stable Version PHP version License

Build Status Release Status

Table of Contents

License

The code in this project is provided under the MIT license.

Overview

Caution

This library is currently still considered experimental and should therefore be used with caution. I would be happy for an issue to be posted if bugs are found.

With horstoeko/zugferdublbridge you can convert the Factur-X/ZUGFeRD-CII-Syntax to PEPPOL UBL-Syntax and visa versa.

Further information

Related projects

Dependencies

This package has no dependencies.

Installation

There is one recommended way to install horstoeko/zugferdublbridge via Composer:

  • adding the dependency to your composer.json file:
  "require": {
      ..
      "horstoeko/zugferdublbridge":"^1",
      ..
  },

Usage

For detailed eplanation you may have a look in the examples of this package and the documentation attached to every release.

Convert CII to UBL

From XML file to XML file

use horstoeko\zugferdublbridge\XmlConverterCiiToUbl;

$sourceXmlFilename = '/path/to/cii.xml.file';
$destinationXmlFilename = '/path/to/ubl.xml.file'

XmlConverterCiiToUbl::fromFile($sourceXmlFilename)->convert()->saveXmlFile($destinationXmlFilename);

From XML string to XML file

use horstoeko\zugferdublbridge\XmlConverterCiiToUbl;

$xmlContent = '<xml>....</xml>';
$destinationXmlFilename = '/path/to/ubl.xml.file'

XmlConverterCiiToUbl::fromString($xmlContent)->convert()->saveXmlFile($destinationXmlFilename);

From XML file to XML string

use horstoeko\zugferdublbridge\XmlConverterCiiToUbl;

$sourceXmlFilename = '/path/to/cii.xml.file';

$converterXmlString = XmlConverterCiiToUbl::fromFile($sourceXmlFilename)->convert()->saveXmlString();

Convert UBL to CII

From XML file to XML file

use horstoeko\zugferdublbridge\XmlConverterUblToCii;

$sourceXmlFilename = '/path/to/ubl.xml.file';
$destinationXmlFilename = '/path/to/cii.xml.file'

XmlConverterUblToCii::fromFile($sourceXmlFilename)->convert()->saveXmlFile($destinationXmlFilename);

From XML string to XML file

use horstoeko\zugferdublbridge\XmlConverterUblToCii;

$xmlContent = '<xml>....</xml>';
$destinationXmlFilename = '/path/to/cii.xml.file'

XmlConverterUblToCii::fromString($xmlContent)->convert()->saveXmlFile($destinationXmlFilename);

From XML file to XML string

use horstoeko\zugferdublbridge\XmlConverterUblToCii;

$sourceXmlFilename = '/path/to/ubl.xml.file';

$converterXmlString = XmlConverterUblToCii::fromFile($sourceXmlFilename)->convert()->saveXmlString();

Usage with horstoeko/zugferd

CII to UBL

You can convert the output of horstoko/zugferd to UBL using this library:

use horstoeko\zugferd\ZugferdDocumentBuilder;
use horstoeko\zugferd\ZugferdProfiles;
use horstoeko\zugferd\codelists\ZugferdPaymentMeans;
use horstoeko\zugferdublbridge\XmlConverterCiiToUbl;

$document = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EN16931);
$document
    ->setDocumentInformation("471102", "380", \DateTime::createFromFormat("Ymd", "20180305"), "EUR")
    ----

$destinationXmlFilename = '/path/to/ubl.xml.file'

XmlConverterCiiToUbl::fromString($document->getContent())->convert()->saveXmlFile($destinationXmlFilename);

UBL to CII

You can convert a UBL document and handle it with horstoko/zugferd

use horstoeko\zugferd\ZugferdDocumentReader;
use horstoeko\zugferdublbridge\XmlConverterUblToCii;

$sourceXmlFilename = '/path/to/ubl.xml.file';

$converterXmlString = XmlConverterUblToCii::fromFile($sourceXmlFilename)->convert()->saveXmlString();

$document = ZugferdDocumentReader::readAndGuessFromContent($converterXmlString);

$document->getDocumentInformation(
    $documentno,
    $documenttypecode,
    $documentdate,
    $duedate,
    $invoiceCurrency,
    $taxCurrency,
    $documentname,
    $documentlanguage,
    $effectiveSpecifiedPeriod
);

echo "The Invoice No. is {$documentno}" . PHP_EOL;

统计信息

  • 总下载量: 101.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 15
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-08