Organizando y comenzando con interfaces
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<div>
|
||||
<form wire:submit.prevent="save" class="grid lg:grid-cols-[repeat(4,minmax(0,2fr))_1fr] gap-2 mb-4 items-end">
|
||||
<x-select.styled label="Tipo Documento" :options="$this->tipos" wire:model="tipo" id="tipo" required
|
||||
searchable invalidate/>
|
||||
<x-input label="Nº Documento" wire:model="numero" invalidate/>
|
||||
<x-input label="Descripción" wire:model="descripcion" invalidate/>
|
||||
<x-input label="Total" wire:model="valor" invalidate/>
|
||||
|
||||
<x-button type="submit">
|
||||
@if($this->currentEgreso)
|
||||
Guardar
|
||||
@else
|
||||
Agregar
|
||||
@endif
|
||||
</x-button>
|
||||
|
||||
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('tipo'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('numero'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('descripcion'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('valor'){{$message}}@enderror
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows">
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" wire:click="edit('{{$row->id}}')" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
|
||||
<div class="mt-4">
|
||||
<p class="text-xl">Egresos Totales: <span class="font-bold">{{$this->totalEgresos}}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,51 @@
|
||||
<div>
|
||||
<form wire:submit.prevent="save" class="grid lg:grid-cols-[repeat(4,minmax(0,2fr))_1fr] gap-2 mb-4 items-end">
|
||||
<x-select.styled label="Tipo Documento" :options="$this->tipos" wire:model="tipo" required searchable
|
||||
invalidate/>
|
||||
<x-input type="number" label="Documento Inicial" wire:model="ingreso_inicial" min="0" invalidate/>
|
||||
<x-input type="number" label="Documento Final" wire:model="ingreso_final" min="0" invalidate/>
|
||||
<x-input type="number" label="Total" wire:model="total" min="0" invalidate/>
|
||||
|
||||
<x-button type="submit">
|
||||
@if($this->currentIngreso)
|
||||
Guardar
|
||||
@else
|
||||
Agregar
|
||||
@endif
|
||||
</x-button>
|
||||
|
||||
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('tipo'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('ingreso_inicial'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('ingreso_final'){{$message}}@enderror
|
||||
</p>
|
||||
<p class="text-sm font-medium text-red-500">
|
||||
@error('total'){{$message}}@enderror
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows">
|
||||
@interact('column_ingreso_inicial', $row)
|
||||
{{\Illuminate\Support\Number::format($row->ingreso_inicial)}}
|
||||
@endinteract
|
||||
@interact('column_ingreso_final', $row)
|
||||
{{\Illuminate\Support\Number::format($row->ingreso_final)}}
|
||||
@endinteract
|
||||
@interact('column_total', $row)
|
||||
{{\Illuminate\Support\Number::currency($row->total)}}
|
||||
@endinteract
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" wire:click="edit('{{$row->id}}')" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
|
||||
<div class="mt-4">
|
||||
<p class="text-xl">Ingresos Totales: <span class="font-bold">{{$this->totalIngresos}}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
47
resources/views/livewire/cajas/edit.blade.php
Normal file
47
resources/views/livewire/cajas/edit.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<div>
|
||||
<div class="flex gap-2 justify-between items-baseline">
|
||||
<x-title>
|
||||
{{$this->turno ? "Editar caja" : "Registrar Caja"}}
|
||||
</x-title>
|
||||
|
||||
<x-button icon="arrow-left" color="secondary" href="{{route('cajas.index')}}">
|
||||
Volver
|
||||
</x-button>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-8 mb-4">
|
||||
<div>
|
||||
<x-label>Fecha</x-label>
|
||||
<p class="font-bold text-secondary">{{$turno->fecha->format('d-m-Y')}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<x-label>Fecha</x-label>
|
||||
<p class="font-bold text-secondary">{{$turno->numero_caja}}</p>
|
||||
</div>
|
||||
<div>
|
||||
<x-label>Turno</x-label>
|
||||
<p class="font-bold text-secondary">{{$turno->numero_turno}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-tab wire:model="tab">
|
||||
<x-tab.items tab="Ingresos">
|
||||
<x-slot:left>
|
||||
<x-icon name="plus" class="w-4 h-4"/>
|
||||
</x-slot:left>
|
||||
<livewire:cajas.components.ingresos-component :turno="$turno"/>
|
||||
</x-tab.items>
|
||||
<x-tab.items tab="Egresos">
|
||||
<x-slot:left>
|
||||
<x-icon name="minus" class="w-4 h-4"/>
|
||||
</x-slot:left>
|
||||
<livewire:cajas.components.egresos-component :turno="$turno"/>
|
||||
</x-tab.items>
|
||||
<x-tab.items tab="Arqueo">
|
||||
<x-slot:left>
|
||||
<x-icon name="plus-minus" class="w-4 h-4"/>
|
||||
</x-slot:left>
|
||||
Arqueo
|
||||
</x-tab.items>
|
||||
</x-tab>
|
||||
</div>
|
||||
@@ -1,3 +1,29 @@
|
||||
<div>
|
||||
<p> Knowing others is intelligence; knowing yourself is true wisdom. </p>
|
||||
</div>
|
||||
<x-title>Cajas</x-title>
|
||||
|
||||
<div class="flex gap-2 justify-between items-end">
|
||||
<x-date label="Fecha" helpers/>
|
||||
<x-button wire:click="createTurno" icon="plus">Registrar Caja</x-button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<x-table striped :headers="$this->headers" :rows="$this->rows" paginate :$sort>
|
||||
@interact('column_action', $row)
|
||||
<x-button.circle icon="edit" :href="route('cajas.edit', $row->id)" :key="uniqid()"/>
|
||||
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
|
||||
@endinteract
|
||||
</x-table>
|
||||
</div>
|
||||
|
||||
<x-modal title="Registrar Caja" wire center blur>
|
||||
<div class="flex flex-col gap-2">
|
||||
<x-date label="Fecha" wire:model="fecha" format="DD-MM-YYYY"/>
|
||||
<x-input type="number" label="Caja" wire:model="caja"/>
|
||||
<x-input type="number" label="Turno" wire:model="turno"/>
|
||||
</div>
|
||||
<x-slot:footer>
|
||||
<x-button color="secondary" icon="arrow-left" wire:click="closeTurnoModal">Volver</x-button>
|
||||
<x-button icon="plus" wire:click="storeTurno">Registrar Caja</x-button>
|
||||
</x-slot:footer>
|
||||
</x-modal>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user