Fix crm arcadia job
This commit is contained in:
parent
a384d57492
commit
be309f3766
4 changed files with 606 additions and 840 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
|
@ -17,7 +17,8 @@
|
|||
"titleBar.activeBackground": "#0f437e",
|
||||
"titleBar.activeForeground": "#e7e7e7",
|
||||
"titleBar.inactiveBackground": "#0f437e99",
|
||||
"titleBar.inactiveForeground": "#e7e7e799"
|
||||
"titleBar.inactiveForeground": "#e7e7e799",
|
||||
"commandCenter.border": "#e7e7e799"
|
||||
},
|
||||
"peacock.remoteColor": "#0f437e"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ use Illuminate\Queue\InteractsWithQueue;
|
|||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Kwaadpepper\ExceptionHandler\Exceptions\ExceptionHandler;
|
||||
use LDC\LDCCRM\Enums\ArcadiaOrderType;
|
||||
use LDC\LDCCRM\Models\ArcadiaMailDefault;
|
||||
|
||||
|
|
@ -26,7 +28,7 @@ class SendOrderToArchadia implements ShouldQueue
|
|||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param \App\Models\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Order $order)
|
||||
|
|
@ -45,29 +47,33 @@ class SendOrderToArchadia implements ShouldQueue
|
|||
$this->order->deliveryAddress : $this->order;
|
||||
foreach ($this->order->sellItems as $sellItem) {
|
||||
for ($i = 0; $i < $sellItem->pivot->quantity; $i++) {
|
||||
// init CRM API
|
||||
app('crmAPI');
|
||||
$mail = new ArcadiaMailDefault([
|
||||
// mettre valeur dans .env
|
||||
'operation' => env('BOUTIQUE_ARCHADIA_OP_CODE', 16),
|
||||
'support_code' => $sellItem->archadia_id,
|
||||
'label_type_support' => $sellItem->name,
|
||||
// format : DD/MM/YYYY
|
||||
'order_date' => Carbon::parse($this->order->created_at)->format('Y/m/d H:i:s'),
|
||||
// format 9 numeric characters
|
||||
'order_num' => $this->order->id,
|
||||
'state_order' => $this->order->payementType->equals(OrderType::cb()) ?
|
||||
ArcadiaOrderType::cb() : ArcadiaOrderType::check(),
|
||||
'package_unit_weight' => $sellItem->archadia_weight,
|
||||
'email' => $deliver->email,
|
||||
'firstname' => $deliver->firstname,
|
||||
'lastname' => $deliver->lastname,
|
||||
'address' => $deliver->address,
|
||||
'city' => $deliver->city,
|
||||
'postcode' => $deliver->postcode,
|
||||
'phone' => $deliver->phone
|
||||
]);
|
||||
$mail->send();
|
||||
try {
|
||||
// * init CRM API
|
||||
app('crmAPI');
|
||||
$mail = new ArcadiaMailDefault([
|
||||
// * mettre valeur dans .env
|
||||
'operation' => \intval(env('BOUTIQUE_ARCHADIA_OP_CODE', 16)),
|
||||
'support_code' => $sellItem->archadia_id,
|
||||
'label_type_support' => $sellItem->name,
|
||||
// * format : DD/MM/YYYY
|
||||
'order_date' => Carbon::parse($this->order->created_at)->format('Y/m/d H:i:s'),
|
||||
// * format 9 numeric characters
|
||||
'order_num' => $this->order->id,
|
||||
'state_order' => $this->order->payementType->equals(OrderType::cb()) ?
|
||||
ArcadiaOrderType::cb() : ArcadiaOrderType::check(),
|
||||
'package_unit_weight' => $sellItem->archadia_weight,
|
||||
'email' => $deliver->email,
|
||||
'firstname' => $deliver->firstname,
|
||||
'lastname' => $deliver->lastname,
|
||||
'address' => $deliver->address,
|
||||
'city' => $deliver->city,
|
||||
'postcode' => $deliver->postcode,
|
||||
'phone' => $deliver->phone
|
||||
]);
|
||||
$mail->send();
|
||||
} catch (ValidationException $e) {
|
||||
ExceptionHandler::sendExceptionByEmailStatic($e);
|
||||
} //end try
|
||||
}//end for
|
||||
}//end foreach
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"guzzlehttp/guzzle": "^7.4",
|
||||
"htmlmin/htmlmin": "^8.0",
|
||||
"kwaadpepper/enum": "^2.1",
|
||||
"kwaadpepper/exception-handler": "^0.0.6",
|
||||
"kwaadpepper/exception-handler": "^0.1.0",
|
||||
"kwaadpepper/image-resizer": "^0.1.0",
|
||||
"kwaadpepper/refresh-sitemap": "^0.0.1",
|
||||
"kwaadpepper/serial-int-caster": "^1.0",
|
||||
|
|
|
|||
1387
composer.lock
generated
1387
composer.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue