Merge branch '161-fix-pricing-for-services' into 'master'
Resolve "Fix pricing for services" Closes #161 See merge request jankstudio/resq!166
This commit is contained in:
commit
73275f99c9
1 changed files with 50 additions and 7 deletions
|
|
@ -268,6 +268,41 @@ 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 processTireRepair(&$total, $invoice)
|
||||
{
|
||||
$item = new InvoiceItem();
|
||||
$item->setInvoice($invoice)
|
||||
->setTitle('Service - Flat Tire')
|
||||
->setQuantity(1)
|
||||
->setPrice(200.00);
|
||||
$invoice->addItem($item);
|
||||
|
||||
$total['total_price'] = 200;
|
||||
$total['vat_ex_price'] = 176;
|
||||
$total['vat'] = 24;
|
||||
}
|
||||
|
||||
public function processRefuel(&$total, $invoice, $ftype)
|
||||
{
|
||||
|
|
@ -282,23 +317,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,8 +395,11 @@ class InvoiceCreator
|
|||
$this->processReplacement($total, $invoice);
|
||||
break;
|
||||
case ServiceType::TIRE_REPAIR:
|
||||
$this->processTireRepair($total, $invoice);
|
||||
// $this->processOtherServices($total, $invoice, $stype);
|
||||
break;
|
||||
case ServiceType::OVERHEAT_ASSISTANCE:
|
||||
$this->processOtherServices($total, $invoice, $stype);
|
||||
$this->processOverheat($total, $invoice);
|
||||
break;
|
||||
case ServiceType::EMERGENCY_REFUEL:
|
||||
error_log('processing refuel');
|
||||
|
|
|
|||
Loading…
Reference in a new issue