invoice.blade.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <html>
  2. <head>
  3. <meta name="viewport" content="width=device-width, initial-scale=1">
  4. <title>Laravel</title>
  5. <meta http-equiv="Content-Type" content="text/html;"/>
  6. <meta charset="UTF-8">
  7. <style media="all">
  8. @font-face {
  9. font-family: 'Roboto';
  10. src: url("{{ static_asset('fonts/Roboto-Regular.ttf') }}") format("truetype");
  11. font-weight: normal;
  12. font-style: normal;
  13. }
  14. *{
  15. margin: 0;
  16. padding: 0;
  17. line-height: 1.3;
  18. font-family: 'Roboto';
  19. color: #333542;
  20. }
  21. body{
  22. font-size: .875rem;
  23. }
  24. .gry-color *,
  25. .gry-color{
  26. color:#878f9c;
  27. }
  28. table{
  29. width: 100%;
  30. }
  31. table th{
  32. font-weight: normal;
  33. }
  34. table.padding th{
  35. padding: .5rem .7rem;
  36. }
  37. table.padding td{
  38. padding: .7rem;
  39. }
  40. table.sm-padding td{
  41. padding: .2rem .7rem;
  42. }
  43. .border-bottom td,
  44. .border-bottom th{
  45. border-bottom:1px solid #eceff4;
  46. }
  47. .text-left{
  48. text-align:left;
  49. }
  50. .text-right{
  51. text-align:right;
  52. }
  53. .small{
  54. font-size: .85rem;
  55. }
  56. .currency{
  57. }
  58. </style>
  59. </head>
  60. <body>
  61. <div>
  62. @php
  63. $logo = get_setting('header_logo');
  64. @endphp
  65. <div style="background: #eceff4;padding: 1.5rem;">
  66. <table>
  67. <tr>
  68. <td>
  69. @if($logo != null)
  70. <img loading="lazy" src="{{ uploaded_asset($logo) }}" height="40" style="display:inline-block;">
  71. @else
  72. <img loading="lazy" src="{{ static_asset('assets/img/logo.png') }}" height="40" style="display:inline-block;">
  73. @endif
  74. </td>
  75. </tr>
  76. </table>
  77. <table>
  78. <tr>
  79. <td style="font-size: 1.2rem;" class="strong">{{ get_setting('site_name') }}</td>
  80. <td class="text-right"></td>
  81. </tr>
  82. <tr>
  83. <td class="gry-color small">{{ get_setting('contact_address') }}</td>
  84. <td class="text-right"></td>
  85. </tr>
  86. <tr>
  87. <td class="gry-color small">{{ translate('Email') }}: {{ get_setting('contact_email') }}</td>
  88. <td class="text-right small"><span class="gry-color small">{{ translate('Order ID') }}:</span> <span class="strong">{{ $order->code }}</span></td>
  89. </tr>
  90. <tr>
  91. <td class="gry-color small">{{ translate('Phone') }}: {{ get_setting('contact_phone') }}</td>
  92. <td class="text-right small"><span class="gry-color small">{{ translate('Order Date') }}:</span> <span class=" strong">{{ date('d-m-Y', $order->date) }}</span></td>
  93. </tr>
  94. </table>
  95. </div>
  96. <div style="padding: 1.5rem;padding-bottom: 0">
  97. <table>
  98. @php
  99. $shipping_address = json_decode($order->shipping_address);
  100. @endphp
  101. <tr><td class="strong small gry-color">{{ translate('Bill to') }}:</td></tr>
  102. <tr><td class="strong">{{ $shipping_address->name }}</td></tr>
  103. <tr><td class="gry-color small">{{ $shipping_address->address }}, {{ $shipping_address->city }}, {{ $shipping_address->country }}</td></tr>
  104. <tr><td class="gry-color small">{{ translate('Email') }}: {{ $shipping_address->email }}</td></tr>
  105. <tr><td class="gry-color small">{{ translate('Phone') }}: {{ $shipping_address->phone }}</td></tr>
  106. </table>
  107. </div>
  108. <div style="padding: 1.5rem;">
  109. <table class="padding text-left small border-bottom">
  110. <thead>
  111. <tr class="gry-color" style="background: #eceff4;">
  112. <th width="35%">{{ translate('Product Name') }}</th>
  113. <th width="15%">{{ translate('Delivery Type') }}</th>
  114. <th width="10%">{{ translate('Qty') }}</th>
  115. <th width="15%">{{ translate('Unit Price') }}</th>
  116. <th width="10%">{{ translate('Tax') }}</th>
  117. <th width="15%" class="text-right">{{ translate('Total') }}</th>
  118. </tr>
  119. </thead>
  120. <tbody class="strong">
  121. @foreach ($order->orderDetails as $key => $orderDetail)
  122. @if ($orderDetail->product != null)
  123. <tr class="">
  124. <td>{{ $orderDetail->product->getTranslation('name') }} @if($orderDetail->variation != null) ({{ $orderDetail->variation }}) @endif</td>
  125. <td>
  126. @if ($order->shipping_type != null && $order->shipping_type == 'home_delivery')
  127. {{ translate('Home Delivery') }}
  128. @elseif ($order->shipping_type == 'pickup_point')
  129. @if ($order->pickup_point != null)
  130. {{ $order->pickup_point->getTranslation('name') }} ({{ translate('Pickip Point') }})
  131. @endif
  132. @endif
  133. </td>
  134. <td class="gry-color">{{ $orderDetail->quantity }}</td>
  135. <td class="gry-color currency">{{ single_price($orderDetail->price/$orderDetail->quantity) }}</td>
  136. <td class="gry-color currency">{{ single_price($orderDetail->tax/$orderDetail->quantity) }}</td>
  137. <td class="text-right currency">{{ single_price($orderDetail->price+$orderDetail->tax) }}</td>
  138. </tr>
  139. @endif
  140. @endforeach
  141. </tbody>
  142. </table>
  143. </div>
  144. <div style="padding:0 1.5rem;">
  145. <table style="width: 40%;margin-left:auto;" class="text-right sm-padding small strong">
  146. <tbody>
  147. <tr>
  148. <th class="gry-color text-left">{{ translate('Sub Total') }}</th>
  149. <td class="currency">{{ single_price($order->orderDetails->sum('price')) }}</td>
  150. </tr>
  151. <tr>
  152. <th class="gry-color text-left">{{ translate('Shipping Cost') }}</th>
  153. <td class="currency">{{ single_price($order->orderDetails->sum('shipping_cost')) }}</td>
  154. </tr>
  155. <tr class="border-bottom">
  156. <th class="gry-color text-left">{{ translate('Total Tax') }}</th>
  157. <td class="currency">{{ single_price($order->orderDetails->sum('tax')) }}</td>
  158. </tr>
  159. <tr class="border-bottom">
  160. <th class="gry-color text-left">{{ translate('Coupon') }}</th>
  161. <td class="currency">{{ single_price($order->coupon_discount) }}</td>
  162. </tr>
  163. <tr>
  164. <th class="text-left strong">{{ translate('Grand Total') }}</th>
  165. <td class="currency">{{ single_price($order->grand_total) }}</td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. </div>
  170. </div>
  171. </body>
  172. </html>