Merge branch '88-add-general-services-under-warranty-service-type' into 'master'
Resolve "Add "general services - under warranty" service type" Closes #88 See merge request jankstudio/resq!74
This commit is contained in:
commit
cf6c72c230
3 changed files with 15 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ class ServiceType extends NameValue
|
|||
const BATTERY_REPLACEMENT_NEW = 'battery_new';
|
||||
const BATTERY_REPLACEMENT_WARRANTY = 'battery_warranty';
|
||||
const JUMPSTART_TROUBLESHOOT = 'jumpstart_troubleshoot';
|
||||
const JUMPSTART_WARRANTY = 'jumpstart_warranty';
|
||||
const POST_RECHARGED = 'post_recharged';
|
||||
const POST_REPLACEMENT = 'post_replacement';
|
||||
const TIRE_REPAIR = 'tire';
|
||||
|
|
@ -17,6 +18,7 @@ class ServiceType extends NameValue
|
|||
'battery_new' => 'Battery Sales',
|
||||
'battery_warranty' => 'Under Warranty',
|
||||
'jumpstart_troubleshoot' => 'General Service',
|
||||
'jumpstart_warranty' => 'General Service - Warranty',
|
||||
'post_recharged' => 'Post - Recharged',
|
||||
'post_replacement' => 'Post - Replacement',
|
||||
'tire' => 'Flat Tire',
|
||||
|
|
|
|||
|
|
@ -203,6 +203,16 @@ class InvoiceCreator
|
|||
$total['total_price'] = 150.00;
|
||||
}
|
||||
|
||||
public function processJumpstartWarranty(&$total, $invoice)
|
||||
{
|
||||
$item = new InvoiceItem();
|
||||
$item->setInvoice($invoice)
|
||||
->setTitle('Troubleshooting fee')
|
||||
->setQuantity(1)
|
||||
->setPrice(0.00);
|
||||
$invoice->addItem($item);
|
||||
}
|
||||
|
||||
public function processRecharge(&$total, $invoice)
|
||||
{
|
||||
// add recharge fee
|
||||
|
|
@ -265,6 +275,8 @@ class InvoiceCreator
|
|||
case ServiceType::JUMPSTART_TROUBLESHOOT:
|
||||
$this->processJumpstart($total, $invoice);
|
||||
break;
|
||||
case ServiceType::JUMPSTART_WARRANTY:
|
||||
$this->processJumpstartWarranty($total, $invoice);
|
||||
|
||||
case ServiceType::BATTERY_REPLACEMENT_NEW:
|
||||
$this->processEntries($total, $criteria, $invoice);
|
||||
|
|
|
|||
|
|
@ -461,8 +461,8 @@
|
|||
{% for item in obj.getInvoice.getItems %}
|
||||
<tr data-key="{{ loop.index0 }}">
|
||||
<td>{{ item.getTitle }}</td>
|
||||
<td class="text-right">{{ item.getPrice|number_format(2) }}</td>
|
||||
<td class="text-right">{{ item.getQuantity|number_format }}</td>
|
||||
<td class="text-right">{{ item.getPrice|number_format(2) }}</td>
|
||||
<td class="text-right">{{ (item.getPrice * item.getQuantity)|number_format(2) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue