Files
Kent-logistics-Laravel/resources/views/admin/account.blade.php
Utkarsh Khedkar e760b1c45f account changes
2025-11-12 19:56:06 +05:30

1011 lines
46 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('admin.layouts.app')
@section('page-title', 'Account Dashboard')
@section('content')
<style>
body { font-family: 'Segoe UI', Arial, sans-serif; background: linear-gradient(135deg, #eef2f7, #f9fbff); margin:0; padding:0;}
.account-container { padding: 30px 40px; }
.account-header { margin-bottom: 25px; background: linear-gradient(90deg, #1a2951, #243a72); padding: 20px 25px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); color: #fff;}
.account-header h2 { font-size: 28px; font-weight: 700; margin: 0 0 5px 0;}
.account-header p { font-size: 15px; opacity: 0.9; margin: 2px 0;}
.search-row { display: flex; align-items: center; justify-content: space-between; margin-bottom:25px; flex-wrap:wrap; gap:10px;}
.search-row input { width:360px; padding:10px 14px; border-radius:8px; border:1px solid #d1d9e6; background: #fff; font-size:15px; box-shadow:0 1px 3px rgba(0,0,0,0.05);}
.search-row input:focus { border-color:#1a2951; box-shadow:0 0 4px rgba(26,41,81,0.2);}
.search-btn { background: linear-gradient(90deg, #1a2951, #243a72); color:white; border:none; border-radius:8px; padding:10px 22px; font-size:15px; cursor:pointer; font-weight:500; transition: all 0.2s;}
.search-btn:hover { background: linear-gradient(90deg, #243a72, #1a2951); transform: translateY(-2px); }
.account-panels { display:flex; justify-content:space-between; align-items:stretch; gap:25px; width:100%; flex-wrap:wrap; }
.panel-card { background: linear-gradient(180deg, #ffffff, #f5f7fb); border-radius:12px; box-shadow:0 4px 8px rgba(0,0,0,0.08); flex: 1; min-width:48%; padding:18px; box-sizing:border-box; overflow-x:auto; transition:0.3s;}
.panel-card:hover { box-shadow: 0 6px 14px rgba(0,0,0,0.15); transform: translateY(-2px);}
.panel-title { font-weight:600; font-size:17px; color:#1a2951; margin-bottom:12px; border-bottom:2px solid #e4e8f0; padding-bottom:6px; }
table { width:100%; border-collapse:collapse; min-width:700px; }
th, td { padding:10px 12px; text-align:left; font-size:15px; border-bottom: 1px solid #e5e9f2; white-space:nowrap;}
th { background: linear-gradient(90deg,#f3f6fb,#f9fbff); color:#4a5570; font-weight:600;}
tr:hover td { background-color:#f9fafc;}
.status-badge { display:inline-block; padding:6px 14px; border-radius:20px; color:#fff; font-size:13px; font-weight:500;}
.status-unpaid { background-color:#ef4f4f; }
.status-paid { background-color:#34c86c; }
.status-loading { background-color:#509cf8; }
.status-dispatched { background-color:#20c5c7; }
.pending-badge-red { background-color:#ef4f4f; }
.pending-badge-green { background-color:#34c86c; }
.entry-link { color:#3769d7; text-decoration:underline; font-weight:600; cursor: pointer;}
.toggle-switch-btn {
appearance: none; -webkit-appearance: none;
width: 48px; height: 22px;
background: #fa6464; border: 2px solid #fa6464;
border-radius: 999px;
position: relative; outline: none;
transition: background .25s, border .25s;
cursor: pointer; vertical-align: middle; display: inline-block;
}
.toggle-switch-btn::before { content: ""; display: block; width: 20px; height: 18px; left: 2px; top: 1px; background: #fff; border-radius: 50%; position: absolute; transition: .24s; box-shadow: 0 0 2px #999;}
.toggle-switch-btn:checked { background: #43d05c; border-color: #43d05c;}
.toggle-switch-btn:checked::before { transform: translateX(26px);}
.plus-btn { display: inline-block; width: 32px; height: 32px; border-radius: 12px; background: #fff; color: #1a2951; border: 1.8px solid #e5eaf2; font-size: 1.35rem; font-weight: 600; text-align: center; line-height: 28px; cursor: pointer; transition: background 0.19s, border 0.19s; vertical-align: middle; outline: none;}
.plus-btn:hover { background: #f4f6fa; border-color: #92a0c2; color: #204080;}
/* Modal */
.modal-fade1 { position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(38,38,38,0.12); display:none; justify-content:center; align-items:center; z-index:999; }
.modal-fade1.modal-open { display:flex; }
.modal-fade{position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(38,38,38,0.12); display:none; justify-content:center; align-items:center; z-index:999; }
.modal-fade.modal-open { display:flex; }
.modal-box1 { background:#fff; border-radius:16px; box-shadow:0 8px 44px #33487129; padding:0 34px 30px 34px; min-width:590px; max-width:100%;;}
.modal-box { background:#fff; border-radius:16px; box-shadow:0 8px 44px #33487129; padding:0 34px 30px 34px; min-width:590px; max: width 100%;;}
.modal-head, .modal-title-main { font-size: 25px; font-weight:700; margin-bottom:5px;}
.modal-desc, .modal-sub { font-size:16px; color:#6a7a8c; margin-bottom:13px;}
.modal-fade1{
position:fixed;
top:0; left:0;
width:100vw; height:100vh;
background:rgba(38,38,38,0.12);
display:none;
justify-content:center;
align-items:center;
z-index:999;
}
.modal-fade1.modal-open {
display:flex;
}
.modal-box1 {
max-width: 680px;
min-width: 370px;
max-height: 90vh;
overflow-y: auto;
box-sizing: border-box;
}
/* Create Order Modal */
.create-order-form-main { display: flex; flex-direction: column; gap: 11px; margin-bottom:18px;}
.create-order-row { display:flex; gap:15px;}
.create-order-group { flex:1; display:flex; flex-direction:column;}
.create-order-group label { font-size:15px; font-weight:600; margin-bottom:3.5px; color:#222b44;}
.create-order-group input, .create-order-group select { font-size:16px; border-radius:7px; border:1.7px solid #d3d8ec; padding:8px 10px; background:#f8fafc; }
.create-order-group input:focus, .create-order-group select:focus { outline:none; border-color:#2672ca;}
/* Consolidated section */
.consolidate-tabs-main { display:flex; align-items:center; margin-bottom:0;}
.consolidate-tab-btn { border:none; outline:none; background:#edf0f8; font-weight:600; color:#1a2951; font-size:17px; padding:8px 20px 7px 18px; border-radius:11px 11px 0 0; margin-right:1px; transition: background 0.14s; cursor:pointer;}
.consolidate-tab-btn.active, .consolidate-tab-btn:focus { background:#f7c97d; color:#0d1736; }
#consolidateOrdersTable { width:100%; border-collapse:collapse; font-size:15px; background:#fffbe9; border-radius:7px; box-shadow:0 1px 8px #eeeae5;}
#consolidateOrdersTable th { background: #ffe0a7; font-weight:600; font-size:14.3px; border-bottom:2px solid #ffeabb;}
#consolidateOrdersTable td { background: #fffbe9; border:none; border-bottom:1px solid #f2e6ce;}
#consolidateOrdersTable tr:last-child td { border-bottom:none;}
#consolidateOrdersTable .order-link { color:#307fde; font-weight:600; text-decoration:underline; }
.modal-actions-row { display:flex; gap:26px; justify-content:flex-end; margin-top:18px;}
.modal-btn { padding:10px 38px; font-size:18px; border-radius:9px; font-weight:600; border:none; cursor:pointer; background:#1a2951; color:#fff; transition:0.18s;}
.modal-btn:hover { background:#243a72;}
.modal-btn.cancel { background:#e7eaf1; color:#243a72;}
.modal-btn.cancel:hover { background:#ccd2e2;}
/* Installment Modal */
.inst-detail-group { display:flex; flex-direction:column; align-items:flex-start; min-width:150px;}
.inst-detail-heading { color:#8a96b2; font-size:13.6px; font-weight:600; margin-bottom:2.5px; }
.inst-detail-val { font-weight:600; font-size:15px; color:#24376a; background: #f9fbff; display:inline-block; border-radius:8px; padding:7px 22px 7px 13px; min-width:80px;}
.inst-detail-pending { color:#e14a4a!important; background:#fff1f1;}
.inst-badge { font-weight:600; border-radius:9px; padding:4px 13px; font-size:15px; display:inline-block;}
.inst-badge-dispatched { background:#20c5c7; color:#fff;}
.inst-badge-pending { background:#ffb84c; color:#24376a;}
.inst-red { color:#d33; }
.inst-green { color:#20c872; }
.inst-blue { color:#509cf8; }
.inst-purple { color:#7d57d2; }
/* Entry Details Modal */
.entry-details-modal { max-width: 800px; min-width: 700px; }
.entry-details-header { background: linear-gradient(90deg, #1a2951, #243a72); color: white; padding: 20px 25px; border-radius: 12px 12px 0 0; margin: 0 -34px 20px -34px; }
.entry-details-title { font-size: 24px; font-weight: 700; margin: 0; }
.entry-details-subtitle { font-size: 14px; opacity: 0.9; margin: 5px 0 0 0; }
.entry-summary-cards { display: flex; gap: 15px; margin-bottom: 20px; }
.entry-summary-card { flex: 1; background: #f8fafc; border-radius: 10px; padding: 15px; border-left: 4px solid #1a2951; }
.entry-summary-label { font-size: 13px; color: #6a7a8c; margin-bottom: 5px; }
.entry-summary-value { font-size: 20px; font-weight: 700; color: #1a2951; }
.entry-installments-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.entry-installments-table th { background: #f3f6fb; padding: 12px 15px; text-align: left; font-weight: 600; color: #4a5570; border-bottom: 2px solid #e5e9f2; }
.entry-installments-table td { padding: 12px 15px; border-bottom: 1px solid #e5e9f2; }
.entry-installments-table tr:hover td { background: #f9fafc; }
/* Modern Installment card style */
.installment-card { background: #fff; border-radius: 10px; margin-bottom: 11px; padding: 10px 16px 10px 10px; display: flex; align-items: center; box-shadow: 0 2.5px 7px 0 rgba(60,90,170,0.09);}
.installment-card:not(:first-child) { border-left: 3px solid #669cff; background: #f7faff; }
.installment-label { color: #2770ea; font-weight:700; text-decoration:underline; font-size:15px; min-width:105px;}
.installment-desc { color: #333; font-size: 14px; opacity: 0.89; margin-left:6px; flex:2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.installment-date { color: #9ea7c1; font-size: 13px; margin-right:14px;}
.installment-amt { color: #20455a; font-weight:600; font-size:15px; background: #f8f5f5; border-radius:7px; padding:6px 16px; margin:0 10px;}
.installment-badge { padding:4px 15px; font-size:13.2px; border-radius:15px; font-weight:600; margin-left:4px; background:#22aebc; color:#fff;}
/* Totals row */
.installment-summary-row { margin-top: 18px; display: flex; gap:17px; justify-content:space-around; text-align:center; }
.isum-block { flex:1; }
.isum-num { font-weight:700; font-size:20px; display: block; }
.isum-blue { color:#367af6; }
.isum-green { color:#27ca58; }
.isum-red { color:#e58211; }
.isum-purple { color:#9856e6; }
.installment-block-card {
background: #fff;
border-radius: 15px;
border: 1.8px solid #eee;
padding: 18px 20px 18px 19px;
box-shadow: 0 3px 13px 0 rgba(30,44,68,0.08);
max-width: 700px;
margin:auto;
}
.installment-title { font-weight:600; font-size:15.8px; margin-bottom:11px; color:#102a44;}
.installment-list { margin-bottom:15px; }
.installment-card {
background: #fafdff;
border-radius: 10px;
margin-bottom: 11px;
padding: 12px 18px;
display: flex;
align-items: center;
box-shadow: 0 2.5px 7px 0 rgba(60,90,170,0.09);
border-left: 3px solid #a7cef7;
}
.installment-card.original {
border-left: 3px solid #2268c0;
background: #f6f8fd;
}
.installment-label {
color: #2268c0;
font-weight:700;
text-decoration:underline;
font-size:15.5px;
min-width:105px;
}
.installment-desc {
color: #314050;
font-size: 13.7px;
opacity: 0.89;
margin-left:8px;
flex:2;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.installment-date {
color: #7c8db2;
font-size: 13px;
margin-right:14px;
margin-left:10px;
}
.installment-amt {
color: #20455a;
font-weight:600;
font-size:15px;
background: #f8f5f5;
border-radius:7px;
padding:7px 15px;
margin:0 11px;
font-variant-numeric: tabular-nums;
}
.installment-badge {
padding:5px 17px;
font-size:13px;
border-radius:15px;
font-weight:600;
margin-left:7px;
background:#2ec3ce;
color:#fff;
box-shadow:0 2px 8px rgba(40,120,150,0.10);
}
/* Summary Row */
.installment-summary-row {
margin-top: 2px;
padding-top:9px;
background:#f7f8fd;
border-radius:11px;
display: flex; gap:18px; justify-content:space-around; text-align:center;
}
.isum-block { flex:1; }
.isum-num { font-weight:700; font-size:18.5px; display: block; }
.isum-label { font-size:12.7px; color:#314050; }
.isum-blue { color:#276dea; }
.isum-green { color:#27ca58; }
.isum-red { color:#e58211; }
.isum-purple { color:#9856e6; }
/* Consolidated Orders Details - k44 style */
#consolidatedOrderDetailsModal .modal-box1 {
max-width: 800px;
border-radius: 16px;
box-shadow: 0 8px 44px #33487129;
background: #fff;
padding: 0 26px 28px 26px;
font-family: 'Segoe UI', Arial, sans-serif;
}
#consolidatedOrderDetailsModal .cod-header {
padding: 18px 0 6px 0;
border-radius: 16px 16px 0 0;
font-weight: 700;
font-size: 20px;
color: #233063;
display: flex;
align-items: center;
justify-content: space-between;
}
#consolidatedOrderDetailsModal .cod-header .cod-x {
font-size: 26px;
color: #aaa;
cursor: pointer;
transition: color 0.2s;
font-weight: 600;
}
#consolidatedOrderDetailsModal .cod-header .cod-x:hover {
color: #dd4343;
}
#consolidatedOrderDetailsModal .cod-detail-row {
display: flex;
gap: 35px;
align-items: center;
font-size: 14.2px;
margin: 9px 0 8px 0;
color: #535770;
}
#consolidatedOrderDetailsModal .cod-detail-row span {
margin-right: 18px;
}
#consolidatedOrderDetailsModal .cod-detail-row .cod-shipid {
color: #2469d6;
font-size: 18px;
font-weight: 700;
margin-right: 18px;
}
#consolidatedOrderDetailsModal .cod-detail-row .cod-badge {
background: #ffb366;
color: #fff;
padding: 3.4px 14px;
border-radius: 12px;
font-size: 13px;
font-weight: 600;
margin: 0 8px 0 0;
vertical-align:middle;
display:inline-block;
}
#consolidatedOrderDetailsModal .cod-detail-row .cod-light {
color: #9ba5bb;
font-weight: 500;
}
#consolidatedOrderDetailsModal .cod-table {
width: 100%;
background: #f8f3e4;
border-collapse: collapse;
border-radius: 11px;
box-shadow: 0 1px 8px #eeeae5;
margin-bottom: 13px;
font-size: 14px;
overflow: hidden;
}
#consolidatedOrderDetailsModal .cod-table th,
#consolidatedOrderDetailsModal .cod-table td {
padding: 9px 9px;
text-align: left;
border-bottom: 1px solid #efe6d1;
color: #233063;
white-space: nowrap;
background: #faf8f1;
}
#consolidatedOrderDetailsModal .cod-table th {
background: #ffe0a7;
font-weight: 600;
font-size: 13px;
color: #3b4060;
}
#consolidatedOrderDetailsModal .cod-table tr:last-child td {
border-bottom: none;
}
#consolidatedOrderDetailsModal .cod-table .cod-link {
color: #2469d6;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
#consolidatedOrderDetailsModal .cod-summary-row {
display: flex;
gap: 15px;
align-items: center;
margin-top: 13px;
margin-bottom: 2px;
padding: 8px 0 2px 0;
background: none;
}
#consolidatedOrderDetailsModal .cod-sum-val {
font-size: 23px;
font-weight: 700;
}
#consolidatedOrderDetailsModal .cod-sum-label {
font-size: 13px;
font-weight: 500;
margin-top: 3px;
color: #858fa2;
letter-spacing:0.2px;
}
#consolidatedOrderDetailsModal .cod-blue { color: #276dea;}
#consolidatedOrderDetailsModal .cod-green { color: #22b963;}
#consolidatedOrderDetailsModal .cod-red { color: #da2479; }
#consolidatedOrderDetailsModal .cod-closebtn {
background: #ebeffa;
color: #37436c;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
padding: 10px 42px;
cursor: pointer;
margin-top: 13px;
transition: background 0.18s;
}
#consolidatedOrderDetailsModal .cod-closebtn:hover {
background: #dae1fa;
}
.shipment-container {
background: #f4f4f6; /* हलका gray background */
border-radius: 10px; /* कोपरे गोल */
padding: 14px 18px; /* आतील space */
box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* हलकी सावली */
margin: 10px 0; /* थोडं बाहेरचं space */
font-family: 'Segoe UI', Arial, sans-serif;
transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* Hover effect - थोडा उठून दिसतो */
.shipment-container:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
/* आतल्या headings साठी consistency */
.shipment-container span {
display: inline-block;
}
/* Status badge look सुधारण्यासाठी */
#modalShipmentStatus {
background: #ffb366;
color: #fff;
padding: 4px 14px;
border-radius: 12px;
font-size: 13px;
font-weight: 600;
}
@media(max-width:1024px){.modal-box{max-width:97vw;min-width:80vw;}}
@media(max-width:800px){.modal-box{min-width:99vw; max-width:99vw; padding:4px 1.5vw;} .create-order-row{flex-direction:column; gap:7px;}}
</style>
<div class="account-container">
<!-- Header -->
<div class="account-header">
<h2>Account Dashboard</h2>
<p>Viewing: China Region Orders</p>
<p>Workflow: Manage payments and dispatch process effectively</p>
</div>
<!-- Search -->
<div class="search-row">
<div>
<input type="text" id="main-search" placeholder="Search by Entry No or Description">
<button class="search-btn">Search</button>
</div>
<button class="search-btn" id="openOrderModal">+ Create New Order</button>
</div>
<div class="account-panels" id="account-panels">
<div class="panel-card">
<div class="panel-title">Payment Sent to China</div>
<table id="main-payment-table">
<thead>
<tr>
<th>Entry No</th><th>Date</th><th>Description</th>
<th>Order Quantity</th><th>Region</th><th>Toggle</th><th>Amount</th><th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>PAY-2023-042</td><td>2024-07-19</td>
<td>Electronic Cams</td><td>3</td><td>China</td>
<td><input type="checkbox" class="toggle-switch-btn" checked></td>
<td>₹3,000</td>
<td><span class="status-badge status-unpaid">Unpaid</span></td>
</tr>
<tr>
<td>PAY-2023-041</td><td>2024-07-19</td>
<td>Electronic Cams</td><td>2</td><td>China</td>
<td><input type="checkbox" class="toggle-switch-btn"></td>
<td>₹2,000</td>
<td><span class="status-badge status-paid">Paid</span></td>
</tr>
</tbody>
</table>
</div>
<div class="panel-card">
<div class="panel-title">Order Dispatch Status</div>
<table id="main-order-table">
<thead>
<tr>
<th>Entry No</th><th>Date</th><th>Description</th>
<th>Region</th><th>Amount</th><th>Status</th>
<th>Pending</th><th></th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="entry-link" onclick="openEntryDetailsModal('PAY-2023-042')">PAY-2023-042</a></td>
<td>2024-07-19</td>
<td>Electronic Cams</td>
<td>China</td>
<td>₹3,000</td>
<td><span class="status-badge status-loading">Loading</span></td>
<td><span class="status-badge pending-badge-green">Completed</span></td>
<td><button class="plus-btn" title="Add" onclick="openInstallmentModal('PAY-2023-042', 'Electronic Cams', 'China', 8000)"><span style="font-size:21px;">+</span></button></td>
</tr>
<tr>
<td><a class="entry-link" onclick="openEntryDetailsModal('PAY-2023-041')">PAY-2023-041</a></td>
<td>2024-07-19</td>
<td>Electronic Cams</td>
<td>China</td>
<td>₹2,000</td>
<td><span class="status-badge status-dispatched">Dispatched</span></td>
<td><span class="status-badge pending-badge-red">₹1,000</span></td>
<td><button class="plus-btn" title="Add" onclick="openInstallmentModal('PAY-2023-041', 'Electronic Cams', 'China', 1000)"><span style="font-size:21px;">+</span></button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- CREATE NEW ORDER MODAL -->
<div class="modal-fade" id="orderModal">
<div class="modal-box">
<div class="modal-head" style="margin-top:18px;">Create New Order Entry</div>
<div class="modal-desc">Create a new order entry and consolidate orders for processing.</div>
<form id="createOrderForm" autocomplete="off">
<div class="create-order-form-main">
<div class="create-order-row">
<div class="create-order-group">
<label>Description *</label>
<input type="text" name="desc" required>
</div>
<div class="create-order-group">
<label>Region *</label>
<select name="region" required>
<option value="China">China</option>
<option value="Europe">Europe</option>
<option value="US">US</option>
</select>
</div>
</div>
<div class="create-order-row">
<div class="create-order-group">
<label>Total Amount () *</label>
<input type="number" name="amount" min="0" required>
</div>
<div class="create-order-group">
<label>Entry Date *</label>
<input type="date" name="entrydate" required>
</div>
</div>
</div>
<div>
<div class="consolidate-tabs-main">
<button type="button" class="consolidate-tab-btn active" id="toggleConsolidatedBtn"><span id="toggleConsolidatedText">Hide Orders</span></button>
<span style="font-weight:600; font-size:16px; color:#1e2d4e; margin-left:10px;">Consolidated Orders</span>
</div>
<div class="consol-orders-section" id="consolidateOrdersList" style="margin-bottom:4px;">
<table id="consolidateOrdersTable">
<thead>
<tr>
<th></th>
<th>Order ID</th>
<th>Item No</th>
<th>Description</th>
<th>CTN</th>
<th>QTY</th>
<th>TTL/QTY</th>
<th>Unit</th>
<th>Price ()</th>
<th>Amount ()</th>
<th>CBM</th>
<th>TTL CBM</th>
<th>KG</th>
<th>TTL KG</th>
<th>Shop No</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" checked></td>
<td><a href="#" class="order-link" onclick="openConsolidatedOrderDetailsModal('KNT-2024-003')">KNT-2024-003</a></td>
<td>ITEM03</td>
<td>Electronic Components...</td>
<td>1</td><td>6</td><td>6</td>
<td>SET</td><td>₹800.00</td><td>₹4800.00</td>
<td>6.00</td><td>6.00</td><td>45.00</td><td>45.00</td><td>SH003</td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td><a href="#" class="order-link" onclick="openConsolidatedOrderDetailsModal('KNT-2024-003')">KNT-2024-003</a></td>
<td>ITEM03</td>
<td>Electronic Components...</td>
<td>1</td><td>6</td><td>6</td>
<td>SET</td><td>₹800.00</td><td>₹4800.00</td>
<td>6.00</td><td>6.00</td><td>45.00</td><td>45.00</td><td>SH003</td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td><a href="#" class="order-link" onclick="openConsolidatedOrderDetailsModal('KNT-2024-003')">KNT-2024-003</a></td>
<td>ITEM03</td>
<td>Electronic Components...</td>
<td>1</td><td>6</td><td>6</td>
<td>SET</td><td>₹800.00</td><td>₹4800.00</td>
<td>6.00</td><td>6.00</td><td>45.00</td><td>45.00</td><td>SH003</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-actions-row">
<button type="button" class="modal-btn cancel" id="cancelOrderModal">Cancel</button>
<button type="submit" class="modal-btn">Create</button>
</div>
</form>
</div>
</div>
<!-- ENTRY DETAILS MODAL (k40.PNG style) -->
<div class="modal-fade1" id="entryDetailsModal">
<div class="modal-box1 entry-details-modal">
<div class="entry-details-header">
<h2 class="entry-details-title">Entry Details - <span id="entryDetailsId">PAY-2024-001</span></h2>
<p class="entry-details-subtitle">Complete view of all installments for this entry.</p>
</div>
<div class="entry-summary-cards">
<div class="entry-summary-card">
<div class="entry-summary-label">Original Amount</div>
<div class="entry-summary-value" id="originalAmount">$5,000</div>
</div>
<div class="entry-summary-card">
<div class="entry-summary-label">Total Processed</div>
<div class="entry-summary-value" id="totalProcessed">$2,000</div>
</div>
<div class="entry-summary-card">
<div class="entry-summary-label">Pending Balance</div>
<div class="entry-summary-value" id="pendingBalance">$2,667</div>
</div>
<div class="entry-summary-card">
<div class="entry-summary-label">Total Installments</div>
<div class="entry-summary-value" id="totalInstallments">3</div>
</div>
</div>
<table class="entry-installments-table">
<thead>
<tr>
<th>Installment</th>
<th>Date</th>
<th>Description</th>
<th>Region</th>
<th>Amount</th>
<th>Status</th>
<th>Pending</th>
</tr>
</thead>
<tbody id="installmentsTableBody">
<tr>
<td>Original Entry</td>
<td>2024-01-15</td>
<td>Electronics Comp</td>
<td>China</td>
<td>$2,000</td>
<td><span class="status-badge status-loading">Loading</span></td>
<td>$1,500</td>
</tr>
<tr>
<td>Installment 2</td>
<td>2024-01-15</td>
<td>Electronics Comp</td>
<td>China</td>
<td>$1,000</td>
<td><span class="status-badge status-dispatched">Dispatched</span></td>
<td>$1,500</td>
</tr>
<tr>
<td>Installment 3</td>
<td>2024-01-15</td>
<td>Electronics Comp</td>
<td>China</td>
<td>$500</td>
<td><span class="status-badge status-dispatched">Dispatched</span></td>
<td>$1,500</td>
</tr>
</tbody>
</table>
<div style="display:flex; justify-content: flex-end; gap:16px; margin-top:20px;">
<button type="button" class="modal-btn cancel" onclick="closeEntryDetailsModal()">Close</button>
<button type="button" class="modal-btn" onclick="openInstallmentModalFromDetails()">+ Add New Installment</button>
</div>
</div>
</div>
<!-- Add Installment Modal (Wide Card Style) -->
<div class="modal-fade1" id="installmentModal">
<div class="modal-box1" style="max: width 90%;; min-width:500px;">
<div style="display:flex; align-items:center; margin-bottom:12px;">
<span style="font-size:1.22rem; font-weight:700; margin-top:50px;">+ Add New Installment</span>
<button style="margin-left:auto; background:none; border:none; font-size:1.33rem; color:#aaa; cursor:pointer; font-weight:600;" onclick="closeInstallmentModal()">×</button>
</div>
<div style="font-size:16px; color:#7687a3; margin-bottom:18px;">Create a new processing entry for the remaining pending amount</div>
<div id="instDetailsRow" style="display:flex; gap:22px; margin-bottom:17px;"></div>
<form id="installmentForm" autocomplete="off">
<div style="display:flex; gap:15px; margin-bottom:9px;">
<div style="flex:1; display:flex; flex-direction:column;">
<label style="font-weight:600; color:#253c57; font-size:15px; margin-bottom:2px;">Processing Date *</label>
<input type="date" name="proc_date" required style="font-size:15px; border-radius:7px; border:1.5px solid #d3d8ec; background:#f8fafc; padding:8px;">
</div>
<div style="flex:1; display:flex; flex-direction:column;">
<label style="font-weight:600; color:#253c57; font-size:15px; margin-bottom:2px;">Processing Amount *</label>
<input type="number" min="1" name="proc_amount" required style="font-size:15px; border-radius:7px; border:1.5px solid #d3d8ec; background:#f8fafc; padding:8px;" placeholder="Enter amount">
<span style="font-size:12px; color:#8e97ba; margin-top:3px;">Maximum: <span id="maxPending"></span></span>
</div>
<div style="flex:1; display:flex; flex-direction:column;">
<label style="font-weight:600; color:#253c57; font-size:15px; margin-bottom:2px;">Status</label>
<select name="status" required style="font-size:15px; border-radius:7px; border:1.5px solid #d3d8ec; background:#f8fafc; padding:8px;">
<option value="Pending">Pending</option>
<option value="Loading">Loading</option>
<option value="Packed">Packed</option>
<option value="Dispatched">Dispatched</option>
<option value="Delivered">Delivered</option>
</select>
</div>
</div>
<div style="font-weight:600; font-size:16px; color:#253c57; margin:12px 0 7px 0;">Processing History</div>
<div style="padding:16px;">
<div class="installment-block-card">
<div class="installment-title">Current Installments (2)</div>
<!-- Card List START -->
<div class="installment-list">
<div class="installment-card original">
<span class="installment-label">Original Entry</span>
<span class="installment-desc">Electronics ...</span>
<span class="installment-date">2024-01-15</span>
<span class="installment-amt">₹2,000</span>
<span class="installment-badge">Dispatched</span>
</div>
<div class="installment-card">
<span class="installment-label">Installment 2</span>
<span class="installment-desc">Electronics ...</span>
<span class="installment-date">2024-01-20</span>
<span class="installment-amt">₹2,000</span>
<span class="installment-badge">Dispatched</span>
</div>
</div>
<!-- Card List END -->
<!-- SUMMARY ROW START -->
<div class="installment-summary-row">
<div class="isum-block">
<span class="isum-num isum-blue">2</span>
<span class="isum-label">Total Installments</span>
</div>
<div class="isum-block">
<span class="isum-num isum-green">₹2,000</span>
<span class="isum-label">Total Processed</span>
</div>
<div class="isum-block">
<span class="isum-num isum-red">₹8,000</span>
<span class="isum-label">Remaining Balance</span>
</div>
<div class="isum-block">
<span class="isum-num isum-purple">₹10,000</span>
<span class="isum-label">Original Amount</span>
</div>
</div>
<!-- SUMMARY ROW END -->
</div>
</div>
<div style="display:flex; justify-content: flex-end; gap:16px; margin-top:8px;">
<button type="button" class="modal-btn cancel" onclick="closeInstallmentModal()">Cancel</button>
<button type="submit" class="modal-btn">Create Installment</button>
</div>
</form>
</div>
</div>
<!-- Consolidated Orders Details Modal (k44 style, heading+values+details) -->
<div class="modal-fade1" id="consolidatedOrderDetailsModal">
<div class="modal-box1" style="max-width:800px; border-radius:16px; box-shadow:0 8px 44px #33487129; background:#fff; padding:0 26px 28px 26px; font-family:'Segoe UI', Arial, sans-serif;">
<!-- Modal heading with close -->
<div style="padding:18px 0 6px 0; font-weight:700; font-size:20px; color:#233063; display:flex;align-items:center; justify-content:space-between;">
Consolidated Orders Details
<span style="font-size:26px;color:#aaa;cursor:pointer;transition:color 0.2s;font-weight:600;" onclick="document.getElementById('consolidatedOrderDetailsModal').classList.remove('modal-open')">&times;</span>
</div>
<!-- Headings and values - separate rows, centered -->
<div class="shipment-container">
<div style="margin:3px 0 12px 0;">
<!-- Headings -->
<div style="display:flex;justify-content:space-between;">
<span style="flex:1;text-align:center;color:#9ba5bb;font-weight:500;">Shipment ID</span>
<span style="flex:1;text-align:center;color:#9ba5bb;font-weight:500;">Total Orders</span>
<span style="flex:1;text-align:center;color:#9ba5bb;font-weight:500;">Status</span>
</div>
<!-- Values row -->
<div style="display:flex;justify-content:space-between;align-items:center;margin-top:2px;">
<span style="flex:1;text-align:center;color:#2469d6;font-size:18px;font-weight:700;" id="modalShipmentId">KNT-SHIP-2024-001</span>
<span style="flex:1;text-align:center;font-weight:600;font-size:17px;" id="modalTotalOrders">1</span>
<span style="flex:1;text-align:center;" id="modalShipmentStatus">In Transit</span>
</div>
</div>
</div>
<!-- Sub-description -->
<!-- Table of orders -->
<table style="width:100%;background:#f8f3e4;border-collapse:collapse;border-radius:11px;box-shadow:0 1px 8px #eeeae5;margin-bottom:13px;font-size:14px;overflow:hidden;">
<thead>
<tr style="background:#ffe0a7;">
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">Order ID</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">Item No</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">Description</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">CTN</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">QTY</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">TTL/QTY</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">Unit</th>
<th style="padding:9px 9px;text-align:left;font-weight:600;font-size:13px;color:#3b4060;">Amount ()</th>
</tr>
</thead>
<tbody id="modalOrdersBody">
<!-- Example rows -->
<tr>
<td><a style="color:#2469d6;font-weight:600;text-decoration:underline;cursor:pointer;">KNT-2024-001</a></td>
<td>ITEM001</td>
<td>Manufacturing Equipment...</td>
<td>4</td>
<td>100</td>
<td>500</td>
<td>PCS</td>
<td>₹4800.00</td>
</tr>
<tr>
<td><a style="color:#2469d6;font-weight:600;text-decoration:underline;cursor:pointer;">KNT-2024-001</a></td>
<td>ITEM001</td>
<td>Manufacturing Equipment...</td>
<td>4</td>
<td>100</td>
<td>500</td>
<td>PCS</td>
<td>₹4800.00</td>
</tr>
</tbody>
</table>
<!-- Summary row -->
<div style="display:flex;gap:20px; justify-content: space-around;align-items:center;margin-top:13px;margin-bottom:2px;padding:11px 0 2px 0;">
<div>
<div style="font-size:23px;font-weight:700;color:#276dea;" id="modalTotalTtlQty">500</div>
<div style="font-size:13px;font-weight:500;margin-top:3px;color:#858fa2;letter-spacing:0.2px;">Total TTL/QTY</div>
</div>
<div>
<div style="font-size:23px;font-weight:700;color:#22b963;" id="modalTotalTtlKg">10</div>
<div style="font-size:13px;font-weight:500;margin-top:3px;color:#858fa2;letter-spacing:0.2px;">Total TTL KG</div>
</div>
<div>
<div style="font-size:23px;font-weight:700;color:#da2479;" id="modalTotalAmount">₹9600.00</div>
<div style="font-size:13px;font-weight:500;margin-top:3px;color:#858fa2;letter-spacing:0.2px;">Total Amount</div>
</div>
</div>
<div style="display:flex;justify-content:flex-end;">
<button type="button" style="background:#ebeffa;color:#37436c;border:none;border-radius:10px;font-size:16px;font-weight:600;padding:10px 42px;cursor:pointer;margin-top:13px;transition:background 0.18s;" onclick="document.getElementById('consolidatedOrderDetailsModal').classList.remove('modal-open')">Close</button>
</div>
</div>
</div>
<script>
const installmentHistory = [
{ ref: 'PAY-2023-042', desc: 'Electronic Cams', date: '2024-07-19', amt: 2000, status: 'Dispatched' },
{ ref: 'PAY-2023-042', desc: 'Electronic Cams', date: '2024-08-01', amt: 2000, status: 'Dispatched' }
];
// Entry Details Modal
let currentEntryId = '';
function openEntryDetailsModal(entryId) {
currentEntryId = entryId;
document.getElementById('entryDetailsId').textContent = entryId;
// Set sample data based on entry ID
if(entryId === 'PAY-2023-042') {
document.getElementById('originalAmount').textContent = '$5,000';
document.getElementById('totalProcessed').textContent = '$2,000';
document.getElementById('pendingBalance').textContent = '$2,667';
document.getElementById('totalInstallments').textContent = '3';
} else if(entryId === 'PAY-2023-041') {
document.getElementById('originalAmount').textContent = '$3,000';
document.getElementById('totalProcessed').textContent = '$2,000';
document.getElementById('pendingBalance').textContent = '$1,000';
document.getElementById('totalInstallments').textContent = '2';
}
document.getElementById('entryDetailsModal').classList.add('modal-open');
}
function closeEntryDetailsModal() {
document.getElementById('entryDetailsModal').classList.remove('modal-open');
}
function openInstallmentModalFromDetails() {
closeEntryDetailsModal();
// Get the pending balance from the details modal
const pendingBalance = document.getElementById('pendingBalance').textContent;
const pendingAmount = parseInt(pendingBalance.replace(/[$,]/g, ''));
// Use the current entry ID and sample data
openInstallmentModal(currentEntryId, 'Electronic Cams', 'China', pendingAmount);
}
// Installment Modal
function openInstallmentModal(ref, desc, region, pending) {
document.getElementById('installmentModal').classList.add('modal-open');
document.getElementById('instDetailsRow').innerHTML = `
<div class="inst-detail-group"><div class="inst-detail-heading">Entry No</div><div class="inst-detail-val">${ref}</div></div>
<div class="inst-detail-group"><div class="inst-detail-heading">Description</div><div class="inst-detail-val">${desc}</div></div>
<div class="inst-detail-group"><div class="inst-detail-heading">Region</div><div class="inst-detail-val">${region}</div></div>
<div class="inst-detail-group"><div class="inst-detail-heading">Pending Balance</div><div class="inst-detail-val inst-detail-pending">₹${pending.toLocaleString()}</div></div>
`;
document.getElementById('maxPending').innerText = `₹${pending.toLocaleString()}`;
let instHtml = `<div class="modal-hist-box"><div style="margin-bottom:3px;"><b>Current Installments (${installmentHistory.length})</b></div>`;
installmentHistory.forEach((inst, idx) => {
instHtml += `<div>
<span style="color:#2268c0;text-decoration:underline;font-weight:600;">
${idx ? 'Installment ' + (idx+1) : 'Original Entry'}
</span>
<span style="margin-left:10px;">${inst.date}</span>
<span style="margin-left:10px;">${inst.desc}</span>
<span style="margin-left:12px;" class="inst-badge inst-badge-dispatched">${inst.status}</span>
<span style="margin-left:13px;" class="inst-green"><b>₹${inst.amt.toLocaleString()}</b></span>
</div>`;
});
instHtml += `<div style="margin-top:9px;">
<span class="inst-num">${installmentHistory.length}</span> <span>Total Installments</span>&nbsp;
<span class="inst-green inst-num">₹2,000</span>&nbsp; <span>Total Processed</span>&nbsp;
<span class="inst-blue inst-num">₹8,000</span>&nbsp; <span>Remaining Balance</span>&nbsp;
<span class="inst-purple inst-num">₹10,000</span>&nbsp;<span>Original Amount</span>
</div>
</div>`;
document.getElementById('installmentHistory').innerHTML = instHtml;
}
function closeInstallmentModal() {
document.getElementById('installmentModal').classList.remove('modal-open');
}
// Consolidated Orders Details Modal
function openConsolidatedOrderDetailsModal(orderId) {
document.getElementById('modalShipmentId').textContent = "KNT-SHIP-2024-001";
document.getElementById('modalShipmentStatus').textContent = "In Transit";
document.getElementById('modalOrdersBody').innerHTML = `
<tr>
<td><a style="color:#307fde;font-weight:600;text-decoration:underline;" href="#">KNT-2024-001</a></td>
<td>ITEM001</td>
<td>Manufacturing Equipment...</td>
<td>4</td>
<td>100</td>
<td>500</td>
<td>PCS</td>
<td>₹4800.00</td>
</tr>
<tr>
<td><a style="color:#307fde;font-weight:600;text-decoration:underline;" href="#">KNT-2024-001</a></td>
<td>ITEM001</td>
<td>Manufacturing Equipment...</td>
<td>4</td>
<td>100</td>
<td>500</td>
<td>PCS</td>
<td>₹4800.00</td>
</tr>
`;
document.getElementById('modalTotalTtlQty').textContent = "500";
document.getElementById('modalTotalTtlKg').textContent = "10";
document.getElementById('modalTotalAmount').textContent = "₹9600.00";
document.getElementById('consolidatedOrderDetailsModal').classList.add('modal-open');
}
document.getElementById('openOrderModal').onclick = function(){
document.getElementById('orderModal').classList.add('modal-open');
};
// Tab-style Consolidated Orders
const toggleBtn = document.getElementById('toggleConsolidatedBtn');
const consolOrdersList = document.getElementById('consolidateOrdersList');
const toggleText = document.getElementById('toggleConsolidatedText');
toggleBtn.onclick = function(){
if(consolOrdersList.style.display === "none"){
consolOrdersList.style.display="block"; toggleText.textContent="Hide Orders"; toggleBtn.classList.add('active');
} else {
consolOrdersList.style.display="none"; toggleText.textContent="Show Orders"; toggleBtn.classList.remove('active');
}
};
document.getElementById('cancelOrderModal').onclick = function(){
document.getElementById('orderModal').classList.remove('modal-open');
};
document.getElementById('orderModal').onclick = function(e){
if(e.target === this) this.classList.remove('modal-open');
};
// Create Order logic
document.getElementById('createOrderForm').addEventListener('submit', function(e) {
e.preventDefault();
const desc = this.desc.value || 'Electronic Cams';
const region = this.region.value || 'China';
const amount = this.amount.value || '0';
const date = this.entrydate.value || '2024-07-19';
const entryNo = 'PAY-2024-' + Math.floor(100 + Math.random() * 900);
document.querySelector('#main-payment-table tbody').insertAdjacentHTML('beforeend', `
<tr>
<td>${entryNo}</td>
<td>${date}</td>
<td>${desc}</td>
<td>1</td>
<td>${region}</td>
<td><input type="checkbox" class="toggle-switch-btn"></td>
<td>₹${amount}</td>
<td><span class="status-badge status-unpaid">Unpaid</span></td>
</tr>
`);
document.querySelector('#main-order-table tbody').insertAdjacentHTML('beforeend', `
<tr>
<td><a class="entry-link" onclick="openEntryDetailsModal('${entryNo}')">${entryNo}</a></td>
<td>${date}</td>
<td>${desc}</td>
<td>${region}</td>
<td>₹${amount}</td>
<td><span class="status-badge status-loading">Loading</span></td>
<td><span class="status-badge pending-badge-green">Completed</span></td>
<td>
<button class="plus-btn" title="Add" onclick="openInstallmentModal('${entryNo}', '${desc}', '${region}', 0)">
<span style="font-size:21px;">+</span>
</button>
</td>
</tr>
`);
document.getElementById('orderModal').classList.remove('modal-open');
this.reset();
});
</script>
@endsection