Merge pull request 'ranjith-dev' (#470) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #470
This commit was merged in pull request #470.
This commit is contained in:
@@ -328,7 +328,7 @@ class StockDataMasterResource extends Resource
|
|||||||
->reactive()
|
->reactive()
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||||
$set('sticker_master_id', null);
|
$set('sticker_master_id', null);
|
||||||
$set('operator_id', null);
|
$set('updated_by', null);
|
||||||
}),
|
}),
|
||||||
TextInput::make('location')
|
TextInput::make('location')
|
||||||
->label('Location')
|
->label('Location')
|
||||||
@@ -388,7 +388,7 @@ class StockDataMasterResource extends Resource
|
|||||||
->native(false),
|
->native(false),
|
||||||
])
|
])
|
||||||
->query(function ($query, array $data) {
|
->query(function ($query, array $data) {
|
||||||
if (!isset($data['type']) && (empty($data['Plant']) && empty($data['invoice_number']) && empty($data['serial_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['operator_id']) && empty($data['scanned_status']) && empty($data['sticker_master_id']))) {
|
if (!isset($data['type']) && (empty($data['Plant']) && empty($data['location']) && empty($data['serial_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['scanned_status']) && empty($data['sticker_master_id']))) {
|
||||||
|
|
||||||
if (empty($data['type'])) {
|
if (empty($data['type'])) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
@@ -399,6 +399,8 @@ class StockDataMasterResource extends Resource
|
|||||||
return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($data['type'] != ''){
|
||||||
|
|
||||||
if ($data['type'] == '0') {
|
if ($data['type'] == '0') {
|
||||||
|
|
||||||
$query->where('type', '0');
|
$query->where('type', '0');
|
||||||
@@ -437,6 +439,24 @@ class StockDataMasterResource extends Resource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ($data['scanned_status']) {
|
||||||
|
|
||||||
|
if ($data['scanned_status'] == 'Scanned') {
|
||||||
|
|
||||||
|
$query->whereNotNull('scanned_status')
|
||||||
|
->where('scanned_status', '!=', '');
|
||||||
|
|
||||||
|
} elseif ($data['scanned_status'] == 'Pending') {
|
||||||
|
|
||||||
|
$query->where(function ($q) {
|
||||||
|
$q->whereNull('scanned_status')
|
||||||
|
->orWhere('scanned_status', '!=', 'Scanned');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
|
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
|
||||||
$query->where('plant_id', $data['Plant']);
|
$query->where('plant_id', $data['Plant']);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Livewire;
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use App\Models\DuplicateStock;
|
||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
use App\Models\NotInStock;
|
use App\Models\NotInStock;
|
||||||
use App\Models\StickerMaster;
|
use App\Models\StickerMaster;
|
||||||
@@ -65,7 +66,8 @@ class StockDataTable extends Component
|
|||||||
'refreshSfgNonData' => 'loadSfgNonQuanData',
|
'refreshSfgNonData' => 'loadSfgNonQuanData',
|
||||||
'confirmStockUpdate',
|
'confirmStockUpdate',
|
||||||
'confirmSerialUpdate',
|
'confirmSerialUpdate',
|
||||||
'confirmSerialFGUpdate'
|
'confirmSerialFGUpdate',
|
||||||
|
'confirmDuplicateUpdate'
|
||||||
];
|
];
|
||||||
|
|
||||||
public $capacitorInput = '';
|
public $capacitorInput = '';
|
||||||
@@ -170,6 +172,43 @@ class StockDataTable extends Component
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function confirmDuplicateUpdate($plantId, $location, $bin, $serial_number, $stickerMasterId, $batch, $docNo, $quantity)
|
||||||
|
{
|
||||||
|
$sNo = $serial_number;
|
||||||
|
$stockRecord = StockDataMaster::where('serial_number', $sNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$stockRecord) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$record = DuplicateStock::where('stock_data_master_id', $stockRecord->id)->first();
|
||||||
|
|
||||||
|
if (!$record) {
|
||||||
|
|
||||||
|
DuplicateStock::create([
|
||||||
|
'stock_data_master_id' => $stockRecord->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
Notification::make()
|
||||||
|
->title('Record inserted successfully in duplicate stock table.')
|
||||||
|
->success()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
DuplicateStock::create([
|
||||||
|
'stock_data_master_id' => $stockRecord->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
Notification::make()
|
||||||
|
->title('Record inserted successfully in duplicate stock table.')
|
||||||
|
->success()
|
||||||
|
->send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function confirmSerialFGUpdate($plantId, $location, $bin, $sNo, $stickerMasterId)
|
public function confirmSerialFGUpdate($plantId, $location, $bin, $sNo, $stickerMasterId)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration
|
||||||
|
|||||||
Reference in New Issue
Block a user