PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 1ms

/app/CoreFacturalo/Templates/pdf/font_sm/sale_note_a5.blade.php

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