Merge branch 'dillon/39-crm-changes' into development

This commit is contained in:
Dillon
2023-08-05 00:44:18 +08:00
+2 -4
View File
@@ -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