fixes for tests

This commit is contained in:
David Bomba 2020-07-29 15:14:55 +10:00
parent 6510536234
commit 8e0942688d
4 changed files with 8 additions and 5 deletions

View File

@ -121,7 +121,6 @@ class EmailTemplateDefaults
return $converter->convertToHtml(self::transformText('invoice_message'));
//return Parsedown::instance()->line(self::transformText('invoice_message'));
}
public static function emailQuoteSubject()

View File

@ -77,11 +77,13 @@ class SendGenericNotification extends BaseNotification implements ShouldQueue
$mail_message = (new MailMessage)
->withSwiftMessage(function ($message) {
$message->getHeaders()->addTextHeader('Tag', $this->invitation->company->company_key);
})->markdown($this->getTemplateView(), $this->buildMailMessageData());
//})->markdown($this->getTemplateView(), $this->buildMailMessageData());
})->markdown('email.template.plain', $this->buildMailMessageData());
$mail_message = $this->buildMailMessageSettings($mail_message);
return $mail_message;
}
/**

View File

@ -120,7 +120,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
$data['$entity.terms'] = ['value' => $this->entity->terms ?: ' ', 'label' => ctrans('texts.invoice_terms')];
$data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a href="' .$invitation->getLink() .'">'. ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
$data['$view_link'] = ['value' => '<a href="' .$this->invitation->getLink() .'">'. ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
}
if ($this->entity_string == 'quote') {
@ -128,7 +128,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.quote_number')];
$data['$entity.terms'] = ['value' => $this->entity->terms ?: '&nbsp;', 'label' => ctrans('texts.quote_terms')];
$data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a href="' .$invitation->getLink() .'">'. ctrans('texts.view_quote').'</a>', 'label' => ctrans('texts.view_quote')];
$data['$view_link'] = ['value' => '<a href="' .$this->invitation->getLink() .'">'. ctrans('texts.view_quote').'</a>', 'label' => ctrans('texts.view_quote')];
}
if ($this->entity_string == 'credit') {
@ -136,7 +136,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.credit_number')];
$data['$entity.terms'] = ['value' => $this->entity->terms ?: '&nbsp;', 'label' => ctrans('texts.credit_terms')];
$data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a href="' .$invitation->getLink() .'">'. ctrans('texts.view_credit').'</a>', 'label' => ctrans('texts.view_credit')];
$data['$view_link'] = ['value' => '<a href="' .$this->invitation->getLink() .'">'. ctrans('texts.view_credit').'</a>', 'label' => ctrans('texts.view_credit')];
}
$data['$entity_number'] = &$data['$number'];

View File

@ -225,6 +225,7 @@ trait MockAccountData
$this->quote = $this->quote_calc->getQuote();
$this->quote->number = $this->getNextQuoteNumber($this->client);
$this->quote->service()->createInvitations()->markSent();
$this->quote->setRelation('client', $this->client);
$this->quote->setRelation('company', $this->company);
@ -242,6 +243,7 @@ trait MockAccountData
$this->credit->save();
$this->credit->service()->createInvitations()->markSent();
$this->credit_calc = new InvoiceSum($this->credit);
$this->credit_calc->build();