Initial commit
This commit is contained in:
102
templates/activity_log.html
Normal file
102
templates/activity_log.html
Normal file
@@ -0,0 +1,102 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Activity Logs</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: "Segoe UI", Tahoma, sans-serif;
|
||||
background-color: #f8f9fa;
|
||||
margin: 20px;
|
||||
}
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
form {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
input, button {
|
||||
padding: 8px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
button {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
table {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
border-collapse: collapse;
|
||||
background: white;
|
||||
box-shadow: 0 0 8px rgba(0,0,0,0.1);
|
||||
}
|
||||
th, td {
|
||||
padding: 12px;
|
||||
border: 1px solid #ddd;
|
||||
text-align: center;
|
||||
}
|
||||
th {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Activity Logs</h2>
|
||||
<form method="get" action="{{ url_for('activity_log') }}" class="filter-form">
|
||||
|
||||
<label for="username">Username:</label>
|
||||
<input type="text" id="username" name="username" placeholder="Enter username" value="{{ username or '' }}">
|
||||
|
||||
<label for="start_date">Start Date:</label>
|
||||
<input type="date" id="start_date" name="start_date" value="{{ start_date or '' }}">
|
||||
|
||||
<label for="end_date">End Date:</label>
|
||||
<input type="date" id="end_date" name="end_date" value="{{ end_date or '' }}">
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-primary">Filter</button>
|
||||
<!-- <button type="button" style="background-color: #6c757d;" onclick="resetFilter()">Reset</button> -->
|
||||
</form>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Timestamp</th>
|
||||
<th>User</th>
|
||||
<th>Action</th>
|
||||
<th>Details</th>
|
||||
</tr>
|
||||
{% for log in logs %}
|
||||
<tr>
|
||||
<td>{{ log.timestamp }}</td>
|
||||
<td>{{ log.user }}</td>
|
||||
<td>{{ log.action }}</td>
|
||||
<td>{{ log.details }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if logs|length == 0 %}
|
||||
<tr>
|
||||
<td colspan="4">No logs found</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
|
||||
<script>
|
||||
function resetFilter() {
|
||||
window.location.href = "{{ url_for('activity_log') }}";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -39,12 +39,18 @@
|
||||
<label for="invoice_No">Invoice No:</label><br>
|
||||
<input type="text" id="invoice_No" name="invoice_No" required><br><br>
|
||||
|
||||
<label for="basic_amount">Amount:</label><br>
|
||||
<label for="basic_amount">Basic Amount:</label><br>
|
||||
<input type="number" step="0.01" id="basic_amount" name="basic_amount" placeholder="₹ - 00.00" required><br><br>
|
||||
|
||||
<label for="final_amount">Total Amount:</label><br>
|
||||
<label for="final_amount">Final Amount:</label><br>
|
||||
<input type="number" step="0.01" id="final_amount" name="final_amount" placeholder="₹ - 00.00" required><br><br>
|
||||
|
||||
<label for="total_amount">Total Amount:</label><br>
|
||||
<input type="number" step="0.01" id="total_amount" name="total_amount" placeholder="₹ - 00.00" required><br><br>
|
||||
|
||||
<label for="utr">UTR:</label><br>
|
||||
<input type="text" id="utr" name="utr" required><br><br>
|
||||
|
||||
<button type="submit">Submit GST Release</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -75,6 +81,8 @@
|
||||
<th>Invoice_No</th>
|
||||
<th>Basic_Amount</th>
|
||||
<th>Final_Amount</th>
|
||||
<th>Total_Amount</th>
|
||||
<th>UTR</th>
|
||||
<th>Update</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
@@ -87,6 +95,8 @@
|
||||
<td>{{ gst_rel[2] }}</td>
|
||||
<td>{{ gst_rel[3] }}</td>
|
||||
<td>{{ gst_rel[4] }}</td>
|
||||
<td>{{ gst_rel[5] }}</td>
|
||||
<td>{{ gst_rel[6] }}</td>
|
||||
<td>
|
||||
<a href="/edit_gst_release/{{ gst_rel[0] }}">
|
||||
<img src="{{ url_for('static', filename='images/icons/pen_blue_icon.png') }}" alt="Edit"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</select><br><br>
|
||||
|
||||
<label for="invoice_No">Invoice No:</label><br>
|
||||
<input type="number" step="0.01" id="invoice_No" name="invoice_No" required><br><br>
|
||||
<input type="number" step="0.01" id="invoice_No" name="invoice_No" ><br><br>
|
||||
|
||||
<label for="Payment_Amount">Amount:</label><br>
|
||||
<input type="number" step="0.01" id="Payment_Amount" name="Payment_Amount" required oninput="calculateTDSAndTotal()"><br><br>
|
||||
|
||||
147
templates/add_purchase_order.html
Normal file
147
templates/add_purchase_order.html
Normal file
@@ -0,0 +1,147 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<head>
|
||||
<title>Manage Purchases</title>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="button-container">
|
||||
<button id="addButton" class="action-button">Add Purchase</button>
|
||||
<button id="displayButton" class="action-button">Display Purchases</button>
|
||||
</div>
|
||||
|
||||
<!-- ADD PURCHASE FORM -->
|
||||
<!-- ADD PURCHASE FORM -->
|
||||
<div id="addForm" style="display: none;">
|
||||
<h2>Add Purchase Entry</h2>
|
||||
<form action="/add_purchase_order" method="POST">
|
||||
<label for="purchase_date">Purchase Date:</label><br>
|
||||
<input type="date" id="purchase_date" name="purchase_date" required><br><br>
|
||||
|
||||
<label for="supplier_name">Supplier Name:</label><br>
|
||||
<input type="text" id="supplier_name" name="supplier_name" required><br><br>
|
||||
|
||||
<label for="Purchase Order No">Purchase Order No:</label><br>
|
||||
<input type="text" name="purchase_order_no" required><br><br>
|
||||
|
||||
<label for="unit">Item Name:</label><br>
|
||||
<input type="text" id="item_name" name="item_name" required><br><br>
|
||||
|
||||
<label for="quantity">Quantity:</label><br>
|
||||
<input type="number" id="quantity" name="quantity" step="1" required><br><br>
|
||||
|
||||
<label for="unit">Unit:</label><br>
|
||||
<input type="text" id="unit" name="unit" required><br><br>
|
||||
|
||||
<label for="rate">Rate:</label><br>
|
||||
<input type="number" step="0.01" id="rate" name="rate" required><br><br>
|
||||
|
||||
<label for="amount">Amount:</label><br>
|
||||
<input type="number" step="0.01" id="amount" name="amount" readonly><br><br>
|
||||
|
||||
<!-- GST input -->
|
||||
<label for="gst_percent">GST %:</label><br>
|
||||
<input type="number" step="0.01" id="gst_percent"><br><br>
|
||||
|
||||
<label>GST Amount:</label><br>
|
||||
<input type="number" step="0.01" id="GST_Amount" name="GST_Amount" readonly><br><br>
|
||||
|
||||
<!-- TDS input -->
|
||||
<label for="tds_percent">TDS %:</label><br>
|
||||
<input type="number" step="0.01" id="tds_percent"><br><br>
|
||||
|
||||
<label>TDS:</label><br>
|
||||
<input type="number" step="0.01" id="TDS" name="TDS" readonly><br><br>
|
||||
|
||||
<label>Final Amount:</label><br>
|
||||
<input type="number" step="0.01" id="final_amount" name="final_amount" readonly><br><br>
|
||||
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- DISPLAY TABLE -->
|
||||
<div id="displayTable" style="display: none;">
|
||||
<h2>Purchase List</h2>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Purchase Date</th>
|
||||
<th>Supplier Name</th>
|
||||
<th>Purchase Order No</th>
|
||||
<th>Item Name</th>
|
||||
<th>Quantity</th>
|
||||
<th>Unit</th>
|
||||
<th>Rate</th>
|
||||
<th>Amount</th>
|
||||
<th>GST Amount</th>
|
||||
<th>TDS</th>
|
||||
<th>Final Amount</th>
|
||||
<th>Edit</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
{% for purchase in purchases %}
|
||||
<tr>
|
||||
<td>{{ purchase['purchase_id'] }}</td>
|
||||
<td>{{ purchase['purchase_date'] }}</td>
|
||||
<td>{{ purchase['supplier_name'] }}</td>
|
||||
<td>{{ purchase['purchase_order_no'] }}</td>
|
||||
<td>{{ purchase['item_name'] }}</td>
|
||||
<td>{{ purchase['quantity'] }}</td>
|
||||
<td>{{ purchase['unit'] }}</td>
|
||||
<td>{{ purchase['rate'] }}</td>
|
||||
<td>{{ purchase['amount'] }}</td>
|
||||
<td>{{ purchase['GST_Amount'] }}</td>
|
||||
<td>{{ purchase['TDS'] }}</td>
|
||||
<td>{{ purchase['final_amount'] }}</td>
|
||||
<td><a href="{{ url_for('update_purchase', id=purchase['purchase_id']) }}">Edit</a></td>
|
||||
<td>
|
||||
<form method="POST" action="{{ url_for('delete_purchase', id=purchase['purchase_id']) }}" style="display:inline;">
|
||||
<button type="submit" onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#addButton').click(function() {
|
||||
$('#addForm').toggle();
|
||||
});
|
||||
$('#displayButton').click(function() {
|
||||
$('#displayTable').toggle();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function calculateAmounts() {
|
||||
const qty = parseFloat(document.getElementById('quantity').value) || 0;
|
||||
const rate = parseFloat(document.getElementById('rate').value) || 0;
|
||||
const gstPercent = parseFloat(document.getElementById('gst_percent').value) || 0;
|
||||
const tdsPercent = parseFloat(document.getElementById('tds_percent').value) || 0;
|
||||
|
||||
const amount = qty * rate;
|
||||
document.getElementById('amount').value = amount.toFixed(2);
|
||||
|
||||
const gstAmount = (gstPercent / 100) * amount;
|
||||
document.getElementById('GST_Amount').value = gstAmount.toFixed(2);
|
||||
|
||||
const tdsAmount = (tdsPercent / 100) * amount;
|
||||
document.getElementById('TDS').value = tdsAmount.toFixed(2);
|
||||
|
||||
const finalAmount = amount + gstAmount - tdsAmount;
|
||||
document.getElementById('final_amount').value = finalAmount.toFixed(2);
|
||||
}
|
||||
|
||||
// Attach events
|
||||
document.getElementById('quantity').addEventListener('input', calculateAmounts);
|
||||
document.getElementById('rate').addEventListener('input', calculateAmounts);
|
||||
document.getElementById('gst_percent').addEventListener('input', calculateAmounts);
|
||||
document.getElementById('tds_percent').addEventListener('input', calculateAmounts);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
{% endblock %}
|
||||
@@ -29,6 +29,9 @@
|
||||
<h2>Display States</h2>
|
||||
<input type="text" id="searchBar" placeholder="Searching..." onkeyup="searchTable()">
|
||||
</div>
|
||||
<script>
|
||||
console.log(statedata)
|
||||
</script>
|
||||
<table id="sortableTable" border="1">
|
||||
<tr>
|
||||
<th>State ID</th>
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
</select><br>
|
||||
|
||||
<label>GST Registration Type :</label>
|
||||
<input type="text" name="GST_Registration_Type" required><br>
|
||||
<input type="text" name="GST_Registration_Type" ><br>
|
||||
|
||||
<label>GST No :</label>
|
||||
<input type="text" id="GST_No" name="GST_No" placeholder="Ex - 27AAACL5602N1ZE" required ><br>
|
||||
<input type="text" id="GST_No" name="GST_No" placeholder="Ex - 27AAACL5602N1ZE" ><br>
|
||||
|
||||
<label>Generated Password :</label>
|
||||
<input type="text" id="Contractor_password" name="Contractor_password" >
|
||||
@@ -112,11 +112,11 @@
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('deleteSubContractor', id=subc[0]) }}"
|
||||
onclick="return confirm('Are you sure you want to delete?')">
|
||||
<img src="{{ url_for('static', filename='images/icons/bin_red_icon.png') }}" alt="Delete"
|
||||
class="icon">
|
||||
</a>
|
||||
{# <a href="{{ url_for('deleteSubContractor', id=subc[0]) }}"#}
|
||||
{# onclick="return confirm('Are you sure you want to delete?')">#}
|
||||
{# <img src="{{ url_for('static', filename='images/icons/bin_red_icon.png') }}" alt="Delete"#}
|
||||
{# class="icon">#}
|
||||
{# </a>#}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
137
templates/add_work_order.html
Normal file
137
templates/add_work_order.html
Normal file
@@ -0,0 +1,137 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<head>
|
||||
<title>Manage Work Order</title>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
|
||||
</head>
|
||||
</head>
|
||||
<body>
|
||||
<div class="button-container">
|
||||
<button id="addButton" class="action-button">Add</button>
|
||||
<button id="displayButton" class="action-button">Display</button>
|
||||
</div>
|
||||
<form action="/submit_work_order" method="POST">
|
||||
<div id="addForm" style="display: none;">
|
||||
<h2>Create Work Order</h2>
|
||||
|
||||
|
||||
<!-- Subcontractor Dropdown -->
|
||||
<label for="subcontractor_id">Select Vender Name:</label><br>
|
||||
<select name="vendor_name" id="vendor_name" required>
|
||||
<option value="">-- Select Subcontractor --</option>
|
||||
{% for sc in subcontractor %}
|
||||
<option value="{{ sc.Contractor_Name }}">{{ sc.Contractor_Name }}</option>
|
||||
{% endfor %}
|
||||
</select><br><br>
|
||||
|
||||
|
||||
|
||||
<label for="work_order_number">Work Order Number:</label><br>
|
||||
<input type="text" id="work_order_number" name="work_order_number" required><br><br>
|
||||
|
||||
<label for="work_order_amount">Work Order Amount</label><br>
|
||||
<input type="number" step="0.01" id="work_order_amount" name="work_order_amount" required><br><br>
|
||||
|
||||
<label for="gst_amount">GST Amount:</label><br>
|
||||
<input type="number" step="0.01" id="gst_amount" name="gst_amount" required><br><br>
|
||||
|
||||
<label for="tds_amount">TDS Amount:</label><br>
|
||||
<input type="number" step="0.01" id="tds_amount" name="tds_amount" required><br><br>
|
||||
|
||||
<label for="security_deposit">Security Deposit:</label><br>
|
||||
<input type="number" step="0.01" id="security_deposit" name="security_deposit" required><br><br>
|
||||
|
||||
<label for="sd_against_gst">SD Against GST:</label><br>
|
||||
<input type="number" step="0.01" id="sd_against_gst" name="sd_against_gst" required><br><br>
|
||||
|
||||
<label for="final_total">Final Total:</label><br>
|
||||
<input type="number" step="0.01" id="final_total" name="final_total" readonly><br><br>
|
||||
|
||||
<input type="submit" value="Submit">
|
||||
</div>
|
||||
</form>
|
||||
{# display data #}
|
||||
<div id="addTable" style="display: none;">
|
||||
{# <div class="search-container">#}
|
||||
{# <h2>Hold Type List</h2>#}
|
||||
{# <input type="text" id="searchBar" placeholder="Searching..." onkeyup="searchTable()">#}
|
||||
{# </div>#}
|
||||
<table id="sortableTable" border="1">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th class="sortable-header">
|
||||
Vender Name
|
||||
{# <span class="sort-buttons">#}
|
||||
{# <span class="sort-asc">⬆️</span>#}
|
||||
{# <span class="sort-desc">⬇️</span>#}
|
||||
{# </span>#}
|
||||
</th>
|
||||
<th>Work Order Type</th>
|
||||
<th>Work Order Amount</th>
|
||||
<th>BOQ Amount</th>
|
||||
<th>Work Done Percentage</th>
|
||||
<th>Update</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
{% for htd in wo %}
|
||||
<tr>
|
||||
<td>{{ htd.work_order_id }}</td>
|
||||
<td>{{ htd['vendor_name'] }}</td>
|
||||
<td>{{ htd['work_order_type'] }}</td>
|
||||
<td>{{ htd['work_order_amount'] }}</td>
|
||||
<td>{{ htd['boq_amount'] }}</td>
|
||||
<td>{{ htd['work_done_percentage'] }}</td>
|
||||
<td>{{ htd['work_order_number'] }}</td>
|
||||
<td>{{ htd['gst_amount'] }}</td>
|
||||
<td>{{ htd['tds_amount'] }}</td>
|
||||
<td>{{ htd[''] }}</td>
|
||||
<td><a href="{{ url_for('update_work_order', id=htd['work_order_id']) }}">Edit</a></td>
|
||||
<td>
|
||||
<form action="{{ url_for('delete_work_order', id=htd['work_order_id']) }}" method="POST" style="display:inline;">
|
||||
<button type="submit" onclick="return confirm('Are you sure you want to delete this work order?');" class="delete-button">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<a href="/">Back to Dashboard</a>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#displayButton').click(function () {
|
||||
$('#addTable').toggle();
|
||||
});
|
||||
|
||||
$('#addButton').click(function () {
|
||||
$('#addForm').toggle();
|
||||
|
||||
// Bind input event handlers ONLY after form is shown
|
||||
setTimeout(function () {
|
||||
["work_order_amount", "gst_amount", "tds_amount", "security_deposit", "sd_against_gst"].forEach(function (id) {
|
||||
document.getElementById(id).addEventListener("input", calculateFinalTotal);
|
||||
});
|
||||
}, 100); // Delay ensures elements are available in DOM
|
||||
});
|
||||
|
||||
function calculateFinalTotal() {
|
||||
const workOrderAmount = parseFloat(document.getElementById("work_order_amount").value) || 0;
|
||||
const gstAmount = parseFloat(document.getElementById("gst_amount").value) || 0;
|
||||
const tdsAmount = parseFloat(document.getElementById("tds_amount").value) || 0;
|
||||
const securityDeposit = parseFloat(document.getElementById("security_deposit").value) || 0;
|
||||
const sdAgainstGst = parseFloat(document.getElementById("sd_against_gst").value) || 0;
|
||||
|
||||
const finalTotal = workOrderAmount + gstAmount - (tdsAmount + securityDeposit + sdAgainstGst);
|
||||
document.getElementById("final_total").value = finalTotal.toFixed(2);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
39
templates/edit_grn.html
Normal file
39
templates/edit_grn.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><title>Edit GRN</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Edit GRN</h2>
|
||||
<form method="POST">
|
||||
<label>GRN Date:</label>
|
||||
<input type="date" name="grn_date" value="{{ grn['grn_date'] }}" required><br><br>
|
||||
|
||||
<label>Purchase ID:</label>
|
||||
<input type="number" name="purchase_id" value="{{ grn['purchase_id'] }}" required><br><br>
|
||||
|
||||
<label>Supplier Name:</label>
|
||||
<input type="text" name="supplier_name" value="{{ grn['supplier_name'] }}" required><br><br>
|
||||
|
||||
<label>Item Description:</label>
|
||||
<input type="text" name="item_description" value="{{ grn['item_description'] }}" required><br><br>
|
||||
|
||||
<label>Received Quantity:</label>
|
||||
<input type="number" name="received_quantity" value="{{ grn['received_quantity'] }}" required><br><br>
|
||||
|
||||
<label>Unit:</label>
|
||||
<input type="text" name="unit" value="{{ grn['unit'] }}" required><br><br>
|
||||
|
||||
<label>Rate:</label>
|
||||
<input type="number" step="0.01" name="rate" value="{{ grn['rate'] }}" required><br><br>
|
||||
|
||||
<label>Amount:</label>
|
||||
<input type="number" step="0.01" name="amount" value="{{ grn['amount'] }}" required><br><br>
|
||||
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="remarks" value="{{ grn['remarks'] }}"><br><br>
|
||||
|
||||
<input type="submit" value="Update GRN">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -21,14 +21,22 @@
|
||||
required><br><br>
|
||||
|
||||
|
||||
<label for="basic_amount">Amount:</label><br>
|
||||
<label for="basic_amount">Basic Amount:</label><br>
|
||||
<input type="number" step="0.01" id="basic_amount" name="basic_amount" value="{{ gst_release_data[3] }}"
|
||||
required><br><br>
|
||||
|
||||
<label for="final_amount">Total Amount:</label><br>
|
||||
<label for="final_amount">Final Amount:</label><br>
|
||||
<input type="number" step="0.01" id="final_amount" name="final_amount" value="{{ gst_release_data[4] }}"
|
||||
required><br><br>
|
||||
|
||||
<label for="total_amount">Total Amount:</label><br>
|
||||
<input type="number" step="0.01" id="total_amount" name="total_amount" value="{{ gst_release_data[5] }}"
|
||||
required><br><br>
|
||||
|
||||
<label for="utr">UTR:</label><br>
|
||||
<input type="text" id="utr" name="utr" value="{{ gst_release_data[6] }}"
|
||||
required><br><br>
|
||||
|
||||
<button type="submit">Update GST Release</button>
|
||||
</form>
|
||||
|
||||
|
||||
47
templates/edit_purchase.html
Normal file
47
templates/edit_purchase.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Edit Purchase</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Edit Purchase Order</h2>
|
||||
<form method="POST">
|
||||
<label>Purchase Date:</label>
|
||||
<input type="date" name="purchase_date" value="{{ purchase['purchase_date'] }}" required><br><br>
|
||||
|
||||
<label>Supplier Name:</label>
|
||||
<input type="text" name="supplier_name" value="{{ purchase['supplier_name'] }}" required><br><br>
|
||||
|
||||
<label>Purchase Order No:</label>
|
||||
<input type="text" name="purchase_order_no" value="{{ purchase['purchase_order_no'] }}" required><br><br>
|
||||
|
||||
<label>Item Name:</label>
|
||||
<input type="text" name="item_name" value="{{ purchase['item_name'] }}" required><br><br>
|
||||
|
||||
<label>Quantity:</label>
|
||||
<input type="number" name="quantity" value="{{ purchase['quantity'] }}" required><br><br>
|
||||
|
||||
<label>Unit:</label>
|
||||
<input type="text" name="unit" value="{{ purchase['unit'] }}" required><br><br>
|
||||
|
||||
<label>Rate:</label>
|
||||
<input type="number" step="0.01" name="rate" value="{{ purchase['rate'] }}" required><br><br>
|
||||
|
||||
<label>Amount:</label>
|
||||
<input type="number" step="0.01" name="amount" value="{{ purchase['amount'] }}" required><br><br>
|
||||
|
||||
|
||||
<label>GST Amount:</label>
|
||||
<input type="text" name="GST_Amount" value="{{ purchase['GST_Amount'] }}" required><br><br>
|
||||
|
||||
<label>TDS:</label>
|
||||
<input type="number" step="0.01" name="TDS" value="{{ purchase['TDS'] }}" required><br><br>
|
||||
|
||||
<label>Final Amount:</label>
|
||||
<input type="number" step="0.01" name="final_amount" value="{{ purchase['final_amount'] }}" required><br><br>
|
||||
|
||||
<input type="submit" value="Update">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
77
templates/grn_form.html
Normal file
77
templates/grn_form.html
Normal file
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>GRN Management</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Add GRN</h2>
|
||||
<form method="POST" action="/add_grn">
|
||||
<label>GRN Date:</label>
|
||||
<input type="date" name="grn_date" required><br><br>
|
||||
|
||||
<label>Purchase ID:</label>
|
||||
<input type="number" name="purchase_id" required><br><br>
|
||||
{# <label for="purchase_id">Purchase Order:</label>#}
|
||||
{# <select name="purchase_id" id="purchase_id" required>#}
|
||||
{# {% for order in purchase_orders %}#}
|
||||
{# <option value="{{ order['purchase_id'] }}">{{ order['supplier_name'] }}</option>#}
|
||||
{# {% endfor %}#}
|
||||
{#</select>#}
|
||||
|
||||
<label>Supplier Name:</label>
|
||||
<input type="text" name="supplier_name" required><br><br>
|
||||
|
||||
<label>Item Description:</label>
|
||||
<input type="text" name="item_description" required><br><br>
|
||||
|
||||
<label>Received Quantity:</label>
|
||||
<input type="number" name="received_quantity" required><br><br>
|
||||
|
||||
<label>Unit:</label>
|
||||
<input type="text" name="unit" required><br><br>
|
||||
|
||||
<label>Rate:</label>
|
||||
<input type="number" step="0.01" name="rate" required><br><br>
|
||||
|
||||
<label>Amount:</label>
|
||||
<input type="number" step="0.01" name="amount" required><br><br>
|
||||
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="remarks"><br><br>
|
||||
|
||||
<input type="submit" value="Add GRN">
|
||||
</form>
|
||||
|
||||
<h2>All GRNs</h2>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>ID</th><th>Date</th><th>Purchase ID</th><th>Supplier</th><th>Item</th>
|
||||
<th>Qty</th><th>Unit</th><th>Rate</th><th>Amount</th><th>Remarks</th><th>Actions</th>
|
||||
</tr>
|
||||
{% for grn in grns %}
|
||||
<tr>
|
||||
<td>{{ grn[0] }}</td>
|
||||
<td>{{ grn[1] }}</td>
|
||||
<td>{{ grn[2] }}</td>
|
||||
<td>{{ grn[3] }}</td>
|
||||
<td>{{ grn[4] }}</td>
|
||||
<td>{{ grn[5] }}</td>
|
||||
<td>{{ grn[6] }}</td>
|
||||
<td>{{ grn[7] }}</td>
|
||||
<td>{{ grn[8] }}</td>
|
||||
<td>{{ grn[9] }}</td>
|
||||
<td style="white-space: nowrap;">
|
||||
<a href="/update_grn/{{ grn['grn_id'] }}" style="margin-right: 10px;">Edit</a>
|
||||
|
||||
<form action="/delete_grn/{{ grn[0] }}" method="POST" style="display:inline;">
|
||||
<button type="submit" onclick="return confirm('Are you sure you want to delete this GRN?')" style="background:none;border:none;color:blue;cursor:pointer;text-decoration:underline;">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,8 +6,31 @@
|
||||
<title>Payment Reconciliation </title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/index.css') }}">
|
||||
<style>
|
||||
.logout-button {
|
||||
position: absolute;
|
||||
top: 2cm;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.logout-button a {
|
||||
background-color: #e74c3c;
|
||||
color: white;
|
||||
padding: 8px 14px;
|
||||
border-radius: 5px;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.logout-button a:hover {
|
||||
background-color: #c0392b;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="logout-button">
|
||||
<a href="/logout">Logout</a>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<img src="https://lceplpmprod.btltech.xyz/assets/images/lcpl.png" alt="logo-image" class="logo">
|
||||
|
||||
@@ -27,6 +50,22 @@
|
||||
<i class="fas fa-cog"></i> Report Details
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item">
|
||||
<a href="/work_order_report" class="nav-link">
|
||||
<i class="fas fa-cog"></i> Work Order Report Details
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/purchase_order_report" class="nav-link">
|
||||
<i class="fas fa-cog"></i>Purchase Order Report Details
|
||||
</a>
|
||||
</li> -->
|
||||
<li class="nav-item">
|
||||
<a href="{{ url_for('activity_log') }}" class="nav-link">
|
||||
<i class="fas fa-cog"></i> Logs
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="user-section">
|
||||
<img src="{{ url_for('static', filename='images/icons/male_profile.jpg') }}" alt="User Avatar">
|
||||
@@ -92,14 +131,31 @@
|
||||
<h2>Hold Types</h2>
|
||||
<a class="btn" href="/add_hold_type">Go ➜</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Hold Release Types</h2>
|
||||
<a class="btn" href="/add_hold_release">Go ➜</a>
|
||||
<div class="card">
|
||||
<h2>Work Order</h2>
|
||||
<a class="btn" href="/add_work_order">Go ➜</a>
|
||||
</div>
|
||||
<!-- <div class="card">
|
||||
<h2>Purchase Order</h2>
|
||||
<a class="btn" href="/add_purchase_order">Go ➜</a>
|
||||
</div> -->
|
||||
<!-- <div class="card">
|
||||
<h2>Goods Receive Note</h2>
|
||||
<a class="btn" href="/add_grn">Go ➜</a>
|
||||
</div> -->
|
||||
<!-- <div class="card">
|
||||
<h2>Unreleased GST</h2>
|
||||
<a class="btn" href="/unreleased_gst">Go ➜</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{# <div class="card">#}
|
||||
{# <h2>Hold Release </h2>#}
|
||||
{# <a class="btn" href="/add_hold_release">Go ➜</a>#}
|
||||
{# </div>#}
|
||||
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
90
templates/login.html
Normal file
90
templates/login.html
Normal file
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>LCEPL Payment Reconciliation</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background: #f3f3f3;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
background: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.flash {
|
||||
color: red;
|
||||
text-align: center;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-container">
|
||||
<h1 class="title">Laxmi Civil Engineering Services</h1>
|
||||
<h4 class="subtitle">LOGIN</h4>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="flash flash-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
|
||||
|
||||
<form method="post">
|
||||
<input type="text" name="username" placeholder="Username" required />
|
||||
<input
|
||||
type="password"
|
||||
name="password"
|
||||
placeholder="Password"
|
||||
required
|
||||
/>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
10
templates/purchase_order.html
Normal file
10
templates/purchase_order.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Purchase Order</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
205
templates/purchase_order_report.html
Normal file
205
templates/purchase_order_report.html
Normal file
@@ -0,0 +1,205 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Purchase Order Report</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/subcontractor_report.css') }}">
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
h2.report-title {
|
||||
font-size: 28px;
|
||||
color: #1a73e8;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.filter-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
label {
|
||||
font-weight: bold;
|
||||
margin-right: 10px;
|
||||
}
|
||||
select {
|
||||
padding: 6px;
|
||||
}
|
||||
#downloadBtn, #searchBtn {
|
||||
padding: 10px 20px;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
margin-top: 20px;
|
||||
}
|
||||
#downloadBtn:hover, #searchBtn:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
table {
|
||||
margin: 0 auto;
|
||||
margin-top: 30px;
|
||||
border-collapse: collapse;
|
||||
width: 95%;
|
||||
}
|
||||
th, td {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2 class="report-title">Purchase Order Report</h2>
|
||||
|
||||
<div class="filter-section">
|
||||
<div>
|
||||
<label for="supplier_name">Select Supplier Name:</label>
|
||||
<select id="supplier_name" name="supplier_name" style="width: 300px;"></select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="purchase_order_no">Select Purchase Order Number:</label>
|
||||
<select id="purchase_order_no" name="purchase_order_no" style="width: 300px;"></select>
|
||||
</div>
|
||||
|
||||
<button id="searchBtn">Search</button>
|
||||
<button id="downloadBtn" style="display: none;">Download Report</button>
|
||||
</div>
|
||||
|
||||
<table border="1" id="purchaseorderTable" style="display: none;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Purchase ID</th>
|
||||
<th>Purchase Date</th>
|
||||
<th>Supplier Name</th>
|
||||
<th>Purchase Order No</th>
|
||||
<th>Item Name</th>
|
||||
<th>Quantity</th>
|
||||
<th>Unit</th>
|
||||
<th>Rate</th>
|
||||
<th>Amount</th>
|
||||
<th>GST Amount</th>
|
||||
<th>TDS</th>
|
||||
<th>Final Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
|
||||
<!-- JS Scripts -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Initialize Select2 for supplier_name
|
||||
$('#supplier_name').select2({
|
||||
placeholder: 'Search Supplier Name',
|
||||
ajax: {
|
||||
url: '/get_supplier_names',
|
||||
data: function (params) {
|
||||
return { q: params.term };
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data.map(name => ({ id: name, text: name }))
|
||||
};
|
||||
},
|
||||
delay: 250,
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize Select2 for purchase_order_no
|
||||
$('#purchase_order_no').select2({
|
||||
placeholder: 'Search Purchase Order No',
|
||||
ajax: {
|
||||
url: '/get_purchase_order_numbers',
|
||||
data: function (params) {
|
||||
return {
|
||||
q: params.term,
|
||||
supplier_name: $('#supplier_name').val()
|
||||
};
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data.map(no => ({ id: no, text: no }))
|
||||
};
|
||||
},
|
||||
delay: 250,
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
// Search button click
|
||||
$('#searchBtn').click(function () {
|
||||
let supplier = $('#supplier_name').val();
|
||||
let poNumber = $('#purchase_order_no').val();
|
||||
|
||||
if (!supplier && !poNumber) {
|
||||
alert("Please select Supplier or Purchase Order No or both.");
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/get_purchase_order_data',
|
||||
data: {
|
||||
supplier_name: supplier,
|
||||
purchase_order_no: poNumber
|
||||
},
|
||||
success: function (data) {
|
||||
let tbody = $('#purchaseorderTable tbody');
|
||||
tbody.empty();
|
||||
|
||||
if (data.length > 0) {
|
||||
$('#purchaseorderTable').show();
|
||||
$('#downloadBtn').show();
|
||||
|
||||
data.forEach(function (row) {
|
||||
tbody.append(`
|
||||
<tr>
|
||||
<td>${row.purchase_id}</td>
|
||||
<td>${row.purchase_date}</td>
|
||||
<td>${row.supplier_name}</td>
|
||||
<td>${row.purchase_order_no}</td>
|
||||
<td>${row.item_name}</td>
|
||||
<td>${row.quantity}</td>
|
||||
<td>${row.unit}</td>
|
||||
<td>${row.rate}</td>
|
||||
<td>${row.amount}</td>
|
||||
<td>${row.GST_Amount}</td>
|
||||
<td>${row.TDS}</td>
|
||||
<td>${row.final_amount}</td>
|
||||
</tr>
|
||||
`);
|
||||
});
|
||||
} else {
|
||||
alert("No matching purchase orders found.");
|
||||
$('#purchaseorderTable').hide();
|
||||
$('#downloadBtn').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Download report
|
||||
$('#downloadBtn').click(function () {
|
||||
let supplier = $('#supplier_name').val();
|
||||
let poNumber = $('#purchase_order_no').val();
|
||||
|
||||
if (!supplier && !poNumber) {
|
||||
alert("Please select filters before downloading.");
|
||||
return;
|
||||
}
|
||||
|
||||
let url = '/download_purchase_order_report?';
|
||||
if (supplier) url += 'supplier_name=' + encodeURIComponent(supplier);
|
||||
if (poNumber) url += '&purchase_order_no=' + encodeURIComponent(poNumber);
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
35
templates/unreleased_gst.html
Normal file
35
templates/unreleased_gst.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2>🚫 GST Release Not Filled</h2>
|
||||
|
||||
<table border="1" cellpadding="8" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>PMC No</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Invoice Details</th>
|
||||
<th>GST_SD_Amount</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in data %}
|
||||
<tr>
|
||||
<td>{{ row.PMC_No }}</td>
|
||||
<td>{{ row.Invoice_No }}</td>
|
||||
<td>{{ row.Invoice_Details }}</td>
|
||||
<td>{{ row.GST_SD_Amount }}</td>
|
||||
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if data|length == 0 %}
|
||||
<p><strong>✅ All invoices have GST releases.</strong></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
209
templates/work_order_report.html
Normal file
209
templates/work_order_report.html
Normal file
@@ -0,0 +1,209 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<head>
|
||||
<title>Work Order Report</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/subcontractor_report.css') }}">
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
h2.report-title {
|
||||
font-size: 28px;
|
||||
color: #1a73e8;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.filter-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
label {
|
||||
font-weight: bold;
|
||||
margin-right: 10px;
|
||||
}
|
||||
select {
|
||||
padding: 6px;
|
||||
}
|
||||
#downloadBtn, #searchBtn {
|
||||
padding: 10px 20px;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
margin-top: 20px;
|
||||
}
|
||||
#downloadBtn:hover, #searchBtn:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
table {
|
||||
margin: 0 auto;
|
||||
margin-top: 30px;
|
||||
border-collapse: collapse;
|
||||
width: 95%;
|
||||
}
|
||||
th, td {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2 class="report-title">Work Order Report</h2>
|
||||
|
||||
<div class="filter-section">
|
||||
<div>
|
||||
<label for="vendor_name">Select Vendor Name:</label>
|
||||
<select id="vendor_name" name="vendor_name" style="width: 300px;"></select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="work_order_number">Select Work Order Number:</label>
|
||||
<select id="work_order_number" name="work_order_number" style="width: 300px;"></select>
|
||||
</div>
|
||||
|
||||
<button id="searchBtn">Search</button>
|
||||
<button id="downloadBtn" style="display: none;">Download Report</button>
|
||||
</div>
|
||||
|
||||
<table border="1" id="workOrderTable" style="display: none;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Vendor Name</th>
|
||||
<th>Work Order Type</th>
|
||||
<th>Amount</th>
|
||||
<th>BOQ</th>
|
||||
<th>Done %</th>
|
||||
<th>GST</th>
|
||||
<th>TDS</th>
|
||||
<th>Security Deposit</th>
|
||||
<th>SD GST</th>
|
||||
<th>Final Total</th>
|
||||
<th>TDS of GST</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
|
||||
<!-- JS Scripts -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#vendor_name, #work_order_number').select2({
|
||||
placeholder: 'Search',
|
||||
minimumInputLength: 1,
|
||||
ajax: {
|
||||
delay: 250,
|
||||
dataType: 'json',
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#vendor_name').select2({
|
||||
placeholder: 'Search Vendor',
|
||||
ajax: {
|
||||
url: '/get_vendor_names',
|
||||
data: function (params) {
|
||||
return { q: params.term };
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data.map(v => ({ id: v, text: v }))
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#work_order_number').select2({
|
||||
placeholder: 'Search Work Order',
|
||||
ajax: {
|
||||
url: '/get_work_order_numbers',
|
||||
data: function (params) {
|
||||
return {
|
||||
q: params.term,
|
||||
vendor_name: $('#vendor_name').val()
|
||||
};
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data.map(o => ({ id: o, text: o }))
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Fetch and display table
|
||||
$('#searchBtn').click(function () {
|
||||
let vendor = $('#vendor_name').val();
|
||||
let order = $('#work_order_number').val();
|
||||
|
||||
if (!vendor && !order) {
|
||||
alert("Please select Vendor or Work Order Number or both.");
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/get_work_order_data',
|
||||
data: {
|
||||
vendor_name: vendor,
|
||||
work_order_number: order
|
||||
},
|
||||
success: function (data) {
|
||||
let tbody = $('#workOrderTable tbody');
|
||||
tbody.empty();
|
||||
|
||||
if (data.length > 0) {
|
||||
$('#workOrderTable').show();
|
||||
$('#downloadBtn').show();
|
||||
|
||||
data.forEach(function (row) {
|
||||
tbody.append(`
|
||||
<tr>
|
||||
<td>${row.work_order_id}</td>
|
||||
<td>${row.vendor_name}</td>
|
||||
<td>${row.work_order_type}</td>
|
||||
<td>${row.work_order_amount}</td>
|
||||
<td>${row.boq_amount}</td>
|
||||
<td>${row.work_done_percentage}</td>
|
||||
<td>${row.gst_amount}</td>
|
||||
<td>${row.tds_amount}</td>
|
||||
<td>${row.security_deposit}</td>
|
||||
<td>${row.sd_against_gst}</td>
|
||||
<td>${row.final_total}</td>
|
||||
<td>${row.tds_of_gst}</td>
|
||||
</tr>
|
||||
`);
|
||||
});
|
||||
} else {
|
||||
alert("No data found for selected filters.");
|
||||
$('#workOrderTable').hide();
|
||||
$('#downloadBtn').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Download report
|
||||
$('#downloadBtn').click(function () {
|
||||
let vendor = $('#vendor_name').val();
|
||||
let order = $('#work_order_number').val();
|
||||
|
||||
if (!vendor && !order) {
|
||||
alert("Please select filters before downloading.");
|
||||
return;
|
||||
}
|
||||
|
||||
let url = '/download_work_order_report?';
|
||||
if (vendor) url += 'vendor_name=' + encodeURIComponent(vendor);
|
||||
if (order) url += '&work_order_number=' + encodeURIComponent(order);
|
||||
|
||||
window.location.href = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user