Add Whatsapp to the list for transaction origin. #434
This commit is contained in:
parent
b4d1cd344d
commit
1c076228c6
2 changed files with 30 additions and 5 deletions
25
src/Ramcar/CMBTransactionOrigin.php
Normal file
25
src/Ramcar/CMBTransactionOrigin.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Ramcar;
|
||||
|
||||
class CMBTransactionOrigin extends NameValue
|
||||
{
|
||||
const CALL = 'call';
|
||||
const ONLINE = 'online';
|
||||
const FACEBOOK = 'facebook';
|
||||
const VIP = 'vip';
|
||||
const MOBILE_APP = 'mobile_app';
|
||||
const WALK_IN = 'walk_in';
|
||||
const WHATSAPP = 'whatsapp';
|
||||
|
||||
// TODO: for now, resq also gets the walk-in option
|
||||
const COLLECTION = [
|
||||
'call' => 'Hotline',
|
||||
'online' => 'Online',
|
||||
'facebook' => 'Facebook',
|
||||
'vip' => 'VIP',
|
||||
'mobile_app' => 'Mobile App',
|
||||
'walk_in' => 'Walk-in',
|
||||
'whatsapp' => 'Whatsapp',
|
||||
];
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ use App\Ramcar\JOStatus;
|
|||
use App\Ramcar\CMBWarrantyClass;
|
||||
use App\Ramcar\DiscountApply;
|
||||
use App\Ramcar\CMBModeOfPayment;
|
||||
use App\Ramcar\TransactionOrigin;
|
||||
use App\Ramcar\CMBTransactionOrigin;
|
||||
use App\Ramcar\FacilitatedType;
|
||||
use App\Ramcar\JORejectionReason;
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$row['status'] = $statuses[$orow->getStatus()];
|
||||
$row['flag_advance'] = $orow->isAdvanceOrder();
|
||||
$row['plate_number'] = $orow->getCustomerVehicle()->getPlateNumber();
|
||||
$row['is_mobile'] = $orow->getSource() == TransactionOrigin::MOBILE_APP;
|
||||
$row['is_mobile'] = $orow->getSource() == CMBTransactionOrigin::MOBILE_APP;
|
||||
$row['car_model'] = $car_model;
|
||||
$row['rider_name'] = $rider_name;
|
||||
$row['rider_plate_number'] = $rider_plate_number;
|
||||
|
|
@ -1658,7 +1658,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
// get template to display
|
||||
// check transaction origin if walkin
|
||||
if ($obj->getSource() == TransactionOrigin::WALK_IN)
|
||||
if ($obj->getSource() == CMBTransactionOrigin::WALK_IN)
|
||||
$params['template'] = $this->getTwigTemplate('jo_walkin_form');
|
||||
else
|
||||
$params['template'] = $this->getTwigTemplate('jo_onestep_form');
|
||||
|
|
@ -2822,7 +2822,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['trade_in_types'] = CMBTradeInType::getCollection();
|
||||
$params['facilitated_types'] = FacilitatedType::getCollection();
|
||||
$params['facilitated_hubs'] = $fac_hubs;
|
||||
$params['sources'] = TransactionOrigin::getCollection();
|
||||
$params['sources'] = CMBTransactionOrigin::getCollection();
|
||||
}
|
||||
|
||||
protected function initFormTags(&$params)
|
||||
|
|
@ -3108,7 +3108,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
throw new NotFoundHttpException('The item does not exist');
|
||||
|
||||
// check transaction origin
|
||||
if ($jo->getSource() == TransactionOrigin::WALK_IN)
|
||||
if ($jo->getSource() == CMBTransactionOrigin::WALK_IN)
|
||||
return 'jo_walkin_edit_form';
|
||||
else
|
||||
return 'jo_onestep_edit_form';
|
||||
|
|
|
|||
Loading…
Reference in a new issue