Downloads
Stars
Version
Invoices package for HoneyComb CMS https://github.com/honey-comb/invoices
HoneyComb CMS invoices functions
This is part invoices package for HoneyComb CMS package.
^7.1
^5.6
Begin by installing this package through Composer.
{
"require": {
"honey-comb/invoices": "0.1.*"
}
}
or
composer require honey-comb/invoices
If you use honey-comb/payments package you can use our generated payment created event listener example to generate invoice.
Run php artisan vendor:publish --tag=hc-invoice
Register event in EventServiceProvider
protected $listen = [
\HoneyComb\Payments\Events\HCPaymentCreated::class => [
\App\Listeners\HCPaymentCreatedListener::class
],
];
The are two DTO's
HCInvoiceDTO
and HCInvoiceItemDTO
Create invoice:
$invoiceItemDto = (new HCInvoiceItemDTO())
->setLabel('Product')
->setQuantity(1)
->setVat(2)
->setAmount(10)
->setUnitPrice(10)
->setVatTotal(2)
->setAmountTotal(12);
$invoiceDto = (new HCInvoiceDTO())
->setAmount(10)
->setAmountTotal(12)
->setVat(2)
->setInvoiceDate('2016-04-13')
->setItems([
$invoiceItemDto->toArray(),
]);
return $this->invoiceService->createAdvanceInvoice($invoiceDto->toArray());