mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 16:04:05 +00:00
Merge branch 'dillon/39-crm-changes' into development
This commit is contained in:
@@ -26,28 +26,30 @@ class UpdatePerfexCRM implements ShouldQueue
|
||||
private $transaction;
|
||||
|
||||
/** @var Boolean|null */
|
||||
private $shouldCreateInvoiceWithPayment;
|
||||
private $shouldCreateInvoice;
|
||||
|
||||
/**
|
||||
* @param UpdatePerfexCRMObject $updatePerfexCRMObject
|
||||
* @param $transaction
|
||||
* @param bool|null $shouldCreateInvoiceWithPayment
|
||||
* @param bool|null $shouldCreateInvoice
|
||||
*/
|
||||
public function __construct(UpdatePerfexCRMObject $updatePerfexCRMObject, $transaction, ?bool $shouldCreateInvoiceWithPayment = false)
|
||||
public function __construct(UpdatePerfexCRMObject $updatePerfexCRMObject, $transaction, ?bool $shouldCreateInvoice = false)
|
||||
{
|
||||
$this->updatePerfexCRMObject = $updatePerfexCRMObject;
|
||||
$this->transaction = $transaction;
|
||||
$this->shouldCreateInvoiceWithPayment = $shouldCreateInvoiceWithPayment;
|
||||
$this->shouldCreateInvoice = $shouldCreateInvoice;
|
||||
}
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
//To use invoice as a reference to decide whether more tasks should be created
|
||||
$this->updatePerfexCRMObject->setInvoiceId($this->getInvoiceIdOrCreateInvoice());
|
||||
if($this->transaction != null && $this->shouldCreateInvoice){
|
||||
$this->updatePerfexCRMObject->setInvoiceId($this->getInvoiceIdOrCreateInvoice());
|
||||
}
|
||||
|
||||
$result = (App()->make(UpdatePerfexCRMProcessor::class))->execute($this->updatePerfexCRMObject);
|
||||
if($this->transaction != null && $this->shouldCreateInvoiceWithPayment){
|
||||
if($this->transaction != null && $this->shouldCreateInvoice){
|
||||
$updatePerfexCRMInvoiceObject = new UpdatePerfexCRMInvoiceObject(
|
||||
$this->updatePerfexCRMObject->getContactEmail(),
|
||||
$this->updatePerfexCRMObject->getProjectName(),
|
||||
|
||||
Reference in New Issue
Block a user