Compare commits

...

7 Commits

Author SHA256 Message Date
Utkarsh Khedkar
4dab96b8d1 Account and Shipment Changes 2025-12-04 11:21:46 +05:30
Utkarsh Khedkar
e7fef314fc Merge branch 'dev' of http://103.248.30.24:3000/kent-logistics/Kent-logistics-Laravel into dev 2025-12-03 16:17:36 +05:30
Utkarsh Khedkar
5114357ff2 Account Changes 2025-12-03 16:17:14 +05:30
Utkarsh Khedkar
9b8c50fcec Merge branch 'dev' of http://103.248.30.24:3000/kent-logistics/Kent-logistics-Laravel into dev 2025-12-03 11:09:28 +05:30
Utkarsh Khedkar
7a814dff1d Dasshboard Changes 2025-12-03 11:09:12 +05:30
Utkarsh Khedkar
3b24ee860a Merge branch 'dev' of http://103.248.30.24:3000/kent-logistics/Kent-logistics-Laravel into dev 2025-12-02 18:12:15 +05:30
Utkarsh Khedkar
2dcd9fe332 Account Changes 2025-12-02 18:11:58 +05:30
10 changed files with 1137 additions and 1301 deletions

View File

@@ -18,6 +18,9 @@ class AdminAccountController extends Controller
'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,16 +73,18 @@ public function deleteEntry(Request $request)
*/
public function getAvailableOrders()
{
$orders = Order::whereDoesntHave('entries')
->orderBy('id', 'desc')
->get();
return response()->json([
'success' => true,
'orders' => $orders
'orders' => $orders,
]);
}
/**
* 🚀 3. Create new entry
*/
@@ -325,10 +304,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 +365,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);
}
}
}

View File

