Fixes for testS

This commit is contained in:
David Bomba 2021-10-08 16:23:00 +11:00
parent e6be94ad22
commit d93928ffbe
3 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,6 @@ class ActivityRepository extends BaseRepository
if ($entity instanceof User || $entity->company->is_disabled)
return;
$entity->load('company', 'client');
$backup = new Backup();
@ -82,6 +81,7 @@ class ActivityRepository extends BaseRepository
|| get_class($entity) == Credit::class
|| get_class($entity) == RecurringInvoice::class
) {
$entity->load('company', 'client');
$contact = $entity->client->primary_contact()->first();
$backup->html_backup = $this->generateHtml($entity);
$backup->amount = $entity->amount;

View File

@ -322,6 +322,8 @@ class InvoiceService
public function deletePdf()
{
$this->invoice->load('invitations');
$this->invoice->invitations->each(function ($invitation){
Storage::disk(config('filesystems.default'))->delete($this->invoice->client->invoice_filepath($invitation) . $this->invoice->numberFormatter().'.pdf');

View File

@ -32,6 +32,8 @@ class SendEmail
*/
public function run()
{
$this->payment->load('company', 'client.contacts');
$this->payment->client->contacts->each(function ($contact) {
if ($contact->email) {
EmailPayment::dispatchNow($this->payment, $this->payment->company, $contact);