PageRenderTime 40ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/app/CoreFacturalo/Templates/pdf/modelw80/quotation_a4.blade.php

https://gitlab.com/laher01/factu40
PHP | 221 lines | 218 code | 2 blank | 1 comment | 1 complexity | 1d3fce283814200700f3bfd9952a9db0 MD5 | raw file
  1. @php
  2. $establishment = $document->establishment;
  3. $customer = $document->customer;
  4. //$path_style = app_path('CoreFacturalo'.DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR.'style.css');
  5. $tittle = $document->prefix.'-'.str_pad($document->id, 8, '0', STR_PAD_LEFT);
  6. @endphp
  7. <html>
  8. <head>
  9. {{--<title>{{ $tittle }}</title>--}}
  10. {{--<link href="{{ $path_style }}" rel="stylesheet" />--}}
  11. </head>
  12. <body>
  13. <table class="full-width">
  14. <tr>
  15. @if($company->logo)
  16. <td width="20%">
  17. <div class="company_logo_box">
  18. <img src="data:{{mime_content_type(public_path("storage/uploads/logos/{$company->logo}"))}};base64, {{base64_encode(file_get_contents(public_path("storage/uploads/logos/{$company->logo}")))}}" alt="{{$company->name}}" class="company_logo" style="max-width: 150px;">
  19. </div>
  20. </td>
  21. @else
  22. <td width="20%">
  23. {{--<img src="{{ asset('logo/logo.jpg') }}" class="company_logo" style="max-width: 150px">--}}
  24. </td>
  25. @endif
  26. <td width="50%" class="pl-3">
  27. <div class="text-left">
  28. <h4 class="">{{ $company->name }}</h4>
  29. <h5>{{ 'RUC '.$company->number }}</h5>
  30. <h6>
  31. {{ ($establishment->address !== '-')? $establishment->address : '' }}
  32. {{ ($establishment->district_id !== '-')? ', '.$establishment->district->description : '' }}
  33. {{ ($establishment->province_id !== '-')? ', '.$establishment->province->description : '' }}
  34. {{ ($establishment->department_id !== '-')? '- '.$establishment->department->description : '' }}
  35. </h6>
  36. <h6>{{ ($establishment->email !== '-')? $establishment->email : '' }}</h6>
  37. <h6>{{ ($establishment->telephone !== '-')? $establishment->telephone : '' }}</h6>
  38. </div>
  39. </td>
  40. <td width="30%" class="border-box py-4 px-2 text-center">
  41. <h5 class="text-center">COTIZACIÓN</h5>
  42. <h3 class="text-center">{{ $tittle }}</h3>
  43. </td>
  44. </tr>
  45. </table>
  46. <table class="full-width mt-5">
  47. <tr>
  48. <td width="15%">Cliente:</td>
  49. <td width="45%">{{ $customer->name }}</td>
  50. <td width="25%">Fecha de emisión:</td>
  51. <td width="15%">{{ $document->date_of_issue->format('Y-m-d') }}</td>
  52. </tr>
  53. <tr>
  54. <td>{{ $customer->identity_document_type->description }}:</td>
  55. <td>{{ $customer->number }}</td>
  56. </tr>
  57. @if ($customer->address !== '')
  58. <tr>
  59. <td class="align-top">Dirección:</td>
  60. <td colspan="3">
  61. {{ $customer->address }}
  62. {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }}
  63. {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }}
  64. {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }}
  65. </td>
  66. </tr>
  67. @endif
  68. </table>
  69. <table class="full-width mt-3">
  70. @if ($document->description)
  71. <tr>
  72. <td width="15%" class="align-top">Descripción: </td>
  73. <td width="85%">{{ $document->description }}</td>
  74. </tr>
  75. @endif
  76. </table>
  77. {{-- <table class="full-width mt-3">
  78. @if ($document->purchase_order)
  79. <tr>
  80. <td width="25%">Orden de Compra: </td>
  81. <td>:</td>
  82. <td class="text-left">{{ $document->purchase_order }}</td>
  83. </tr>
  84. @endif
  85. </table> --}}
  86. @if ($document->guides)
  87. <br/>
  88. {{--<strong>Guías:</strong>--}}
  89. <table>
  90. @foreach($document->guides as $guide)
  91. <tr>
  92. @if(isset($guide->document_type_description))
  93. <td>{{ $guide->document_type_description }}</td>
  94. @else
  95. <td>{{ $guide->document_type_id }}</td>
  96. @endif
  97. <td>:</td>
  98. <td>{{ $guide->number }}</td>
  99. </tr>
  100. @endforeach
  101. </table>
  102. @endif
  103. <table class="full-width mt-10 mb-10">
  104. <thead class="">
  105. <tr class="bg-grey">
  106. <th class="border-top-bottom text-center py-2" width="8%">CANT.</th>
  107. <th class="border-top-bottom text-center py-2" width="8%">UNIDAD</th>
  108. <th class="border-top-bottom text-left py-2">DESCRIPCIÓN</th>
  109. <th class="border-top-bottom text-right py-2" width="12%">P.UNIT</th>
  110. <th class="border-top-bottom text-right py-2" width="8%">DTO.</th>
  111. <th class="border-top-bottom text-right py-2" width="12%">TOTAL</th>
  112. </tr>
  113. </thead>
  114. <tbody>
  115. @foreach($document->items as $row)
  116. <tr>
  117. <td class="text-center align-top">
  118. @if(((int)$row->quantity != $row->quantity))
  119. {{ $row->quantity }}
  120. @else
  121. {{ number_format($row->quantity, 0) }}
  122. @endif
  123. </td>
  124. <td class="text-center align-top">{{ $row->item->unit_type_id }}</td>
  125. <td class="text-left">
  126. @if($row->item->name_product_pdf ?? false) {!!$row->item->name_product_pdf ?? ''!!} @else {!!$row->item->description!!} @endif @if (!empty($row->item->presentation)) {!!$row->item->presentation->description!!} @endif
  127. @if($row->attributes)
  128. @foreach($row->attributes as $attr)
  129. <br/><span style="font-size: 9px">{!! $attr->description !!} : {{ $attr->value }}</span>
  130. @endforeach
  131. @endif
  132. @if($row->discounts)
  133. @foreach($row->discounts as $dtos)
  134. <br/><span style="font-size: 9px">{{ $dtos->factor * 100 }}% {{$dtos->description }}</span>
  135. @endforeach
  136. @endif
  137. </td>
  138. <td class="text-right align-top">{{ number_format($row->unit_price, 2) }}</td>
  139. <td class="text-right align-top">
  140. @if($row->discounts)
  141. @php
  142. $total_discount_line = 0;
  143. foreach ($row->discounts as $disto) {
  144. $total_discount_line = $total_discount_line + $disto->amount;
  145. }
  146. @endphp
  147. {{ number_format($total_discount_line, 2) }}
  148. @else
  149. 0
  150. @endif
  151. </td>
  152. <td class="text-right align-top">{{ number_format($row->total, 2) }}</td>
  153. </tr>
  154. <tr>
  155. <td colspan="6" class="border-bottom"></td>
  156. </tr>
  157. @endforeach
  158. @if($document->total_exportation > 0)
  159. <tr>
  160. <td colspan="5" class="text-right font-bold">OP. EXPORTACIÓN: {{ $document->currency_type->symbol }}</td>
  161. <td class="text-right font-bold">{{ number_format($document->total_exportation, 2) }}</td>
  162. </tr>
  163. @endif
  164. @if($document->total_free > 0)
  165. <tr>
  166. <td colspan="5" class="text-right font-bold">OP. GRATUITAS: {{ $document->currency_type->symbol }}</td>
  167. <td class="text-right font-bold">{{ number_format($document->total_free, 2) }}</td>
  168. </tr>
  169. @endif
  170. @if($document->total_unaffected > 0)
  171. <tr>
  172. <td colspan="5" class="text-right font-bold">OP. INAFECTAS: {{ $document->currency_type->symbol }}</td>
  173. <td class="text-right font-bold">{{ number_format($document->total_unaffected, 2) }}</td>
  174. </tr>
  175. @endif
  176. @if($document->total_exonerated > 0)
  177. <tr>
  178. <td colspan="5" class="text-right font-bold">OP. EXONERADAS: {{ $document->currency_type->symbol }}</td>
  179. <td class="text-right font-bold">{{ number_format($document->total_exonerated, 2) }}</td>
  180. </tr>
  181. @endif
  182. @if($document->total_taxed > 0)
  183. <tr>
  184. <td colspan="5" class="text-right font-bold">OP. GRAVADAS: {{ $document->currency_type->symbol }}</td>
  185. <td class="text-right font-bold">{{ number_format($document->total_taxed, 2) }}</td>
  186. </tr>
  187. @endif
  188. @if($document->total_discount > 0)
  189. <tr>
  190. <td colspan="5" class="text-right font-bold">{{(($document->total_prepayment > 0) ? 'ANTICIPO':'DESCUENTO TOTAL')}}: {{ $document->currency_type->symbol }}</td>
  191. <td class="text-right font-bold">{{ number_format($document->total_discount, 2) }}</td>
  192. </tr>
  193. @endif
  194. <tr>
  195. <td colspan="5" class="text-right font-bold">IGV: {{ $document->currency_type->symbol }}</td>
  196. <td class="text-right font-bold">{{ number_format($document->total_igv, 2) }}</td>
  197. </tr>
  198. <tr>
  199. <td colspan="5" class="text-right font-bold">TOTAL A PAGAR: {{ $document->currency_type->symbol }}</td>
  200. <td class="text-right font-bold">{{ number_format($document->total, 2) }}</td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <table class="full-width">
  205. <tr>
  206. {{-- <td width="65%">
  207. @foreach($document->legends as $row)
  208. <p>Son: <span class="font-bold">{{ $row->value }} {{ $document->currency_type->description }}</span></p>
  209. @endforeach
  210. <br/>
  211. <strong>Información adicional</strong>
  212. @foreach($document->additional_information as $information)
  213. <p>{{ $information }}</p>
  214. @endforeach
  215. </td> --}}
  216. </tr>
  217. </table>
  218. </body>
  219. </html>