PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/app/CoreFacturalo/Templates/pdf/dispatch_place_2/sale_note_a4.blade.php

https://gitlab.com/laher01/factu40
PHP | 238 lines | 230 code | 7 blank | 1 comment | 2 complexity | c897889d8ce8d63a18a17d8c8f6c23d7 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-left py-2">DESPACHO</th>
  111. <th class="border-top-bottom text-right py-2" width="12%">P.UNIT</th>
  112. <th class="border-top-bottom text-right py-2" width="8%">DTO.</th>
  113. <th class="border-top-bottom text-right py-2" width="12%">TOTAL</th>
  114. </tr>
  115. </thead>
  116. <tbody>
  117. @foreach($document->items as $row)
  118. <tr>
  119. <td class="text-center align-top">
  120. @if(((int)$row->quantity != $row->quantity))
  121. {{ $row->quantity }}
  122. @else
  123. {{ number_format($row->quantity, 0) }}
  124. @endif
  125. </td>
  126. <td class="text-center align-top">{{ $row->item->unit_type_id }}</td>
  127. <td class="text-left">
  128. {!!$row->item->description!!} @if (!empty($row->item->presentation)) {!!$row->item->presentation->description!!} @endif
  129. @if($row->attributes)
  130. @foreach($row->attributes as $attr)
  131. <br/><span style="font-size: 9px">{!! $attr->description !!} : {{ $attr->value }}</span>
  132. @endforeach
  133. @endif
  134. @if($row->discounts)
  135. @foreach($row->discounts as $dtos)
  136. <br/><span style="font-size: 9px">{{ $dtos->factor * 100 }}% {{$dtos->description }}</span>
  137. @endforeach
  138. @endif
  139. @if($row->item->is_set == 1)
  140. <br>
  141. @inject('itemSet', 'App\Services\ItemSetService')
  142. {{join( "-", $itemSet->getItemsSet($row->item_id) )}}
  143. @endif
  144. </td>
  145. <td class="text-left">
  146. @if ($row->warehouse)<b>{!!$row->warehouse->description!!}</b> @endif
  147. </td>
  148. <td class="text-right align-top">{{ number_format($row->unit_price, 2) }}</td>
  149. <td class="text-right align-top">
  150. @if($row->discounts)
  151. @php
  152. $total_discount_line = 0;
  153. foreach ($row->discounts as $disto) {
  154. $total_discount_line = $total_discount_line + $disto->amount;
  155. }
  156. @endphp
  157. {{ number_format($total_discount_line, 2) }}
  158. @else
  159. 0
  160. @endif
  161. </td>
  162. <td class="text-right align-top">{{ number_format($row->total, 2) }}</td>
  163. </tr>
  164. <tr>
  165. <td colspan="7" class="border-bottom"></td>
  166. </tr>
  167. @endforeach
  168. @if($document->total_exportation > 0)
  169. <tr>
  170. <td colspan="6" class="text-right font-bold">OP. EXPORTACIÓN: {{ $document->currency_type->symbol }}</td>
  171. <td class="text-right font-bold">{{ number_format($document->total_exportation, 2) }}</td>
  172. </tr>
  173. @endif
  174. @if($document->total_free > 0)
  175. <tr>
  176. <td colspan="6" class="text-right font-bold">OP. GRATUITAS: {{ $document->currency_type->symbol }}</td>
  177. <td class="text-right font-bold">{{ number_format($document->total_free, 2) }}</td>
  178. </tr>
  179. @endif
  180. @if($document->total_unaffected > 0)
  181. <tr>
  182. <td colspan="6" class="text-right font-bold">OP. INAFECTAS: {{ $document->currency_type->symbol }}</td>
  183. <td class="text-right font-bold">{{ number_format($document->total_unaffected, 2) }}</td>
  184. </tr>
  185. @endif
  186. @if($document->total_exonerated > 0)
  187. <tr>
  188. <td colspan="6" class="text-right font-bold">OP. EXONERADAS: {{ $document->currency_type->symbol }}</td>
  189. <td class="text-right font-bold">{{ number_format($document->total_exonerated, 2) }}</td>
  190. </tr>
  191. @endif
  192. @if($document->total_taxed > 0)
  193. <tr>
  194. <td colspan="6" class="text-right font-bold">OP. GRAVADAS: {{ $document->currency_type->symbol }}</td>
  195. <td class="text-right font-bold">{{ number_format($document->total_taxed, 2) }}</td>
  196. </tr>
  197. @endif
  198. @if($document->total_discount > 0)
  199. <tr>
  200. <td colspan="6" class="text-right font-bold">{{(($document->total_prepayment > 0) ? 'ANTICIPO':'DESCUENTO TOTAL')}}: {{ $document->currency_type->symbol }}</td>
  201. <td class="text-right font-bold">{{ number_format($document->total_discount, 2) }}</td>
  202. </tr>
  203. @endif
  204. {{--<tr>
  205. <td colspan="6" class="text-right font-bold">IGV: {{ $document->currency_type->symbol }}</td>
  206. <td class="text-right font-bold">{{ number_format($document->total_igv, 2) }}</td>
  207. </tr>--}}
  208. <tr>
  209. <td colspan="6" class="text-right font-bold">TOTAL A PAGAR: {{ $document->currency_type->symbol }}</td>
  210. <td class="text-right font-bold">{{ number_format($document->total, 2) }}</td>
  211. </tr>
  212. </tbody>
  213. </table>
  214. <table class="full-width">
  215. <tr>
  216. <td>
  217. <strong>PAGOS:</strong> </td></tr>
  218. @php
  219. $payment = 0;
  220. @endphp
  221. @foreach($payments as $row)
  222. <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>
  223. @php
  224. $payment += (float) $row->payment;
  225. @endphp
  226. @endforeach
  227. <tr><td><strong>SALDO:</strong> {{ $document->currency_type->symbol }} {{ number_format($document->total - $payment, 2) }}</td>
  228. </tr>
  229. </table>
  230. </body>
  231. </html>