PageRenderTime 48ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://gitlab.com/laher01/factu40
PHP | 334 lines | 323 code | 10 blank | 1 comment | 2 complexity | 335517114d20f113bd8502244a4f6106 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 colspan="">
  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. @if ($document->guides)
  154. <br/>
  155. {{--<strong>Guías:</strong>--}}
  156. <table>
  157. @foreach($document->guides as $guide)
  158. <tr>
  159. @if(isset($guide->document_type_description))
  160. <td>{{ $guide->document_type_description }}</td>
  161. @else
  162. <td>{{ $guide->document_type_id }}</td>
  163. @endif
  164. <td>:</td>
  165. <td>{{ $guide->number }}</td>
  166. </tr>
  167. @endforeach
  168. </table>
  169. @endif
  170. <table class="full-width mt-10 mb-10">
  171. <thead class="">
  172. <tr class="bg-grey">
  173. <th class="border-top-bottom text-center py-2" width="8%">CANT.</th>
  174. <th class="border-top-bottom text-center py-2" width="8%">UNIDAD</th>
  175. <th class="border-top-bottom text-left py-2">DESCRIPCIÓN</th>
  176. <th class="border-top-bottom text-right py-2" width="12%">P.UNIT</th>
  177. <th class="border-top-bottom text-right py-2" width="8%">DTO.</th>
  178. <th class="border-top-bottom text-right py-2" width="12%">TOTAL</th>
  179. </tr>
  180. </thead>
  181. <tbody>
  182. @foreach($document->items as $row)
  183. <tr>
  184. <td class="text-center align-top">
  185. @if(((int)$row->quantity != $row->quantity))
  186. {{ $row->quantity }}
  187. @else
  188. {{ number_format($row->quantity, 0) }}
  189. @endif
  190. </td>
  191. <td class="text-center align-top">{{ $row->item->unit_type_id }}</td>
  192. <td class="text-left">
  193. {!!$row->relation_item->name!!} @if (!empty($row->item->presentation)) {!!$row->item->presentation->description!!} @endif
  194. @if($row->attributes)
  195. @foreach($row->attributes as $attr)
  196. <br/><span style="font-size: 9px">{!! $attr->description !!} : {{ $attr->value }}</span>
  197. @endforeach
  198. @endif
  199. @if($row->discounts)
  200. @foreach($row->discounts as $dtos)
  201. <br/><span style="font-size: 9px">{{ $dtos->factor * 100 }}% {{$dtos->description }}</span>
  202. @endforeach
  203. @endif
  204. @if($row->item->is_set == 1)
  205. <br>
  206. @inject('itemSet', 'App\Services\ItemSetService')
  207. @foreach ($itemSet->getItemsSet($row->item_id) as $item)
  208. {{$item}}<br>
  209. @endforeach
  210. @endif
  211. </td>
  212. <td class="text-right align-top">{{ number_format($row->unit_price, 2) }}</td>
  213. <td class="text-right align-top">
  214. @if($row->discounts)
  215. @php
  216. $total_discount_line = 0;
  217. foreach ($row->discounts as $disto) {
  218. $total_discount_line = $total_discount_line + $disto->amount;
  219. }
  220. @endphp
  221. {{ number_format($total_discount_line, 2) }}
  222. @else
  223. 0
  224. @endif
  225. </td>
  226. <td class="text-right align-top">{{ number_format($row->total, 2) }}</td>
  227. </tr>
  228. <tr>
  229. <td colspan="6" class="border-bottom"></td>
  230. </tr>
  231. @endforeach
  232. @if($document->total_exportation > 0)
  233. <tr>
  234. <td colspan="5" class="text-right font-bold">OP. EXPORTACIÓN: {{ $document->currency_type->symbol }}</td>
  235. <td class="text-right font-bold">{{ number_format($document->total_exportation, 2) }}</td>
  236. </tr>
  237. @endif
  238. @if($document->total_free > 0)
  239. <tr>
  240. <td colspan="5" class="text-right font-bold">OP. GRATUITAS: {{ $document->currency_type->symbol }}</td>
  241. <td class="text-right font-bold">{{ number_format($document->total_free, 2) }}</td>
  242. </tr>
  243. @endif
  244. @if($document->total_unaffected > 0)
  245. <tr>
  246. <td colspan="5" class="text-right font-bold">OP. INAFECTAS: {{ $document->currency_type->symbol }}</td>
  247. <td class="text-right font-bold">{{ number_format($document->total_unaffected, 2) }}</td>
  248. </tr>
  249. @endif
  250. @if($document->total_exonerated > 0)
  251. <tr>
  252. <td colspan="5" class="text-right font-bold">OP. EXONERADAS: {{ $document->currency_type->symbol }}</td>
  253. <td class="text-right font-bold">{{ number_format($document->total_exonerated, 2) }}</td>
  254. </tr>
  255. @endif
  256. @if($document->total_taxed > 0)
  257. <tr>
  258. <td colspan="5" class="text-right font-bold">OP. GRAVADAS: {{ $document->currency_type->symbol }}</td>
  259. <td class="text-right font-bold">{{ number_format($document->total_taxed, 2) }}</td>
  260. </tr>
  261. @endif
  262. @if($document->total_discount > 0)
  263. <tr>
  264. <td colspan="5" class="text-right font-bold">{{(($document->total_prepayment > 0) ? 'ANTICIPO':'DESCUENTO TOTAL')}}: {{ $document->currency_type->symbol }}</td>
  265. <td class="text-right font-bold">{{ number_format($document->total_discount, 2) }}</td>
  266. </tr>
  267. @endif
  268. <tr>
  269. <td colspan="5" class="text-right font-bold">IGV: {{ $document->currency_type->symbol }}</td>
  270. <td class="text-right font-bold">{{ number_format($document->total_igv, 2) }}</td>
  271. </tr>
  272. <tr>
  273. <td colspan="5" class="text-right font-bold">TOTAL A PAGAR: {{ $document->currency_type->symbol }}</td>
  274. <td class="text-right font-bold">{{ number_format($document->total, 2) }}</td>
  275. </tr>
  276. </tbody>
  277. </table>
  278. <table class="full-width">
  279. <tr>
  280. <td width="65%" style="text-align: top; vertical-align: top;">
  281. <br>
  282. @foreach($accounts as $account)
  283. <p>
  284. <span class="font-bold">{{$account->bank->description}}</span> {{$account->currency_type->description}}
  285. <span class="font-bold">N°:</span> {{$account->number}}
  286. @if($account->cci)
  287. - <span class="font-bold">CCI:</span> {{$account->cci}}
  288. @endif
  289. </p>
  290. @endforeach
  291. </td>
  292. </tr>
  293. <tr>
  294. {{-- <td width="65%">
  295. @foreach($document->legends as $row)
  296. <p>Son: <span class="font-bold">{{ $row->value }} {{ $document->currency_type->description }}</span></p>
  297. @endforeach
  298. <br/>
  299. <strong>Información adicional</strong>
  300. @foreach($document->additional_information as $information)
  301. <p>{{ $information }}</p>
  302. @endforeach
  303. </td> --}}
  304. </tr>
  305. </table>
  306. <br>
  307. <table class="full-width">
  308. <tr>
  309. <td>
  310. <strong>PAGOS:</strong> </td></tr>
  311. @php
  312. $payment = 0;
  313. @endphp
  314. @foreach($document->payments as $row)
  315. <tr><td>- {{ $row->payment_method_type->description }} - {{ $row->reference ? $row->reference.' - ':'' }} {{ $document->currency_type->symbol }} {{ $row->payment }}</td></tr>
  316. @php
  317. $payment += (float) $row->payment;
  318. @endphp
  319. @endforeach
  320. <tr><td><strong>SALDO:</strong> {{ $document->currency_type->symbol }} {{ number_format($document->total - $payment, 2) }}</td>
  321. </tr>
  322. </table>
  323. </body>
  324. </html>