print-order.blade.php_1 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <style>
  2. @media all {
  3. #invoice-POS {
  4. direction: rtl;
  5. padding: 2mm;
  6. width: 80mm;
  7. background: #fafafa;
  8. }
  9. ::selection {
  10. background: #f31544;
  11. color: #FFF;
  12. }
  13. ::moz-selection {
  14. background: #f31544;
  15. color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  16. color: #FFF;
  17. }
  18. h1 {
  19. font-size: 1.5em;
  20. color: #222;
  21. }
  22. h2 {
  23. font-size: .9em;
  24. }
  25. h3 {
  26. font-size: 1.2em;
  27. font-weight: 300;
  28. line-height: 2em;
  29. }
  30. p {
  31. font-size: .7em;
  32. color: #666;
  33. line-height: 1.2em;
  34. }
  35. #top, #mid, #bot { /* Targets all id with 'col-' */
  36. border-bottom: 1px solid #EEE;
  37. }
  38. #top {
  39. min-height: 100px;
  40. }
  41. #mid {
  42. min-height: 80px;
  43. }
  44. #bot {
  45. min-height: 50px;
  46. }
  47. #top .logo {
  48. margin: auto;
  49. height: 60px;
  50. width: 60px;
  51. /* background: url(
  52. {!! env('APP_URL').'public/uploads/logo/'.\Illuminate\Support\Facades\Auth::user()->restaurants->photos->file_name !!} ) no-repeat;
  53. */
  54. background-size: 60px 60px;
  55. }
  56. .clientlogo {
  57. float: left;
  58. height: 60px;
  59. width: 60px;
  60. /* background: url(
  61. {!! env('APP_URL').'public/uploads/logo/'.\Illuminate\Support\Facades\Auth::user()->restaurants->photos->file_name !!} ) no-repeat;
  62. */
  63. background-size: 60px 60px;
  64. border-radius: 50px;
  65. }
  66. .info {
  67. display: block;
  68. margin-left: 0;
  69. }
  70. .title {
  71. float: right;
  72. }
  73. .title p {
  74. text-align: right;
  75. }
  76. .table1 {
  77. width: 100%;
  78. border-collapse: collapse;
  79. }
  80. .table1 td {
  81. padding: 5px;
  82. border: 1px solid #EEE
  83. }
  84. .no-border td{
  85. border: 0 !important; font-size: 9px;
  86. }
  87. .tabletitle {
  88. padding: 5px;
  89. font-size: .5em;
  90. background: #EEE;
  91. color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  92. }
  93. .service {
  94. border-bottom: 1px solid #EEE;
  95. }
  96. .item {
  97. width: 24mm;
  98. }
  99. .itemtext {
  100. font-size: .5em;
  101. margin: 0 !important;
  102. }
  103. #legalcopy {
  104. margin-top: 5mm;
  105. }
  106. }
  107. </style>
  108. <div id="invoice-POS">
  109. <center id="top">
  110. <p class="legal" style="text-align: center; font-size: 16px"><strong>شكرا لطلبك!</strong> 
  111. <div class="logo"><img src="{!! env('APP_URL').'public/uploads/logo/'.\Illuminate\Support\Facades\Auth::user()->restaurants->photos->file_name !!}" height="60" /> </div>
  112. <div class="info">
  113. <h2 style="text-align: center">{!! \Illuminate\Support\Facades\Auth::user()->restaurants->name !!}</h2>
  114. </div><!--End Info-->
  115. </center><!--End InvoiceTop-->
  116. <div id="mid">
  117. <div class="info">
  118. <h2>Order ID: {!! $order->order_ref !!} </h2>
  119. <h6 style="margin: 0">اسم الزبون :
  120. {!! $order->customer_name !!}</h6>
  121. <table class="no-border" border="0" style="border: 0 !important;">
  122. <tr>
  123. <td><strong> العنوان :</strong></td>
  124. <td>
  125. @if(isset($order->customers->customer_addresses[0]))
  126. {!! ucwords($order->customers->customer_addresses[0]->label) !!}
  127. ،{!! $order->customers->customer_addresses[0]->area !!}
  128. {!! $order->customers->customer_addresses[0]->address !!}
  129. @endif
  130. </td>
  131. </tr>
  132. <tr>
  133. <td><strong> الموبايل :</strong></td>
  134. <td> {!! isset($order->customers)?(str_replace(env('COUNTRY_CODE'),'',$order->customers->users->email)):"" !!} </td>
  135. </tr>
  136. </table>
  137. </div>
  138. </div><!--End Invoice Mid-->
  139. <div id="bot">
  140. <div id="table">
  141. <table class="table1">
  142. @if(isset($order->orderItems) && $order->orderItems->count() > 0)
  143. <tr class="tabletitle">
  144. <th class="item">اسم المادة</th>
  145. <th class="Hours">الكمية</th>
  146. <th class="Hours">السعر</th>
  147. <th class="Rate">السعر الإجمالي</th>
  148. </tr>
  149. @php
  150. $extra_price = 0;
  151. @endphp
  152. @foreach($order->orderItems as $item)
  153. <tr class="service">
  154. <td class="tableitem"><p class="itemtext">
  155. @php
  156. $recipe = $item->recipes;
  157. $cate_name = "";
  158. $categories = isset($recipe->categories)?$recipe->categories->pluck('category_id'):NULL;
  159. if($categories){
  160. $categories = \App\Categories::whereIn('id',$categories)->pluck('name')->toArray();
  161. $cate_name = $categories[0];
  162. }
  163. @endphp
  164. @php
  165. $extra_options = NULL;
  166. $opt = [];
  167. if(!empty($item->extra_options)){
  168. $extra_options = json_decode($item->extra_options);
  169. //$opt = "<ul>";
  170. foreach($extra_options as $option){
  171. $itm = \App\ExtraOptionItems::find($option->id);
  172. if(isset($itm)){
  173. $opt[] = $itm->name;
  174. // $opt.="<li>".$itm->name.' <span class="ml-2 badge badge-danger">'.number_format($itm->price,2).'</span>';
  175. $extra_price = $extra_price+$itm->price;
  176. // dump($extra_price);
  177. if(isset($option->sub_items)){
  178. foreach($option->sub_items as $sub){
  179. $itm = \App\ExtraOptionItems::find($sub->sub_item_id);
  180. $extra_price = $extra_price+$itm->price;
  181. }
  182. }
  183. //$opt.="</li>";
  184. }
  185. }
  186. // $opt.="</ul>";
  187. }
  188. @endphp
  189. {!! isset($item->recipes)?$item->recipes->name:"" !!}</p>
  190. </td>
  191. <td class="tableitem"><p class="itemtext">{!! $item->qty !!}</td>
  192. <td class="tableitem"><p class="itemtext">IQD {!! number_format($item->price) !!}</td>
  193. <td class="tableitem"><p class="itemtext">IQD {!! number_format($item->qty*$item->price) !!}</td>
  194. </tr>
  195. @endforeach
  196. <tr class="tabletitle">
  197. <td></td>
  198. <td></td>
  199. <th class="Rate">سعر التوصيل</th>
  200. <th class="payment">IQD {!! $order->delivery_fee !!}</th>
  201. </tr>
  202. <tr class="tabletitle">
  203. <td></td>
  204. <td></td>
  205. <th class="Rate">المبلغ الكلي</th>
  206. <th class="payment">IQD {!! number_format($order->delivery_fee+$order->total_price+$extra_price) !!}</td>
  207. </tr>
  208. @endif
  209. </table>
  210. </div><!--End Table-->
  211. <div id="legalcopy">
  212. </p>
  213. <p class="legal"><strong>ملاحظات التوصيل ( ان وجدت):</strong> @if(isset($order->customers) && isset($order->customers->customer_addresses))
  214. {!! $order->customers->customer_addresses[0]->instructions !!} @endif </p>
  215. </div>
  216. <div style="border-top: 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 8px">
  217. {!! \Illuminate\Support\Facades\Auth::user()->restaurants->name !!} , {!! \Illuminate\Support\Facades\Auth::user()->restaurants->address !!} {!! \Illuminate\Support\Facades\Auth::user()->restaurants->phone_number !!}
  218. </div>
  219. </div><!--End InvoiceBot-->
  220. </div><!--End Invoice-->