Files
qds/app/Livewire/StickerValidation.php
dhanabalan 2f593326e5
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Larastan / larastan (pull_request) Failing after 2m8s
Laravel Pint / pint (pull_request) Failing after 2m23s
Added sticker validation livewire pages
2025-12-30 14:28:49 +05:30

66 lines
1.6 KiB
PHP

<?php
namespace App\Livewire;
use App\Models\ProductionQuantity;
use Livewire\Component;
class StickerValidation extends Component
{
public $plantId;
public $refNumber;
public $serialNumber;
public bool $materialInvoice = false;
public $records = [];
protected $listeners = [
'refreshEmptySticker' => 'loadStickerData',
'addStickerToList' => 'loadSticker'
];
public function loadStickerData($plantId, $refNumber)
{
$this->plantId = $plantId;
$this->refNumber = $refNumber;
// $this->records = ProductionQuantity::where('plant_id', $plantId)
// ->where('production_order', $refNumber)
// ->orderBy('created_at', 'asc')
// ->get(['serial_number', 'operator_id']);
$this->records = ProductionQuantity::query()
->where('production_quantities.plant_id', $plantId)
->where('production_quantities.production_order', $refNumber)
->leftJoin(
'sticker_validations',
'sticker_validations.serial_number',
'=',
'production_quantities.serial_number'
)
->orderBy('production_quantities.created_at', 'asc')
->get([
'production_quantities.serial_number',
'production_quantities.operator_id',
'sticker_validations.status',
'sticker_validations.sticker_id',
])
->map(function ($row) {
$row->status = $row->status ?? '';
return $row;
});
//dd($this->records);
}
public function render()
{
return view('livewire.sticker-validation');
}
}