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

/app/CoreFacturalo/Templates/pdf/default_lote_fven_serie/quotation_a5.blade.php

https://gitlab.com/laher01/factu40
PHP | 355 lines | 342 code | 12 blank | 1 comment | 3 complexity | b52874128cc0ebff93fc31b8c8f43a05 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. $accounts = \App\Models\Tenant\BankAccount::all();
  6. $tittle = $document->prefix.'-'.str_pad($document->id, 8, '0', STR_PAD_LEFT);
  7. @endphp
  8. <html>
  9. <head>
  10. {{--<title>{{ $tittle }}</title>--}}
  11. {{--<link href="{{ $path_style }}" rel="stylesheet" />--}}
  12. </head>
  13. <body>
  14. <table class="full-width">
  15. <tr>
  16. @if($company->logo)
  17. <td width="20%">
  18. <div class="company_logo_box">
  19. <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;">
  20. </div>
  21. </td>
  22. @else
  23. <td width="20%">
  24. {{--<img src="{{ asset('logo/logo.jpg') }}" class="company_logo" style="max-width: 150px">--}}
  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. @isset($establishment->trade_address)
  38. <h6>{{ ($establishment->trade_address !== '-')? 'D. Comercial: '.$establishment->trade_address : '' }}</h6>
  39. @endisset
  40. <h6>{{ ($establishment->telephone !== '-')? 'Central telefónica: '.$establishment->telephone : '' }}</h6>
  41. <h6>{{ ($establishment->email !== '-')? 'Email: '.$establishment->email : '' }}</h6>
  42. @isset($establishment->web_address)
  43. <h6>{{ ($establishment->web_address !== '-')? 'Web: '.$establishment->web_address : '' }}</h6>
  44. @endisset
  45. @isset($establishment->aditional_information)
  46. <h6>{{ ($establishment->aditional_information !== '-')? $establishment->aditional_information : '' }}</h6>
  47. @endisset
  48. </div>
  49. </td>
  50. <td width="30%" class="border-box py-4 px-2 text-center">
  51. <h5 class="text-center">COTIZACIÓN</h5>
  52. <h3 class="text-center">{{ $tittle }}</h3>
  53. </td>
  54. </tr>
  55. </table>
  56. <table class="full-width mt-5">
  57. <tr>
  58. <td width="15%">Cliente:</td>
  59. <td width="45%">{{ $customer->name }}</td>
  60. <td width="25%">Fecha de emisión:</td>
  61. <td width="15%">{{ $document->date_of_issue->format('Y-m-d') }}</td>
  62. </tr>
  63. <tr>
  64. <td>{{ $customer->identity_document_type->description }}:</td>
  65. <td>{{ $customer->number }}</td>
  66. @if($document->date_of_due)
  67. <td width="25%">Tiempo de Validez:</td>
  68. <td width="15%">{{ $document->date_of_due }}</td>
  69. @endif
  70. </tr>
  71. @if ($customer->address !== '')
  72. <tr>
  73. <td class="align-top">Dirección:</td>
  74. <td>
  75. {{ $customer->address }}
  76. {{ ($customer->district_id !== '-')? ', '.$customer->district->description : '' }}
  77. {{ ($customer->province_id !== '-')? ', '.$customer->province->description : '' }}
  78. {{ ($customer->department_id !== '-')? '- '.$customer->department->description : '' }}
  79. </td>
  80. @if($document->delivery_date)
  81. <td width="25%">Tiempo de Entrega:</td>
  82. <td width="15%">{{ $document->delivery_date }}</td>
  83. @endif
  84. </tr>
  85. @endif
  86. @if ($document->payment_method_type)
  87. <tr>
  88. <td class="align-top">T. Pago:</td>
  89. <td colspan="">
  90. {{ $document->payment_method_type->description }}
  91. </td>
  92. @if($document->sale_opportunity)
  93. <td width="25%">O. Venta:</td>
  94. <td width="15%">{{ $document->sale_opportunity->number_full }}</td>
  95. @endif
  96. </tr>
  97. @endif
  98. @if ($document->account_number)
  99. <tr>
  100. <td class="align-top">N° Cuenta:</td>
  101. <td colspan="3">
  102. {{ $document->account_number }}
  103. </td>
  104. </tr>
  105. @endif
  106. @if ($document->shipping_address)
  107. <tr>
  108. <td class="align-top">Dir. Envío:</td>
  109. <td colspan="3">
  110. {{ $document->shipping_address }}
  111. </td>
  112. </tr>
  113. @endif
  114. @if ($customer->telephone)
  115. <tr>
  116. <td class="align-top">Teléfono:</td>
  117. <td colspan="3">
  118. {{ $customer->telephone }}
  119. </td>
  120. </tr>
  121. @endif
  122. <tr>
  123. <td class="align-top">Vendedor:</td>
  124. <td colspan="3">
  125. {{ $document->user->name }}
  126. </td>
  127. </tr>
  128. @if ($document->contact)
  129. <tr>
  130. <td class="align-top">Contacto:</td>
  131. <td colspan="3">
  132. {{ $document->contact }}
  133. </td>
  134. </tr>
  135. @endif
  136. @if ($document->phone)
  137. <tr>
  138. <td class="align-top">Telf. Contacto:</td>
  139. <td colspan="3">
  140. {{ $document->phone }}
  141. </td>
  142. </tr>
  143. @endif
  144. </table>
  145. <table class="full-width mt-3">
  146. @if ($document->description)
  147. <tr>
  148. <td width="15%" class="align-top">Observación: </td>
  149. <td width="85%">{{ $document->description }}</td>
  150. </tr>
  151. @endif
  152. </table>
  153. {{-- <table class="full-width mt-3">
  154. @if ($document->purchase_order)
  155. <tr>
  156. <td width="25%">Orden de Compra: </td>
  157. <td>:</td>
  158. <td class="text-left">{{ $document->purchase_order }}</td>
  159. </tr>
  160. @endif
  161. </table> --}}
  162. @if ($document->guides)
  163. <br/>
  164. {{--<strong>Guías:</strong>--}}
  165. <table>
  166. @foreach($document->guides as $guide)
  167. <tr>
  168. @if(isset($guide->document_type_description))
  169. <td>{{ $guide->document_type_description }}</td>
  170. @else
  171. <td>{{ $guide->document_type_id }}</td>
  172. @endif
  173. <td>:</td>
  174. <td>{{ $guide->number }}</td>
  175. </tr>
  176. @endforeach
  177. </table>
  178. @endif
  179. <table class="full-width mt-10 mb-10">
  180. <thead class="">
  181. <tr class="bg-grey">
  182. <th class="border-top-bottom text-center py-2" width="8%">CANT.</th>
  183. <th class="border-top-bottom text-center py-2" width="8%">UNIDAD</th>
  184. <th class="border-top-bottom text-left py-2">DESCRIPCIÓN</th>
  185. <th class="border-top-bottom text-left py-2">MODELO</th>
  186. <th class="border-top-bottom text-right py-2" width="12%">P.UNIT</th>
  187. <th class="border-top-bottom text-right py-2" width="8%">DTO.</th>
  188. <th class="border-top-bottom text-right py-2" width="12%">TOTAL</th>
  189. </tr>
  190. </thead>
  191. <tbody>
  192. @foreach($document->items as $row)
  193. <tr>
  194. <td class="text-center align-top">
  195. @if(((int)$row->quantity != $row->quantity))
  196. {{ $row->quantity }}
  197. @else
  198. {{ number_format($row->quantity, 0) }}
  199. @endif
  200. </td>
  201. <td class="text-center align-top">{{ $row->item->unit_type_id }}</td>
  202. <td class="text-left">
  203. @if($row->item->name_product_pdf ?? false)
  204. {!!$row->item->name_product_pdf ?? ''!!}
  205. @else
  206. {!!$row->item->description!!}
  207. @endif
  208. @if (!empty($row->item->presentation)) {!!$row->item->presentation->description!!} @endif
  209. @if($row->attributes)
  210. @foreach($row->attributes as $attr)
  211. <br/><span style="font-size: 9px">{!! $attr->description !!} : {{ $attr->value }}</span>
  212. @endforeach
  213. @endif
  214. @if($row->discounts)
  215. @foreach($row->discounts as $dtos)
  216. <br/><span style="font-size: 9px">{{ $dtos->factor * 100 }}% {{$dtos->description }}</span>
  217. @endforeach
  218. @endif
  219. @if($row->item->is_set == 1)
  220. <br>
  221. @inject('itemSet', 'App\Services\ItemSetService')
  222. @foreach ($itemSet->getItemsSet($row->item_id) as $item)
  223. {{$item}}<br>
  224. @endforeach
  225. @endif
  226. @if($row->item->extra_attr_value != '')
  227. <br/><span style="font-size: 9px">{{$row->item->extra_attr_name}}: {{ $row->item->extra_attr_value }}</span>
  228. @endif
  229. </td>
  230. <td class="text-left">{{ $row->item->model ?? '' }}</td>
  231. <td class="text-right align-top">{{ number_format($row->unit_price, 2) }}</td>
  232. <td class="text-right align-top">
  233. @if($row->discounts)
  234. @php
  235. $total_discount_line = 0;
  236. foreach ($row->discounts as $disto) {
  237. $total_discount_line = $total_discount_line + $disto->amount;
  238. }
  239. @endphp
  240. {{ number_format($total_discount_line, 2) }}
  241. @else
  242. 0
  243. @endif
  244. </td>
  245. <td class="text-right align-top">{{ number_format($row->total, 2) }}</td>
  246. </tr>
  247. <tr>
  248. <td colspan="7" class="border-bottom"></td>
  249. </tr>
  250. @endforeach
  251. @if($document->total_exportation > 0)
  252. <tr>
  253. <td colspan="6" class="text-right font-bold">OP. EXPORTACIÓN: {{ $document->currency_type->symbol }}</td>
  254. <td class="text-right font-bold">{{ number_format($document->total_exportation, 2) }}</td>
  255. </tr>
  256. @endif
  257. @if($document->total_free > 0)
  258. <tr>
  259. <td colspan="6" class="text-right font-bold">OP. GRATUITAS: {{ $document->currency_type->symbol }}</td>
  260. <td class="text-right font-bold">{{ number_format($document->total_free, 2) }}</td>
  261. </tr>
  262. @endif
  263. @if($document->total_unaffected > 0)
  264. <tr>
  265. <td colspan="6" class="text-right font-bold">OP. INAFECTAS: {{ $document->currency_type->symbol }}</td>
  266. <td class="text-right font-bold">{{ number_format($document->total_unaffected, 2) }}</td>
  267. </tr>
  268. @endif
  269. @if($document->total_exonerated > 0)
  270. <tr>
  271. <td colspan="6" class="text-right font-bold">OP. EXONERADAS: {{ $document->currency_type->symbol }}</td>
  272. <td class="text-right font-bold">{{ number_format($document->total_exonerated, 2) }}</td>
  273. </tr>
  274. @endif
  275. @if($document->total_taxed > 0)
  276. <tr>
  277. <td colspan="6" class="text-right font-bold">OP. GRAVADAS: {{ $document->currency_type->symbol }}</td>
  278. <td class="text-right font-bold">{{ number_format($document->total_taxed, 2) }}</td>
  279. </tr>
  280. @endif
  281. @if($document->total_discount > 0)
  282. <tr>
  283. <td colspan="6" class="text-right font-bold">{{(($document->total_prepayment > 0) ? 'ANTICIPO':'DESCUENTO TOTAL')}}: {{ $document->currency_type->symbol }}</td>
  284. <td class="text-right font-bold">{{ number_format($document->total_discount, 2) }}</td>
  285. </tr>
  286. @endif
  287. <tr>
  288. <td colspan="6" class="text-right font-bold">IGV: {{ $document->currency_type->symbol }}</td>
  289. <td class="text-right font-bold">{{ number_format($document->total_igv, 2) }}</td>
  290. </tr>
  291. <tr>
  292. <td colspan="6" class="text-right font-bold">TOTAL A PAGAR: {{ $document->currency_type->symbol }}</td>
  293. <td class="text-right font-bold">{{ number_format($document->total, 2) }}</td>
  294. </tr>
  295. </tbody>
  296. </table>
  297. <table class="full-width">
  298. <tr>
  299. <td width="65%" style="text-align: top; vertical-align: top;">
  300. <br>
  301. @foreach($accounts as $account)
  302. <p>
  303. <span class="font-bold">{{$account->bank->description}}</span> {{$account->currency_type->description}}
  304. <span class="font-bold">N°:</span> {{$account->number}}
  305. @if($account->cci)
  306. - <span class="font-bold">CCI:</span> {{$account->cci}}
  307. @endif
  308. </p>
  309. @endforeach
  310. </td>
  311. </tr>
  312. <tr>
  313. {{-- <td width="65%">
  314. @foreach($document->legends as $row)
  315. <p>Son: <span class="font-bold">{{ $row->value }} {{ $document->currency_type->description }}</span></p>
  316. @endforeach
  317. <br/>
  318. <strong>Información adicional</strong>
  319. @foreach($document->additional_information as $information)
  320. <p>{{ $information }}</p>
  321. @endforeach
  322. </td> --}}
  323. </tr>
  324. </table>
  325. <br>
  326. <table class="full-width">
  327. <tr>
  328. <td>
  329. <strong>PAGOS:</strong> </td></tr>
  330. @php
  331. $payment = 0;
  332. @endphp
  333. @foreach($document->payments as $row)
  334. <tr><td>- {{ $row->payment_method_type->description }} - {{ $row->reference ? $row->reference.' - ':'' }} {{ $document->currency_type->symbol }} {{ $row->payment }}</td></tr>
  335. @php
  336. $payment += (float) $row->payment;
  337. @endphp
  338. @endforeach
  339. <tr><td><strong>SALDO:</strong> {{ $document->currency_type->symbol }} {{ number_format($document->total - $payment, 2) }}</td>
  340. </tr>
  341. </table>
  342. </body>
  343. </html>