mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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->company = $this->company;
|
||||||
$nmo->settings = $this->company->settings;
|
$nmo->settings = $this->company->settings;
|
||||||
|
|
||||||
/** @var \App\Models\CompanyUser $cu */
|
|
||||||
$this->company->company_users->each(function ($cu) use ($product, $nmo, $notification_level) {
|
$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))) {
|
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->mailable = new NinjaMailer((new InventoryNotificationObject($product, $notification_level, $cu->portalType()))->build());
|
||||||
$nmo->to_user = $cu->user;
|
$nmo->to_user = $cu->user;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace App\Services\Pdf;
|
namespace App\Services\Pdf;
|
||||||
|
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\ClientContact;
|
use App\Models\ClientContact;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
@ -94,6 +95,8 @@ class PdfConfiguration
|
|||||||
*/
|
*/
|
||||||
public function init(): self
|
public function init(): self
|
||||||
{
|
{
|
||||||
|
MultiDB::setDb($this->service->company->db);
|
||||||
|
|
||||||
$this->setEntityType()
|
$this->setEntityType()
|
||||||
->setDateFormat()
|
->setDateFormat()
|
||||||
->setPdfVariables()
|
->setPdfVariables()
|
||||||
@ -271,8 +274,8 @@ class PdfConfiguration
|
|||||||
*/
|
*/
|
||||||
private function setDesign(): self
|
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);
|
$this->design = Design::withTrashed()->find($design_id ?? 2);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user