Update prices for refuel and overheat services #161

This commit is contained in:
Kendrick Chan 2018-07-27 00:24:10 +08:00
parent 8e5a7ebc49
commit 397f3d144a

View file

@ -268,6 +268,27 @@ class InvoiceCreator
$total['total_price'] = 200.00;
}
public function processOverheat(&$total, $invoice)
{
$item = new InvoiceItem();
$item->setInvoice($invoice)
->setTitle('Service - Overheat Assitance')
->setQuantity(1)
->setPrice(200.00);
$invoice->addItem($item);
$coolant = new InvoiceItem();
$coolant->setInvoice($invoice)
->setTitle('4L Coolant')
->setQuantity(1)
->setPrice(1600);
$invoice->addItem($coolant);
$total['total_price'] = 1800;
$total['vat_ex_price'] = 1584;
$total['vat'] = 216;
}
public function processRefuel(&$total, $invoice, $ftype)
{
@ -282,23 +303,28 @@ class InvoiceCreator
$total['total_price'] = 200.00;
$fuel = new InvoiceItem();
$sfee = new InvoiceItem();
error_log('fuel type - ' . $ftype);
switch ($ftype)
{
case FuelType::GAS:
$fuel->setInvoice($invoice)
->setTitle('Fuel - Gas')
->setTitle('4L Fuel - Gas')
->setQuantity(1)
->setPrice(200);
->setPrice(240);
$invoice->addItem($fuel);
$total['total_price'] += 200.00;
$total['total_price'] += 240.00;
$total['vat'] = 52.80;
$total['vat_ex_price'] = 387.20;
break;
case FuelType::DIESEL:
$fuel->setInvoice($invoice)
->setTitle('Fuel - Diesel')
->setTitle('4L Fuel - Diesel')
->setQuantity(1)
->setPrice(150);
$total['total_price'] += 150.00;
->setPrice(200);
$total['total_price'] += 200.00;
$total['vat'] = 48.00;
$total['vat_ex_price'] = 352.00;
$invoice->addItem($fuel);
break;
default:
@ -355,9 +381,11 @@ class InvoiceCreator
$this->processReplacement($total, $invoice);
break;
case ServiceType::TIRE_REPAIR:
case ServiceType::OVERHEAT_ASSISTANCE:
$this->processOtherServices($total, $invoice, $stype);
break;
case ServiceType::OVERHEAT_ASSISTANCE:
$this->processOverheat($total, $invoice);
break;
case ServiceType::EMERGENCY_REFUEL:
error_log('processing refuel');
$ftype = $criteria->getCustomerVehicle()->getFuelType();