You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

modern.blade.php 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @php
  2. $data = $this->form->getRawState();
  3. $document = \App\DTO\DocumentPreviewDTO::fromSettings($this->record, $data);
  4. @endphp
  5. {!! $document->getFontHtml() !!}
  6. <style>
  7. .doc-template-paper {
  8. font-family: '{{ $document->font->getLabel() }}', sans-serif;
  9. }
  10. </style>
  11. <x-company.document-template.container class="modern-template-container" preview>
  12. <!-- Colored Header with Logo -->
  13. <x-company.document-template.header class="bg-gray-800 h-20">
  14. <!-- Logo -->
  15. <div class="w-2/3">
  16. @if($document->logo && $document->showLogo)
  17. <x-company.document-template.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-28 flex flex-col justify-end rounded-bl-sm"
  22. style="background: {{ $document->accentColor }};">
  23. @if($document->header)
  24. <h1 class="text-3xl font-bold text-white text-center uppercase">{{ $document->header }}</h1>
  25. @endif
  26. </div>
  27. </x-company.document-template.header>
  28. <!-- Company Details -->
  29. <x-company.document-template.metadata class="modern-template-metadata space-y-8">
  30. <div class="text-xs">
  31. <h2 class="text-base 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-xs">
  39. <h3 class="text-gray-600 font-medium mb-1">BILL TO</h3>
  40. <p class="text-xs 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-xs">
  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.document-template.metadata>
  72. <!-- Line Items Table -->
  73. <x-company.document-template.line-items class="modern-template-line-items">
  74. <table class="w-full text-left table-fixed">
  75. <thead class="text-xs leading-relaxed">
  76. <tr class="text-gray-600">
  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-xs border-y-2">
  84. @foreach($document->lineItems as $index => $item)
  85. <tr @class(['bg-gray-100' => $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-xs summary-section">
  99. @if($document->subtotal)
  100. <tr>
  101. <td class="pl-6 py-2" colspan="2"></td>
  102. <td class="text-right font-semibold py-2">Subtotal:</td>
  103. <td class="text-right pr-6 py-2">{{ $document->subtotal }}</td>
  104. </tr>
  105. @endif
  106. @if($document->discount)
  107. <tr class="text-success-800">
  108. <td class="pl-6 py-2" colspan="2"></td>
  109. <td class="text-right py-2">Discount:</td>
  110. <td class="text-right pr-6 py-2">
  111. ({{ $document->discount }})
  112. </td>
  113. </tr>
  114. @endif
  115. @if($document->tax)
  116. <tr>
  117. <td class="pl-6 py-2" colspan="2"></td>
  118. <td class="text-right py-2">Tax:</td>
  119. <td class="text-right pr-6 py-2">{{ $document->tax }}</td>
  120. </tr>
  121. @endif
  122. <tr>
  123. <td class="pl-6 py-2" colspan="2"></td>
  124. <td class="text-right font-semibold border-t py-2">Total:</td>
  125. <td class="text-right border-t pr-6 py-2">{{ $document->total }}</td>
  126. </tr>
  127. @if($document->amountDue)
  128. <tr>
  129. <td class="pl-6 py-2" colspan="2"></td>
  130. <td class="text-right font-semibold border-t-4 border-double py-2">{{ $document->label->amountDue }}
  131. ({{ $document->currencyCode }}):
  132. </td>
  133. <td class="text-right border-t-4 border-double pr-6 py-2">{{ $document->amountDue }}</td>
  134. </tr>
  135. @endif
  136. </tfoot>
  137. </table>
  138. </x-company.document-template.line-items>
  139. <!-- Footer Notes -->
  140. <x-company.document-template.footer class="modern-template-footer">
  141. <h4 class="font-semibold px-6 text-xs" style="color: {{ $document->accentColor }}">
  142. Terms & Conditions
  143. </h4>
  144. <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
  145. <div class="flex justify-between space-x-4 px-6 text-xs">
  146. <p class="w-1/2 break-words line-clamp-4">{{ $document->terms }}</p>
  147. <p class="w-1/2 break-words line-clamp-4">{{ $document->footer }}</p>
  148. </div>
  149. </x-company.document-template.footer>
  150. </x-company.document-template.container>