diff --git a/app/Jobs/Entity/CreateRawPdf.php b/app/Jobs/Entity/CreateRawPdf.php index 45483faf156f..4d52e4319758 100644 --- a/app/Jobs/Entity/CreateRawPdf.php +++ b/app/Jobs/Entity/CreateRawPdf.php @@ -112,8 +112,7 @@ class CreateRawPdf try { $pdf = $ps->boot()->getPdf(); } catch (\Exception $e) { - echo "EXCEPTION::".PHP_EOL; - echo $e->getMessage().PHP_EOL; + nlog($e->getMessage()); throw new FilePermissionsFailure('Unable to generate the raw PDF'); } diff --git a/app/Listeners/Invoice/UpdateInvoiceActivity.php b/app/Listeners/Invoice/UpdateInvoiceActivity.php index c783e1299161..1b346b2bbf44 100644 --- a/app/Listeners/Invoice/UpdateInvoiceActivity.php +++ b/app/Listeners/Invoice/UpdateInvoiceActivity.php @@ -21,6 +21,7 @@ class UpdateInvoiceActivity implements ShouldQueue { protected $activity_repo; + public $delay = 10; /** * Create the event listener. * diff --git a/app/Repositories/ActivityRepository.php b/app/Repositories/ActivityRepository.php index b802cec68888..035faa5efa6a 100644 --- a/app/Repositories/ActivityRepository.php +++ b/app/Repositories/ActivityRepository.php @@ -81,6 +81,8 @@ class ActivityRepository extends BaseRepository return; } + $entity = $entity->fresh(); + if (get_class($entity) == Invoice::class || get_class($entity) == Quote::class || get_class($entity) == Credit::class diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 13f94fe63656..00c619d6236c 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -292,9 +292,9 @@ class InvoiceService //12-10-2022 if ($this->invoice->partial > 0 && !$this->invoice->partial_due_date) { - $this->invoice->partial_due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms')); + $this->invoice->partial_due_date = Carbon::parse($this->invoice->date)->addDays((int)$this->invoice->client->getSetting('payment_terms')); } else { - $this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms')); + $this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays((int)$this->invoice->client->getSetting('payment_terms')); } return $this;