mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 02:04:30 -04:00
Fixes for custom email templates
This commit is contained in:
parent
d91e8c438e
commit
f5092e8cf4
@ -49,6 +49,10 @@ class TemplateEmail extends Mailable
|
||||
{
|
||||
$template_name = 'email.template.'.$this->build_email->getTemplate();
|
||||
|
||||
if($this->build_email->getTemplate() == 'custom') {
|
||||
$this->build_email->setBody(str_replace('$body', $this->build_email->getBody(), $this->client->getSetting('email_style_custom')));
|
||||
}
|
||||
|
||||
$settings = $this->client->getMergedSettings();
|
||||
|
||||
$company = $this->client->company;
|
||||
|
@ -200,15 +200,17 @@ class SubscriptionService
|
||||
|
||||
if ($outstanding->count() == 0){
|
||||
//nothing outstanding
|
||||
return $target->price;
|
||||
}
|
||||
elseif ($outstanding_amounts > $current_amount){
|
||||
elseif ($outstanding->count() == 1){
|
||||
//user has multiple amounts outstanding
|
||||
return $target->price - $this->calculateProRataRefund($outstanding->first());
|
||||
}
|
||||
elseif ($outstanding_amounts < $current_amount && $outstanding_amounts > 0) {
|
||||
elseif ($outstanding->count > 1) {
|
||||
//user is changing plan mid frequency cycle
|
||||
//we cannot handle this if there are more than one invoice outstanding.
|
||||
}
|
||||
|
||||
// $current_plan_price = $this->subscription
|
||||
}
|
||||
|
||||
private function calculateProRataRefund($invoice)
|
||||
@ -278,7 +280,7 @@ class SubscriptionService
|
||||
}
|
||||
|
||||
|
||||
private function convertInvoiceToRecurring($client_id)
|
||||
private function convertInvoiceToRecurring($client_id) :RecurringInvoice
|
||||
{
|
||||
|
||||
$subscription_repo = new SubscriptionRepository();
|
||||
|
@ -1 +1,16 @@
|
||||
{!! $body !!}
|
||||
{!! $body !!}
|
||||
@isset($whitelabel)
|
||||
@if(!$whitelabel)
|
||||
<table cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<a href="https://invoiceninja.com" target="_blank">
|
||||
{{ __('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }}
|
||||
</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
@endif
|
Loading…
x
Reference in New Issue
Block a user