@if ($format === 'pdf') @else @endif Inventario @php $configuration = \App\Models\Tenant\Configuration::first(); $configurations = \App\Models\Tenant\Configuration::first(); $company_name = $company->name; $company_owner = null; if ($configurations->trade_name_pdf) { $company_name = $company->trade_name; $company_owner = $company->name; } @endphp
Reporte Inventario
Empresa: {{ $company->name }}
RUC: {{ $company->number }}
Establecimiento: {{ $establishment->address }} - {{ $establishment->department->description }} - {{ $establishment->district->description }}
Fecha: {{ date('d/m/Y') }}
@if ($configuration->is_pharmacy) @endif @php $total_purchase_unit_price = 0; $total_sale_unit_price = 0; $total = 0; $total_profit = 0; $total_all_profit = 0; $total_all_sale = 0; @endphp @foreach ($records as $key => $row) @php Log::debug(json_encode($row)); $total_line = $row['stock'] * $row['purchase_unit_price']; $profit = $row['sale_unit_price'] - $row['purchase_unit_price']; $total += $total_line; $total_profit += $profit; $total_all_profit += (number_format(abs($profit * $row['stock']), 2, '.', '')); $total_all_sale += (number_format(abs($row['sale_unit_price'] * $row['kardex_quantity']), 2, '.', '')); $profit = number_format($profit, 2, '.', ''); $total_purchase_unit_price += $row['purchase_unit_price']; $total_sale_unit_price += $row['sale_unit_price']; $rowUnitText = \App\Models\Tenant\UnitMeasure::where('code', $row['unit_type_id'])->first()->description; $stockText = $row['stock'].' '.$rowUnitText; @endphp > @if ($configuration->is_pharmacy) @endif @foreach ($row['item_unit_types'] as $item_unit_type) @php $stockVariation = floor($row['stock'] / $item_unit_type['quantity_unit']); $rowUnitText2 = \App\Models\Tenant\UnitMeasure::where('code', $item_unit_type['unit_type_id'])->first()->description; $stockText = $stockVariation.' '.$rowUnitText2.' y '.($row['stock'] - ($stockVariation * $item_unit_type['quantity_unit'])) . $rowUnitText; $total_line = $stockVariation * $row['purchase_unit_price']; $profit = $item_unit_type['base_unit_price'] - $row['purchase_unit_price']; $total += $total_line; $total_profit += $profit; $total_all_profit += (number_format(abs($profit * $row['stock']), 2, '.', '')); $profit = number_format($profit, 2, '.', ''); $total_purchase_unit_price += $row['purchase_unit_price']; $total_sale_unit_price += $item_unit_type['base_unit_price']; $total_all_sale += (number_format(abs($item_unit_type['base_unit_price'] * $item_unit_type['total_quantity']), 2, '.', '')); @endphp @if ($configuration->is_pharmacy) @endif 1 @endforeach @endforeach @if ($configuration->is_pharmacy) @endif @if ($configuration->is_pharmacy) @endif
# Cod. de barras Cod. Interno Nombre Descripción CategoriaLaboratorio Registro sanitario LotesUnidad de medida Factor de conversion Stock mínimo Stock total Stock actual Vendidos Costo Costo Total Precio de venta por presentación Ganancia Ganancia Total Total de venta Marca Modelo F. vencimiento Almacén
{{ $loop->iteration }}{{ $row['barcode'] }} {{ $row['internal_id'] }} {{ $row['name'] }} @php $description = $row['description']; $item = \App\Models\Tenant\Item::where('internal_id', $row['internal_id'])->first(); if ($item) { $description = $item->name; } @endphp {{$description}} {{ $row['item_category_name'] }}{{ $row['laboratory'] }} {{ $row['num_reg_san'] }} @foreach ($row['lots_group'] as $lot) {{ $lot['code'] }}
{{ $lot['date_of_due'] }} @endforeach
{{ $rowUnitText }} {{ 1 }} {{ $row['stock_min'] }} {{ $stockText }} {{ $row['stock'] }} {{ $row['kardex_quantity'] }} {{ $row['purchase_unit_price'] }} {{ $total_line }} {{ $row['sale_unit_price'] }} {{ $profit }} {{ number_format(abs($profit * $row['stock']), 2, '.', '') }} {{ number_format(abs($row['sale_unit_price'] * $row['kardex_quantity']), 2, '.', '') }} {{ $row['brand_name'] }} {{ $row['model'] }} {{ $row['date_of_due'] }} {{ $row['warehouse_name'] }}
- {{ $item_unit_type['barcode'] }} {{ $item_unit_type['id'] }} {{ $item_unit_type['description'] }} - {{ $row['item_category_name'] }}{{ $row['laboratory'] }} {{ $row['num_reg_san'] }} @foreach ($row['lots_group'] as $lot) {{ $lot['code'] }}
{{ $lot['date_of_due'] }} @endforeach
{{ $rowUnitText2 }} {{ $item_unit_type['quantity_unit'] }} {{ $row['stock_min'] }} {{ $stockText }} {{ $stockVariation }} {{ $item_unit_type['total_quantity'] }} {{ $row['purchase_unit_price'] }}{{ $total_line }} {{ $item_unit_type['base_unit_price'] }} {{ $profit }} {{ number_format(abs($profit * $row['stock']), 2, '.', '') }} {{ number_format(abs($item_unit_type['base_unit_price'] * $item_unit_type['total_quantity']), 2, '.', '') }} {{ $row['brand_name'] }} {{ $row['model'] }} {{ $row['date_of_due'] }} {{ $row['warehouse_name'] }}
Costo Costo Total de Inventario Precio de venta Ganancia Ganancia Total Venta Total
{{ number_format($total_purchase_unit_price, 2, '.', '') }} {{ $total }} {{ number_format($total_sale_unit_price, 2, '.', '') }} S/ {{ number_format($total_profit, 2, '.', '') }} S/ {{ number_format($total_all_profit, 2, '.', '') }} S/ {{ number_format($total_all_sale, 2, '.', '') }}