mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Ensure multidb set in PdfConfiguration
This commit is contained in:
parent
7964069e5b
commit
c4a0a8ee14
@ -137,8 +137,10 @@ class AdjustProductInventory implements ShouldQueue
|
||||
$nmo->company = $this->company;
|
||||
$nmo->settings = $this->company->settings;
|
||||
|
||||
/** @var \App\Models\CompanyUser $cu */
|
||||
|
||||
$this->company->company_users->each(function ($cu) use ($product, $nmo, $notification_level) {
|
||||
|
||||
/** @var \App\Models\CompanyUser $cu */
|
||||
if ($this->checkNotificationExists($cu, $product, ['inventory_all', 'inventory_user', 'inventory_threshold_all', 'inventory_threshold_user']) && (! in_array($product->id, $this->notified_products))) {
|
||||
$nmo->mailable = new NinjaMailer((new InventoryNotificationObject($product, $notification_level, $cu->portalType()))->build());
|
||||
$nmo->to_user = $cu->user;
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace App\Services\Pdf;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Country;
|
||||
@ -94,6 +95,8 @@ class PdfConfiguration
|
||||
*/
|
||||
public function init(): self
|
||||
{
|
||||
MultiDB::setDb($this->service->company->db);
|
||||
|
||||
$this->setEntityType()
|
||||
->setDateFormat()
|
||||
->setPdfVariables()
|
||||
@ -271,7 +274,7 @@ class PdfConfiguration
|
||||
*/
|
||||
private function setDesign(): self
|
||||
{
|
||||
$design_id = $this->entity->design_id ? : $this->decodePrimaryKey($this->settings_object->getSetting($this->entity_design_id));
|
||||
$design_id = $this->entity->design_id ?: $this->decodePrimaryKey($this->settings_object->getSetting($this->entity_design_id));
|
||||
|
||||
$this->design = Design::withTrashed()->find($design_id ?? 2);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user