@php $establishment = $document->establishment; $customer = $document->customer; $invoice = $document->invoice; $document_base = ($document->note) ? $document->note : null; //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css'); $document_number = $document->series.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT); $accounts = \App\Models\Tenant\BankAccount::all(); if($document_base) { $affected_document_number = ($document_base->affected_document) ? $document_base->affected_document->series.'-'.str_pad($document_base->affected_document->number, 8, '0', STR_PAD_LEFT) : $document_base->data_affected_document->series.'-'.str_pad($document_base->data_affected_document->number, 8, '0', STR_PAD_LEFT); } else { $affected_document_number = null; } $payments = $document->payments; $document->load('reference_guides'); $total_payment = $document->payments->sum('payment'); $balance = ($document->total - $total_payment) - $document->payments->sum('change'); //calculate items $allowed_items = 100; $quantity_items = $document->items()->count(); $cycle_items = $allowed_items - ($quantity_items * 3); $total_weight = 0; @endphp {{--{{ $document_number }}--}} {{----}} @inject('itemLotGroup', 'App\Services\ItemLotsGroupService') @if($document->state_type->id == '11')
anulado
@endif @if($company->logo) @else @endif
logo}"))}};base64, {{base64_encode(file_get_contents(public_path("storage/uploads/logos/{$company->logo}")))}}" alt="{{$company->name}}" class="company_logo" style="max-width: 150px;">
{{----}}
@if($company->number=='20601890071')

TEC MED EQUIPOS MEDICOS S.A.C.

Av. Primavera N° 120 Int. B-401
Urb. Chacarilla del Estanque - Santiago de Surco
Email: informes@tecmedequipos.com.pe
Web: www.tecmedequipos.com.pe
Central Telefónica: 01-7688370 Cel: 967 740 056
@else

{{ $company->name }}

{{ ($establishment->address !== '-')? $establishment->address : '' }} {{ ($establishment->district_id !== '-')? ', '.$establishment->district->description : '' }} {{ ($establishment->province_id !== '-')? ', '.$establishment->province->description : '' }} {{ ($establishment->department_id !== '-')? '- '.$establishment->department->description : '' }} @endif @isset($establishment->trade_address)
{{ ($establishment->trade_address !== '-')? 'D. Comercial: '.$establishment->trade_address : '' }}
@endisset
{{ ($establishment->telephone !== '-')? 'Central telefónica: '.$establishment->telephone : '' }}
@isset($establishment->web_address)
{{ ($establishment->web_address !== '-')? 'Web: '.$establishment->web_address : '' }}
@endisset @isset($establishment->aditional_information)
{{ ($establishment->aditional_information !== '-')? $establishment->aditional_information : '' }}
@endisset

{{ 'R.U.C. '.$company->number }}

{{ $document->document_type->description }}


{{ $document_number }}

