fix(cog): memperbaiki kondisi untuk show harga jual

This commit is contained in:
Yoga Pangestu 2025-11-17 21:56:53 +07:00
parent 44697030f8
commit 88217e548e
6 changed files with 15 additions and 12 deletions

View File

@ -66,7 +66,7 @@ public function columns(): array
->searchable() ->searchable()
->sortable() ->sortable()
->html() ->html()
->hideIf(auth()->user()->cannot('view cogs')), ->hideIf(! auth()->user()->hasRole(['Developer', 'Owner'])),
Column::make('Harga Jual', 'sale_price') Column::make('Harga Jual', 'sale_price')
->label(fn ($row, $column) => currency($row->sale_price, 'Rp')) ->label(fn ($row, $column) => currency($row->sale_price, 'Rp'))

View File

@ -76,7 +76,7 @@ public function columns(): array
->searchable() ->searchable()
->sortable() ->sortable()
->html() ->html()
->hideIf(auth()->user()->cannot('view cogs')), ->hideIf(! auth()->user()->hasRole(['Developer', 'Owner'])),
Column::make('Harga Jual', 'sale_price') Column::make('Harga Jual', 'sale_price')
->label(fn ($row, $column) => currency($row->sale_price, 'Rp')) ->label(fn ($row, $column) => currency($row->sale_price, 'Rp'))

View File

@ -65,7 +65,7 @@ public function columns(): array
->searchable() ->searchable()
->sortable() ->sortable()
->html() ->html()
->hideIf(auth()->user()->cannot('view cogs')), ->hideIf(! auth()->user()->hasRole(['Developer', 'Owner'])),
Column::make('Harga Jual', 'sale_price') Column::make('Harga Jual', 'sale_price')
->label(fn ($row, $column) => currency($row->sale_price, 'Rp')) ->label(fn ($row, $column) => currency($row->sale_price, 'Rp'))

View File

@ -32,18 +32,19 @@
<flux:error name="form.size" /> <flux:error name="form.size" />
</flux:field> </flux:field>
@can('view cogs') @if (auth()->user()->hasRole(['Developer', 'Owner']))
<flux:field> <flux:field>
<flux:label>Harga Beli <span class="text-red-500 ms-1">*</span></flux:label> <flux:label>Harga Beli <span class="text-red-500 ms-1">*</span></flux:label>
<flux:input.group> <flux:input.group>
<flux:input.group.prefix>Rp</flux:input.group.prefix> <flux:input.group.prefix>Rp</flux:input.group.prefix>
<flux:input placeholder="Masukkan harga beli" <flux:input placeholder="Masukkan harga beli"
x-mask:dynamic="$money($input, ',')" x-mask:dynamic="$money($input, ',')"
wire:model.live.debounce.500ms="form.cost_price" autocomplete="off" /> wire:model.live.debounce.500ms="form.cost_price"
autocomplete="off" />
</flux:input.group> </flux:input.group>
<flux:error name="form.cost_price" /> <flux:error name="form.cost_price" />
</flux:field> </flux:field>
@endcan @endif
<flux:field <flux:field
class="col-span-{{ auth()->user()->hasRole(['Developer', 'Owner'])? '1': '2' }}"> class="col-span-{{ auth()->user()->hasRole(['Developer', 'Owner'])? '1': '2' }}">

View File

@ -43,19 +43,20 @@ class="grid grid-cols-1 md:grid-cols-{{ auth()->user()->hasRole(['Developer', 'O
@endforeach @endforeach
</flux:select> </flux:select>
@can('view cogs') @if (auth()->user()->hasRole(['Developer', 'Owner']))
<flux:field> <flux:field>
<flux:label>Harga Beli <span class="text-red-500 ms-1">*</span> <flux:label>Harga Beli <span class="text-red-500 ms-1">*</span>
</flux:label> </flux:label>
<flux:input.group> <flux:input.group>
<flux:input.group.prefix>Rp</flux:input.group.prefix> <flux:input.group.prefix>Rp</flux:input.group.prefix>
<flux:input placeholder="xxx" x-mask:dynamic="$money($input, ',')" <flux:input placeholder="xxx"
x-mask:dynamic="$money($input, ',')"
wire:model.live.debounce.500ms="form.cost_price" wire:model.live.debounce.500ms="form.cost_price"
autocomplete="off" /> autocomplete="off" />
</flux:input.group> </flux:input.group>
<flux:error name="form.cost_price" /> <flux:error name="form.cost_price" />
</flux:field> </flux:field>
@endcan @endif
<flux:field> <flux:field>
<flux:label>Harga Jual <span class="text-red-500 ms-1">*</span> <flux:label>Harga Jual <span class="text-red-500 ms-1">*</span>

View File

@ -32,18 +32,19 @@
<flux:error name="form.sku" /> <flux:error name="form.sku" />
</flux:field> </flux:field>
@can('view cogs') @if (auth()->user()->hasRole(['Developer', 'Owner']))
<flux:field> <flux:field>
<flux:label>Harga Beli <span class="text-red-500 ms-1">*</span></flux:label> <flux:label>Harga Beli <span class="text-red-500 ms-1">*</span></flux:label>
<flux:input.group> <flux:input.group>
<flux:input.group.prefix>Rp</flux:input.group.prefix> <flux:input.group.prefix>Rp</flux:input.group.prefix>
<flux:input placeholder="Masukkan harga beli" <flux:input placeholder="Masukkan harga beli"
x-mask:dynamic="$money($input, ',')" x-mask:dynamic="$money($input, ',')"
wire:model.live.debounce.500ms="form.cost_price" autocomplete="off" /> wire:model.live.debounce.500ms="form.cost_price"
autocomplete="off" />
</flux:input.group> </flux:input.group>
<flux:error name="form.cost_price" /> <flux:error name="form.cost_price" />
</flux:field> </flux:field>
@endcan @endif
<flux:field <flux:field
class="col-span-{{ auth()->user()->hasRole(['Developer', 'Owner'])? '1': '2' }}"> class="col-span-{{ auth()->user()->hasRole(['Developer', 'Owner'])? '1': '2' }}">