Add support for mode of payment dropdown #33
This commit is contained in:
parent
4093dc65ce
commit
36e4219f99
4 changed files with 56 additions and 1 deletions
|
|
@ -10,6 +10,8 @@ use App\Ramcar\DiscountApply;
|
|||
use App\Ramcar\TradeInType;
|
||||
use App\Ramcar\InvoiceCriteria;
|
||||
use App\Ramcar\InvoiceStatus;
|
||||
use App\Ramcar\ModeOfPayment;
|
||||
|
||||
use App\Entity\JobOrder;
|
||||
use App\Entity\BatteryManufacturer;
|
||||
use App\Entity\Customer;
|
||||
|
|
@ -134,6 +136,7 @@ class JobOrderController extends BaseController
|
|||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
$params['trade_in_types'] = TradeInType::getCollection();
|
||||
|
|
@ -569,6 +572,7 @@ class JobOrderController extends BaseController
|
|||
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
|
|
@ -765,6 +769,7 @@ class JobOrderController extends BaseController
|
|||
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
|
|
@ -893,6 +898,7 @@ class JobOrderController extends BaseController
|
|||
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
|
|
@ -993,6 +999,7 @@ class JobOrderController extends BaseController
|
|||
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
|
|
@ -1147,6 +1154,7 @@ class JobOrderController extends BaseController
|
|||
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
|
|
@ -1260,6 +1268,7 @@ class JobOrderController extends BaseController
|
|||
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||
$params['service_types'] = ServiceType::getCollection();
|
||||
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||
$params['modes_of_payment'] = ModeOfPayment::getCollection();
|
||||
$params['statuses'] = JOStatus::getCollection();
|
||||
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||
$params['discount_apply'] = DiscountApply::getCollection();
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
|
||||
use CrEOF\Spatial\PHP\Types\Geometry\Point;
|
||||
use DateTime;
|
||||
use App\Ramcar\ModeOfPayment;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
|
|
@ -192,6 +193,11 @@ class JobOrder
|
|||
*/
|
||||
protected $ref_jo;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=50)
|
||||
*/
|
||||
protected $mode_of_payment;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
|
|
@ -199,6 +205,7 @@ class JobOrder
|
|||
|
||||
$this->flag_advance = false;
|
||||
$this->source = 'mobile';
|
||||
$this->mode_of_payment = ModeOfPayment::CASH;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
|
|
@ -497,4 +504,15 @@ class JobOrder
|
|||
{
|
||||
return $this->ref_jo;
|
||||
}
|
||||
|
||||
public function setModeOfPayment($mode)
|
||||
{
|
||||
$this->mode_of_payment = $mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getModeOfPayment()
|
||||
{
|
||||
return $this->mode_of_payment;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
18
src/Ramcar/ModeOfPayment.php
Normal file
18
src/Ramcar/ModeOfPayment.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Ramcar;
|
||||
|
||||
class ModeOfPayment extends NameValue
|
||||
{
|
||||
const CASH = 'cash';
|
||||
const CREDIT_CARD = 'credit_card';
|
||||
const DEBIT_CARD = 'debit_card';
|
||||
const INSTALLMENT = 'installment';
|
||||
|
||||
const COLLECTION = [
|
||||
'cash' => 'Cash',
|
||||
'credit_card' => 'Credit Card',
|
||||
'debit_card' => 'Debit Card',
|
||||
'installment' => 'Installment',
|
||||
];
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@
|
|||
</select>
|
||||
<div class="form-control-feedback hide" data-field="service_type"></div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="col-lg-3">
|
||||
<label data-field="warranty_class">Warranty Class</label>
|
||||
<select class="form-control m-input" id="warranty-class" name="warranty_class">
|
||||
<!--<option value=""></option>-->
|
||||
|
|
@ -212,6 +212,16 @@
|
|||
</select>
|
||||
<div class="form-control-feedback hide" data-field="warranty_class"></div>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<label data-field="mode_of_payment">Mode of Payment</label>
|
||||
<select class="form-control m-input" id="mode-of-payment" name="mode_of_payment">
|
||||
<!--<option value=""></option>-->
|
||||
{% for key, class in modes_of_payment %}
|
||||
<option value="{{ key }}"{{ obj.getModeOfPayment == key ? ' selected' }}>{{ class }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-control-feedback hide" data-field="mode_of_payment"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
|
|
|
|||
Loading…
Reference in a new issue