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.3KB

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