Compare commits
21 Commits
164a1becac
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 105295350b | |||
|
|
41d31fcf3d | ||
| ac1ca537ef | |||
|
|
5e86a51fa5 | ||
| 207527491e | |||
|
|
188cfdac4d | ||
| 7aa244886b | |||
|
|
8f3dfbc290 | ||
| 5189ece56b | |||
|
|
a294ca3ef0 | ||
| bbecb86dc3 | |||
|
|
fdc0aed31c | ||
| a3cec9db06 | |||
|
|
947aacb074 | ||
| 0c6331282e | |||
|
|
b7b5db068b | ||
| 7d8b2d8632 | |||
|
|
d42ae70e46 | ||
|
|
be2e7b00d7 | ||
| 7276765aa4 | |||
|
|
1ce7995105 |
@@ -39,8 +39,6 @@ class ProductionCharacteristicExporter extends Exporter
|
|||||||
->label('OBSERVED VALUE'),
|
->label('OBSERVED VALUE'),
|
||||||
ExportColumn::make('status')
|
ExportColumn::make('status')
|
||||||
->label('STATUS'),
|
->label('STATUS'),
|
||||||
ExportColumn::make('inspection_status')
|
|
||||||
->label('INSPECTION STATUS'),
|
|
||||||
ExportColumn::make('remark')
|
ExportColumn::make('remark')
|
||||||
->label('REMARK'),
|
->label('REMARK'),
|
||||||
ExportColumn::make('created_at')
|
ExportColumn::make('created_at')
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ class CycleCount extends Page
|
|||||||
$operatorName = $user->name;
|
$operatorName = $user->name;
|
||||||
|
|
||||||
$pattern1 = '/^[^#]*#[^#]*#[^#]*#[^#]*#$/';
|
$pattern1 = '/^[^#]*#[^#]*#[^#]*#[^#]*#$/';
|
||||||
$pattern2 = '/^[^|]*\|[^|]*\|[^|]*$/';
|
// $pattern2 = '/^[^|]*\|[^|]*\|[^|]*$/';
|
||||||
|
$pattern2 = '/^[^|]+\|[^|]+(?:\|[^|]*)?$/';
|
||||||
$pattern3 = '/^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPp])?\|?$/';
|
$pattern3 = '/^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPp])?\|?$/';
|
||||||
|
|
||||||
// $pattern2 = '/^[^|]+\|[^|]+\|[^|]+\|?$/'; Optional Pipeline at end
|
// $pattern2 = '/^[^|]+\|[^|]+\|[^|]+\|?$/'; Optional Pipeline at end
|
||||||
@@ -678,7 +679,7 @@ class CycleCount extends Page
|
|||||||
$stock->update([
|
$stock->update([
|
||||||
'bin' => $bin,
|
'bin' => $bin,
|
||||||
'batch' => $this->batch,
|
'batch' => $this->batch,
|
||||||
// 'doc_no' =>$this->docNo,
|
'doc_no' =>$this->docNo,
|
||||||
'scanned_quantity' => $newScannedQty,
|
'scanned_quantity' => $newScannedQty,
|
||||||
'scanned_status' => $status,
|
'scanned_status' => $status,
|
||||||
]);
|
]);
|
||||||
@@ -721,6 +722,13 @@ class CycleCount extends Page
|
|||||||
$parts = explode('|', $value);
|
$parts = explode('|', $value);
|
||||||
|
|
||||||
$this->itemCode = $parts[0] ?? null;
|
$this->itemCode = $parts[0] ?? null;
|
||||||
|
|
||||||
|
if (count($parts) == 2) {
|
||||||
|
// Format: itemcode|serialnumber
|
||||||
|
$this->sNo = $parts[1];
|
||||||
|
$this->batch = null;
|
||||||
|
} else {
|
||||||
|
// Format: itemcode|value1|value2
|
||||||
if (strlen($parts[1]) > strlen($parts[2])) {
|
if (strlen($parts[1]) > strlen($parts[2])) {
|
||||||
$this->sNo = $parts[1];
|
$this->sNo = $parts[1];
|
||||||
$this->batch = $parts[2];
|
$this->batch = $parts[2];
|
||||||
@@ -728,6 +736,14 @@ class CycleCount extends Page
|
|||||||
$this->batch = $parts[1];
|
$this->batch = $parts[1];
|
||||||
$this->sNo = $parts[2];
|
$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) {
|
if (strlen($this->itemCode) < 6) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
@@ -759,7 +775,7 @@ class CycleCount extends Page
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} elseif (strlen($this->batch) < 5) {
|
} elseif (count($parts) !== 2 && strlen($this->batch) < 5) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Unknown Batch')
|
->title('Unknown Batch')
|
||||||
->body("Batch should contain minimum 5 digits '$this->batch'")
|
->body("Batch should contain minimum 5 digits '$this->batch'")
|
||||||
@@ -927,7 +943,7 @@ class CycleCount extends Page
|
|||||||
'bin' => $bin,
|
'bin' => $bin,
|
||||||
'serial_number' => $this->sNo,
|
'serial_number' => $this->sNo,
|
||||||
'stickerMasterId' => $stickerMasterId,
|
'stickerMasterId' => $stickerMasterId,
|
||||||
'batch' => $this->batch,
|
'batch' => $this->batch ?? null,
|
||||||
'docNo' => $this->docNo,
|
'docNo' => $this->docNo,
|
||||||
'quantity' => $this->quantity,
|
'quantity' => $this->quantity,
|
||||||
]),
|
]),
|
||||||
@@ -1240,7 +1256,7 @@ class CycleCount extends Page
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($serialAgaPlant->batch != '' || $serialAgaPlant->batch != null) {
|
if (count($parts) !== 2 && ($serialAgaPlant->batch != '' || $serialAgaPlant->batch != null)){
|
||||||
|
|
||||||
if ($serialAgaPlant->batch != $this->batch) {
|
if ($serialAgaPlant->batch != $this->batch) {
|
||||||
|
|
||||||
@@ -1396,7 +1412,7 @@ class CycleCount extends Page
|
|||||||
'bin' => $bin,
|
'bin' => $bin,
|
||||||
'serial_number' => $this->sNo,
|
'serial_number' => $this->sNo,
|
||||||
'stickerMasterId' => $stickerMasterId,
|
'stickerMasterId' => $stickerMasterId,
|
||||||
'batch' => $this->batch,
|
'batch' => $this->batch ?? null,
|
||||||
'docNo' => $this->docNo,
|
'docNo' => $this->docNo,
|
||||||
'quantity' => $this->quantity,
|
'quantity' => $this->quantity,
|
||||||
]),
|
]),
|
||||||
@@ -1415,8 +1431,8 @@ class CycleCount extends Page
|
|||||||
|
|
||||||
$serial->update([
|
$serial->update([
|
||||||
'bin' => $bin ?? null,
|
'bin' => $bin ?? null,
|
||||||
'batch' => $this->batch ?? null,
|
'batch' => count($parts) !== 2 ? $this->batch : $serial->batch,
|
||||||
'doc_no' => $this->docNo ?? null,
|
// 'doc_no' => $this->docNo ?? null,
|
||||||
'scanned_status' => 'Scanned',
|
'scanned_status' => 'Scanned',
|
||||||
'scanned_quantity' => '1',
|
'scanned_quantity' => '1',
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
@@ -2132,6 +2148,7 @@ class CycleCount extends Page
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Item;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
use Illuminate\Http\Request;
|
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.
|
* Update the specified resource in storage.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -307,7 +307,7 @@
|
|||||||
max-width: <?php echo $isilogoMaxWidth; ?>mm;
|
max-width: <?php echo $isilogoMaxWidth; ?>mm;
|
||||||
left: 71mm;"> --}}
|
left: 71mm;"> --}}
|
||||||
<img src="{{ $qrBase64 }}"
|
<img src="{{ $qrBase64 }}"
|
||||||
style="position: absolute; bottom: 1.2mm; right: 2mm; width: 8mm; height: 7.2mm;">
|
style="position: absolute; bottom: 0.8mm; right: 2mm; width: 8mm; height: 7.8mm;">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,17 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: 5pt;
|
right: 5pt;
|
||||||
top: 8pt;
|
top: 8pt;
|
||||||
|
/* width: 69pt; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.po-long {
|
||||||
|
font-size: 8pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left !important;
|
||||||
|
position: absolute;
|
||||||
|
right: 5pt;
|
||||||
|
top: 8pt;
|
||||||
|
width: 69pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .desc {
|
/* .desc {
|
||||||
@@ -108,7 +119,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="text">
|
<td class="text">
|
||||||
<div class="serial">{{ $sticker['serial'] }}</div>
|
<div class="serial">{{ $sticker['serial'] }}</div>
|
||||||
<div class="po">{{ $sticker['production_order'] }}</div>
|
{{-- <div class="po">{{ $sticker['production_order'] }}</div> --}}
|
||||||
|
<div class="{{ strlen($sticker['serial']) > 14 ? 'po-long' : 'po' }}">
|
||||||
|
{{ $sticker['production_order'] }}
|
||||||
|
</div>
|
||||||
<div class="desc">{{ $sticker['description'] }}</div>
|
<div class="desc">{{ $sticker['description'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -79,6 +79,16 @@
|
|||||||
top: 8pt;
|
top: 8pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.po-long {
|
||||||
|
font-size: 8pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left !important;
|
||||||
|
position: absolute;
|
||||||
|
right: 5pt;
|
||||||
|
top: 8pt;
|
||||||
|
width: 45pt;
|
||||||
|
}
|
||||||
|
|
||||||
/* .desc {
|
/* .desc {
|
||||||
font-size: 6pt;
|
font-size: 6pt;
|
||||||
margin-left: -5pt;
|
margin-left: -5pt;
|
||||||
@@ -108,7 +118,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="text">
|
<td class="text">
|
||||||
<div class="serial">{{ $sticker['serial'] }}</div>
|
<div class="serial">{{ $sticker['serial'] }}</div>
|
||||||
<div class="po">{{ $sticker['production_order'] }}</div>
|
{{-- <div class="po">{{ $sticker['production_order'] }}</div> --}}
|
||||||
|
<div class="{{ strlen($sticker['serial']) > 14 ? 'po-long' : 'po' }}">
|
||||||
|
{{ $sticker['production_order'] }}
|
||||||
|
</div>
|
||||||
<div class="desc">{{ $sticker['description'] }}</div>
|
<div class="desc">{{ $sticker['description'] }}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -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::get('/print-pallet/{pallet}/{plant}', [PalletPrintController::class, 'print'])->name('print.pallet');
|
||||||
|
|
||||||
Route::post('vehicle/entry', [VehicleController::class, 'storeVehicleEntry']);
|
Route::post('vehicle/entry', [VehicleController::class, 'storeVehicleEntry']);
|
||||||
|
|
||||||
|
//..Item Code
|
||||||
|
|
||||||
|
Route::get('item-code', [PlantController::class, 'getItemCode']);
|
||||||
|
|||||||
Reference in New Issue
Block a user