einfacharchiv/rechnungsmail.de 问题修复 & 功能扩展

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

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

einfacharchiv/rechnungsmail.de

最新稳定版本:v2.0.0

Composer 安装命令:

composer require einfacharchiv/rechnungsmail.de

包简介

Extract billing data from text according to rechnungsmail.de

README 文档

README

Software License

This package provides an easy way to extract billing data from text according to rechnungsmail.de.

einfachArchiv is a German SaaS product to organize your documents in one place and meet all legal requirements. You'll find us on our website.

Requirements

PHP 7.0 and later.

Installation

You can install this package via Composer. Run the following command:

composer require einfacharchiv/rechnungsmail.de

Usage

Extracting billing data is easy.

$email = <<<EOE
Sehr geehrte Frau Mustermann, 

anbei erhalten Sie Rechnung-Nr. 4711 vom 20.11.2077. 
Die Rechnung ist im PDF-Format erstellt worden. Sollten 
Sie Fragen oder Probleme haben, stehen wir Ihnen 
jederzeit zur Verfügung. 

-- 
Mit freundlichen Grüßen,
Max Müller

Rechnungsdaten nach rechnungsmail.de:
Rechnungsnummer:     4711
Rechnungsdatum:      20.11.2077
Rechnungsbetrag:     119,00 EUR
Kundennummer:        123456
Nettobetrag 19%:     100,00 EUR
Umsatzsteuer 19%:    19,00 EUR
Absender-Name:       Max Müller GbR
Ihre Auftragsnummer: 4500006789
Vertragsnummer:      V-4711
EOE;

$rechnungsmail = new \einfachArchiv\Rechnungsmail\Rechnungsmail($email);

// Check if the email contains billing data according to rechnungsmail.de
if ($rechnungsmail->isValid()) {
    $rechnungsmail->getInvoiceId();
    $rechnungsmail->getInvoiceDate();
    $rechnungsmail->getInvoiceAmount(); // Returns an array
    $rechnungsmail->getCustomerId();
    $rechnungsmail->getNetAmount(); // Returns an array
    $rechnungsmail->getTax(); // Returns an array
    $rechnungsmail->getSenderName();
    $rechnungsmail->getOrderId();
    $rechnungsmail->getContractId();
}

If a field is not present or invalid, the method returns null.

The method ->getInvoiceAmount() returns an array like this one:

[
    'amount' => 119,
    'currency' => 'EUR',
];

The methods ->getNetAmount() and ->getTax() return arrays like this one:

[
    'amount' => 100,
    'currency' => 'EUR',
    'taxRate' => 19
];

All amounts are returned as floats.

The invoice date is, if present, a valid date and can be used like this:

$invoiceDate = $rechnungsmail->getInvoiceDate();

if ($invoiceDate) {
    \Carbon\Carbon::parse($invoiceDate)->toDateString();
}

Contributing

Contributions are welcome.

We accept contributions via Pull Requests on Github.

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improvement? Feel free to create an issue on GitHub, we'll try to address it as soon as possible.

If you've found a security issue, please email support@einfacharchiv.com instead of using the issue tracker.

Happy coding!

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固