From aceb377081d7a2e677a9b78abff6abd99d42f817 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 27 Jul 2022 20:03:46 +1000 Subject: [PATCH] Fixes for settings purchase order designs --- app/Http/Controllers/DesignController.php | 4 +++- app/Libraries/MultiDB.php | 2 +- app/Services/PurchaseOrder/PurchaseOrderService.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/DesignController.php b/app/Http/Controllers/DesignController.php index a7c603f06b..6f6c949102 100644 --- a/app/Http/Controllers/DesignController.php +++ b/app/Http/Controllers/DesignController.php @@ -564,7 +564,9 @@ class DesignController extends BaseController case 'credit': $company->credits()->update(['design_id' => $design_id]); break; - + case 'purchase_order': + $company->purchase_orders()->update(['design_id' => $design_id]); + break; default: // code... break; diff --git a/app/Libraries/MultiDB.php b/app/Libraries/MultiDB.php index b589850258..56f3d1d9ac 100644 --- a/app/Libraries/MultiDB.php +++ b/app/Libraries/MultiDB.php @@ -423,7 +423,7 @@ class MultiDB * @param array $data * @return User|null */ - public static function hasPhoneNumber(string $phone) : ?User + public static function hasPhoneNumber(string $phone) : bool { if (! config('ninja.db.multi_db_enabled')) return Account::where('account_sms_verification_number', $phone)->where('account_sms_verified', true)->exists(); diff --git a/app/Services/PurchaseOrder/PurchaseOrderService.php b/app/Services/PurchaseOrder/PurchaseOrderService.php index c6c1e57d4d..1cabb4dd7f 100644 --- a/app/Services/PurchaseOrder/PurchaseOrderService.php +++ b/app/Services/PurchaseOrder/PurchaseOrderService.php @@ -52,7 +52,7 @@ class PurchaseOrderService $settings = $this->purchase_order->company->settings; if (! $this->purchase_order->design_id) - $this->purchase_order->design_id = $this->decodePrimaryKey($settings->invoice_design_id); + $this->purchase_order->design_id = $this->decodePrimaryKey($settings->purchase_order_design_id); if (!isset($this->invoice->footer) || empty($this->invoice->footer)) $this->purchase_order->footer = $settings->purchase_order_footer;