6 Commits

Author SHA1 Message Date
dhanabalan
fdc0aed31c added logic in cycle count
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 3m36s
Laravel Larastan / larastan (pull_request) Failing after 3m59s
2026-07-16 15:39:29 +05:30
dhanabalan
947aacb074 Changed logic in cycle count
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 2m22s
Laravel Larastan / larastan (pull_request) Failing after 3m44s
2026-07-16 15:26:36 +05:30
dhanabalan
b7b5db068b uncommented doc no update logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m25s
Laravel Larastan / larastan (pull_request) Failing after 4m55s
2026-07-16 12:23:44 +05:30
dhanabalan
d42ae70e46 added item code api route php
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 18s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Larastan / larastan (pull_request) Failing after 4m9s
Laravel Pint / pint (pull_request) Successful in 4m20s
2026-07-16 09:48:50 +05:30
dhanabalan
be2e7b00d7 added get item code method in plant controller
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 20s
2026-07-16 09:47:06 +05:30
dhanabalan
1ce7995105 removed inspection status column in production characteristic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 1m15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 58s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 2m4s
Laravel Pint / pint (pull_request) Successful in 2m59s
Laravel Larastan / larastan (pull_request) Failing after 4m20s
2026-07-13 14:03:27 +05:30
4 changed files with 106 additions and 14 deletions

View File

@@ -39,8 +39,6 @@ class ProductionCharacteristicExporter extends Exporter
->label('OBSERVED VALUE'),
ExportColumn::make('status')
->label('STATUS'),
ExportColumn::make('inspection_status')
->label('INSPECTION STATUS'),
ExportColumn::make('remark')
->label('REMARK'),
ExportColumn::make('created_at')

View File

@@ -128,7 +128,8 @@ class CycleCount extends Page
$operatorName = $user->name;
$pattern1 = '/^[^#]*#[^#]*#[^#]*#[^#]*#$/';
$pattern2 = '/^[^|]*\|[^|]*\|[^|]*$/';
// $pattern2 = '/^[^|]*\|[^|]*\|[^|]*$/';
$pattern2 = '/^[^|]+\|[^|]+(?:\|[^|]*)?$/';
$pattern3 = '/^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPp])?\|?$/';
// $pattern2 = '/^[^|]+\|[^|]+\|[^|]+\|?$/'; Optional Pipeline at end
@@ -678,7 +679,7 @@ class CycleCount extends Page
$stock->update([
'bin' => $bin,
'batch' => $this->batch,
// 'doc_no' =>$this->docNo,
'doc_no' =>$this->docNo,
'scanned_quantity' => $newScannedQty,
'scanned_status' => $status,
]);
@@ -721,13 +722,28 @@ class CycleCount extends Page
$parts = explode('|', $value);
$this->itemCode = $parts[0] ?? null;
if (strlen($parts[1]) > strlen($parts[2])) {
if (count($parts) == 2) {
// Format: itemcode|serialnumber
$this->sNo = $parts[1];
$this->batch = $parts[2];
$this->batch = null;
} else {
$this->batch = $parts[1];
$this->sNo = $parts[2];
// Format: itemcode|value1|value2
if (strlen($parts[1]) > strlen($parts[2])) {
$this->sNo = $parts[1];
$this->batch = $parts[2];
} else {
$this->batch = $parts[1];
$this->sNo = $parts[2];
}
}
// if (strlen($parts[1]) > strlen($parts[2])) {
// $this->sNo = $parts[1];
// $this->batch = $parts[2];
// } else {
// $this->batch = $parts[1];
// $this->sNo = $parts[2];
// }
if (strlen($this->itemCode) < 6) {
Notification::make()
@@ -759,7 +775,7 @@ class CycleCount extends Page
]);
return;
} elseif (strlen($this->batch) < 5) {
} elseif (count($parts) !== 2 && strlen($this->batch) < 5) {
Notification::make()
->title('Unknown Batch')
->body("Batch should contain minimum 5 digits '$this->batch'")
@@ -927,7 +943,7 @@ class CycleCount extends Page
'bin' => $bin,
'serial_number' => $this->sNo,
'stickerMasterId' => $stickerMasterId,
'batch' => $this->batch,
'batch' => $this->batch ?? null,
'docNo' => $this->docNo,
'quantity' => $this->quantity,
]),
@@ -1240,7 +1256,7 @@ class CycleCount extends Page
return;
}
if ($serialAgaPlant->batch != '' || $serialAgaPlant->batch != null) {
if (count($parts) !== 2 && ($serialAgaPlant->batch != '' || $serialAgaPlant->batch != null)){
if ($serialAgaPlant->batch != $this->batch) {
@@ -1396,7 +1412,7 @@ class CycleCount extends Page
'bin' => $bin,
'serial_number' => $this->sNo,
'stickerMasterId' => $stickerMasterId,
'batch' => $this->batch,
'batch' => $this->batch ?? null,
'docNo' => $this->docNo,
'quantity' => $this->quantity,
]),
@@ -1415,8 +1431,8 @@ class CycleCount extends Page
$serial->update([
'bin' => $bin ?? null,
'batch' => $this->batch ?? null,
'doc_no' => $this->docNo ?? null,
'batch' => count($parts) !== 2 ? $this->batch : $serial->batch,
// 'doc_no' => $this->docNo ?? null,
'scanned_status' => 'Scanned',
'scanned_quantity' => '1',
'updated_at' => now(),
@@ -2132,6 +2148,7 @@ class CycleCount extends Page
}
}
}
}
protected function getHeaderActions(): array

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Item;
use App\Models\Plant;
use Illuminate\Http\Request;
@@ -56,6 +57,78 @@ class PlantController extends Controller
]);
}
public function getItemCode(Request $request){
$expectedUser = env('API_AUTH_USER');
$expectedPw = env('API_AUTH_PW');
$header_auth = $request->header('Authorization');
$expectedToken = $expectedUser.':'.$expectedPw;
if ('Bearer '.$expectedToken != $header_auth) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!',
], 403);
}
$plantCode = $request->header('plant-code');
$itemCode = $request->header('item-code');
if (! $plantCode) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant Code value can't be empty",
], 404);
} elseif (! $itemCode) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Item code cannot be empty!',
], 404);
}
$plant = Plant::where('code', $plantCode)->first();
$plantId = $plant->id;
if (! $plant) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Plant Code '{$plantCode}' not found!",
], 404);
}
$itemCodeExist = Item::where('code', $itemCode)->first();
if (! $itemCodeExist) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => 'Item code not found',
], 404);
}
$itemCodePlantExist = Item::where('code', $itemCode)->where('plant_id', $plantId)->first();
if (! $itemCodePlantExist) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code not found against plant code '$plantCode'",
], 404);
}
if (empty(trim($itemCodePlantExist->description ?? ''))) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Description is empty in Item Master against item code '$itemCode'.",
], 404);
}
return response()->json([
'status_code' => 'SUCCESS',
'status_description' => [
'description' => $itemCodePlantExist->description,
],
], 200);
}
/**
* Update the specified resource in storage.
*/

View File

@@ -234,3 +234,7 @@ Route::post('file/store', [SapFileController::class, 'store'])->name('file.store
Route::get('/print-pallet/{pallet}/{plant}', [PalletPrintController::class, 'print'])->name('print.pallet');
Route::post('vehicle/entry', [VehicleController::class, 'storeVehicleEntry']);
//..Item Code
Route::get('item-code', [PlantController::class, 'getItemCode']);