diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index 09761a62..826088b8 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -1018,11 +1018,36 @@ class JobOrderController extends BaseController { $error = false; + $stype = $req->request->get('stype'); $items = $req->request->get('items'); $promo_id = $req->request->get('promo'); $em = $this->getDoctrine()->getManager(); + // if it's a jumpstart or troubleshoot only, we know what to charge already + if ($stype == ServiceType::JUMPSTART_TROUBLESHOOT) + { + $invoice = [ + 'price' => 150.00, + 'discount' => 0, + 'trade_in' => 0, + 'vat' => 0, + 'total_price' => 150.00, + 'items' => [] + ]; + $invoice['items'][] = [ + 'title' => 'Troubleshooting fee', + 'quantity' => 1, + 'unit_price' => 150.00, + 'amount' => 150.00 + ]; + + return $this->json([ + 'success' => true, + 'invoice' => $invoice + ]); + } + // instantiate invoice criteria $criteria = new InvoiceCriteria(); diff --git a/src/Ramcar/ServiceType.php b/src/Ramcar/ServiceType.php index c2d657e7..65fe5deb 100644 --- a/src/Ramcar/ServiceType.php +++ b/src/Ramcar/ServiceType.php @@ -6,6 +6,7 @@ class ServiceType extends NameValue { const BATTERY_REPLACEMENT_NEW = 'battery_new'; const BATTERY_REPLACEMENT_WARRANTY = 'battery_warranty'; + const JUMPSTART_TROUBLESHOOT = 'jumpstart_troubleshoot'; const TIRE_REPAIR = 'tire'; const OVERHEAT_ASSITANCE = 'overheat'; const EMERGENCY_REFUEL = 'fuel'; @@ -13,6 +14,7 @@ class ServiceType extends NameValue const COLLECTION = [ 'battery_new' => 'Battery Replacement (New)', 'battery_warranty' => 'Battery Replacement (Under Warranty)', + 'jumpstart_troubleshoot' => 'Jumpstart or Troubleshoot', 'tire' => 'Tire Repair', 'overheat' => 'Overheat Assistance', 'fuel' => 'Emergency Refuel', diff --git a/templates/job-order/form.html.twig b/templates/job-order/form.html.twig index e11851ce..3625f2a1 100644 --- a/templates/job-order/form.html.twig +++ b/templates/job-order/form.html.twig @@ -172,7 +172,7 @@