invoice.blade.php 6.9 KB

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