選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

document-preview.blade.php 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. @php
  2. use App\View\Models\DocumentPreviewViewModel;
  3. use App\Enums\Accounting\DocumentType;
  4. $type = $getType();
  5. $viewModel = new DocumentPreviewViewModel($getRecord(), $type);
  6. extract($viewModel->buildViewData(), EXTR_SKIP);
  7. @endphp
  8. <div {{ $attributes }}>
  9. <x-company.invoice.container class="modern-template-container">
  10. <!-- Colored Header with Logo -->
  11. <x-company.invoice.header class="bg-gray-800 h-24">
  12. <!-- Logo -->
  13. <div class="w-2/3">
  14. @if($logo && $style['show_logo'])
  15. <x-company.invoice.logo class="ml-8" :src="$logo"/>
  16. @endif
  17. </div>
  18. <!-- Ribbon Container -->
  19. <div class="w-1/3 absolute right-0 top-0 p-3 h-32 flex flex-col justify-end rounded-bl-sm"
  20. style="background: {{ $style['accent_color'] }};">
  21. @if($header)
  22. <h1 class="text-4xl font-bold text-white text-center uppercase">{{ $header }}</h1>
  23. @endif
  24. </div>
  25. </x-company.invoice.header>
  26. <!-- Company Details -->
  27. <x-company.invoice.metadata class="modern-template-metadata space-y-8">
  28. <div class="text-sm">
  29. <h2 class="text-lg font-semibold">{{ $company['name'] }}</h2>
  30. @if($company['address'] && $company['city'] && $company['state'] && $company['zip_code'])
  31. <p>{{ $company['address'] }}</p>
  32. <p>{{ $company['city'] }}
  33. , {{ $company['state'] }} {{ $company['zip_code'] }}</p>
  34. <p>{{ $company['country'] }}</p>
  35. @endif
  36. </div>
  37. <div class="flex justify-between items-end">
  38. <!-- Billing Details -->
  39. <div class="text-sm tracking-tight">
  40. <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
  41. <p class="text-base font-bold"
  42. style="color: {{ $style['accent_color'] }}">{{ $client['name'] }}</p>
  43. @if($client['address_line_1'])
  44. <p>{{ $client['address_line_1'] }}</p>
  45. @if($client['address_line_2'])
  46. <p>{{ $client['address_line_2'] }}</p>
  47. @endif
  48. <p>
  49. {{ $client['city'] }}{{ $client['state'] ? ', ' . $client['state'] : '' }}
  50. {{ $client['postal_code'] }}
  51. </p>
  52. @if($client['country'])
  53. <p>{{ $client['country'] }}</p>
  54. @endif
  55. @endif
  56. </div>
  57. <div class="text-sm tracking-tight">
  58. <table class="min-w-full">
  59. <tbody>
  60. <tr>
  61. <td class="font-semibold text-right pr-2">{{ $labels['number'] }}:</td>
  62. <td class="text-left pl-2">{{ $metadata['number'] }}</td>
  63. </tr>
  64. @if($metadata['reference_number'])
  65. <tr>
  66. <td class="font-semibold text-right pr-2">{{ $labels['reference_number'] }}:</td>
  67. <td class="text-left pl-2">{{ $metadata['reference_number'] }}</td>
  68. </tr>
  69. @endif
  70. <tr>
  71. <td class="font-semibold text-right pr-2">{{ $labels['date'] }}:</td>
  72. <td class="text-left pl-2">{{ $metadata['date'] }}</td>
  73. </tr>
  74. <tr>
  75. <td class="font-semibold text-right pr-2">{{ $labels['due_date'] }}:</td>
  76. <td class="text-left pl-2">{{ $metadata['due_date'] }}</td>
  77. </tr>
  78. </tbody>
  79. </table>
  80. </div>
  81. </div>
  82. </x-company.invoice.metadata>
  83. <!-- Line Items Table -->
  84. <x-company.invoice.line-items class="modern-template-line-items">
  85. <table class="w-full text-left table-fixed">
  86. <thead class="text-sm leading-relaxed">
  87. <tr class="text-gray-600 dark:text-gray-400">
  88. <th class="text-left pl-6 w-[45%] py-4">Items</th>
  89. <th class="text-center w-[15%] py-4">Quantity</th>
  90. <th class="text-right w-[20%] py-4">Price</th>
  91. <th class="text-right pr-6 w-[20%] py-4">Amount</th>
  92. </tr>
  93. </thead>
  94. <tbody class="text-sm tracking-tight border-y-2">
  95. @foreach($lineItems as $index => $item)
  96. <tr @class(['bg-gray-100 dark:bg-gray-800' => $index % 2 === 0])>
  97. <td class="text-left pl-6 font-semibold py-3">
  98. {{ $item['name'] }}
  99. @if($item['description'])
  100. <div class="text-gray-600 font-normal line-clamp-2 mt-1">{{ $item['description'] }}</div>
  101. @endif
  102. </td>
  103. <td class="text-center py-3">{{ $item['quantity'] }}</td>
  104. <td class="text-right py-3">{{ $item['unit_price'] }}</td>
  105. <td class="text-right pr-6 py-3">{{ $item['subtotal'] }}</td>
  106. </tr>
  107. @endforeach
  108. </tbody>
  109. <tfoot class="text-sm tracking-tight">
  110. <tr>
  111. <td class="pl-6 py-2" colspan="2"></td>
  112. <td class="text-right font-semibold py-2">Subtotal:</td>
  113. <td class="text-right pr-6 py-2">{{ $totals['subtotal'] }}</td>
  114. </tr>
  115. @if($totals['discount'])
  116. <tr class="text-success-800 dark:text-success-600">
  117. <td class="pl-6 py-2" colspan="2"></td>
  118. <td class="text-right py-2">Discount:</td>
  119. <td class="text-right pr-6 py-2">
  120. ({{ $totals['discount'] }})
  121. </td>
  122. </tr>
  123. @endif
  124. @if($totals['tax'])
  125. <tr>
  126. <td class="pl-6 py-2" colspan="2"></td>
  127. <td class="text-right py-2">Tax:</td>
  128. <td class="text-right pr-6 py-2">{{ $totals['tax'] }}</td>
  129. </tr>
  130. @endif
  131. <tr>
  132. <td class="pl-6 py-2" colspan="2"></td>
  133. <td class="text-right font-semibold border-t py-2">Total:</td>
  134. <td class="text-right border-t pr-6 py-2">{{ $totals['total'] }}</td>
  135. </tr>
  136. @if($totals['amount_due'])
  137. <tr>
  138. <td class="pl-6 py-2" colspan="2"></td>
  139. <td class="text-right font-semibold border-t-4 border-double py-2">Amount Due
  140. ({{ $metadata['currency_code'] }}):
  141. </td>
  142. <td class="text-right border-t-4 border-double pr-6 py-2">{{ $totals['amount_due'] }}</td>
  143. </tr>
  144. @else
  145. <tr>
  146. <td class="pl-6 py-2" colspan="2"></td>
  147. <td class="text-right font-semibold border-t-4 border-double py-2">Grand Total
  148. ({{ $metadata['currency_code'] }}):
  149. </td>
  150. <td class="text-right border-t-4 border-double pr-6 py-2">{{ $totals['total'] }}</td>
  151. </tr>
  152. @endif
  153. </tfoot>
  154. </table>
  155. </x-company.invoice.line-items>
  156. <!-- Footer Notes -->
  157. <x-company.invoice.footer class="modern-template-footer tracking-tight">
  158. <h4 class="font-semibold px-6 text-sm" style="color: {{ $style['accent_color'] }}">
  159. Terms & Conditions
  160. </h4>
  161. <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
  162. <div class="flex justify-between space-x-4 px-6 text-sm">
  163. <p class="w-1/2 break-words line-clamp-4">{{ $terms }}</p>
  164. <p class="w-1/2 break-words line-clamp-4">{{ $footer }}</p>
  165. </div>
  166. </x-company.invoice.footer>
  167. </x-company.invoice.container>
  168. </div>