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.

360 lines
18 KiB

1 month ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Order Invoice</title>
  6. <style >
  7. body {
  8. font-family: Arial, DejaVu Sans, sans-serif;
  9. }
  10. </style>
  11. @if($language === "bd")
  12. <style >
  13. body {
  14. font-family: Arial, DejaVu Sans, sans-serif, bangla;
  15. }
  16. </style>
  17. @endif
  18. <style>
  19. .container{
  20. width: 100%;
  21. max-width: 800px;
  22. margin: 0 auto;
  23. padding: 10px;
  24. }
  25. .shadow{
  26. box-shadow: 0 0 10px 0 rgba(0,0,0,0.2);
  27. }
  28. </style>
  29. </head>
  30. <body style="background:#edf2f7">
  31. {{--$order collection is available here--}}
  32. @component('mail::message')
  33. # {{ __('sms.order.orderCreated.customer.subject') }}
  34. {{ __('sms.order.orderCreated.customer.message',['ORDER_TRACKING_NUMBER'=>$order->tracking_number]) }}
  35. @component('mail::button', ['url' => $url ])
  36. {{__('common.view-order')}}
  37. @endcomponent
  38. {{__('common.thanks')}},<br>
  39. {{ config('app.name') }}
  40. @endcomponent
  41. <div class="container shadow" style="background: white;margin-top: 1rem;">
  42. @php
  43. $contactDetails = $settings->options['contactDetails'];
  44. $customer = $order->customer;
  45. $shippingAddress = $order->shipping_address;
  46. $products = $order->products;
  47. $settings = $settings->options;
  48. $authorDetails = $settings['contactDetails'];
  49. $authorLocation = $authorDetails['location'];
  50. $currency = isset($settings['currency']) ? $settings['currency']: 'USD';
  51. if($order->parent_id) {
  52. $parentOrder = $order->parent;
  53. }else{
  54. $parentOrder = $order;
  55. }
  56. $cancelled_products = [];
  57. foreach ($parentOrder->children as $childOrder) {
  58. if($childOrder->order_status == 'order-cancelled') {
  59. foreach ($childOrder->products as $product) {
  60. $cancelled_products[] = $product->id;
  61. }
  62. }
  63. }
  64. @endphp
  65. <div style="display: block;">
  66. <div style="width: 50%; {{ $is_rtl ? " direction: ltr;" : "float: left;" }} float: left;">
  67. @if(isset($translated_text['invoice_no']) || isset($order->tracking_number) )
  68. <p>{{ $translated_text['invoice_no'] }}: {{ $order->tracking_number }}</p>
  69. @endif
  70. @if(isset($translated_text['delivery_time']) || isset($order->delivery_time) )
  71. <p>{{ isset($translated_text['payment_method']) ? $translated_text['payment_method'] : 'Payment Method' }}: {{ $order->payment_gateway }}</p>
  72. @endif
  73. </div>
  74. <div style="width: 49%; {{ $is_rtl ? " direction: rtl; float: left; margin-left: 10px;"
  75. : "float: right; text-align: right!important; margin-right: 5px;" }}">
  76. @if(isset($translated_text['date']))
  77. {{ $translated_text['date'] }}: {{date("jS F, Y")}}
  78. @endif
  79. </div>
  80. <div style="clear: both;"></div>
  81. </div>
  82. <div style="height: 30px;"></div>
  83. <div style="display: block;">
  84. <ul style="width: 50%; {{ $is_rtl ? " direction: rtl; float: right;" : "float: left;" }} list-style: none;
  85. margin: 0; padding: 0;">
  86. @if(isset($customer['name']))<li style="display: block; font-size: 18px; font-weight:bold;">
  87. <div style="margin-bottom: 10px">{{$customer['name']}}</div>
  88. </li>@endif
  89. @if(isset($customer['email']))<li style="display: block; color: #6f6f6f; font-size:14px;">
  90. <div style="margin-bottom: 5x">{{$customer['email']}}</div>
  91. </li>@endif
  92. @if(isset($order->customer_contact))
  93. <li style="display: block; color: #6f6f6f; font-size:14px;">
  94. <div style="margin-bottom: 5x">{{$order->customer_contact}}</div>
  95. </li>
  96. @endif
  97. <li>
  98. <ul style="list-style: none; margin: 0; padding: 0;">
  99. @if(isset($shippingAddress['street_address']))
  100. <li style="display: block; color: #6f6f6f; font-size:14px;">{{$shippingAddress['street_address']}}
  101. </li>
  102. @endif
  103. @if(isset($shippingAddress['city']))
  104. <li style="display: block; color: #6f6f6f; font-size:14px;">{{$shippingAddress['city']}}</li>
  105. @endif
  106. @if(isset($shippingAddress['state']))
  107. <li style="display: block; color: #6f6f6f; font-size:14px;">{{$shippingAddress['state']}}</li>
  108. @endif
  109. @if(isset($shippingAddress['zip']))
  110. <li style="display: block; color: #6f6f6f; font-size:14px;">{{$shippingAddress['zip']}}</li>
  111. @endif
  112. @if(isset($shippingAddress['country']))
  113. <li style="display: block; color: #6f6f6f; font-size:14px;">{{$shippingAddress['country']}}</;>
  114. @endif
  115. </ul>
  116. </li>
  117. </ul>
  118. <ul style="width: 49%; {{ $is_rtl ? " direction: ltr; margin: 0; margin-left: 10px;"
  119. : "text-align: right; margin: 0; margin-right: 5px;" }} list-style: none; padding: 0; float: right;">
  120. @if(isset($settings['siteTitle']))
  121. <li style="display: block; color: #000000; font-size:18px; font-weight:bold">
  122. <div style="margin-bottom: 10px">{{$settings['siteTitle']}}</div>
  123. </li>
  124. @endif
  125. @if(isset($authorDetails['website']))
  126. <li style="display: block; color: #6f6f6f; font-size:14px;">
  127. <div>{{$authorDetails['website']}}</div>
  128. </li>
  129. @endif
  130. @if(isset($authorDetails['contact']))
  131. <li style="display: block; color: #6f6f6f; font-size:14px;">
  132. <div>{{$authorDetails['contact']}}</div>
  133. </li>
  134. @endif
  135. @if(isset($authorLocation['formattedAddress']))
  136. <li style="display: block; color: #6f6f6f; font-size:14px;">
  137. <div>{{$authorLocation['formattedAddress']}}</div>
  138. </li>
  139. @endif
  140. </ul>
  141. <div style="clear: both;"></div>
  142. </div>
  143. <div style="height: 30px;"></div>
  144. @if(isset($translated_text['products']) || isset($translated_text['quantity']) || isset($translated_text['total']) )
  145. <ul style="list-style: none; margin: 0; padding: 0;">
  146. @if(isset($translated_text['products']))
  147. <li style="{{ $is_rtl ? " direction: rtl; float: right;" : "float: left; border-right: 1px solid #02705a;" }}
  148. width: 39%; display: inline-block;">
  149. <div style="background-color:#019376; color: #FFF; font : normal 14px; padding:5px 8px;">
  150. <span style="display: block">{{ $translated_text['products'] }}</span>
  151. </div>
  152. </li>
  153. @endif
  154. @if(isset($translated_text['quantity']))
  155. <li style="{{ $is_rtl ? " direction: rtl; float: right; border-left: 1px solid #02705a;"
  156. : "float: left; border-right: 1px solid #02705a;" }} text-align: center; width: 30%; display:
  157. inline-block;">
  158. <div style="background-color:#019376; color: #FFF; font : normal 14px; padding:5px 8px;">
  159. <span style="display: block">{{ $translated_text['quantity'] }}</span>
  160. </div>
  161. </li>
  162. @endif
  163. @if(isset($translated_text['total']))
  164. <li style="{{ $is_rtl ? " direction: rtl; float: right; text-align: left;" : "float: left; text-align: right;"
  165. }} width: 30%; display: inline-block;">
  166. <div style="background-color:#019376; color: #FFF; font : normal 14px; padding:5px 8px;">
  167. <span style="display: block">{{ $translated_text['total'] }}</span>
  168. </div>
  169. </li>
  170. @endif
  171. <li style="clear: both;"></li>
  172. </ul>
  173. @endif
  174. @if (!empty($products))
  175. @foreach ($products as $product)
  176. <ul style="list-style: none; margin: 0; padding: 0;">
  177. <li style="{{ $is_rtl ? " direction: rtl; float: right; border-left: solid 1px #d4d4d4;"
  178. : "float: left; border-right: solid 1px #d4d4d4;" }} width: 39%; display: inline-block; border-bottom: solid
  179. 1px #d4d4d4;">
  180. <div style="display: block; padding: 7px; box-sizing: broder-box;">
  181. {{$product['name']}}
  182. @if(in_array($product->id,$cancelled_products))
  183. <small style="color: red;">{{ $translated_text['cancelled'] ?? "Cancelled"}}</small>
  184. @endif
  185. </div>
  186. </li>
  187. <li style="{{ $is_rtl ? " direction: rtl; float: right; border-left: solid 1px #d4d4d4;"
  188. : "float: left; border-right: solid 1px #d4d4d4;" }} text-align: center; width: 30%; display: inline-block;
  189. border-bottom: solid 1px #d4d4d4;">
  190. <div style="display: block; padding: 7px; box-sizing: broder-box;">
  191. {{$product->pivot['order_quantity']}}
  192. </div>
  193. </li>
  194. <li style="{{ $is_rtl ? " direction: rtl; float: right; text-align: left;" : "float: left; text-align: right;"
  195. }} width: 30%; display: inline-block; border-bottom: solid 1px #d4d4d4;">
  196. <div style="display: block; padding: 7px; box-sizing: broder-box;">
  197. @money($product->pivot['unit_price'], $currency)
  198. </div>
  199. </li>
  200. <li style="clear: both;"></li>
  201. </ul>
  202. @endforeach
  203. @endif
  204. <div style="height: 20px;"></div>
  205. <div style="display: block;">
  206. <div style="width: 65%; height: 10px; {{ $is_rtl ? " direction: rtl; float: right;" : "float: left;" }}"></div>
  207. <div style="width: 33%; {{ $is_rtl ? " direction: rtl; float: left; margin-left: 10px;"
  208. : "float: right; margin-right: 10px;" }}">
  209. @if(isset($order->amount))
  210. <div style="padding: 3px 0px; box-sizing: border-box;">
  211. <div style="display: block; width: 48%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  212. : "float: left;" }} color: #6b7280; font-size:14px;">{{ $translated_text['subtotal']
  213. }} : </div>
  214. <div style="display: block; width: 50%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  215. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">
  216. @money($order->amount, $currency)
  217. </div>
  218. <div style="clear: both;"></div>
  219. </div>
  220. @endif
  221. @if(isset($order->discount))
  222. <div style="padding: 3px 0px; box-sizing: border-box;">
  223. <div style="display: block; width: 48%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  224. : "float: left;" }} color: #6b7280; font-size:14px;">{{ $translated_text['discount']
  225. }} : </div>
  226. <div style="display: block; width: 50%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  227. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">@money($order->discount,
  228. $currency)</div>
  229. <div style="clear: both;"></div>
  230. </div>
  231. @endif
  232. @if(isset($order->sales_tax))
  233. <div style="padding: 3px 0px; box-sizing: border-box;">
  234. <div style="display: block; width: 48%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  235. : "float: left;" }} color: #6b7280; font-size:14px;">{{ $translated_text['tax']
  236. }} : </div>
  237. <div style="display: block; width: 50%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  238. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">@money($order->sales_tax+$order->cancelled_tax,
  239. $currency)</div>
  240. <div style="clear: both;"></div>
  241. </div>
  242. @endif
  243. @if(isset($order->delivery_fee))
  244. <div style="padding: 3px 0px; box-sizing: border-box;">
  245. <div style="display: block; width: 48%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  246. : "float: left;" }} color: #6b7280; font-size:14px;">{{ $translated_text['delivery_fee']
  247. }} : </div>
  248. <div style="display: block; width: 50%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  249. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">
  250. @money($order->delivery_fee+$order->cancelled_delivery_fee,
  251. $currency)</div>
  252. <div style="clear: both;"></div>
  253. </div>
  254. @endif
  255. @if(isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_tax > 0)
  256. <div style="padding: 3px 0px; box-sizing: border-box;">
  257. <div style="display: block; width: 68%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  258. : "float: left;" }} color: #6b7280; font-size:14px;">
  259. {{(isset($translated_text['cancelled_tax'])) ? $translated_text['cancelled_tax'] : "Tax reduced"}} : </div>
  260. <div style="display: block; width: 30%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  261. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">
  262. - @money($order->cancelled_tax,
  263. $currency)</div>
  264. <div style="clear: both;"></div>
  265. </div>
  266. @endif
  267. @if(isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_delivery_fee > 0)
  268. <div style="padding: 3px 0px; box-sizing: border-box;">
  269. <div style="display: block; width: 73%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  270. : "float: left;" }} color: #6b7280; font-size:14px;">
  271. {{(isset($translated_text['cancelled_delivery_fee'])) ? $translated_text['cancelled_delivery_fee'] : "Delivery fee reduced"}} : </div>
  272. <div style="display: block; width: 23%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  273. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">
  274. - @money($order->cancelled_delivery_fee,
  275. $currency)</div>
  276. <div style="clear: both;"></div>
  277. </div>
  278. @endif
  279. @if(isset($order->cancelled_amount) && $order->cancelled_amount > 0)
  280. <div style="padding: 3px 0px; box-sizing: border-box;">
  281. <div style="display: block; width: 68%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  282. : "float: left;" }} color: #6b7280; font-size:14px;">
  283. {{(isset($translated_text['cancelled_subtotal'])) ? $translated_text['cancelled_subtotal'] : " Cancelled subtotal "}}: </div>
  284. <div style="display: block; width: 30%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  285. : "float: right; text-align: right;" }} color: #6b7280; font-size:14px;">
  286. - @money(($order->cancelled_amount-$order->cancelled_tax-$order->cancelled_delivery_fee),
  287. $currency)</div>
  288. <div style="clear: both;"></div>
  289. </div>
  290. @endif
  291. @if(isset($order->total))
  292. <div style="padding: 3px 0px; box-sizing: border-box;">
  293. <div style="display: block; width: 48%; {{ $is_rtl ? " direction: rtl; float: right; text-align: right;"
  294. : "float: left;" }} font-weight: bold; color: #000000; font-size:14px;">{{ $translated_text['total']
  295. }} : </div>
  296. <div style="display: block; width: 50%; {{ $is_rtl ? " direction: rtl; float: left; text-align: left;"
  297. : "float: right; text-align: right;" }} font-weight: bold; color: #000000; font-size:14px;">
  298. @money($order->total,
  299. $currency)</div>
  300. <div style="clear: both;"></div>
  301. </div>
  302. @endif
  303. </div>
  304. <div style="clear: both;"></div>
  305. </div>
  306. </div>
  307. </body>
  308. </html>