@php //function check if a key exists in an array and return the value or return a default value function checkKey($array, $key, $default = null) { return array_key_exists($key, $array) ? $array[$key] : $default; } @endphp
FORMATO 13.1: "REGISTRO DE INVENTARIO PERMANENTE VALORIZADO - DETALLE DEL INVENTARIO VALORIZADO" |
|||||||
PERÍODO: |
{{ $additionalData['period'] }} | @if ($additionalData['month'])
MES: |
{{ $additionalData['month'] }} | @endif||||
RUC: |
{{ $company->number }} | ||||||
APELLIDOS Y NOMBRES, DENOMINACIÓN O RAZÓN SOCIAL: |
{{ $company->name }} | ||||||
ESTABLECIMIENTO (1): |
{{ optional($establishment)->description }} | ||||||
CÓDIGO DE LA EXISTENCIA: |
{{ $additionalData['internal_id'] }} | ||||||
TIPO (TABLA 5): |
01 | ||||||
DESCRIPCIÓN: |
{{ $additionalData['description'] }} | ||||||
CÓDIGO DE LA UNIDAD DE MEDIDA (TABLA 6): |
{{ $additionalData['unit_type_table_six']['code'] }} - {{ $additionalData['unit_type_table_six']['description'] }} | ||||||
MÉTODO DE VALUACIÓN: |
COSTO PROMEDIO |
DOCUMENTO DE TRASLADO, COMPROBANTE DE PAGO, DOCUMENTO DE TRASLADO, COMPROBANTE DE PAGO, DOCUMENTO INTERNO O SIMILAR |
TIPO DE OPERACIÓN (TABLA 12) |
ENTRADAS |
SALIDAS |
SALDO FINAL |
||||||||||||
FECHA |
TIPO (TABLA 10) |
SERIE |
NÚMERO |
{{-- ENTRADAS --}}
CANTIDAD |
COSTO UNITARIO |
COSTO TOTAL |
{{-- SALIDAS --}}
CANTIDAD |
COSTO UNITARIO |
COSTO TOTAL |
{{-- SALDO --}}
CANTIDAD |
COSTO UNITARIO |
COSTO TOTAL |
||||
STOCK INICIAL | {{-- {{ $balance_quantity }} --}} {{ $init_stock }} | {{-- {{ $balance_cost }} --}} {{ $init_cost_unit }} | {{-- {{ $balance_total }} --}} {{ $init_cost_total }} | |||||||||||||
{{ $row['date_of_issue'] }} | {{ $row['document_type_id'] }} | {{ $row['series'] }} | {{ $row['number'] }} | {{ $row['operation_type_code'] }} | {{-- ENTRADAS --}}{{ $row['input_quantity'] }} | {{ $row['input_unit_price'] }} | {{ $row['input_total'] }} | {{-- SALIDAS --}} @if ($row['type'] == 'output'){{ $row['output_quantity'] }} | {{ $row['output_unit_price'] }} | {{ $row['output_total'] }} | @else@endif {{-- SALDO --}} @php // $balance_quantity += $row['quantity'] * $row['factor']; // $balance_total += $row['total'] * $row['factor']; // $balance_cost = ($balance_quantity != 0) ? round($balance_total / $balance_quantity, 4) : null; if ($row['type'] == 'input') { $totals['input_quantity'] += $row['input_quantity']; $totals['input_unit_price'] += $row['input_unit_price']; $totals['input_total'] += $row['input_total']; } else { $totals['output_quantity'] += $row['output_quantity']; $totals['output_unit_price'] += $row['output_unit_price']; $totals['output_total'] += $row['output_total']; } $totals['balance_quantity'] += $row['balance_quantity']; $totals['balance_total'] += $row['balance_total_cost']; $totals['balance_cost'] += $row['balance_unit_cost']; @endphp | {{-- {{ $balance_quantity }} --}} {{ $row['balance_quantity'] }} | {{-- {{ $balance_cost }} --}} {{ $row['balance_unit_cost'] }} | {{-- {{ $balance_total }} --}} {{ $row['balance_total_cost'] }} | ||
TOTALES | {{ checkKey($last_input, 'input_quantity', 0) }} | {{ checkKey($last_input, 'input_unit_price', 0) }} | {{ checkKey($last_input, 'input_total', 0) }} | {{ checkKey($last_output, 'output_quantity', 0) }} | {{ checkKey($last_output, 'output_unit_price', 0) }} | {{ checkKey($last_output, 'output_total', 0) }} | {{ checkKey($last_row, 'balance_quantity', 0) }} | {{ checkKey($last_row, 'balance_unit_cost', 0) }} | {{ checkKey($last_row, 'balance_total_cost', 0) }} | |||||||
TOTALES | {{ $totals['input_quantity'] }} | {{ $totals['input_unit_price'] }} | {{ $totals['input_total'] }} | {{ $totals['output_quantity'] }} | {{ $totals['output_unit_price'] }} | {{ $totals['output_total'] }} | {{ $totals['balance_quantity'] }} | {{ $totals['balance_cost'] }} | {{ $totals['balance_total'] }} |