Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

document-preview.blade.php 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. @php
  2. $document = \App\DTO\DocumentDTO::fromModel($getRecord());
  3. @endphp
  4. {!! $document->getFontHtml() !!}
  5. <style>
  6. .inv-paper {
  7. font-family: '{{ $document->font->getLabel() }}', sans-serif;
  8. }
  9. </style>
  10. <div {{ $attributes }}>
  11. <x-company.invoice.container class="modern-template-container">
  12. <!-- Colored Header with Logo -->
  13. <x-company.invoice.header class="bg-gray-800 h-24">
  14. <!-- Logo -->
  15. <div class="w-2/3">
  16. @if($document->logo && $document->showLogo)
  17. <x-company.invoice.logo class="ml-8" :src="$document->logo"/>
  18. @endif
  19. </div>
  20. <!-- Ribbon Container -->
  21. <div class="w-1/3 absolute right-0 top-0 p-3 h-32 flex flex-col justify-end rounded-bl-sm"
  22. style="background: {{ $document->accentColor }};">
  23. @if($document->header)
  24. <h1 class="text-4xl font-bold text-white text-center uppercase">{{ $document->header }}</h1>
  25. @endif
  26. </div>
  27. </x-company.invoice.header>
  28. <!-- Company Details -->
  29. <x-company.invoice.metadata class="modern-template-metadata space-y-8">
  30. <div class="text-sm">
  31. <h2 class="text-lg font-semibold">{{ $document->company->name }}</h2>
  32. @if($formattedAddress = $document->company->getFormattedAddressHtml())
  33. {!! $formattedAddress !!}
  34. @endif
  35. </div>
  36. <div class="flex justify-between items-end">
  37. <!-- Billing Details -->
  38. <div class="text-sm tracking-tight">
  39. <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
  40. <p class="text-base font-bold"
  41. style="color: {{ $document->accentColor }}">{{ $document->client->name }}</p>
  42. @if($formattedAddress = $document->client->getFormattedAddressHtml())
  43. {!! $formattedAddress !!}
  44. @endif
  45. </div>
  46. <div class="text-sm tracking-tight">
  47. <table class="min-w-full">
  48. <tbody>
  49. <tr>
  50. <td class="font-semibold text-right pr-2">{{ $document->label->number }}:</td>
  51. <td class="text-left pl-2">{{ $document->number }}</td>
  52. </tr>
  53. @if($document->referenceNumber)
  54. <tr>
  55. <td class="font-semibold text-right pr-2">{{ $document->label->referenceNumber }}:</td>
  56. <td class="text-left pl-2">{{ $document->referenceNumber }}</td>
  57. </tr>
  58. @endif
  59. <tr>
  60. <td class="font-semibold text-right pr-2">{{ $document->label->date }}:</td>
  61. <td class="text-left pl-2">{{ $document->date }}</td>
  62. </tr>
  63. <tr>
  64. <td class="font-semibold text-right pr-2">{{ $document->label->dueDate }}:</td>
  65. <td class="text-left pl-2">{{ $document->dueDate }}</td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. </x-company.invoice.metadata>
  72. <!-- Line Items Table -->
  73. <x-company.invoice.line-items class="modern-template-line-items">
  74. <table class="w-full text-left table-fixed">
  75. <thead class="text-sm leading-relaxed">
  76. <tr class="text-gray-600 dark:text-gray-400">
  77. <th class="text-left pl-6 w-[50%] py-4">{{ $document->columnLabel->items }}</th>
  78. <th class="text-center w-[10%] py-4">{{ $document->columnLabel->units }}</th>
  79. <th class="text-right w-[20%] py-4">{{ $document->columnLabel->price }}</th>
  80. <th class="text-right pr-6 w-[20%] py-4">{{ $document->columnLabel->amount }}</th>
  81. </tr>
  82. </thead>
  83. <tbody class="text-sm tracking-tight border-y-2">
  84. @foreach($document->lineItems as $index => $item)
  85. <tr @class(['bg-gray-100 dark:bg-gray-800' => $index % 2 === 0])>
  86. <td class="text-left pl-6 font-semibold py-3">
  87. {{ $item->name }}
  88. @if($item->description)
  89. <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item->description }}</div>
  90. @endif
  91. </td>
  92. <td class="text-center py-3">{{ $item->quantity }}</td>
  93. <td class="text-right py-3">{{ $item->unitPrice }}</td>
  94. <td class="text-right pr-6 py-3">{{ $item->subtotal }}</td>
  95. </tr>
  96. @endforeach
  97. </tbody>
  98. <tfoot class="text-sm tracking-tight">
  99. <tr>
  100. <td class="pl-6 py-2" colspan="2"></td>
  101. <td class="text-right font-semibold py-2">Subtotal:</td>
  102. <td class="text-right pr-6 py-2">{{ $document->subtotal }}</td>
  103. </tr>
  104. @if($document->discount)
  105. <tr class="text-success-800 dark:text-success-600">
  106. <td class="pl-6 py-2" colspan="2"></td>
  107. <td class="text-right py-2">Discount:</td>
  108. <td class="text-right pr-6 py-2">
  109. ({{ $document->discount }})
  110. </td>
  111. </tr>
  112. @endif
  113. @if($document->tax)
  114. <tr>
  115. <td class="pl-6 py-2" colspan="2"></td>
  116. <td class="text-right py-2">Tax:</td>
  117. <td class="text-right pr-6 py-2">{{ $document->tax }}</td>
  118. </tr>
  119. @endif
  120. <tr>
  121. <td class="pl-6 py-2" colspan="2"></td>
  122. <td class="text-right font-semibold border-t py-2">Total:</td>
  123. <td class="text-right border-t pr-6 py-2">{{ $document->total }}</td>
  124. </tr>
  125. @if($document->amountDue)
  126. <tr>
  127. <td class="pl-6 py-2" colspan="2"></td>
  128. <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
  129. ({{ $document->currencyCode }}):
  130. </td>
  131. <td class="text-right border-t-4 border-double pr-6 py-2">{{ $document->amountDue }}</td>
  132. </tr>
  133. @endif
  134. </tfoot>
  135. </table>
  136. </x-company.invoice.line-items>
  137. <!-- Footer Notes -->
  138. <x-company.invoice.footer class="modern-template-footer tracking-tight">
  139. <h4 class="font-semibold px-6 text-sm" style="color: {{ $document->accentColor }}">
  140. Terms & Conditions
  141. </h4>
  142. <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
  143. <div class="flex justify-between space-x-4 px-6 text-sm">
  144. <p class="w-1/2 break-words line-clamp-4">{{ $document->terms }}</p>
  145. <p class="w-1/2 break-words line-clamp-4">{{ $document->footer }}</p>
  146. </div>
  147. </x-company.invoice.footer>
  148. </x-company.invoice.container>
  149. </div>