@extends('tenant.layouts.app') @section('content')

Consulta kardex

@if(!empty($reports) && $reports->count())
@if(isset($reports))
{{csrf_field()}}
{{csrf_field()}}
@endif
@foreach($reports as $key => $value) @php if($value->inventory_kardexable_type == $models[3]){ if(!$value->inventory_kardexable->type){ $transaction = Modules\Inventory\Models\InventoryTransaction::findOrFail($value->inventory_kardexable->inventory_transaction_id); } } @endphp @php $balance += $value->quantity; @endphp @endforeach
# Fecha y hora transacción Tipo transacción Número Feha emisión Entrada Salida Saldo
{{$loop->iteration}} {{$value->created_at}} @switch($value->inventory_kardexable_type) @case($models[0]) {{($value->quantity < 0) ? "Venta":"Anulación Venta"}} @break @case($models[1]) {{($value->quantity < 0) ? "Anulación Compra":"Compra"}} @break @case($models[2]) {{"Nota de venta"}} @break @case($models[3]) {{$value->inventory_kardexable->description}} @break @endswitch @switch($value->inventory_kardexable_type) @case($models[0]) {{ optional($value->inventory_kardexable)->series.'-'.optional($value->inventory_kardexable)->number }} @break @case($models[1]) {{ optional($value->inventory_kardexable)->series.'-'.optional($value->inventory_kardexable)->number }} @break @case($models[2]) {{ optional($value->inventory_kardexable)->prefix.'-'.optional($value->inventory_kardexable)->id }} @break @case($models[3]) {{"-"}} @break @endswitch @switch($value->inventory_kardexable_type) @case($models[0]) {{ isset($value->inventory_kardexable->date_of_issue) ? $value->inventory_kardexable->date_of_issue->format('Y-m-d') : '' }} @break @case($models[1]) {{ isset($value->inventory_kardexable->date_of_issue) ? $value->inventory_kardexable->date_of_issue->format('Y-m-d') : '' }} @break @case($models[2]) {{ isset($value->inventory_kardexable->date_of_issue) ? $value->inventory_kardexable->date_of_issue->format('Y-m-d') : '' }} @break @case($models[3]) {{"-"}} @break @endswitch @switch($value->inventory_kardexable_type) @case($models[0]) {{ ($value->quantity > 0) ? $value->quantity:"-"}} @break @case($models[1]) {{ ($value->quantity > 0) ? $value->quantity:"-"}} @break @case($models[3]) @if($value->inventory_kardexable->type != null) {{ ($value->inventory_kardexable->type == 1) ? $value->quantity : "-" }} @else {{($transaction->type == 'input') ? $value->quantity : "-" }} @endif @break @default {{"-"}} @break @endswitch @switch($value->inventory_kardexable_type) @case($models[0]) {{ ($value->quantity < 0) ? $value->quantity:"-" }} @break @case($models[1]) {{ ($value->quantity < 0) ? $value->quantity:"-"}} @break @case($models[2]) {{ $value->quantity }} @break @case($models[3]) @if($value->inventory_kardexable->type != null) {{($value->inventory_kardexable->type == 2 || $value->inventory_kardexable->type == 3) ? $value->quantity : "-" }} @else {{($transaction->type == 'output') ? $value->quantity : "-" }} @endif @break @default {{"-"}} @break @endswitch {{number_format($balance, 4)}}
Total {{$reports->total()}}
@else
No se encontraron registros
@endif
@endsection @push('scripts') @endpush