Merge branch '774-add-late-documentation-tickbox-and-reason-field-in-new-ticket-ticket-creation' into '746-resq-2-0-final'
Add source to invoice criteria. Modify invoice rules to get service fees from... See merge request jankstudio/resq!881
This commit is contained in:
commit
b20371cd1f
4 changed files with 102 additions and 2 deletions
|
|
@ -105,6 +105,7 @@ class TicketController extends Controller
|
|||
$row['status'] = TicketStatus::getName($orow->getStatus());
|
||||
$row['ticket_type'] = $orow->getTicketTypeText();
|
||||
$row['plate_number'] = $orow->getPlateNumber();
|
||||
$row['flag_late_doc'] = $orow->isLateDoc();
|
||||
|
||||
// add row metadata
|
||||
$row['meta'] = [
|
||||
|
|
@ -260,6 +261,12 @@ class TicketController extends Controller
|
|||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// is this a late documentation
|
||||
$flag_late_doc = $req->request->get('flag_late_doc', false);
|
||||
|
||||
// reason for late documentation
|
||||
$late_doc_reason = $flag_late_doc ? $req->request->get('late_doc_reason') : null;
|
||||
|
||||
// set and save values
|
||||
$obj->setFirstName($first_name)
|
||||
->setLastName($last_name)
|
||||
|
|
@ -273,7 +280,9 @@ class TicketController extends Controller
|
|||
->setCreatedBy($this->getUser())
|
||||
->setSourceOfAwareness($soa_type)
|
||||
->setRemarks($remarks)
|
||||
->setOtherDescription($other_desc);
|
||||
->setOtherDescription($other_desc)
|
||||
->setLateDoc($flag_late_doc)
|
||||
->setLateDocReason($late_doc_reason);
|
||||
|
||||
// if assigned to customer, set association
|
||||
if ($customer_id) {
|
||||
|
|
@ -471,6 +480,12 @@ class TicketController extends Controller
|
|||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// is this a late documentation
|
||||
$flag_late_doc = $req->request->get('flag_late_doc', false);
|
||||
|
||||
// reason for late documentation
|
||||
$late_doc_reason = $flag_late_doc ? $req->request->get('late_doc_reason') : null;
|
||||
|
||||
// set and save values
|
||||
$obj->setFirstName($first_name)
|
||||
->setLastName($last_name)
|
||||
|
|
@ -482,7 +497,9 @@ class TicketController extends Controller
|
|||
->setPlateNumber($req->request->get('plate_number'))
|
||||
->setSourceOfAwareness($soa_type)
|
||||
->setRemarks($remarks)
|
||||
->setOtherDescription($other_desc);
|
||||
->setOtherDescription($other_desc)
|
||||
->setLateDoc($flag_late_doc)
|
||||
->setLateDocReason($late_doc_reason);
|
||||
|
||||
// initialize error list
|
||||
$error_array = [];
|
||||
|
|
|
|||
|
|
@ -139,9 +139,22 @@ class Ticket
|
|||
*/
|
||||
protected $other_description;
|
||||
|
||||
// is it a late documentation?
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
protected $flag_late_doc;
|
||||
|
||||
// reason for late documentation
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
protected $late_doc_reason;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
$this->flag_late_doc = false;
|
||||
}
|
||||
|
||||
public function getID()
|
||||
|
|
@ -354,4 +367,26 @@ class Ticket
|
|||
{
|
||||
return $this->other_description;
|
||||
}
|
||||
|
||||
public function setLateDoc($flag_late_doc = true)
|
||||
{
|
||||
$this->flag_late_doc = $flag_late_doc;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isLateDoc()
|
||||
{
|
||||
return $this->flag_late_doc;
|
||||
}
|
||||
|
||||
public function setLateDocReason($late_doc_reason)
|
||||
{
|
||||
$this->late_doc_reason = $late_doc_reason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLateDocReason()
|
||||
{
|
||||
return $this->late_doc_reason;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,6 +183,28 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group m-form__group row no-border">
|
||||
<div class="col-lg-4">
|
||||
<span class="m-switch m-switch--icon block-switch">
|
||||
<label>
|
||||
<input type="checkbox" name="flag_late_doc" id="flag_late_doc" value="1"{{ obj.isLateDoc ? ' checked' }}>
|
||||
<label class="switch-label" for="flag_late_doc">This is a late documentation</label>
|
||||
<span></span>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group m-form__group row no-border{{ obj.isLateDoc ? '' : ' hide' }}" id="late_doc_reason_box">
|
||||
<div class="col-lg-12">
|
||||
<label for="details" data-field="late_doc_reason">
|
||||
Reason for Late Documentation
|
||||
</label>
|
||||
<textarea class="form-control m-input" id="late_doc_reason" rows="6" name="late_doc_reason">{{ obj.getLateDocReason }}</textarea>
|
||||
<div class="form-control-feedback hide" data-field="late_doc_reason"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if mode == 'update' %}
|
||||
|
|
@ -381,5 +403,16 @@ $('form').on('change', '#new-ticket-type', function() {
|
|||
$('#sub-ticket-type').html(options);
|
||||
});
|
||||
|
||||
$('form').on('change', '#flag_late_doc', (e) => {
|
||||
const reasonBox = document.getElementById("late_doc_reason_box");
|
||||
|
||||
if (e.target.checked) {
|
||||
reasonBox.classList.remove('hide');
|
||||
reasonBox.querySelector('textarea').focus();
|
||||
} else {
|
||||
reasonBox.classList.add('hide');
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,21 @@
|
|||
field: 'status',
|
||||
title: 'Status'
|
||||
},
|
||||
{
|
||||
field: 'flag_late_doc',
|
||||
title: 'Documentation Time',
|
||||
template: function (row, index, datatable) {
|
||||
var tag = '';
|
||||
|
||||
if (!row.flag_late_doc) {
|
||||
tag = '<span class="m-badge m-badge--success m-badge--wide">On Time</span>';
|
||||
} else {
|
||||
tag = '<span class="m-badge m-badge--danger m-badge--wide">Late</span>';
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Actions',
|
||||
width: 110,
|
||||
|
|
|
|||
Loading…
Reference in a new issue