Allow fulfilled job orders to be cancelled #103
This commit is contained in:
parent
23dbe7552c
commit
aea22c7e11
3 changed files with 9 additions and 1 deletions
|
|
@ -153,6 +153,7 @@ class JobOrderController extends BaseController
|
|||
'set_map_coordinate' => true,
|
||||
'preset_vehicle' => false,
|
||||
'ticket_table' => true,
|
||||
'cancel_button' => true,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -167,12 +168,14 @@ class JobOrderController extends BaseController
|
|||
$params['ftags']['set_map_coordinate'] = false;
|
||||
$params['ftags']['invoice_edit'] = true;
|
||||
$params['ftags']['ticket_table'] = false;
|
||||
$params['ftags']['cancel_button'] = false;
|
||||
break;
|
||||
case 'create_vehicle':
|
||||
$params['ftags']['set_map_coordinate'] = false;
|
||||
$params['ftags']['invoice_edit'] = true;
|
||||
$params['ftags']['preset_vehicle'] = true;
|
||||
$params['ftags']['ticket_table'] = false;
|
||||
$params['ftags']['cancel_button'] = false;
|
||||
break;
|
||||
case 'open_edit':
|
||||
$params['ftags']['invoice_edit'] = true;
|
||||
|
|
|
|||
|
|
@ -613,4 +613,9 @@ class JobOrder
|
|||
{
|
||||
return !$this->isClosed();
|
||||
}
|
||||
|
||||
public function isCancelled()
|
||||
{
|
||||
return $this->status == JOStatus::CANCELLED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@
|
|||
{% if mode != 'update-all' %}
|
||||
<button type="submit" class="btn btn-success">{{ mode == 'update-fulfillment' ? 'Fulfill' : 'Submit' }}</button>
|
||||
{% endif %}
|
||||
{% if mode != 'create' and mode != 'create_vehicle' and is_granted('joborder.cancel') and obj.isOpen %}
|
||||
{% if ftags.set_map_coordinate and is_granted('joborder.cancel') and not obj.isCancelled %}
|
||||
<a href="{{ url('jo_cancel', {'id': obj.getID}) }}" class="btn btn-danger btn-cancel-job-order">Cancel Job Order</button>
|
||||
{% endif %}
|
||||
{% if mode != 'create' %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue