ahsanshabbir / smartbill
适用于 laravel9 的 SmartBill API 封装
v1.2.0
2024-07-23 22:01 UTC
Requires
- php: ^7.2.5|^8.0|^8.1|^8.2|^8.3
- illuminate/support: ~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^3.8|^4.0|^5.0|^6.0
- phpunit/phpunit: ^7.0|^8.1|^9.0|^10.0
README
为 Laravel 提供简单的 SmartBill API 集成。
安装
您可以通过 composer 安装此包
composer require necenzurat/smartbill
使用方法
点击查看使用方法
$invoice = [ 'companyVatCode' => config('smartbill.vatCode'), 'client' => [ 'name' => "Intelligent IT", 'vatCode' => "RO12345678", 'regCom' => "", 'address' => "str. Sperantei, nr. 5", 'isTaxPayer' => false, 'city' => "Sibiu", 'country' => "Romania", 'email' => "office@intelligent.ro", ], 'issueDate' => date('Y-m-d'), 'seriesName' => config('smartbill.invoiceSeries'), 'isDraft' => false, 'dueDate' => date('Y-m-d', time() + 3600 * 24 * 30), 'mentions' => '', 'observations' => '', 'deliveryDate' => date('Y-m-d', time() + 3600 * 24 * 10), 'precision' => 2, 'products' => [ [ 'name' => "Produs 1", 'code' => "ccd1", 'isDiscount' => false, 'measuringUnitName' => "buc", 'currency' => "RON", 'quantity' => 2, 'price' => 10, 'isTaxIncluded' => true, 'taxName' => "Redusa", 'taxPercentage' => 9, 'isService' => false, 'saveToDb' => false, ], ], ]; echo 'Emitere factura simpla: '; try { $smartbill = new SmartBill(); $output = $smartbill->createInvoice($invoice); //see docs for response $invoiceNumber = $output['number']; $invoiceSeries = $output['series']; echo $invoiceSeries . $invoiceNumber; } catch (\Exception $ex) { echo $ex->getMessage(); }
测试
hell no
变更日志
请参阅 CHANGELOG 以获取有关最近更改的更多信息。
贡献
请参阅 CONTRIBUTING 以获取详细信息。
安全
如果您发现任何安全相关的问题,请通过电子邮件 necenzurat@gmail.com 联系,而不是使用问题跟踪器。
鸣谢
许可证
WTFPL。请参阅 许可证文件 以获取更多信息。