fixed crud list
fixed payments upload -a
This commit is contained in:
@@ -1,10 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$Title$</title>
|
||||
</head>
|
||||
<body>
|
||||
$END$
|
||||
</body>
|
||||
</html>
|
||||
{# templates/barrier/container-search.html #}
|
||||
{% extends "barrier/barrier-base.html" %}
|
||||
{% block content %}
|
||||
<div class="barrier-container">
|
||||
<form method="post" class="w-full">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="search_type" value="{{ search_type }}">
|
||||
|
||||
<div class="p-6">
|
||||
<label for="id_number" class="block text-2xl mb-4">
|
||||
{% if search_type == 'container_receive' %}
|
||||
Enter Booking Number
|
||||
{% else %}
|
||||
Enter Container Number
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
<div class="flex flex-col gap-4">
|
||||
<input type="text"
|
||||
id="id_number"
|
||||
name="number"
|
||||
class="px-4 py-3 text-xl border-2 rounded-lg"
|
||||
required
|
||||
autocomplete="off"
|
||||
autofocus>
|
||||
|
||||
<button type="submit"
|
||||
class="barrier-button">
|
||||
Search
|
||||
</button>
|
||||
|
||||
{% if error %}
|
||||
<div class="text-red-600 text-xl text-center">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<a href="{% url 'barrier_dashboard' %}"
|
||||
class="barrier-button"
|
||||
style="background-color: #f5f5f5;">
|
||||
Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -16,10 +16,10 @@
|
||||
<td>{{ object.number }}</td>
|
||||
<td>{{ object.container_type }}</td>
|
||||
<td>{{ object.line.short_name }}</td>
|
||||
<td>{{ object.received_on }}</td>
|
||||
<td>{{ object.received_on|date:"y.m.d h:m" }}</td>
|
||||
<td>{{ object.position }}</td>
|
||||
<td>{{ object.swept }}</td>
|
||||
<td>{{ object.washed }}</td>
|
||||
<td>{{ object.swept|yesno:"Yes," }}</td>
|
||||
<td>{{ object.washed|yesno:"Yes," }}</td>
|
||||
<td>{{ object.booking.number }}</td>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -1,34 +1,44 @@
|
||||
{% extends "employee-base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
||||
{% for container in containers %}
|
||||
<input type="hidden" name="containers" value="{{ container.id }}">
|
||||
{% endfor %}
|
||||
|
||||
<div class="selected-containers">
|
||||
<h3>Selected Containers</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Container Number</th>
|
||||
<th>Type</th>
|
||||
<th>Company</th>
|
||||
<th>Received Date</th>
|
||||
<th>Expedited Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for container in containers %}
|
||||
|
||||
<div>
|
||||
<button id="createPaymentBtn" class="btn btn-primary" type="submit">Create Payment</button>
|
||||
</div>
|
||||
|
||||
<div class="selected-containers">
|
||||
<h3>Selected Containers</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ container.number }}</td>
|
||||
<td>{{ container.container_type }}</td>
|
||||
<td>{{ container.line.company.short_name }}</td>
|
||||
<td>{{ container.received_on|date:"Y-m-d" }}</td>
|
||||
<td>{{ container.expedited_on|date:"Y-m-d" }}</td>
|
||||
<th>Container Number</th>
|
||||
<th>Type</th>
|
||||
<th>Company</th>
|
||||
<th>Received Date</th>
|
||||
<th>Expedited Date</th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for container in containers %}
|
||||
<tr>
|
||||
<td>{{ container.number }}</td>
|
||||
<td>{{ container.container_type }}</td>
|
||||
<td>{{ container.line.company.short_name }}</td>
|
||||
<td>{{ container.received_on|date:"Y-m-d" }}</td>
|
||||
<td>{{ container.expedited_on|date:"Y-m-d" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -2,7 +2,7 @@
|
||||
{% load static %}
|
||||
|
||||
{% block filter %}
|
||||
<div class="filter-form">
|
||||
{#<div class="filter-form">#}
|
||||
<form method="GET">
|
||||
<span style="display: flex; align-items: center; width: 100%;">
|
||||
<label for="date" style="margin-right: 8px;">Date:</label>
|
||||
@@ -17,11 +17,11 @@
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
|
||||
<button type="submit">Search</button>
|
||||
</span>
|
||||
</form>
|
||||
</div>
|
||||
{#</div>#}
|
||||
{% endblock %}
|
||||
|
||||
{% block selection %}
|
||||
@@ -59,18 +59,18 @@
|
||||
document.getElementById('createPaymentBtn').addEventListener('click', function() {
|
||||
const selectedIds = Array.from(document.querySelectorAll('.selected-row'))
|
||||
.map(row => row.dataset.id);
|
||||
|
||||
|
||||
const dateInput = document.getElementById('date').value;
|
||||
const companySelect = document.getElementById('company').value;
|
||||
|
||||
|
||||
|
||||
|
||||
if (selectedIds.length > 0) {
|
||||
const params = new URLSearchParams({
|
||||
containers: selectedIds.join(','),
|
||||
date: dateInput,
|
||||
company: companySelect
|
||||
});
|
||||
|
||||
|
||||
window.location.href = '{% url "payments_create" %}?' + params.toString();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user