Fixes for template service
This commit is contained in:
parent
0c2260ca0f
commit
089383950f
|
|
@ -250,6 +250,10 @@ class StaticServiceProvider extends ServiceProvider
|
|||
'subject' => EmailTemplateDefaults::emailStatementSubject(),
|
||||
'body' => EmailTemplateDefaults::emailStatementTemplate(),
|
||||
],
|
||||
'purchase_order' => [
|
||||
'subject' => EmailTemplateDefaults::emailPurchaseOrderSubject(),
|
||||
'body' => EmailTemplateDefaults::emailPurchaseOrderTemplate(),
|
||||
],
|
||||
];
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -461,7 +461,7 @@ class TemplateService
|
|||
|
||||
$processed = [];
|
||||
|
||||
if (in_array($key, ['tasks', 'projects', 'aging', 'unapplied']) || !$value->first()) {
|
||||
if (in_array($key, ['aging', 'unapplied']) || !$value->first() || (in_array($key, ['projects','tasks']) && !$value->first()->client)) {
|
||||
return $processed;
|
||||
}
|
||||
|
||||
|
|
@ -471,16 +471,13 @@ class TemplateService
|
|||
'quotes' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->setSettings($this->getSettings())->generateLabelsAndValues() ?? [],
|
||||
'credits' => $processed = (new HtmlEngine($value->first()->invitations()->first()))->setSettings($this->getSettings())->generateLabelsAndValues() ?? [],
|
||||
'payments' => $processed = (new PaymentHtmlEngine($value->first(), $value->first()->client->contacts()->first()))->setSettings($this->getSettings())->generateLabelsAndValues() ?? [], //@phpstan-ignore-line
|
||||
'tasks' => $processed = [],
|
||||
'projects' => $processed = [],
|
||||
'tasks' => $processed = (new HtmlEngine($value->first()->client->invoices()->first()->invitations()->first()))->setSettings($this->getSettings())->generateLabelsAndValues() ?? [],
|
||||
'projects' => $processed = (new HtmlEngine($value->first()->client->invoices()->first()->invitations()->first()))->setSettings($this->getSettings())->generateLabelsAndValues() ?? [],
|
||||
'purchase_orders' => (new VendorHtmlEngine($value->first()->invitations()->first()))->setSettings($this->getSettings())->generateLabelsAndValues() ?? [],
|
||||
'aging' => $processed = [],
|
||||
default => $processed = [],
|
||||
};
|
||||
|
||||
// nlog($key);
|
||||
// nlog($processed);
|
||||
|
||||
return $processed;
|
||||
|
||||
})->toArray();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPaused;
|
|||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionExpired;
|
||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRenewed;
|
||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRevoked;
|
||||
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus;
|
||||
use Imdhemy\Purchases\Events\AppStore\Subscribed;
|
||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionCanceled;
|
||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPurchased;
|
||||
|
|
@ -129,6 +128,8 @@ return [
|
|||
DidRecover::class => class_exists(\Modules\Admin\Listeners\Subscription\AppleRecover::class) ? [\Modules\Admin\Listeners\Subscription\AppleRecover::class] : [],
|
||||
InitialBuy::class => class_exists(\Modules\Admin\Listeners\Subscription\AppleInitialBuy::class) ? [\Modules\Admin\Listeners\Subscription\AppleInitialBuy::class] : [],
|
||||
InteractiveRenewal::class => class_exists(\Modules\Admin\Listeners\Subscription\AppleInteractiveRenewal::class) ? [\Modules\Admin\Listeners\Subscription\AppleInteractiveRenewal::class] : [],
|
||||
\Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus::class => class_exists(\Modules\Admin\Listeners\Subscription\AppleSubscribed::class) ? [\Modules\Admin\Listeners\Subscription\AppleSubscribed::class] : [],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue