git issue solved
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
<h2 class="mb-4 text-center">Generate Subcontractor Report</h2>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<div class="card p-4 shadow-sm mx-auto" style="max-width: 600px;">
|
||||
@@ -22,7 +22,7 @@
|
||||
<select name="subcontractor_id" class="form-select" required>
|
||||
<option value="">-- Select Subcontractor --</option>
|
||||
{% for sc in subcontractors %}
|
||||
<option value="{{ sc.id }}" {% if selected_sc_id == sc.id|string %}selected{% endif %}>
|
||||
<option value="{{ sc.id }}" {% if selected_sc_id==sc.id|string %}selected{% endif %}>
|
||||
{{ sc.subcontractor_name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
@@ -30,7 +30,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input class="form-check-input" type="checkbox" name="download_all" value="true" id="downloadAllSwitch" onchange="toggleRAInput(this)" {% if download_all %}checked{% endif %}>
|
||||
<input class="form-check-input" type="checkbox" name="download_all" value="true" id="downloadAllSwitch"
|
||||
onchange="toggleRAInput(this)" {% if download_all %}checked{% endif %}>
|
||||
<label class="form-check-label fw-bold text-primary" for="downloadAllSwitch">
|
||||
Download All RA Bills for this Contractor
|
||||
</label>
|
||||
@@ -38,7 +39,8 @@
|
||||
|
||||
<div class="mb-4" id="ra_bill_container">
|
||||
<label class="form-label fw-semibold">RA Bill Number</label>
|
||||
<input type="text" name="ra_bill_no" id="ra_bill_input" class="form-control" placeholder="e.g. 01" value="{{ ra_bill_no or '' }}">
|
||||
<input type="text" name="ra_bill_no" id="ra_bill_input" class="form-control" placeholder="e.g. 01"
|
||||
value="{{ ra_bill_no or '' }}">
|
||||
<small class="text-muted">Required if "Download All" is off.</small>
|
||||
</div>
|
||||
|
||||
@@ -61,18 +63,24 @@
|
||||
<div class="mt-5 mb-5">
|
||||
<hr>
|
||||
<h3 class="text-center mb-4">Report Preview</h3>
|
||||
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<ul class="nav nav-tabs card-header-tabs" id="reportTabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link active" id="tr-tab" data-bs-toggle="tab" data-bs-target="#tr" type="button">Transport (Tr.Ex.)</button>
|
||||
<button class="nav-link active" id="tr-tab" data-bs-toggle="tab" data-bs-target="#tr"
|
||||
type="button">Transport (Tr.Ex.)</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="mh-tab" data-bs-toggle="tab" data-bs-target="#mh" type="button">Manpower (MH.Ex.)</button>
|
||||
<button class="nav-link" id="mh-tab" data-bs-toggle="tab" data-bs-target="#mh"
|
||||
type="button">Manpower (MH.Ex.)</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="dc-tab" data-bs-toggle="tab" data-bs-target="#dc" type="button">MH & DC</button>
|
||||
<button class="nav-link" id="dc-tab" data-bs-toggle="tab" data-bs-target="#dc" type="button">MH
|
||||
& DC</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="lay-tab" data-bs-toggle="tab" data-bs-target="#lay" type="button">Laying</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -92,6 +100,10 @@
|
||||
{{ tables.dc | safe }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="lay" role="tabpanel">
|
||||
<div class="table-responsive">
|
||||
{{ tables.lay | safe }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,28 +116,29 @@
|
||||
font-size: 0.9rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.table-responsive thead {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function toggleRAInput(checkbox) {
|
||||
const input = document.getElementById('ra_bill_input');
|
||||
const container = document.getElementById('ra_bill_container');
|
||||
if (checkbox.checked) {
|
||||
input.value = "";
|
||||
input.disabled = true;
|
||||
container.style.opacity = "0.5";
|
||||
} else {
|
||||
input.disabled = false;
|
||||
container.style.opacity = "1";
|
||||
function toggleRAInput(checkbox) {
|
||||
const input = document.getElementById('ra_bill_input');
|
||||
const container = document.getElementById('ra_bill_container');
|
||||
if (checkbox.checked) {
|
||||
input.value = "";
|
||||
input.disabled = true;
|
||||
container.style.opacity = "0.5";
|
||||
} else {
|
||||
input.disabled = false;
|
||||
container.style.opacity = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check status on load to handle form persistence
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
toggleRAInput(document.getElementById('downloadAllSwitch'));
|
||||
});
|
||||
// Check status on load to handle form persistence
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
toggleRAInput(document.getElementById('downloadAllSwitch'));
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user