@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Admin;
use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Shipment;
@@ -107,9 +106,6 @@ class ShipmentController extends Controller
'order_qty' => $order->qty,
'order_ttl_qty' => $order->ttl_qty,
'order_ttl_amount' => $order->ttl_amount,
'order_cbm' => $order->cbm,
'order_ttl_cbm' => $order->ttl_cbm,
'order_kg' => $order->kg,
'order_ttl_kg' => $order->ttl_kg,
]);
}
@@ -117,110 +113,22 @@ class ShipmentController extends Controller
return redirect()->back()->with('success', "Shipment $newShipmentId created successfully!");
}
public function edit($id)
{
$shipment = Shipment::with('orders')->findOrFail($id);
return view('admin.shipments.show', [
'shipment' => $shipment,
'orders' => $shipment->orders,
'isViewMode' => false // This is the edit mode
]);
}
/**
* Show shipment details (for modal popup)
*/
public function show($id)
{
$mode = request()->get('mode', 'view');
$shipment = Shipment::with(['items.order'])->findOrFail($id);
// Get orders from shipment items
$orders = collect();
foreach ($shipment->items as $item) {
if ($item->order) {
$orders->push($item->order);
}
}
// Get orders not assigned to any shipment (available orders)
$usedOrderIds = ShipmentItem::pluck('order_id')->toArray();
$availableOrders = Order::whereNotIn('id', $usedOrderIds)->get();
return view('admin.view-shipment', [
'shipment' => $shipment,
'orders' => $orders,
'mode' => $mode,
'availableOrders' => $availableOrders
]);
}
public function addOrders(Request $request, $id)
{
$request->validate([
'order_ids' => 'required|array|min:1'
]);
$shipment = Shipment::findOrFail($id);
$orderIds = $request->order_ids;
DB::beginTransaction();
try {
$orders = Order::whereIn('id', $orderIds)->get();
$addedOrders = [];
foreach ($orders as $order) {
// Prevent duplicates
if (ShipmentItem::where('shipment_id', $shipment->id)->where('order_id', $order->id)->exists()) {
continue;
}
ShipmentItem::create([
'shipment_id' => $shipment->id,
'order_id' => $order->id,
'order_ctn' => $order->ctn,
'order_qty' => $order->qty,
'order_ttl_qty' => $order->ttl_qty,
'order_ttl_amount' => $order->ttl_amount,
'order_cbm' => $order->cbm,
'order_ttl_cbm' => $order->ttl_cbm,
'order_kg' => $order->kg,
'order_ttl_kg' => $order->ttl_kg,
]);
$addedOrders[] = $order;
}
// Recalculate totals
$this->recalculateShipmentTotals($shipment->id);
DB::commit();
$shipment->refresh();
$shipment->load('items.order');
// Get updated orders list
$updatedOrders = collect();
foreach ($shipment->items as $item) {
if ($item->order) {
$updatedOrders->push($item->order);
}
}
// Load full order data from orders table
$orders = Order::whereIn('id',
ShipmentItem::where('shipment_id', $id)->pluck('order_id')
)->get();
return response()->json([
'success' => true,
'message' => 'Orders added to shipment successfully.',
'shipment' => $shipment,
'orders' => $addedOrders
'orders' => $orders
]);
} catch (\Exception $e) {
DB::rollBack();
return response()->json([
'success' => false,
'message' => 'Failed to add orders: ' . $e->getMessage()
], 500);
}
}
/**
@@ -301,77 +209,4 @@ class ShipmentController extends Controller
return redirect()->route('admin.shipments')
->with('success', 'Shipment deleted successfully.');
}
public function removeOrder(Request $request)
{
$request->validate([
'shipment_id' => 'required|exists:shipments,id',
'order_id' => 'required|exists:orders,id'
]);
$shipmentId = $request->shipment_id;
$orderId = $request->order_id;
// Get order data before deletion
$order = Order::findOrFail($orderId);
// Delete pivot entry
ShipmentItem::where('shipment_id', $shipmentId)
->where('order_id', $orderId)
->delete();
// Recalculate totals
$shipment = $this->recalculateShipmentTotals($shipmentId);
if ($request->ajax() || $request->wantsJson()) {
return response()->json([
'success' => true,
'message' => 'Order removed successfully.',
'order' => $order,
'shipment' => $shipment
]);
}
return back()->with('success', 'Order removed successfully.');
}
private function recalculateShipmentTotals($shipmentId)
{
$shipment = Shipment::with('items')->findOrFail($shipmentId);
// Use the shipment items to calculate totals
$shipment->total_ctn = $shipment->items->sum('order_ctn');
$shipment->total_qty = $shipment->items->sum('order_qty');
$shipment->total_ttl_qty = $shipment->items->sum('order_ttl_qty');
$shipment->total_amount = $shipment->items->sum('order_ttl_amount');
$shipment->total_cbm = $shipment->items->sum('order_cbm');
$shipment->total_ttl_cbm = $shipment->items->sum('order_ttl_cbm');
$shipment->total_kg = $shipment->items->sum('order_kg');
$shipment->total_ttl_kg = $shipment->items->sum('order_ttl_kg');
$shipment->save();
$shipment->refresh(); // Refresh to get updated data
return $shipment;
}
// Helper method to get available orders for a shipment
public function getAvailableOrders($shipmentId)
{
$shipment = Shipment::findOrFail($shipmentId);
// Get all used order IDs
$usedOrderIds = ShipmentItem::pluck('order_id')->toArray();
// Remove orders that are already in this shipment
$shipmentOrderIds = $shipment->items->pluck('order_id')->toArray();
$availableOrderIds = array_diff($usedOrderIds, $shipmentOrderIds);
$availableOrders = Order::whereNotIn('id', $availableOrderIds)->get();
return response()->json([
'success' => true,
'availableOrders' => $availableOrders
]);
}
}

View File

@@ -10,7 +10,7 @@
"barryvdh/laravel-dompdf": "^3.1",
"laravel/framework": "^12.0",
"laravel/tinker": "^2.10.1",
"maatwebsite/excel": "^3.1",
"maatwebsite/excel": "^1.1",
"mpdf/mpdf": "^8.2",
"php-open-source-saver/jwt-auth": "2.8"
},

556
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c33d415efbeb5f4bc492cea187970455",
"content-hash": "6a2ec43d7e96d38cacfc2f9e1ae5cb9e",
"packages": [
{
"name": "barryvdh/laravel-dompdf",
@@ -212,162 +212,6 @@
],
"time": "2024-02-09T16:56:22+00:00"
},
{
"name": "composer/pcre",
"version": "3.3.2",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
"reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
"reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0"
},
"conflict": {
"phpstan/phpstan": "<1.11.10"
},
"require-dev": {
"phpstan/phpstan": "^1.12 || ^2",
"phpstan/phpstan-strict-rules": "^1 || ^2",
"phpunit/phpunit": "^8 || ^9"
},
"type": "library",
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Pcre\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "PCRE wrapping library that offers type-safe preg_* replacements.",
"keywords": [
"PCRE",
"preg",
"regex",
"regular expression"
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
"source": "https://github.com/composer/pcre/tree/3.3.2"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2024-11-12T16:29:46+00:00"
},
{
"name": "composer/semver",
"version": "3.4.4",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95",
"reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
},
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com",
"homepage": "http://robbast.nl"
}
],
"description": "Semver library that offers utilities, version constraint parsing and validation.",
"keywords": [
"semantic",
"semver",
"validation",
"versioning"
],
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.4.4"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
}
],
"time": "2025-08-20T19:15:30+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@@ -896,67 +740,6 @@
],
"time": "2025-03-06T22:45:56+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.19.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "b287d2a16aceffbf6e0295559b39662612b77fcf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/b287d2a16aceffbf6e0295559b39662612b77fcf",
"reference": "b287d2a16aceffbf6e0295559b39662612b77fcf",
"shasum": ""
},
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-tidy": "Used for pretty-printing HTML"
},
"type": "library",
"autoload": {
"files": [
"library/HTMLPurifier.composer.php"
],
"psr-0": {
"HTMLPurifier": "library/"
},
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.19.0"
},
"time": "2025-10-17T16:34:55+00:00"
},
{
"name": "fruitcake/php-cors",
"version": "v1.4.0",
@@ -2540,58 +2323,48 @@
},
{
"name": "maatwebsite/excel",
"version": "3.1.67",
"version": "v1.1.5",
"source": {
"type": "git",
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
"reference": "e508e34a502a3acc3329b464dad257378a7edb4d"
"url": "https://github.com/Maatwebsite/Laravel-Excel.git",
"reference": "0c67aba8387726458d42461eae91a3415593bbc4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/e508e34a502a3acc3329b464dad257378a7edb4d",
"reference": "e508e34a502a3acc3329b464dad257378a7edb4d",
"url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/0c67aba8387726458d42461eae91a3415593bbc4",
"reference": "0c67aba8387726458d42461eae91a3415593bbc4",
"shasum": ""
},
"require": {
"composer/semver": "^3.3",
"ext-json": "*",
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0",
"php": "^7.0||^8.0",
"phpoffice/phpspreadsheet": "^1.30.0",
"psr/simple-cache": "^1.0||^2.0||^3.0"
"php": ">=5.3.0",
"phpoffice/phpexcel": "~1.8.0"
},
"require-dev": {
"laravel/scout": "^7.0||^8.0||^9.0||^10.0",
"orchestra/testbench": "^6.0||^7.0||^8.0||^9.0||^10.0",
"predis/predis": "^1.1"
"mockery/mockery": "~0.9",
"orchestra/testbench": "~2.2.0@dev",
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
},
"providers": [
"Maatwebsite\\Excel\\ExcelServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"psr-0": {
"Maatwebsite\\Excel\\": "src/"
}
},
"classmap": [
"src/Maatwebsite/Excel",
"tests/TestCase.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
"LGPL"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "patrick@spartner.nl"
"name": "Maatwebsite.nl",
"email": "patrick@maatwebsite.nl"
}
],
"description": "Supercharged Excel exports and imports in Laravel",
"description": "An eloquent way of importing and exporting Excel and CSV in Laravel 4 with the power of PHPExcel",
"keywords": [
"PHPExcel",
"batch",
@@ -2599,210 +2372,13 @@
"excel",
"export",
"import",
"laravel",
"php",
"phpspreadsheet"
"laravel"
],
"support": {
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.67"
"issues": "https://github.com/Maatwebsite/Laravel-Excel/issues",
"source": "https://github.com/Maatwebsite/Laravel-Excel/tree/master"
},
"funding": [
{
"url": "https://laravel-excel.com/commercial-support",
"type": "custom"
},
{
"url": "https://github.com/patrickbrouwers",
"type": "github"
}
],
"time": "2025-08-26T09:13:16+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "3.1.2",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php-64bit": "^8.2"
},
"require-dev": {
"brianium/paratest": "^7.7",
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.16",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^11.0",
"vimeo/psalm": "^6.0"
},
"suggest": {
"guzzlehttp/psr7": "^2.4",
"psr/http-message": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
}
],
"time": "2025-01-27T12:07:53+00:00"
},
{
"name": "markbaker/complex",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
"time": "2022-12-06T16:21:08+00:00"
},
{
"name": "markbaker/matrix",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
"time": "2022-12-02T22:17:43+00:00"
"time": "2014-07-10T09:06:07+00:00"
},
{
"name": "masterminds/html5",
@@ -3825,110 +3401,66 @@
"time": "2025-02-10T21:11:16+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.30.1",
"name": "phpoffice/phpexcel",
"version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "fa8257a579ec623473eabfe49731de5967306c4c"
"url": "https://github.com/PHPOffice/PHPExcel.git",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fa8257a579ec623473eabfe49731de5967306c4c",
"reference": "fa8257a579ec623473eabfe49731de5967306c4c",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"shasum": ""
},
"require": {
"composer/pcre": "^1||^2||^3",
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.15",
"maennchen/zipstream-php": "^2.1 || ^3.0",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": ">=7.4.0 <8.5.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
"php": ">=5.2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
"psr-0": {
"PHPExcel": "Classes/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
"LGPL"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
"homepage": "http://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
"name": "Mark Baker"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
"homepage": "http://blog.rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "http://phpexcel.codeplex.com",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.30.1"
"issues": "https://github.com/PHPOffice/PHPExcel/issues",
"source": "https://github.com/PHPOffice/PHPExcel/tree/master"
},
"time": "2025-10-26T16:01:04+00:00"
"abandoned": "phpoffice/phpspreadsheet",
"time": "2015-05-01T07:00:55+00:00"
},
{
"name": "phpoption/phpoption",

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,7 @@
font-family: 'Inter', Arial, sans-serif;
display: flex;
flex-direction: row;
transition: all 0.3s ease-in-out;
}
/* ✨ Sidebar Glass + Animated Highlight Effect */
@@ -36,7 +37,13 @@
position: fixed;
top: 0;
left: 0;
}
/* Sidebar collapsed state */
.sidebar.collapsed {
transform: translateX(-100%);
opacity: 0;
visibility: hidden;
}
.sidebar .logo {
@@ -73,7 +80,6 @@
overflow: hidden;
transition: all 0.25s ease;
z-index: 0;
}
/* Background Animation */
@@ -151,6 +157,39 @@
flex-direction: column;
width: calc(100vw - 190px);
margin-left: 190px;
transition: all 0.3s ease-in-out;
}
/* Main content when sidebar is collapsed */
.main-content.expanded {
margin-left: 0;
width: 100vw;
}
/* Header hamburger button */
.header-toggle {
background: transparent;
border: none;
cursor: pointer;
padding: 8px;
margin-right: 15px;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.3s ease;
width: 40px;
height: 40px;
border-radius: 8px;
}
.header-toggle:hover {
transform: scale(1.1);
background: rgba(43, 92, 182, 0.1);
}
.header-toggle i {
font-size: 1.6rem;
color: #2b5cb6;
}
header {
@@ -165,6 +204,11 @@
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.header-left {
display: flex;
align-items: center;
}
.content-wrapper {
padding: 18px 16px 16px 16px;
flex-grow: 1;
@@ -222,16 +266,16 @@
<a href="{{ route('admin.staff') }}" class="{{ request()->routeIs('admin.staff') ? 'active' : '' }}"><i class="bi bi-person-badge"></i> Staff</a>
<a href="{{ route('admin.account') }}" class="{{ request()->routeIs('admin.account') ? 'active' : '' }}"><i class="bi bi-gear"></i> Account</a>
<a href="{{ route('admin.marklist.index') }}" class="{{ request()->routeIs('admin.marklist.index') ? 'active' : '' }}"><i class="bi bi-list-check"></i> Mark List</a>
<!-- <form method="POST" action="{{ route('admin.logout') }}" class="mt-4 px-3">
@csrf
<button type="submit" class="btn btn-danger w-100"><i class="bi bi-box-arrow-right"></i> Logout</button>
</form> -->
</div>
<div class="main-content">
<header>
<h5>@yield('page-title')</h5>
<div class="header-left">
<button class="header-toggle" id="headerToggle">
<i class="bi bi-list"></i>
</button>
<h5 class="mb-0">@yield('page-title')</h5>
</div>
<div class="d-flex align-items-center gap-3">
<i class="bi bi-bell position-relative fs-4">
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">2</span>
@@ -260,5 +304,23 @@
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const headerToggle = document.getElementById('headerToggle');
const sidebar = document.querySelector('.sidebar');
const mainContent = document.querySelector('.main-content');
// Function to toggle sidebar
function toggleSidebar() {
sidebar.classList.toggle('collapsed');
mainContent.classList.toggle('expanded');
}
// Header toggle button click event
if (headerToggle) {
headerToggle.addEventListener('click', toggleSidebar);
}
});
</script>
</body>
</html>

