mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fire invoice pdf creator when an invoice has been updated
This commit is contained in:
parent
6fce752de4
commit
0803ffda11
@ -35,6 +35,10 @@ class CreateInvoicePdf implements ShouldQueue
|
||||
*/
|
||||
public function handle($event)
|
||||
{
|
||||
PdfCreator::dispatch($event->invoice->invitations->first());
|
||||
$event->invoice->invitations->each(function ($invitation) {
|
||||
|
||||
PdfCreator::dispatch($invitation);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Events\Invoice\InvoiceWasUpdated;
|
||||
use App\Factory\InvoiceInvitationFactory;
|
||||
use App\Factory\QuoteInvitationFactory;
|
||||
use App\Jobs\Product\UpdateOrCreateProduct;
|
||||
@ -294,6 +295,9 @@ class BaseRepository
|
||||
}
|
||||
|
||||
$model = $model->calc()->getInvoice();
|
||||
|
||||
event(new InvoiceWasUpdated($model));
|
||||
|
||||
}
|
||||
|
||||
if ($class->name == Credit::class) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user