Added filters and duplicate confirmation in cycle count page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 2m43s
Laravel Larastan / larastan (pull_request) Failing after 3m58s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 2m43s
Laravel Larastan / larastan (pull_request) Failing after 3m58s
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,33 +399,53 @@ class StockDataMasterResource extends Resource
|
|||||||
return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['type'] == '0') {
|
if($data['type'] != ''){
|
||||||
|
|
||||||
$query->where('type', '0');
|
if ($data['type'] == '0') {
|
||||||
|
|
||||||
if (!empty($data['scanned_status'])) {
|
$query->where('type', '0');
|
||||||
|
|
||||||
|
if (!empty($data['scanned_status'])) {
|
||||||
|
|
||||||
|
if ($data['scanned_status'] == 'Scanned') {
|
||||||
|
$query->whereNotNull('scanned_status')
|
||||||
|
->where('scanned_status', '!=', '');
|
||||||
|
} elseif ($data['scanned_status'] == 'Pending') {
|
||||||
|
|
||||||
|
$query->where(function ($query) {
|
||||||
|
$query->whereNull('scanned_status')
|
||||||
|
->orWhere('scanned_status', '!=', 'Scanned');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($data['type'] == '1') {
|
||||||
|
$query->where('type', '1')
|
||||||
|
->whereNotNull('quantity');
|
||||||
|
|
||||||
|
if ($data['scanned_status']) {
|
||||||
|
|
||||||
|
if ($data['scanned_status'] == 'Scanned') {
|
||||||
|
|
||||||
if ($data['scanned_status'] == 'Scanned') {
|
|
||||||
$query->whereNotNull('scanned_status')
|
$query->whereNotNull('scanned_status')
|
||||||
->where('scanned_status', '!=', '');
|
->where('scanned_status', '!=', '');
|
||||||
} elseif ($data['scanned_status'] == 'Pending') {
|
|
||||||
|
|
||||||
$query->where(function ($query) {
|
} elseif ($data['scanned_status'] == 'Pending') {
|
||||||
$query->whereNull('scanned_status')
|
|
||||||
|
$query->where(function ($q) {
|
||||||
|
$q->whereNull('scanned_status')
|
||||||
->orWhere('scanned_status', '!=', 'Scanned');
|
->orWhere('scanned_status', '!=', 'Scanned');
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($data['type'] == '1') {
|
}
|
||||||
$query->where('type', '1')
|
else{
|
||||||
->whereNotNull('quantity');
|
|
||||||
|
|
||||||
if ($data['scanned_status']) {
|
if ($data['scanned_status']) {
|
||||||
|
|
||||||
if ($data['scanned_status'] == 'Scanned') {
|
if ($data['scanned_status'] == 'Scanned') {
|
||||||
|
|
||||||
$query->whereNotNull('scanned_status')
|
$query->whereNotNull('scanned_status')
|
||||||
->where('scanned_status', '!=', '');
|
->where('scanned_status', '!=', '');
|
||||||
|
|
||||||
} elseif ($data['scanned_status'] == 'Pending') {
|
} elseif ($data['scanned_status'] == 'Pending') {
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user