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.

399 lines
20 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 type="text/css">
  7. body {
  8. font-family: Arial, sans-serif;
  9. }
  10. </style>
  11. @if ($language === 'bd')
  12. <style type="text/css">
  13. body {
  14. font-family: Arial, DejaVu Sans, sans-serif, 'bangla';
  15. }
  16. </style>
  17. @endif
  18. <style type="text/css">
  19. body {
  20. font-family: Arial, DejaVu Sans, sans-serif, 'bangla';
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. @php
  26. $contactDetails = $settings->options['contactDetails'];
  27. $customer = $order->customer;
  28. $shippingAddress = $order->shipping_address;
  29. $products = $order->products;
  30. $settings = $settings->options;
  31. $authorDetails = $settings['contactDetails'];
  32. $authorLocation = $authorDetails['location'];
  33. $currency = isset($settings['currency']) ? $settings['currency'] : 'USD';
  34. $currencyOptions = isset($settings['currencyOptions']) ? $settings['currencyOptions'] : ['formation' => 'en-US', 'fractions' => 2];
  35. $locale = $currencyOptions['formation'] ?? 'en-US';
  36. $amountDue = $order->payment_status !== 'payment-success' ? $order->paid_total - intval($order?->wallet_point?->amount) : 0;
  37. if ($order->order_status === 'order-completed') {
  38. $amountDue = 0;
  39. }
  40. if ($order->parent_id) {
  41. $parentOrder = $order->parent_order;
  42. } else {
  43. $parentOrder = $order;
  44. }
  45. $cancelled_products = [];
  46. foreach ($parentOrder->children as $childOrder) {
  47. if ($childOrder->order_status == 'order-cancelled') {
  48. foreach ($childOrder->products as $product) {
  49. $cancelled_products[] = $product->id;
  50. }
  51. }
  52. }
  53. @endphp
  54. <div style="display: block;">
  55. <div style="width: 50%; {{ $is_rtl ? ' direction: ltr;' : 'float: left;' }} float: left;">
  56. @if (isset($translated_text['invoice_no']) || isset($order->tracking_number))
  57. <p>{{ $translated_text['invoice_no'] }}: {{ $order->tracking_number }}</p>
  58. @endif
  59. @if (isset($translated_text['delivery_time']) || isset($order->delivery_time))
  60. <p>{{ isset($translated_text['payment_method']) ? $translated_text['payment_method'] : 'Payment Method' }}:
  61. {{ $order->payment_gateway }}</p>
  62. @endif
  63. </div>
  64. <div
  65. style="width: 49%; {{ $is_rtl
  66. ? ' direction: rtl; float: left; margin-left: 10px;'
  67. : 'float: right; text-align: right; margin-right: 5px;' }}">
  68. @if (isset($translated_text['date']))
  69. <p>{{ $translated_text['date'] }}: {{ date('jS F, Y') }}</p>
  70. @endif
  71. </div>
  72. <div style="clear: both;"></div>
  73. </div>
  74. <div style="height: 30px;"></div>
  75. <div style="display: block;">
  76. <ul
  77. style="width: 50%; {{ $is_rtl ? ' direction: rtl; float: right;' : 'float: left;' }} list-style: none;
  78. margin: 0; padding: 0;">
  79. @if (isset($customer['name']))
  80. <li style="display: block; font-size: 18px; font-weight:bold;">
  81. <div style="margin-bottom: 10px">{{ $customer['name'] }}</div>
  82. </li>
  83. @endif
  84. @if (isset($customer['email']))
  85. <li style="display: block; color: #6f6f6f; font-size:14px;">
  86. <div style="margin-bottom: 5x">{{ $customer['email'] }}</div>
  87. </li>
  88. @endif
  89. @if (isset($order->customer_contact))
  90. <li style="display: block; color: #6f6f6f; font-size:14px;">
  91. <div style="margin-bottom: 5x">{{ $order->customer_contact }}</div>
  92. </li>
  93. @endif
  94. <li>
  95. <ul style="list-style: none; margin: 0; padding: 0;">
  96. @if (isset($shippingAddress['street_address']))
  97. <li style="display: block; color: #6f6f6f; font-size:14px;">
  98. {{ $shippingAddress['street_address'] }}
  99. </li>
  100. @endif
  101. @if (isset($shippingAddress['city']))
  102. <li style="display: block; color: #6f6f6f; font-size:14px;">{{ $shippingAddress['city'] }}</li>
  103. @endif
  104. @if (isset($shippingAddress['state']))
  105. <li style="display: block; color: #6f6f6f; font-size:14px;">{{ $shippingAddress['state'] }}
  106. </li>
  107. @endif
  108. @if (isset($shippingAddress['zip']))
  109. <li style="display: block; color: #6f6f6f; font-size:14px;">{{ $shippingAddress['zip'] }}</li>
  110. @endif
  111. @if (isset($shippingAddress['country']))
  112. <li style="display: block; color: #6f6f6f; font-size:14px;">{{ $shippingAddress['country'] }}
  113. </;>
  114. @endif
  115. </ul>
  116. </li>
  117. </ul>
  118. <ul
  119. style="width: 49%; {{ $is_rtl
  120. ? ' direction: ltr; margin: 0; margin-left: 10px;'
  121. : 'text-align: right; margin: 0; margin-right: 5px;' }} list-style: none; padding: 0; float: right;">
  122. @if (isset($settings['siteTitle']))
  123. <li style="display: block; color: #000000; font-size:18px; font-weight:bold">
  124. <div style="margin-bottom: 10px">{{ $settings['siteTitle'] }}</div>
  125. </li>
  126. @endif
  127. @if (isset($authorDetails['website']))
  128. <li style="display: block; color: #6f6f6f; font-size:14px;">
  129. <div>{{ $authorDetails['website'] }}</div>
  130. </li>
  131. @endif
  132. @if (isset($authorDetails['contact']))
  133. <li style="display: block; color: #6f6f6f; font-size:14px;">
  134. <div>{{ $authorDetails['contact'] }}</div>
  135. </li>
  136. @endif
  137. @if (isset($authorLocation['formattedAddress']))
  138. <li style="display: block; color: #6f6f6f; font-size:14px;">
  139. <div>{{ $authorLocation['formattedAddress'] }}</div>
  140. </li>
  141. @endif
  142. </ul>
  143. <div style="clear: both;"></div>
  144. </div>
  145. <div style="height: 30px;"></div>
  146. @if (isset($translated_text['products']) || isset($translated_text['quantity']) || isset($translated_text['total']))
  147. <ul style="list-style: none; margin: 0; padding: 0;">
  148. @if (isset($translated_text['products']))
  149. <li
  150. style="{{ $is_rtl ? ' direction: rtl; float: right;' : 'float: left; border-right: 1px solid #02705a;' }}
  151. width: 39%; display: inline-block;">
  152. <div style="background-color:#019376; color: #FFF; font : normal 14px; padding:5px 8px;">
  153. <span style="display: block">{{ $translated_text['products'] }}</span>
  154. </div>
  155. </li>
  156. @endif
  157. @if (isset($translated_text['quantity']))
  158. <li
  159. style="{{ $is_rtl
  160. ? ' direction: rtl; float: right; border-left: 1px solid #02705a;'
  161. : 'float: left; border-right: 1px solid #02705a;' }} text-align: center; width: 30%; display:
  162. inline-block;">
  163. <div style="background-color:#019376; color: #FFF; font : normal 14px; padding:5px 8px;">
  164. <span style="display: block">{{ $translated_text['quantity'] }}</span>
  165. </div>
  166. </li>
  167. @endif
  168. @if (isset($translated_text['total']))
  169. <li
  170. style="{{ $is_rtl ? ' direction: rtl; float: right; text-align: left;' : 'float: left; text-align: right;' }} width: 30%; display: inline-block;">
  171. <div style="background-color:#019376; color: #FFF; font : normal 14px; padding:5px 8px;">
  172. <span style="display: block">{{ $translated_text['total'] }}</span>
  173. </div>
  174. </li>
  175. @endif
  176. <li style="clear: both;"></li>
  177. </ul>
  178. @endif
  179. @if (!empty($products))
  180. @foreach ($products as $product)
  181. <ul style="list-style: none; margin: 0; padding: 0;">
  182. <li
  183. style="{{ $is_rtl
  184. ? ' direction: rtl; float: right; border-left: solid 1px #d4d4d4;'
  185. : 'float: left; border-right: solid 1px #d4d4d4;' }} width: 39%; display: inline-block; border-bottom: solid
  186. 1px #d4d4d4;">
  187. <div style="display: block; padding: 7px; box-sizing: broder-box;">
  188. {{ $product['name'] }}
  189. @if (in_array($product->id, $cancelled_products))
  190. <small style="color: red;">{{ $translated_text['cancelled'] ?? 'Cancelled' }}</small>
  191. @endif
  192. </div>
  193. </li>
  194. <li
  195. style="{{ $is_rtl
  196. ? ' direction: rtl; float: right; border-left: solid 1px #d4d4d4;'
  197. : 'float: left; border-right: solid 1px #d4d4d4;' }} text-align: center; width: 30%; display: inline-block;
  198. border-bottom: solid 1px #d4d4d4;">
  199. <div style="display: block; padding: 7px; box-sizing: broder-box;">
  200. {{ $product->pivot['order_quantity'] }}
  201. </div>
  202. </li>
  203. <li
  204. style="{{ $is_rtl ? ' direction: rtl; float: right; text-align: left;' : 'float: left; text-align: right;' }} width: 30%; display: inline-block; border-bottom: solid 1px #d4d4d4;">
  205. <div style="display: block; padding: 7px; box-sizing: broder-box;">
  206. {{ formatCurrency($product->pivot['unit_price'], $currency, $locale) }}
  207. </div>
  208. </li>
  209. <li style="clear: both;"></li>
  210. </ul>
  211. @endforeach
  212. @endif
  213. <div style="height: 20px;"></div>
  214. <div style="display: block;">
  215. <div style="width: 65%; height: 10px; {{ $is_rtl ? ' direction: rtl; float: right;' : 'float: left;' }}"></div>
  216. <div
  217. style="width: 33%; {{ $is_rtl ? ' direction: rtl; float: left; margin-left: 10px;' : 'float: right; margin-right: 10px;' }}">
  218. @if (isset($order->amount))
  219. <div style="padding: 3px 0px; box-sizing: border-box;">
  220. <div
  221. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  222. {{ $translated_text['subtotal'] }} : </div>
  223. <div
  224. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  225. {{ formatCurrency($order->amount, $currency, $locale) }}
  226. </div>
  227. <div style="clear: both;"></div>
  228. </div>
  229. <br>
  230. @endif
  231. @if (isset($order->discount))
  232. <div style="padding: 3px 0px; box-sizing: border-box;">
  233. <div
  234. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  235. {{ $translated_text['discount'] }} : </div>
  236. <div
  237. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  238. {{ formatCurrency($order->discount, $currency, $locale) }}
  239. </div>
  240. <div style="clear: both;"></div>
  241. </div>
  242. <br>
  243. @endif
  244. @if (isset($order->sales_tax))
  245. <div style="padding: 3px 0px; box-sizing: border-box;">
  246. <div
  247. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  248. {{ $translated_text['tax'] }} : </div>
  249. <div
  250. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  251. {{ formatCurrency($order->sales_tax + $order->cancelled_tax, $currency, $locale) }}
  252. <div style="clear: both;"></div>
  253. </div>
  254. <br>
  255. @endif
  256. @if (isset($order->delivery_fee))
  257. <div style="padding: 3px 0px; box-sizing: border-box;">
  258. <div
  259. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  260. {{ $translated_text['delivery_fee'] }} : </div>
  261. <div
  262. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  263. {{ formatCurrency($order->sales_tax + $order->cancelled_tax, $currency, $locale) }}
  264. </div>
  265. <div style="clear: both;"></div>
  266. </div>
  267. <br>
  268. @endif
  269. @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_tax > 0)
  270. <div style="padding: 3px 0px; box-sizing: border-box;">
  271. <div
  272. style="display: block; width: 68%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  273. {{ isset($translated_text['cancelled_tax']) ? $translated_text['cancelled_tax'] : 'Tax reduced' }}
  274. :
  275. </div>
  276. <div
  277. style="display: block; width: 30%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  278. - {{ formatCurrency($order->cancelled_tax, $currency, $locale) }}
  279. </div>
  280. <div style="clear: both;"></div>
  281. </div>
  282. <br>
  283. @endif
  284. @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0 && $order->cancelled_delivery_fee > 0)
  285. <div style="padding: 3px 0px; box-sizing: border-box;">
  286. <div
  287. style="display: block; width: 73%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  288. {{ isset($translated_text['cancelled_delivery_fee']) ? $translated_text['cancelled_delivery_fee'] : 'Delivery fee reduced' }}
  289. :
  290. </div>
  291. <div
  292. style="display: block; width: 23%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  293. - {{ formatCurrency($order->cancelled_delivery_fee, $currency, $locale) }}
  294. </div>
  295. <div style="clear: both;"></div>
  296. </div>
  297. <br>
  298. @endif
  299. @if (isset($order->cancelled_amount) && $order->cancelled_amount > 0)
  300. <div style="padding: 3px 0px; box-sizing: border-box;">
  301. <div
  302. style="display: block; width: 68%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  303. {{ isset($translated_text['cancelled_subtotal']) ? $translated_text['cancelled_subtotal'] : ' Cancelled subtotal ' }}:
  304. </div>
  305. <div
  306. style="display: block; width: 30%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  307. -{{ formatCurrency($order->cancelled_amount - $order->cancelled_tax - $order->cancelled_delivery_fee, $currency, $locale) }}
  308. </div>
  309. <div style="clear: both;"></div>
  310. </div>
  311. <br>
  312. @endif
  313. @if (isset($order->total))
  314. <div style="padding: 3px 0px; box-sizing: border-box;">
  315. <div
  316. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} font-weight: bold; color: #000000; font-size:14px;">
  317. {{ $translated_text['total'] }} : </div>
  318. <div
  319. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} font-weight: bold; color: #000000; font-size:14px;">
  320. {{ formatCurrency($order->total, $currency, $locale) }}
  321. </div>
  322. <div style="clear: both;"></div>
  323. </div>
  324. <br>
  325. @endif
  326. @if (isset($order?->wallet_point?->amount) && !$order->shop_id)
  327. <div style="padding: 3px 0px; box-sizing: border-box;">
  328. <div
  329. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  330. {{ $translated_text['paid_from_wallet'] }} : </div>
  331. <div
  332. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  333. {{ formatCurrency($order?->wallet_point?->amount, $currency, $locale) }}
  334. </div>
  335. <div style="clear: both;"></div>
  336. </div>
  337. <br>
  338. @endif
  339. @if (!$order->shop_id)
  340. <div style="padding: 3px 0px; box-sizing: border-box;">
  341. <div
  342. style="display: block; width: 48%; {{ $is_rtl ? ' direction: rtl; float: right; text-align: right;' : 'float: left;' }} color: #6b7280; font-size:14px;">
  343. {{ $translated_text['amount_due'] }} : </div>
  344. <div
  345. style="display: block; width: 50%; {{ $is_rtl ? ' direction: rtl; float: left; text-align: left;' : 'float: right; text-align: right;' }} color: #6b7280; font-size:14px;">
  346. {{ formatCurrency($amountDue, $currency, $locale) }}
  347. </div>
  348. <div style="clear: both;"></div>
  349. </div>
  350. @endif
  351. </div>
  352. <div style="clear: both;"></div>
  353. </div>
  354. </body>
  355. </html>