add: twig case

* add case rate to twig template forms
This commit is contained in:
Ryan Prather 2025-02-10 15:04:43 -05:00
parent e3380bab2f
commit 24784bb1bb
3 changed files with 20 additions and 7 deletions

View File

@ -7,7 +7,6 @@
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<section>
<div class="card card-plain">
<div class="card-header">
<h4 class="font-weight-bolder">Case Info</h4>
@ -87,6 +86,11 @@
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3'>
<label for='case_form_rate'></label>
<input type='number' name='{{ field_name(form.rate) }}' id='case_form_rate' class='form-control' required='required'/>
</div>
</div>
<div class='col'>
<div class='input-group input-group-outline mb-3'>

View File

@ -30,12 +30,12 @@
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='case_form_admitDate' class='form-label'>Admit Date</label>
<label for='case_form_admitDate' class='form-label'></label>
<input type='date' name='{{ field_name(form.admitDate) }}' id='case_form_admitDate' value='{{ case.admitDate|date('Y-m-d', company_timezone) }}' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3{% if case.closeDate %} is-filled{% endif %}'>
<label for='case_form_closeDate' class='form-label'>Close Date</label>
<label for='case_form_closeDate' class='form-label'></label>
<input type='date' name='{{ field_name(form.closeDate) }}' id='case_form_closeDate' value='{% if case.closeDate %}{{ case.closeDate|date('Y-m-d', company_timezone) }}{% endif %}' class='form-control'/>
</div>
@ -46,14 +46,14 @@
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='case_form_referralType' class='form-label'>Referral Type</label>
<input type='text' name='{{ field_name(form.referralType) }}' id='case_form_referralType' value='{{ case.referralType }}' class='form-control'/>
<input type='text' name='{{ field_name(form.referralType) }}' id='case_form_referralType' value='{{ case.referralType.value }}' class='form-control'/>
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='case_form_level' class='form-label'>Level</label>
<select name='{{ field_name(form.level) }}' id='case_form_level' class='form-control'>
<option value=''></option>
{% for l in enum('App\\Enums\\CaseLevel').cases() %}
{% for l in enum('App\\Enums\\Case\\CaseLevel').cases() %}
<option value='{{ l.value }}' {% if case.level.value == l.value %} selected='selected'{% endif %}>{{ l.name }}</option>
{% endfor %}
</select>
@ -88,6 +88,11 @@
{% endfor %}
</select>
</div>
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='case_form_rate'></label>
<input type='number' name='{{ field_name(form.rate) }}' id='case_form_rate' class='form-control' value='{{ (field_value(form.rate)/100)|number_format(2) }}' required='required'/>
</div>
</div>
<div class='col'>
<div class='input-group input-group-outline mb-3 is-filled'>
@ -129,12 +134,12 @@
<label for='case_form_county' class='form-label'>County</label>
<select name='{{ field_name(form.county) }}' id='case_form_county' class='form-control'>
<option value=''></option>
{% for c in enum('App\\Enums\\County').cases() %}
{% for c in enum('App\\Enums\\System\\County').cases() %}
{% set selected="" %}
{% if case.county.value %}
{% set selected=" selected='selected'" %}
{% endif %}
<option value='{{ c.value }}' {{ selected }}>{{ c.name }}</option>
<option value='{{ c.value }}' {{ selected }}>{{ c.name|lower|capitalize }}</option>
{% endfor %}
</select>
</div>

View File

@ -46,6 +46,7 @@
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>County</th>
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Referral Count</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Case Worker</th>
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Rate</th>
<th class="text-secondary opacity-7"></th>
</tr>
</thead>
@ -84,6 +85,9 @@
{% endif %}
</p>
</td>
<td class='align-middle text-center text-xs'>
{{ (c.rate/100)|number_format(2) }}
</td>
<td class='align-right'>
{% if is_granted('ROLE_CASE_MANAGER') or is_granted('ROLE_ADMIN') %}
<a href='{{ path('app_edit_case', {id: c.id}) }}' class='text-secondary ' title='Edit Case' data-toggle='tooltip'>