{{-- --}}
@if(!is_null($document_base)) @endif
Cliente : {{ $customer->name }}
{{$customer->identity_document_type->description}} : {{$customer->number}}
Dirección : @if ($customer->address !== '') {{ $customer->address }} {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }} {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }} {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }} @endif
Condición de Pago : @if($document->payment_condition_id==01) Contado @else Crédito @endif
Moneda : {{ $document->currency_type->description }}
Doc. Afectado : {{ $affected_document_number }}
Tipo de nota : {{ ($document_base->note_type === 'credit')?$document_base->note_credit_type->description:$document_base->note_debit_type->description}}
Descripción : {{ $document_base->note_description }}
@if($invoice) @endif @endif
Fecha de Emisión : {{ $document->date_of_issue->format('Y-m-d') }}
Fecha de Vencimiento : {{$invoice->date_of_due->format('Y-m-d')}}
Vendedor : @if($document->seller->id==2) Zona 0 @endif @if($document->seller->id==3) Zona 1 @endif @if($document->seller->id==4) Zona 2 @endif @if($document->seller->id==5) Administrador @endif @if($document->seller->id==6) Zona 3 @endif @if($document->seller->id==7) Zona 4 @endif @if($document->seller->id==8) Zona 5 @endif @if($document->seller->id==9) Zona 6 @endif
O/C : @if($document->purchase_order) {{ $document->purchase_order }}
Guía de Remisión : @foreach($document->reference_guides as $guide) {{ $guide->series }} - {{ $guide->number }} @endforeach
@foreach($document->items as $row) @endforeach
Código Cant. Unid. Descripción P.V. Unit. Dscto. Importe Total
{{ $row->item->internal_id }} @if(((int)$row->quantity != $row->quantity)) {{ $row->quantity }} @else {{ number_format($row->quantity, 0) }} @endif @if($row->item->unit_type_id=='NIU') UND @else {{ $row->item->unit_type_id }} @endif @if($row->name_product_pdf) {!!$row->name_product_pdf!!} @else {!!$row->item->description!!} @endif @inject('descriptionProduct', 'App\Services\ItemLotsGroupService') @if ($descriptionProduct->getProductSecondName($row->item_id))
{{ $descriptionProduct->getProductSecondName($row->item_id) }} @endif @if ($descriptionProduct->getProductDes($row->item_id))
{{ $descriptionProduct->getProductDes($row->item_id) }} @endif @if (!empty($row->item->presentation)) {!!$row->item->presentation->description!!} @endif @if($row->attributes) @foreach($row->attributes as $attr)
{!! $attr->description !!} : {{ $attr->value }} @endforeach @endif @if($row->discounts) @foreach($row->discounts as $dtos)
{{ $dtos->factor * 100 }}% {{$dtos->description }} @endforeach @endif @if($row->item->is_set == 1)
@inject('itemSet', 'App\Services\ItemSetService') {{join( "-", $itemSet->getItemsSet($row->item_id) )}} @endif
@if(!empty($itemLotGroup->getLote($row->item->IdLoteSelected))) Lote {{ $itemLotGroup->getLote($row->item->IdLoteSelected) }} @endif @if(!empty($itemLotGroup->date_of_due($row->item->IdLoteSelected))) F.V. {{ $itemLotGroup->date_of_due($row->item->IdLoteSelected) }} @endif @if( $row->item->lots )
Series:
    @foreach ($row->item->lots as $l)
  • {{ $l->series }} - {{ $l->date }}
  • @endforeach
@endif
{{ number_format($row->unit_price, 2) }} @if($row->discounts) @php $total_discount_line = 0; foreach ($row->discounts as $disto) { $total_discount_line = $total_discount_line + $disto->amount; } @endphp {{ number_format($total_discount_line, 2) }} @endif {{ number_format($row->total, 2) }}
@for($i = 0; $i < $cycle_items; $i++) @endfor
SON: @foreach(array_reverse( (array) $document->legends) as $row) @if ($row->code == "1000") {{ $row->value }} {{ $document->currency_type->description }} @else {{$row->code}}: {{ $row->value }} @endif @endforeach
Op. Gravadas {{$document->currency_type->symbol}} {{ number_format($document->total_taxed, 2) }}
Op. Inafectas {{$document->currency_type->symbol}} {{ number_format($document->total_unaffected, 2) }}
Op. Exoneradas {{$document->currency_type->symbol}} {{ number_format($document->total_exonerated, 2) }}
Op. Gratuitas {{$document->currency_type->symbol}} {{ number_format($document->total_free, 2) }}
Total Dctos {{$document->currency_type->symbol}} {{ number_format($document->total_discount, 2) }}
IGV {{$document->currency_type->symbol}} {{ number_format($document->total_igv, 2) }}
Total a Pagar {{$document->currency_type->symbol}} {{ number_format($document->total, 2) }}
Observación: @foreach($document->additional_information as $information) @if ($information) {{ $information }}
@endif @endforeach

Depositar en las siguientes cuentas de: {{ $company->name }}

BBVA SOLES 011 194 000100112325 84 BBVA CCI SOLES 011 194 000100112325 84
BBVA DOLARES 0011 0194 0100112090 84 BBVA CCI DOLARES 0011 0194 0100112090 84
BCP SOLES 194-8744823-0-43 BCP CCI SOLES 00219400874482304390
BCP DOLARES 194-8737297-1-3 BCP CCI DOLARES 00219400873729713390
NACION SOLES 01800800000807441035 NACION CCI SOLES 01800800000807441035