View File

@@ -748,10 +748,13 @@
<script>
// Pagination state
let currentPage = 1;
const itemsPerPage = 10;
let allOrders = @json($orders);
let filteredOrders = [...allOrders];
let currentPage = 1;
const itemsPerPage = 10;
let allOrders = @json($orders);
let filteredOrders = [...allOrders];
console.log('ORDERS SAMPLE:', allOrders[0]);
// Status icon helper functions
function getInvoiceStatusIcon(status) {
@@ -932,9 +935,10 @@
filteredOrders = allOrders.filter(order => {
const matchesSearch = !searchTerm ||
(order.order_id && order.order_id.toLowerCase().includes(searchTerm)) ||
(order.markList?.company_name && order.markList.company_name.toLowerCase().includes(searchTerm)) ||
(order.invoice?.invoice_number && order.invoice.invoice_number.toLowerCase().includes(searchTerm));
order.order_id?.toLowerCase().includes(searchTerm) ||
order.mark_list?.company_name?.toLowerCase().includes(searchTerm) ||
order.invoice?.invoice_number?.toLowerCase().includes(searchTerm);
const matchesStatus = !statusFilter ||
(order.invoice?.status && order.invoice.status.toLowerCase() === statusFilter);
@@ -1049,7 +1053,7 @@
const paginatedItems = filteredOrders.slice(startIndex, endIndex);
paginatedItems.forEach(order => {
const mark = order.markList || null;
const mark = order.mark_list || null;
const invoice = order.invoice || null;
const shipment = order.shipments?.[0] || null;
const invoiceStatus = (invoice?.status || '').toLowerCase();

View File

@@ -63,7 +63,6 @@
--hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
/* UPDATED: Search Bar Styles - White Background */
.search-shipment-bar {
display: flex;
align-items: center;
@@ -90,69 +89,9 @@
z-index: 0;
}
.search-input-container:focus-within {
border-color: #4361ee;
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}
.search-shipment-bar input {
padding: 12px 16px;
border: none;
flex: 1;
background: transparent;
font-weight: 500;
transition: all 0.3s ease;
font-family: 'Inter', sans-serif;
font-size: 14px;
outline: none;
color: #333;
}
.search-shipment-bar input::placeholder {
color: #6b7280;
}
/* UPDATED: Search Button - White with Blue Icon by default, Gradient on hover */
.search-button {
background: white;
color: #4361ee;
border: none;
padding: 12px 20px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 600;
font-family: 'Inter', sans-serif;
font-size: 14px;
display: flex;
align-items: center;
gap: 8px;
border-radius: 0 10px 10px 0;
min-width: 100px;
justify-content: center;
border-left: 1px solid #d1d5db;
}
.search-input-group {
border: 1px solid #d1d5db !important;
border-radius: 8px !important;
padding: 4px !important;
background: #ffffff !important;
}
.search-button:hover {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.search-icon {
font-size: 16px;
color: #4361ee;
transition: all 0.3s ease;
}
.search-button:hover .search-icon {
color: white;
.search-shipment-bar > * {
position: relative;
z-index: 1;
}
.search-shipment-bar input,
@@ -215,26 +154,6 @@
width: 100%;
}
}
/* VIEW BUTTON STYLING */
.btn-view {
background: linear-gradient(135deg, #4cc9f0, #4361ee) !important;
border: none !important;
border-radius: 10px !important;
padding: 8px 14px !important;
color: white !important;
box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35) !important;
transition: all 0.3s ease !important;
}
.btn-view:hover {
transform: translateY(-2px) scale(1.05) !important;
background: linear-gradient(135deg, #3a56d4, #4cc9f0) !important;
box-shadow: 0 8px 20px rgba(67, 97, 238, 0.5) !important;
}
.btn-view i {
font-size: 16px !important;
}
/* Card Styles */
.card {
@@ -326,7 +245,7 @@
border-bottom: none;
}
/* UPDATED: Status Badge Styles - ALL SAME SIZE WITH ICONS */
/* UPDATED: Status Badge Styles - ALL SAME SIZE */
.badge {
padding: 7px 17px !important;
border-radius: 20px !important;
@@ -339,15 +258,7 @@
line-height: 1.2 !important;
}
/* Status icons */
.status-icon {
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
}
/* Pending Status - SAME SIZE WITH CLOCK ICON */
/* Pending Status - SAME SIZE */
.badge-pending {
background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
color: #d97706 !important;
@@ -355,7 +266,7 @@
width: 110px;
}
/* In Transit Status - SAME SIZE WITH TRUCK ICON */
/* In Transit Status - SAME SIZE */
.badge-in_transit {
background: linear-gradient(135deg, #dbeafe, #93c5fd) !important;
color: #1e40af !important;
@@ -363,7 +274,7 @@
width: 110px;
}
/* Dispatched Status - SAME SIZE WITH BOX ICON */
/* Dispatched Status - SAME SIZE */
.badge-dispatched {
background: linear-gradient(135deg, #e9d5ff, #c4b5fd) !important;
color: #6b21a8 !important;
@@ -371,7 +282,7 @@
width: 110px;
}
/* Delivered Status - SAME SIZE WITH CHECK ICON */
/* Delivered Status - SAME SIZE */
.badge-delivered {
background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
color: #065f46 !important;
@@ -536,66 +447,6 @@
background: #10b981;
}
/* NEW: View Button Styles - Icon Only */
.btn-view {
background: #4361ee;
color: white;
border: none;
border-radius: 8px;
padding: 8px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
font-weight: 600;
font-size: 16px;
font-family: 'Inter', sans-serif;
position: relative;
overflow: hidden;
}
.btn-view::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
transition: all 0.3s ease;
z-index: 1;
}
.btn-view:hover::before {
left: 0;
}
.btn-view i {
position: relative;
z-index: 2;
transition: all 0.3s ease;
}
.btn-view:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.btn-view:hover i {
transform: scale(1.1);
}
/* Action buttons container */
.action-buttons {
display: flex;
gap: 8px;
align-items: center;
justify-content: center;
}
/* Modal Styles */
.modal-content {
border-radius: 20px;
@@ -830,9 +681,6 @@
transition: all 0.3s ease;
position: relative;
color: #4361ee !important;
font-family: 'Inter', sans-serif;
font-size: 14px;
cursor: pointer;
}
a.text-primary:hover {
@@ -840,7 +688,7 @@
text-decoration: underline;
}
/* Shipment Details Modal - UPDATED TO MATCH SECOND CODE */
/* Shipment Details Modal */
.shipment-details-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
@@ -930,7 +778,7 @@
border-bottom-right-radius: 10px;
}
/* Shipment Totals Section - UPDATED */
/* Shipment Totals Section */
.shipment-totals {
margin-top: 25px;
padding: 25px;
@@ -1214,48 +1062,8 @@
justify-content: center;
}
}
/* Edit Form Styles */
.edit-shipment-form {
background: #f8fafc;
padding: 25px;
border-radius: 12px;
margin-bottom: 20px;
border-left: 4px solid #4361ee;
}
.btn-save {
background: linear-gradient(135deg, #48bb78, #38a169);
color: white;
font-weight: 600;
border-radius: 8px;
padding: 10px 20px;
border: none;
transition: all 0.3s ease;
}
.btn-save:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}
.btn-cancel-edit {
background: #f7fafc;
color: #718096;
border: 1px solid #cbd5e0;
border-radius: 8px;
font-weight: 600;
padding: 10px 20px;
transition: all 0.3s ease;
}
.btn-cancel-edit:hover {
background: #edf2f7;
color: #4a5568;
}
</style>
<div class="container-fluid py-4">
{{-- SUCCESS / ERROR MESSAGES --}}
@@ -1420,7 +1228,6 @@
<th>Status</th>
<th>Date</th>
<th>Action</th>
<th>View</th>
</tr>
</thead>
@@ -1433,15 +1240,16 @@
{{-- REVERSE INDEX: सर्वात वरच्या shipment ला सर्वात मोठा क्रमांक --}}
<td class="fw-bold">{{ $totalShipments - $loop->index }}</td>
<td>
<a href="#" class="text-primary fw-bold" onclick="openShipmentDetails({{ $ship->id }})">
<a href="#" class="text-primary fw-bold"
onclick="openShipmentDetails({{ $ship->id }})">
{{ $ship->shipment_id }}
</a>
</td>
<td>{{ $ship->origin }}</td>
<td>{{ $ship->destination }}</td>
<td>{{ $ship->total_qty }}</td>
<td>{{ $ship->total_kg }} kg</td>
<td>{{ $ship->total_cbm }} CBM</td>
<td><span class="badge bg-light text-dark">{{ $ship->total_qty }}</span></td>
<td><span class="badge bg-light text-dark">{{ $ship->total_kg }} kg</span></td>
<td><span class="badge bg-light text-dark">{{ $ship->total_cbm }} CBM</span></td>
<td class="fw-bold text-success">{{ number_format($ship->total_amount, 2) }}</td>
<td>
<span class="badge badge-{{ $ship->status }}">
@@ -1478,12 +1286,6 @@
</div>
</div>
</td>
<td>
<a href="{{ route('admin.shipments.view', ['id' => $ship->id, 'mode' => 'edit']) }}"
class="btn btn-view">
<i class="bi bi-eye"></i>
</a>
</td>
</tr>
@empty
<tr>
@@ -1521,12 +1323,10 @@
</div>
</div>
</div>
<!-- ============================= -->
<!-- SHIPMENT DETAILS MODAL -->
<!-- ============================= -->
<div class="modal fade" id="shipmentDetailsModal" tabindex="-1">
<!-- ============================= -->
<!-- SHIPMENT DETAILS MODAL -->
<!-- ============================= -->
<div class="modal fade" id="shipmentDetailsModal" tabindex="-1">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header shipment-details-header">
@@ -1544,6 +1344,8 @@
</div>
</div>
</div>
</div>
</div>
<!-- ========================= -->
@@ -1775,19 +1577,11 @@ function renderTable() {
</div>
</div>
</td>
<td>
<a href="/admin/shipments/view/${shipment.id}?mode=edit"
class="btn btn-view"
title="Edit Shipment">
<i class="bi bi-eye"></i>
</a>
</td>
`;
tbody.appendChild(row);
});
}
// Function to open shipment details modal
function openShipmentDetails(id) {
let modal = new bootstrap.Modal(document.getElementById('shipmentDetailsModal'));
let content = document.getElementById('shipmentDetailsContent');
@@ -1958,15 +1752,11 @@ function toggleStatusDropdown(button, shipmentId) {
// Close dropdown when clicking outside
document.addEventListener('click', function closeDropdown(e) {
// allow clicking links normally
if (e.target.closest('a')) return;
if (!button.contains(e.target) && !dropdown.contains(e.target)) {
dropdown.classList.remove('show');
document.removeEventListener('click', closeDropdown);
}
}, { once: true });
});
}
// Auto-close dropdown after form submission

View File

@@ -150,45 +150,31 @@ Route::prefix('admin')
// ---------------------------
// SHIPMENTS (FIXED ROUTES)
// ---------------------------
// View shipment MUST be before /shipments/{id}
Route::get('/shipments/view/{id}', [ShipmentController::class, 'show'])
->name('admin.shipments.view');
// List shipments
Route::get('/shipments', [ShipmentController::class, 'index'])
->name('admin.shipments');
// Create shipment
Route::post('/shipments', [ShipmentController::class, 'store'])
->name('admin.shipments.store');
// Update status
Route::post('/shipments/update-status', [ShipmentController::class, 'updateStatus'])
->name('admin.shipments.updateStatus');
// Shipment orders (AJAX)
// Get shipment orders for modal (AJAX)
Route::get('/shipments/{id}/orders', [ShipmentController::class, 'getShipmentOrders'])
->name('admin.shipments.orders');
// Shipment update
// Get shipment details for edit (AJAX)
Route::get('/shipments/{id}', [ShipmentController::class, 'show'])
->name('admin.shipments.show');
// Shipment Update
Route::put('/shipments/{id}', [ShipmentController::class, 'update'])
->name('admin.shipments.update');
// Shipment delete
// Shipment Delete
Route::delete('/shipments/{id}', [ShipmentController::class, 'destroy'])
->name('admin.shipments.destroy');
// Remove order
Route::post('/shipments/remove-order', [ShipmentController::class, 'removeOrder'])
->name('admin.shipments.removeOrder');
Route::post('/shipments/add-order', [ShipmentController::class, 'addOrder'])
->name('admin.shipments.addOrder');
Route::post('/shipments/{id}/add-orders', [ShipmentController::class, 'addOrders'])
->name('admin.shipments.addOrders');
// ---------------------------
// INVOICES
// ---------------------------
@@ -301,6 +287,11 @@ Route::prefix('admin')
Route::get('/admin/orders/download/excel', [AdminOrderController::class, 'downloadExcel'])
->name('admin.orders.download.excel');
Route::prefix('admin/account')->middleware('auth:admin')->name('admin.account.')->group(function () {
Route::post('/toggle-payment', [AdminAccountController::class, 'togglePayment'])->name('toggle');
});
//---------------------------
//Edit Button Route
//---------------------------