Added audio in panel box inspection stock page #1306

Merged
jothi merged 1 commits from ranjith-dev into master 2026-10-26 05:36:19 +00:00
2 changed files with 19 additions and 1 deletions

View File

@@ -450,9 +450,10 @@ class PanelBoxInspectionStock extends Page
if ($serialExists) { if ($serialExists) {
Notification::make() Notification::make()
->title('Duplicate Serial Number') ->title('Duplicate Serial Number')
->body("Serial number already exists '$serialNumber' with supplier number '$supplier'.") ->body("Serial number already exists '$serialNumber' with supplier number '$supplier'.<br>Please scan this serial number in Invoice Validation.")
->danger() ->danger()
->send(); ->send();
$this->dispatch('play-error-sound');
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'line_id' => $lineId, 'line_id' => $lineId,

View File

@@ -6,4 +6,21 @@
</div> </div>
</div> </div>
<audio id="error-sound" src="{{ asset('sounds/scan_serial_tamil.mp3') }}" preload="auto"></audio>
<script>
document.addEventListener('livewire:init', () => {
Livewire.on('play-error-sound', () => {
const audio = document.getElementById('error-sound');
if (audio) {
audio.currentTime = 0;
audio.play().catch(error => {
console.log('Could not play error sound:', error);
});
}
});
});
</script>
</x-filament-panels::page> </x-filament-panels::page>