承接 kigkonsult/sie5sdk 相关项目开发

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

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

kigkonsult/sie5sdk

Composer 安装命令:

composer require kigkonsult/sie5sdk

包简介

Sie5 SDK, based on Sie5 XSD schema

README 文档

README

  • the PHP SDK for the Sie5 export/import formats
  • manages accounting, book-keeping, ledger, asset, inventory data etc
  • based on the Sie5 XSD schema

and provide

Usage, parse XML

Sie5Sdk uses XMLReader parsing input and accepts Sie and SieEntry root elements.

To parse an export Sie XML file :

<?php
namespace Kigkonsult\Sie5Sdk;
use Kigkonsult\Sie5Sdk\XMLParse\Sie5Parser;

$sie = Sie5Parser::factory()->parse( 
    file_get_contents( 'SieExportFile.xml' )
);

foreach( $sie->getAccounts()->getAccount() as $account ) {
    $id = $account->getId();
    //...
}
//...

To parse an import SieEntry XML file :

<?php
namespace Kigkonsult\Sie5Sdk;
use Kigkonsult\Sie5Sdk\XMLParse\Sie5Parser;

$sieEntry = Sie5Parser::factory()->parse( 
    file_get_contents( 'SieImportFile.xml' )
);

foreach( $sieEntry->getAccounts()->getAccount() as $account ) {
    $id = $account->getId();
    //...
}
//...

The XML parser save the XMLreader node properties (baseURI, localName, name, namespaceURI, prefix) for each XML (Dto) element as 'XMLattributes' as well as XML attributes (xmlns, xmlns:*, schemaLocation), if set.

Usage, build up structure

To build up import SieEntry structure:

<?php
namespace Kigkonsult\Sie5Sdk;
use Kigkonsult\Sie5Sdk\XMLWrite\Sie5Writer;
use Kigkonsult\Sie5Sdk\Dto\SieEntry;
use Kigkonsult\Sie5Sdk\Dto\AccountsTypeEntry;
use Kigkonsult\Sie5Sdk\Dto\AccountTypeEntry;

$sieEntry = sieEntry::factory()
    ->setXMLattribute( SieEntry::XMLNS_XSI,          SieEntry::XMLSCHEMAINSTANCE )
    ->setXMLattribute( SieEntry::XMLNS_XSD,          SieEntry::XMLSCHEMA )
    ->setXMLattribute( SieEntry::XSI_SCHEMALOCATION, SieEntry::SIE5SCHEMALOCATION )
    ->setXMLattribute( SieEntry::XMLNS,              SieEntry::SIE5URI );

    ->setAccounts( 
        AccountsTypeEntry::factory()
            ->setAccount(
                [
                    AccountTypeEntry::factory()
                        ->setId( '1910' )
                        ->setName( 'Kassa' )
                        ->setType( AccountTypeEntry::ASSET ),
                    AccountTypeEntry::factory()
                        ->setId( '1930' )
                        ->setName( 'Bank' )
                        ->setType( AccountTypeEntry::ASSET )
                ]
            )
    )
    ->set...
    
$XMLstring = Sie5Writer::factory()->write( $sieEntry );
...
XML attributes

You may also set XMLattribute(s) (explicitly, NOT required if rewriting a parsed sie xml file) using

$sieEntry->setXMLAttribut( <key>, <value> );

To set (ex. prefix) and 'propagate' down in hierarchy:

$sieEntry->setXMLAttribut( SieEntry::PREFIX, <value>, true );

You can remove (single 'element') XMLattribute using

$dsig->unsetXMLAttribut( <key> );

To unset (ex. prefix) and 'propagate' down in hierarchy:

$sieEntry->unsetXMLAttribut( SignatureType::PREFIX, true );

To fetch and iterate over XMLAttributes

foreach( $sieEntry->getXMLAttributes() as $key => $value {
    ...
}

Usage, output as XML

Sie5Sdk uses XMLWriter creating output.

$XMLstring = Sie5Writer::factory()->write( $sieEntry );

The XMLwriter adds for (each) element

  • element name with prefix, is exists
  • XMLattribute xmlns, xmlns:* and schemaLocation, if exists.

Usage, output as DomNode

$domNode = Sie5Writer::factory()->write( $sieEntry, true );

Info

Sie5Sdk require PHP7+.

For class structure, architecture and usage, please examine

You may find convenient constants in

Sie5Sdk uses

Sie5Sdk support attribute extensions in the elements

  • Account, Company, CustomerInvoice, Customer, FileInfo, FixedAsset, GeneralObject, JournalEntry, LedgerEntry, Supplier

Installation

Composer, from the Command Line:

composer require kigkonsult/sie5sdk

Composer, in your composer.json:

{
    "require": {
        "kigkonsult/sie5sdk": "dev-master"
    }
}

Version 1.4 supports PHP 8.0, 1.2 7.4, 1.1 7.0.

Acquire access

namespace Kigkonsult\Sie5Sdk;
...
include 'vendor/autoload.php';

Otherwise , download and acquire..

namespace Kigkonsult\Sie5Sdk;
...
include 'pathToSource/sie5sdk/autoload.php';

Sponsorship

Donation using paypal.me/kigkonsult are appreciated. For invoice, please e-mail.

Support

For support, please use Github/issues.

For Sie XSD issues, go to Sie homepage.

License

This project is licensed under the LGPLv3 License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2020-01-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固