From bea8180e200a0b04ba5d89c4dfc091bebe51067c Mon Sep 17 00:00:00 2001 From: Dillon Date: Sat, 5 Aug 2023 00:44:11 +0800 Subject: [PATCH] Fix error from production logs --- app/Classes/Jobs/UpdatePerfexCRM.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Classes/Jobs/UpdatePerfexCRM.php b/app/Classes/Jobs/UpdatePerfexCRM.php index cbb65228..9f598c34 100644 --- a/app/Classes/Jobs/UpdatePerfexCRM.php +++ b/app/Classes/Jobs/UpdatePerfexCRM.php @@ -45,9 +45,7 @@ class UpdatePerfexCRM implements ShouldQueue public function handle() { //To use invoice as a reference to decide whether more tasks should be created - if($this->transaction != null && $this->transaction->type === TransactionType::PAYMENT){ - $this->updatePerfexCRMObject->setInvoiceId($this->getInvoiceIdOrCreateInvoice()); - } + $this->updatePerfexCRMObject->setInvoiceId($this->getInvoiceIdOrCreateInvoice()); $result = (App()->make(UpdatePerfexCRMProcessor::class))->execute($this->updatePerfexCRMObject); if($this->transaction != null && $this->shouldCreateInvoice){ @@ -63,7 +61,7 @@ class UpdatePerfexCRM implements ShouldQueue } private function getInvoiceIdOrCreateInvoice(){ - if($this->transaction != null){ + if($this->transaction != null && $this->transaction->type !== TransactionType::PURCHASE_ORDER){ $fetchPerfexCRMInvoiceObject = new FetchPerfexCRMInvoiceObject( $this->updatePerfexCRMObject->getContactEmail(), $this->transaction