|
|
|
|
@ -11,6 +11,7 @@ use App\Ramcar\TradeInType;
|
|
|
|
|
use App\Ramcar\InvoiceCriteria;
|
|
|
|
|
use App\Ramcar\InvoiceStatus;
|
|
|
|
|
use App\Ramcar\ModeOfPayment;
|
|
|
|
|
use App\Ramcar\TransactionOrigin;
|
|
|
|
|
|
|
|
|
|
use App\Entity\JobOrder;
|
|
|
|
|
use App\Entity\BatteryManufacturer;
|
|
|
|
|
@ -119,6 +120,25 @@ class JobOrderController extends BaseController
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function fillDropdownParameters(&$params)
|
|
|
|
|
{
|
|
|
|
|
$em = $this->getDoctrine()->getManager();
|
|
|
|
|
|
|
|
|
|
// db loaded
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
|
|
|
|
|
// name values
|
|
|
|
|
$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();
|
|
|
|
|
$params['sources'] = TransactionOrigin::getCollection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function incomingForm()
|
|
|
|
|
{
|
|
|
|
|
$this->denyAccessUnlessGranted('jo_in.list', null, 'No access.');
|
|
|
|
|
@ -131,16 +151,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
|
|
|
|
|
$em = $this->getDoctrine()->getManager();
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
|
|
|
|
$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();
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
// response
|
|
|
|
|
return $this->render('job-order/form.html.twig', $params);
|
|
|
|
|
@ -189,7 +200,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
->setWarrantyClass($req->request->get('warranty_class'))
|
|
|
|
|
->setCustomer($cust_vehicle->getCustomer())
|
|
|
|
|
->setCustomerVehicle($cust_vehicle)
|
|
|
|
|
->setSource('web')
|
|
|
|
|
->setSource($req->request->get('source'))
|
|
|
|
|
->setStatus(JOStatus::PENDING)
|
|
|
|
|
->setDeliveryInstructions($req->request->get('delivery_instructions'))
|
|
|
|
|
->setTier1Notes($req->request->get('tier1_notes'))
|
|
|
|
|
@ -568,19 +579,9 @@ class JobOrderController extends BaseController
|
|
|
|
|
|
|
|
|
|
$params = $this->initParameters('jo_proc');
|
|
|
|
|
$params['mode'] = 'update-processing';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$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['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
$params['discount_apply'] = DiscountApply::getCollection();
|
|
|
|
|
$params['trade_in_types'] = TradeInType::getCollection();
|
|
|
|
|
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
// get closest hubs
|
|
|
|
|
$hubs = $map_tools->getClosestHubs($obj->getCoordinates(), 10, date("H:i:s"));
|
|
|
|
|
@ -673,7 +674,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
|
|
|
|
|
->setServiceType($req->request->get('service_type'))
|
|
|
|
|
->setWarrantyClass($req->request->get('warranty_class'))
|
|
|
|
|
->setSource('web')
|
|
|
|
|
->setSource($req->request->get('source'))
|
|
|
|
|
->setStatus(JOStatus::RIDER_ASSIGN)
|
|
|
|
|
->setDeliveryInstructions($req->request->get('delivery_instructions'))
|
|
|
|
|
->setTier1Notes($req->request->get('tier1_notes'))
|
|
|
|
|
@ -768,19 +769,10 @@ class JobOrderController extends BaseController
|
|
|
|
|
throw $this->createAccessDeniedException('Not the assignor');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$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['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
$params['discount_apply'] = DiscountApply::getCollection();
|
|
|
|
|
$params['trade_in_types'] = TradeInType::getCollection();
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
$params['obj'] = $obj;
|
|
|
|
|
$params['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['submit_url'] = $this->generateUrl('jo_assign_submit', ['id' => $obj->getID()]);
|
|
|
|
|
$params['return_url'] = $this->generateUrl('jo_assign');
|
|
|
|
|
|
|
|
|
|
@ -830,7 +822,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
|
|
|
|
|
->setServiceType($req->request->get('service_type'))
|
|
|
|
|
->setWarrantyClass($req->request->get('warranty_class'))
|
|
|
|
|
->setSource('web')
|
|
|
|
|
->setSource($req->request->get('source'))
|
|
|
|
|
->setStatus(JOStatus::ASSIGNED)
|
|
|
|
|
->setDeliveryInstructions($req->request->get('delivery_instructions'))
|
|
|
|
|
->setTier1Notes($req->request->get('tier1_notes'))
|
|
|
|
|
@ -904,19 +896,10 @@ class JobOrderController extends BaseController
|
|
|
|
|
throw $this->createNotFoundException('The job order is not on a hub assigned to this user');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$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['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
$params['discount_apply'] = DiscountApply::getCollection();
|
|
|
|
|
$params['trade_in_types'] = TradeInType::getCollection();
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
$params['obj'] = $obj;
|
|
|
|
|
$params['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['submit_url'] = $this->generateUrl('jo_fulfill_submit', ['id' => $obj->getID()]);
|
|
|
|
|
$params['return_url'] = $this->generateUrl('jo_fulfill');
|
|
|
|
|
|
|
|
|
|
@ -954,7 +937,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
|
|
|
|
|
->setServiceType($req->request->get('service_type'))
|
|
|
|
|
->setWarrantyClass($req->request->get('warranty_class'))
|
|
|
|
|
->setSource('web')
|
|
|
|
|
->setSource($req->request->get('source'))
|
|
|
|
|
->setStatus(JOStatus::FULFILLED)
|
|
|
|
|
->setDeliveryInstructions($req->request->get('delivery_instructions'))
|
|
|
|
|
->setTier1Notes($req->request->get('tier1_notes'))
|
|
|
|
|
@ -1037,21 +1020,12 @@ class JobOrderController extends BaseController
|
|
|
|
|
throw $this->createNotFoundException('The job order does not exist');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$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['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
$params['discount_apply'] = DiscountApply::getCollection();
|
|
|
|
|
$params['trade_in_types'] = TradeInType::getCollection();
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
// get closest hubs
|
|
|
|
|
$hubs = $map_tools->getClosestHubs($obj->getCoordinates(), 10, date("H:i:s"));
|
|
|
|
|
|
|
|
|
|
$params['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['hubs'] = [];
|
|
|
|
|
|
|
|
|
|
// format duration and distance into friendly time
|
|
|
|
|
@ -1131,7 +1105,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
|
|
|
|
|
->setServiceType($req->request->get('service_type'))
|
|
|
|
|
->setWarrantyClass($req->request->get('warranty_class'))
|
|
|
|
|
->setSource('web')
|
|
|
|
|
->setSource($req->request->get('source'))
|
|
|
|
|
->setStatus(JOStatus::RIDER_ASSIGN)
|
|
|
|
|
->setDeliveryInstructions($req->request->get('delivery_instructions'))
|
|
|
|
|
->setTier1Notes($req->request->get('tier1_notes'))
|
|
|
|
|
@ -1193,19 +1167,10 @@ class JobOrderController extends BaseController
|
|
|
|
|
throw $this->createNotFoundException('The job order does not have an assigned hub');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$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['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
$params['discount_apply'] = DiscountApply::getCollection();
|
|
|
|
|
$params['trade_in_types'] = TradeInType::getCollection();
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
$params['obj'] = $obj;
|
|
|
|
|
$params['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['submit_url'] = $this->generateUrl('jo_open_rider_submit', ['id' => $obj->getID()]);
|
|
|
|
|
$params['return_url'] = $this->generateUrl('jo_open');
|
|
|
|
|
|
|
|
|
|
@ -1255,7 +1220,7 @@ class JobOrderController extends BaseController
|
|
|
|
|
->setAdvanceOrder($req->request->get('flag_advance') ?? false)
|
|
|
|
|
->setServiceType($req->request->get('service_type'))
|
|
|
|
|
->setWarrantyClass($req->request->get('warranty_class'))
|
|
|
|
|
->setSource('web')
|
|
|
|
|
->setSource($req->request->get('source'))
|
|
|
|
|
->setStatus(JOStatus::ASSIGNED)
|
|
|
|
|
->setDeliveryInstructions($req->request->get('delivery_instructions'))
|
|
|
|
|
->setTier1Notes($req->request->get('tier1_notes'))
|
|
|
|
|
@ -1308,19 +1273,10 @@ class JobOrderController extends BaseController
|
|
|
|
|
if (empty($obj))
|
|
|
|
|
throw $this->createNotFoundException('The job order does not exist');
|
|
|
|
|
|
|
|
|
|
// get parent associations
|
|
|
|
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
|
|
|
|
$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['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
|
|
|
|
$params['discount_apply'] = DiscountApply::getCollection();
|
|
|
|
|
$params['trade_in_types'] = TradeInType::getCollection();
|
|
|
|
|
$this->fillDropdownParameters($params);
|
|
|
|
|
|
|
|
|
|
$params['obj'] = $obj;
|
|
|
|
|
$params['status_cancelled'] = JOStatus::CANCELLED;
|
|
|
|
|
$params['return_url'] = $this->generateUrl('jo_all');
|
|
|
|
|
$params['submit_url'] = '';
|
|
|
|
|
|
|
|
|
|
|