diff --git a/app/Http/Controllers/Admin/AdminAccountController.php b/app/Http/Controllers/Admin/AdminAccountController.php index 8b5d98d..4703ff7 100644 --- a/app/Http/Controllers/Admin/AdminAccountController.php +++ b/app/Http/Controllers/Admin/AdminAccountController.php @@ -11,13 +11,16 @@ use Illuminate\Support\Facades\DB; class AdminAccountController extends Controller { - public function updateEntry(Request $request) + public function updateEntry(Request $request) { try { $data = $request->validate([ - 'entry_no' => 'required|exists:entries,entry_no', - 'description' => 'required|string|max:255', - 'order_quantity' => 'required|numeric|min:0', + 'entry_no' => 'required|exists:entries,entry_no', + 'description' => 'required|string|max:255', + 'order_quantity' => 'required|numeric|min:0', + 'region' => 'required|string|max:50', + 'amount' => 'required|numeric|min:0', + 'payment_status' => 'required|string|max:50', ]); $entry = Entry::where('entry_no', $data['entry_no'])->first(); @@ -31,6 +34,10 @@ class AdminAccountController extends Controller $entry->description = $data['description']; $entry->order_quantity = $data['order_quantity']; + $entry->region = $data['region']; + $entry->amount = $data['amount']; + $entry->payment_status = $data['payment_status']; + $entry->save(); return response()->json([ @@ -46,36 +53,6 @@ class AdminAccountController extends Controller } } -public function deleteEntry(Request $request) -{ - try { - $data = $request->validate([ - 'entry_no' => 'required|exists:entries,entry_no', - ]); - - $entry = Entry::where('entry_no', $data['entry_no'])->first(); - - if (!$entry) { - return response()->json([ - 'success' => false, - 'message' => 'Entry not found.', - ], 404); - } - - $entry->delete(); - - return response()->json([ - 'success' => true, - 'message' => 'Entry deleted successfully.', - ]); - } catch (\Throwable $e) { - return response()->json([ - 'success' => false, - 'message' => 'Server error: '.$e->getMessage(), - ], 500); - } -} - /** * 🚀 1. Get dashboard entries */ @@ -96,15 +73,14 @@ public function deleteEntry(Request $request) */ public function getAvailableOrders() { - $orders = Order::whereDoesntHave('entries') - ->orderBy('id', 'desc') - ->get(); - + $orders = Order::orderBy('id', 'desc')->get(); + return response()->json([ 'success' => true, - 'orders' => $orders + 'orders' => $orders, ]); } + /** * 🚀 3. Create new entry @@ -325,10 +301,9 @@ public function deleteEntry(Request $request) return DB::transaction(function () use ($data) { $entry = Entry::where('entry_no', $data['entry_no'])->firstOrFail(); - // आधीचे orders काढू नका, फक्त नवीन add करा + $entry->orders()->syncWithoutDetaching($data['order_ids']); - // इथे quantity auto update $entry->order_quantity = $entry->orders()->count(); $entry->save(); @@ -387,5 +362,35 @@ public function removeOrderFromEntry(Request $request) ]); }); } +public function deleteEntry(Request $request) +{ + try { + $data = $request->validate([ + 'entry_no' => 'required|exists:entries,entry_no', + ]); + + $entry = Entry::where('entry_no', $data['entry_no'])->first(); + + if (!$entry) { + return response()->json([ + 'success' => false, + 'message' => 'Entry not found.', + ], 404); + } + + $entry->delete(); + + return response()->json([ + 'success' => true, + 'message' => 'Entry deleted successfully.', + ]); + } catch (\Throwable $e) { + return response()->json([ + 'success' => false, + 'message' => 'Server error: '.$e->getMessage(), + ], 500); + } +} + } \ No newline at end of file diff --git a/resources/views/admin/account.blade.php b/resources/views/admin/account.blade.php index cf3d3a3..d904a04 100644 --- a/resources/views/admin/account.blade.php +++ b/resources/views/admin/account.blade.php @@ -464,6 +464,9 @@ tr:hover td{ background:#fbfdff; } overflow:auto; min-height: 500px; } +#entryOrdersModal { + z-index: 1300; +} /* entry summary cards */ .entry-summary-cards { @@ -493,15 +496,41 @@ tr:hover td{ background:#fbfdff; } .kv { font-weight:700; color:#26364f; } /* form styles */ -.input, select { - width:100%; - padding:12px 14px; - border-radius:8px; - border:1.3px solid #e3eaf6; - background:#fff; - font-size:14px; - box-sizing:border-box; -} + .input, select { + width:100%; + padding:12px 14px; + border-radius:8px; + border:1.3px solid #e3eaf6; + background:#fff; + font-size:14px; + box-sizing:border-box; + } + + /* Additional styling for the installment dropdown - doesn't affect original class */ + .installment-status-dropdown { + cursor: pointer; + appearance: none; + background-image: url('data:image/svg+xml;charset=US-ASCII,'); + background-repeat: no-repeat; + background-position: right 12px center; + padding-right: 40px; + transition: all 0.2s ease; + } + + .installment-status-dropdown:hover { + border-color: #c2d1f0; + } + + .installment-status-dropdown:focus { + outline: none; + border-color: #4d7cfe; + box-shadow: 0 0 0 3px rgba(77, 124, 254, 0.1); + } + + /* Status-specific styling for selected option */ + .installment-status-dropdown option:checked { + font-weight: 600; + } .create-grid { display:grid; grid-template-columns: 1fr 1fr; @@ -516,8 +545,8 @@ tr:hover td{ background:#fbfdff; } margin-top:16px; } -/* Filter section styles - FOR BOTH TABLES */ -.payment-filters, .order-filters { +/* Combined filters row styling */ +.combined-filters-row { display: flex; gap: 12px; align-items: center; @@ -527,15 +556,231 @@ tr:hover td{ background:#fbfdff; } background: linear-gradient(90deg, #f8fbff, #f5f9ff); border-radius: 10px; border: 1px solid #eef3fb; - width: 480px; - max-width: 480px; + width: 365px; } -.filter-group { +.right{ + margin-left:auto; + margin-top:-16px; +} + +.filter-group1 { display: flex; flex-direction: column; gap: 6px; + width: 159px; } +.filter-group2 { + display: flex; + flex-direction: column; + gap: 6px; + width: 160px; +} + +.filter-group3 { + flex: 1; + width: 159px; + } + +.filter-label { + display: block; + font-size: 13px; + font-weight: 600; + color: #44546a; + margin-bottom: 6px; +} + +.payment-filters-section { + display: flex; + align-items: flex-end; + gap: 16px; +} + + .filter-group4 { + display: flex; + flex-direction: column; + gap: 6px; + width: 160px; +} + + +.filter-label { + display: block; + font-size: 13px; + font-weight: 600; + color: #44546a; + margin-bottom: 2px; +} + +/* Status option colors */ +.filter-control option { + padding: 10px 12px; + font-size: 14px; +} + +.filter-control option[value=""] { + color: #6b778c; +} + +.filter-control option[value="pending"] { + color: #f59e0b; + font-weight: 500; +} + +.filter-control option[value="loading"] { + color: #3b82f6; + font-weight: 500; +} + +.filter-control option[value="packed"] { + color: #8b5cf6; + font-weight: 500; +} + +.filter-control option[value="dispatched"] { + color: #10b981; + font-weight: 500; +} + +.filter-control option[value="delivered"] { + color: #0c6b2e; + font-weight: 500; +} + + + + +.status-color { + width: 12px; + height: 12px; + border-radius: 50%; +} + +.status-color.pending { background-color: #f59e0b; } +.status-color.loading { background-color: #3b82f6; } +.status-color.packed { background-color: #8b5cf6; } +.status-color.dispatched { background-color: #10b981; } +.status-color.delivered { background-color: #0c6b2e; } + + + + +/* Style for options with icons */ +.filter-control option { + padding: 8px 12px; +} + +.filter-control option[value=""] { + color: #6b778c; +} + +.filter-control option[value="paid"] { + color: #0c6b2e; + font-weight: 500; +} + +.filter-control option[value="unpaid"] { + color: #c9372c; + font-weight: 500; +} + +.filter-control option[value="pending"] { + color: #f59e0b; + font-weight: 500; +} + + +.filter-group4 { + display: flex; + flex-direction: column; + gap: 6px; + width: 510px; +} + +/* Modern filter alternative with icons */ +.filter-status-buttons { + display: flex; + gap: 8px; + margin-top: 8px; +} + +.status-btn { + display: flex; + align-items: center; + gap: 6px; + padding: 6px 12px; + border-radius: 6px; + border: 1px solid #e3eaf6; + background: #fff; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.2s ease; +} + +.status-btn:hover { + background-color: #f8fafc; + transform: translateY(-1px); +} + +.status-btn.active { + border-color: transparent; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); +} + +.status-btn[data-status="paid"] { + color: #0c6b2e; + background-color: #f0f9f0; +} + +.status-btn[data-status="paid"].active { + background-color: #e1f7e1; +} + +.status-btn[data-status="paid"] i { + color: #0c6b2e; +} + +.status-btn[data-status="unpaid"] { + color: #c9372c; + background-color: #fef0f0; +} + +.status-btn[data-status="unpaid"].active { + background-color: #fde8e8; +} + +.status-btn[data-status="unpaid"] i { + color: #c9372c; +} + +.status-btn[data-status="pending"] { + color: #f59e0b; + background-color: #fff7e6; +} + +.status-btn[data-status="pending"].active { + background-color: #fff0cc; +} + +.status-btn[data-status="pending"] i { + color: #f59e0b; +} + +.status-btn[data-status="all"] { + color: #44546a; + background-color: #f8fafc; +} + +.status-btn[data-status="all"].active { + background-color: #f1f5f9; +} + +.status-btn[data-status="all"] i { + color: #44546a; +} + + .filter-label { font-size: 13px; @@ -558,10 +803,17 @@ tr:hover td{ background:#fbfdff; } box-shadow: 0 0 0 2px rgba(26, 41, 81, 0.1); } -.filter-actions { +/* Table-specific filter sections */ +.payment-filters-section, .order-filters-section { display: flex; - gap: 8px; - align-items: flex-end; + gap: 12px; + align-items: center; + flex-wrap: wrap; + margin-bottom: 16px; + padding: 12px 14px; + background: linear-gradient(90deg, #f9fbff, #f7faff); + border-radius: 8px; + border: 1px solid #eef3fb; } /* Action buttons in table */ @@ -602,6 +854,7 @@ tr:hover td{ background:#fbfdff; } /* Edit modal styles */ .edit-modal .modal-box1 { max-width: 800px; + z-index: 1250; } .edit-form-grid { @@ -709,10 +962,11 @@ tr:hover td{ background:#fbfdff; } .pagination-controls { justify-content: center; } .account-container { padding: 20px; } .panel-card { padding: 18px; } - .payment-filters, .order-filters { flex-direction: column; align-items: stretch; } + .combined-filters-row { flex-direction: column; align-items: stretch; } .filter-group { width: 100%; } .filter-control { min-width: auto; } .edit-form-grid { grid-template-columns: 1fr; } + .payment-filters-section, .order-filters-section { flex-direction: column; align-items: stretch; } } @media (max-width:768px){ @@ -743,6 +997,14 @@ tr:hover td{ background:#fbfdff; } .pagination-right { justify-content: flex-end; } + +/* Combined top row styling */ +.combined-top-row { + display: flex; + gap: 12px; + align-items: center; + flex-wrap: wrap; +}
Viewing: All Regions — Workflow: Manage payments and dispatch.
| Order ID | +Mark No | +Origin | +Destination | +CTN | +QTY | +Amount | +
|---|---|---|---|---|---|---|
| No orders associated with this entry | +||||||