{!! '<'.'?xml version="1.0" encoding="utf-8" standalone="no"?'.'>' !!} 2.0 1.1 {{ $document->identifier }} {{ $document->date_of_reference->format('Y-m-d') }} {{ $document->date_of_issue->format('Y-m-d') }} {{ config('configuration.signature_uri') }} {{ config('configuration.signature_note') }} {{ $company->number }} trade_name }}]]> #{{ config('configuration.signature_uri') }} {{ $company->number }} 6 name }}]]> @foreach($document->documents as $row) @php $doc = $row->document; if (!$doc) continue; $summary_affectation = '10'; if ((float) ($doc->total_ivap ?? 0) > 0) { $summary_affectation = '17'; } elseif ((float) $doc->total_taxed > 0) { $summary_affectation = '10'; } elseif ((float) $doc->total_exonerated > 0) { $summary_affectation = '20'; } elseif ((float) $doc->total_unaffected > 0) { $summary_affectation = '30'; } elseif ((float) $doc->total_exportation > 0) { $summary_affectation = '40'; } elseif ((float) $doc->total_free > 0) { $summary_affectation = '11'; } $summary_percent = number_format(18, 2, '.', ''); $summary_taxable_amount = 0; if ($summary_affectation === '17' || $summary_affectation === '10') { $summary_taxable_amount = $doc->total_taxed; } elseif ($summary_affectation === '20') { $summary_taxable_amount = $doc->total_exonerated; } elseif ($summary_affectation === '30') { $summary_taxable_amount = $doc->total_unaffected; } elseif ($summary_affectation === '40') { $summary_taxable_amount = $doc->total_exportation; } else { $summary_taxable_amount = $doc->total_free; } @endphp {{ $loop->iteration }} {{ $doc->document_type_id }} {{ $doc->series }}-{{ $doc->number }} {{ $doc->customer->number }} {{ $doc->customer->identity_document_type_id }} @if(in_array($doc->document_type_id, ['07', '08'])) @php($affected_document = ($doc->note->affected_document) ? $doc->note->affected_document : $doc->note->data_affected_document) {{ $affected_document->series }}-{{ $affected_document->number }} {{ $affected_document->document_type_id }} @endif @if($doc->perception) @php($perception = $doc->perception) {{ $perception->code }} {{ $perception->percentage }} {{ $perception->amount }} {{ round((float)$perception->base + (float)$perception->amount, 2) }} {{ $perception->base }} @endif {{ $document->summary_status_type_id }} {{ $doc->total }} @if($doc->total_taxed > 0) {{ $doc->total_taxed }} 01 @endif @if($doc->total_exonerated > 0) {{ $doc->total_exonerated }} 02 @endif @if($doc->total_unaffected > 0) {{ $doc->total_unaffected }} 03 @endif @if($doc->total_exportation > 0) {{ $doc->total_exportation }} 04 @endif @if($doc->total_free > 0) {{ $doc->total_free }} 05 @endif @if($doc->total_charges > 0) true {{ $doc->total_charges }} @endif @if($doc->total_ivap > 0) {{ $doc->total_ivap }} {{ $summary_taxable_amount }} {{ $doc->total_ivap }} {{ $summary_percent }} {{ $summary_affectation }} 1016 IVAP VAT @endif {{ $doc->total_igv }} {{ $summary_taxable_amount }} {{ $doc->total_igv }} {{ $summary_percent }} {{ $summary_affectation }} 1000 IGV VAT @if($doc->total_isc > 0) {{ $doc->total_isc }} {{$doc->total_isc }} 2000 ISC EXC @endif @if($doc->total_other_taxes > 0) {{ $doc->total_other_taxes }} {{ $doc->total_other_taxes }} 9999 OTROS OTH @endif @if($doc->total_plastic_bag_taxes > 0) {{ $doc->total_plastic_bag_taxes }} {{ $doc->total_plastic_bag_taxes }} 7152 ICBPER OTH @endif @endforeach