This commit is contained in:
Dwi Swandhana
2026-05-07 19:29:23 +07:00
parent b6f2e66729
commit 35d8211a65
2 changed files with 5 additions and 8 deletions
+4 -7
View File
@@ -18,7 +18,7 @@ class GudangPos extends Component
use WithPagination;
public string $tanggal = '';
public ?int $penerimaId = null;
public ?string $penerimaId = null;
public string $scan = '';
public string $selectedKode = '';
@@ -36,7 +36,7 @@ class GudangPos extends Component
public function mount(): void
{
$this->tanggal = date('Y-m-d');
$this->penerimaId = User::orderBy('nama', 'ASC')->value('id');
$this->penerimaId = User::orderBy('nama', 'ASC')->value('nama');
}
public function updatingSearch(): void
@@ -201,10 +201,7 @@ class GudangPos extends Component
return;
}
$penerima = User::select('id', 'nama')->find($this->penerimaId);
if (!$penerima) {
$penerima = $penerimaId;
}
$penerima = $this->penerimaId;
$service = app(SimbhpStockService::class);
@@ -264,7 +261,7 @@ class GudangPos extends Component
'tanggal' => (int) $date->format('d'),
'bulan' => (int) $date->format('m'),
'tahun' => (int) $date->format('Y'),
'deskripsi' => 'Diterima oleh ' . ($penerima->nama ?? $penerimaId),
'deskripsi' => 'Diterima oleh ' . ($penerima ?? $penerimaId),
'pemasukan' => null,
'pengeluaran' => (int) $row['qty'],
'qty_base' => (int) $row['qty_base'],
@@ -88,7 +88,7 @@
<label>Penerima</label>
<select class="form-control" wire:model.live="penerimaId">
@foreach($users as $u)
<option value="{{ $u->id }}">{{ $u->nama }}</option>
<option value="{{ $u->nama }}">{{ $u->nama }}</option>
@endforeach
@foreach($ruangans as $ruang)
<option value="{{ $ruang->ruangan }}">{{ $ruang->ruangan }}</option>