Fix error from production logs

This commit is contained in:
Dillon
2023-08-05 00:36:18 +08:00
parent fd3aacd2c0
commit edfec118fe
+2 -1
View File
@@ -14,6 +14,7 @@ use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMInvoiceObje
use App\Classes\Modules\PerfexCRM\DataTransferObjects\FetchPerfexCRMInvoiceObject;
use Illuminate\Support\Facades\Log;
use PhpOffice\PhpSpreadsheet\Calculation\Logical\Boolean;
use App\Classes\ValueObjects\Constants\TransactionType;
class UpdatePerfexCRM implements ShouldQueue
{
@@ -44,7 +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->shouldCreateInvoice){
if($this->transaction != null && $this->transaction->type === TransactionType::PAYMENT){
$this->updatePerfexCRMObject->setInvoiceId($this->getInvoiceIdOrCreateInvoice());
}