PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/app/CoreFacturalo/Templates/pdf/default2/perception.blade.php

https://gitlab.com/laher01/factu40
PHP | 327 lines | 322 code | 0 blank | 5 comment | 2 complexity | 68a076d506cb8a7ec3284791c00e84fd MD5 | raw file
  1. @php
  2. $establishment = $document->establishment;
  3. $customer = $document->customer;
  4. $details = $document->details;
  5. $document_base = $document->invoice;
  6. //$optional = $document->optional;
  7. $document_number = $document->series.'-'.str_pad($document->number, 8, '0', STR_PAD_LEFT);
  8. $document_type_description_array = [
  9. '01' => 'FACTURA',
  10. '03' => 'BOLETA DE VENTA',
  11. '07' => 'NOTA DE CREDITO',
  12. '08' => 'NOTA DE DEBITO',
  13. ];
  14. $identity_document_type_description_array = [
  15. '-' => 'S/D',
  16. '0' => 'S/D',
  17. '1' => 'DNI',
  18. '6' => 'RUC',
  19. ];
  20. //$document_type_description = $document_type_description_array[$document->document_type_code];
  21. @endphp
  22. <html>
  23. <head>
  24. <title>{{ $document_number }}</title>
  25. <style>
  26. html {
  27. font-family: sans-serif;
  28. font-size: 12px;
  29. }
  30. .text-center {
  31. text-align: center;
  32. }
  33. .text-right {
  34. text-align: right;
  35. }
  36. .font-xsm {
  37. font-size: 10px;
  38. }
  39. .font-sm {
  40. font-size: 12px;
  41. }
  42. .font-lg {
  43. font-size: 13px;
  44. }
  45. .font-xlg {
  46. font-size: 16px;
  47. }
  48. .font-xxlg {
  49. font-size: 22px;
  50. }
  51. .font-bold {
  52. font-weight: bold;
  53. }
  54. table {
  55. width: 100%;
  56. border-spacing: 0;
  57. }
  58. .voucher-company-right {
  59. border: 1px solid #333;
  60. padding-top: 15px;
  61. padding-bottom: 15px;
  62. margin-bottom: 10px;
  63. }
  64. .voucher-company-right tbody tr:first-child td {
  65. padding-top: 10px;
  66. }
  67. .voucher-company-right tbody tr:last-child td {
  68. padding-bottom: 10px;
  69. }
  70. .voucher-information {
  71. border: 1px solid #333;
  72. }
  73. .voucher-information.top-note, .voucher-information.top-note tbody tr td {
  74. border-top: 0;
  75. }
  76. .voucher-information tbody tr td {
  77. padding-top: 5px;
  78. padding-bottom: 5px;
  79. vertical-align: top;
  80. }
  81. .voucher-information-left tbody tr td {
  82. padding: 3px 10px;
  83. vertical-align: top;
  84. }
  85. .voucher-information-right tbody tr td {
  86. padding: 3px 10px;
  87. vertical-align: top;
  88. }
  89. .voucher-details {
  90. }
  91. .voucher-details thead {
  92. background-color: #f5f5f5;
  93. }
  94. .voucher-details thead tr th {
  95. /*border-top: 1px solid #333;*/
  96. /*border-bottom: 1px solid #333;*/
  97. padding: 5px 10px;
  98. }
  99. .voucher-details thead tr th:first-child {
  100. border-left: 1px solid #333;
  101. }
  102. .voucher-details thead tr th:last-child {
  103. border-right: 1px solid #333;
  104. }
  105. .voucher-details tbody tr td {
  106. /*border-bottom: 1px solid #333;*/
  107. }
  108. .voucher-details tbody tr td:first-child {
  109. border-left: 1px solid #333;
  110. }
  111. .voucher-details tbody tr td:last-child {
  112. border-right: 1px solid #333;
  113. }
  114. .voucher-details tbody tr td {
  115. padding: 5px 10px;
  116. vertical-align: middle;
  117. }
  118. .voucher-details tfoot tr td {
  119. padding: 3px 10px;
  120. }
  121. .voucher-totals {
  122. margin-top: 10px;
  123. margin-bottom: 10px;
  124. }
  125. .voucher-totals tbody tr td {
  126. padding: 3px 10px;
  127. vertical-align: top;
  128. }
  129. .voucher-footer {
  130. margin-bottom: 30px;
  131. }
  132. .voucher-footer tbody tr td{
  133. border-top: 1px solid #333;
  134. padding: 3px 10px;
  135. }
  136. .company_logo {
  137. min-width: 150px;
  138. max-width: 100%;
  139. height: auto;
  140. }
  141. .pt-1 {
  142. padding-top: 1rem;
  143. }
  144. </style>
  145. </head>
  146. <body>
  147. <table class="voucher-company">
  148. <tr>
  149. @if($company->logo)
  150. <td width="25%">
  151. <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">
  152. </td>
  153. @else
  154. <td width="20%">
  155. <img src="{{ asset('logo/logo.jpg') }}" alt="" class="company_logo" style="max-width: 200px">
  156. </td>
  157. @endif
  158. <td width="100%">
  159. <table class="voucher-company-left">
  160. <tbody>
  161. <tr><td class="text-left font-xxlg font-bold">{{ $company->name }}</td></tr>
  162. <tr><td class="text-left font-xl font-bold">{{ 'RUC '.$company->number }}</td></tr>
  163. @if($establishment)
  164. <tr><td class="text-left font-lg">{{ $establishment->address }}</td></tr>
  165. <tr><td class="text-left font-lg">{{ ($establishment->email != '-')? $establishment->email : '' }}</td></tr>
  166. <tr><td class="text-left font-lg font-bold">{{ ($establishment->telephone != '-')? $establishment->telephone : '' }}</td></tr>
  167. @endif
  168. </tbody>
  169. </table>
  170. </td>
  171. <td width="30%">
  172. <table class="voucher-company-right">
  173. <tbody>
  174. <tr><td class="text-center font-lg">{{ $document->document_type->description }}</td></tr>
  175. <tr><td class="text-center font-xlg font-bold">{{ $document_number }}</td></tr>
  176. </tbody>
  177. </table>
  178. </td>
  179. </tr>
  180. </table>
  181. <table class="voucher-information">
  182. <tr>
  183. <td width="55%">
  184. <table class="voucher-information-left">
  185. <tbody>
  186. <tr>
  187. <td width="50%">Fecha de emisión: </td>
  188. <td width="50%">{{ $document->date_of_issue->format('d/m/Y') }}</td>
  189. </tr>
  190. @if($document_base->date_of_due)
  191. <tr>
  192. <td width="50%">Fecha de vencimiento: </td>
  193. <td width="50%">{{ $document_base->date_of_due->format('d/m/Y') }}</td>
  194. </tr>
  195. @endif
  196. <tr>
  197. <td width="20%">Cliente:</td>
  198. <td width="80%">{{ $customer->name }}</td>
  199. </tr>
  200. <tr>
  201. <td width="20%">{{ $customer->identity_document_type->description }}:</td>
  202. <td width="80%">{{ $customer->number }}</td>
  203. </tr>
  204. @if ($customer->address !== '')
  205. <tr>
  206. <td width="20%">Dirección:</td>
  207. <td width="80%">{{ $customer->address }}</td>
  208. </tr>
  209. @endif
  210. </tbody>
  211. </table>
  212. </td>
  213. <td width="45%">
  214. <table class="voucher-information-right">
  215. <tbody>
  216. @if ($document->purchase_order)
  217. <tr>
  218. <td width="50%">Orden de Compra: </td>
  219. <td width="50%">{{ $document->purchase_order }}</td>
  220. </tr>
  221. @endif
  222. @if ($document->guides)
  223. @foreach($document->guides as $guide)
  224. <tr>
  225. <td>{{ $guide->document_type_id }}</td>
  226. <td>{{ $guide->number }}</td>
  227. </tr>
  228. @endforeach
  229. @endif
  230. </tbody>
  231. </table>
  232. </td>
  233. </tr>
  234. </table>
  235. <table class="voucher-details">
  236. <thead>
  237. <tr>
  238. <th class="text-center" width="80px">CANT.</th>
  239. <th width="60px">UNIDAD</th>
  240. <th>DESCRIPCIÓN</th>
  241. <th class="text-right" width="80px">P.UNIT</th>
  242. <th class="text-right" width="80px">TOTAL</th>
  243. </tr>
  244. </thead>
  245. <tbody>
  246. @foreach($details as $row)
  247. <tr>
  248. <td class="text-center">{{ $row->quantity }}</td>
  249. <td>{{ $row->item->unit_type_id }}</td>
  250. <td>
  251. {!! $row->item->description !!}
  252. @if($row->attributes)
  253. @foreach($row->attributes as $attr)
  254. <br/>{!! $attr->name !!} : {{ $attr->value }}
  255. @endforeach
  256. @endif
  257. </td>
  258. <td class="text-right" >{{ number_format($row->unit_price, 2) }}</td>
  259. <td class="text-right">{{ number_format($row->total, 2) }}</td>
  260. </tr>
  261. @endforeach
  262. </tbody>
  263. <tfoot style="border-top: 1px solid #333;">
  264. <tr>
  265. <td colspan="5" class="font-lg font-bold" style="padding-top: 2rem;">Son: {{ $document->number_to_letter }} {{ $document->currency_type->description }}</td>
  266. </tr>
  267. </tfoot>
  268. </table>
  269. <table class="voucher-totals">
  270. <tbody>
  271. <tr>
  272. <td width="35%">
  273. <table class="voucher-totals-left">
  274. {{--<tbody>--}}
  275. <tr>
  276. <td class="text-center">
  277. <img class="qr_code" src="data:image/png;base64, {{ $document->qr }}" />
  278. </td>
  279. </tr>
  280. <tr><td class="text-center">Código Hash</td></tr>
  281. <tr><td class="text-center">{{ $document->hash }}</td></tr>
  282. {{--</tbody>--}}
  283. </table>
  284. </td>
  285. <td width="65%">
  286. <table class="voucher-totals-right">
  287. <tbody>
  288. @if($document->total_free > 0)
  289. <tr>
  290. <td class="text-right font-lg font-bold" width="70%">OP. GRATUITAS: {{ $document->currency_type->symbol }}</td>
  291. <td class="text-right font-lg font-bold" width="30%">{{ number_format($document->total_free, 2) }}</td>
  292. </tr>
  293. @endif
  294. @if($document->total_unaffected > 0)
  295. <tr>
  296. <td class="text-right font-lg font-bold" width="70%">OP. INAFECTAS: {{ $document->currency_type->symbol }}</td>
  297. <td class="text-right font-lg font-bold" width="30%">{{ number_format($document->total_unaffected, 2) }}</td>
  298. </tr>
  299. @endif
  300. @if($document->total_exonerated > 0)
  301. <tr>
  302. <td class="text-right font-lg font-bold" width="70%">OP. EXONERADAS: {{ $document->currency_type->symbol }}</td>
  303. <td class="text-right font-lg font-bold" width="30%">{{ number_format($document->total_exonerated, 2) }}</td>
  304. </tr>
  305. @endif
  306. @if($document->total_taxed > 0)
  307. <tr>
  308. <td class="text-right font-lg font-bold" width="70%">OP. GRAVADAS: {{ $document->currency_type->symbol }}</td>
  309. <td class="text-right font-lg font-bold" width="30%">{{ number_format($document->total_taxed, 2) }}</td>
  310. </tr>
  311. @endif
  312. <tr>
  313. <td class="text-right font-lg font-bold" width="70%">IGV: {{ $document->currency_type->symbol }}</td>
  314. <td class="text-right font-lg font-bold" width="30%">{{ number_format($document->total_igv, 2) }}</td>
  315. </tr>
  316. <tr>
  317. <td class="text-right font-lg font-bold" width="70%">TOTAL A PAGAR: {{ $document->currency_type->symbol }}</td>
  318. <td class="text-right font-lg font-bold" width="30%">{{ number_format($document->total, 2) }}</td>
  319. </tr>
  320. </tbody>
  321. </table>
  322. </td>
  323. </tr>
  324. </tbody>
  325. </table>
  326. </body>
  327. </html>