print-order.blade.phpbk 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <link rel="preconnect" href="https://fonts.googleapis.com">
  2. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  3. <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic&display=swap" rel="stylesheet">
  4. <style>
  5. @media print {
  6. body{
  7. font-family: 'Noto Sans Arabic', sans-serif;
  8. }
  9. #invoice-POS {
  10. direction: rtl;
  11. padding: 2mm;
  12. width: 80mm;
  13. background: #FFF;
  14. }
  15. ::selection {
  16. background: #f31544;
  17. color: #FFF;
  18. }
  19. ::moz-selection {
  20. background: #f31544;
  21. color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  22. color: #FFF;
  23. }
  24. h1 {
  25. font-size: 1.5em;
  26. color: #222;
  27. font-family: 'Noto Sans Arabic', sans-serif;
  28. }
  29. h2 {
  30. font-size: .9em;
  31. font-family: 'Noto Sans Arabic', sans-serif;
  32. }
  33. h3 {
  34. font-size: 1.2em;
  35. font-weight: 300;
  36. line-height: 2em;
  37. font-family: 'Noto Sans Arabic', sans-serif;
  38. }
  39. p {
  40. font-size: .7em;
  41. color: #666;
  42. line-height: 1.2em;
  43. font-family: 'Noto Sans Arabic', sans-serif;
  44. }
  45. #top, #mid, #bot { /* Targets all id with 'col-' */
  46. border-bottom: 1px solid #EEE;
  47. }
  48. #top {
  49. min-height: 100px;
  50. }
  51. #mid {
  52. min-height: 80px;
  53. }
  54. #bot {
  55. min-height: 50px;
  56. }
  57. #top .logo {
  58. margin: auto;
  59. height: 60px;
  60. width: 60px;
  61. /* background: url(
  62. {!! env('APP_URL').'public/uploads/logo/'.\Illuminate\Support\Facades\Auth::user()->restaurants->photos->file_name !!} ) no-repeat;
  63. */
  64. background-size: 60px 60px;
  65. }
  66. .clientlogo {
  67. float: left;
  68. height: 60px;
  69. width: 60px;
  70. /* background: url(
  71. {!! env('APP_URL').'public/uploads/logo/'.\Illuminate\Support\Facades\Auth::user()->restaurants->photos->file_name !!} ) no-repeat;
  72. */
  73. background-size: 60px 60px;
  74. border-radius: 50px;
  75. }
  76. .info {
  77. display: block;
  78. margin-left: 0;
  79. }
  80. .title {
  81. float: right;
  82. }
  83. .title p {
  84. text-align: right;
  85. }
  86. .table1 {
  87. width: 100%;
  88. border-collapse: collapse;
  89. }
  90. .table1 td {
  91. padding: 5px;
  92. border: 1px solid #EEE
  93. }
  94. .no-border td{
  95. border: 0 !important; font-size: 9px;
  96. }
  97. .tabletitle {
  98. padding: 5px;
  99. font-size: .5em;
  100. background: #FFF;
  101. color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  102. }
  103. .service {
  104. border-bottom: 1px solid #EEE;
  105. }
  106. .item {
  107. width: 24mm;
  108. }
  109. .itemtext {
  110. font-size: .5em;
  111. margin: 0 !important;
  112. }
  113. #legalcopy {
  114. margin-top: 5mm;
  115. }
  116. }
  117. </style>
  118. <div id="invoice-POS">
  119. @php
  120. $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
  121. $resto_meta = isset($resto->resto_metas)?$resto->resto_metas:null;
  122. //dd($resto_meta);
  123. //dump($resto_meta);
  124. $resto_metas = [];
  125. $billing = [];
  126. if(isset($resto_meta)){
  127. foreach($resto_meta as $meta){
  128. if($meta->outlet_id!=""){
  129. continue;
  130. }
  131. $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
  132. // dump($meta->resto_meta_defs);
  133. if($index_name=="BILLING_GATEWAY"){
  134. // dump($meta->resto_meta_defs->meta_def_name);
  135. // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
  136. $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
  137. }
  138. $resto_metas[$index_name] = $meta->meta_val;
  139. }
  140. }
  141. $resto_metas['BILLING_GATEWAY'] = $billing;
  142. $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
  143. $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants";
  144. // dump($resto->default_lang);
  145. app()->setLocale($resto->default_lang);
  146. @endphp
  147. <center id="top">
  148. <p class="legal" style="text-align: center; font-size: 16px"><strong>{{__('label.thankyou')}}</strong> 
  149. <div class="logo"><img src="{!! \Illuminate\Support\Facades\Auth::user()->restaurants->photos->file_name !!}" height="60" /> </div>
  150. <div class="info">{!! $resto->name !!}</h2>
  151. </div><!--End Info-->
  152. </center><!--End InvoiceTop-->
  153. <div id="mid" @if($resto->default_lang=="en") style="direction:ltr" @endif>
  154. <div class="info">
  155. <h2>Order ID: {!! $order->order_ref !!} </h2>
  156. <h6 style="margin: 0">{{__('label.customer_name')}} :
  157. {!! $order->customer_name !!}</h6>
  158. <table class="no-border" border="0" style="border: 0 !important;" @if($resto->default_lang=="en") style="direction:ltr" @endif>
  159. <tr>
  160. <td><strong> {{__('label.address')}} :</strong></td>
  161. <td>
  162. @if(isset($order->customers) && isset($order->customers->customer_addresses) && $order->customers->customer_addresses->count() > 0 ))
  163. {!! ucwords($order->customers->customer_addresses[0]->label) !!}
  164. ،{!! $order->customers->customer_addresses[0]->area !!}
  165. {!! $order->customers->customer_addresses[0]->address !!}
  166. @else
  167. {!! $order->order_instructions !!}
  168. @endif
  169. </td>
  170. </tr>
  171. <tr>
  172. <td><strong> {{__('label.mobile_number')}} :</strong></td>
  173. <td> {!! isset($order->customers)?(str_replace(env('COUNTRY_CODE'),'',$order->customers->users->email)):"" !!} </td>
  174. </tr>
  175. </table>
  176. </div>
  177. </div><!--End Invoice Mid-->
  178. <div id="bot">
  179. <div id="table">
  180. <table class="table1" @if($resto->default_lang=="en") style="direction:ltr" @endif>
  181. @if(isset($order->orderItems) && $order->orderItems->count() > 0)
  182. <tr class="tabletitle">
  183. <th class="item">{{__('label.item_name')}}</th>
  184. <th class="Hours">{{__('label.quantity')}}</th>
  185. <th class="Hours">{{__('label.item_price')}}</th>
  186. <th class="Rate">{{__('label.total_price')}}</th>
  187. </tr>
  188. @php
  189. $total_price = 0;
  190. @endphp
  191. @foreach($order->orderItems as $item)
  192. <tr class="service">
  193. <td class="tableitem"><p class="itemtext">
  194. @php
  195. $recipe = $item->recipes;
  196. $extra_price = 0;
  197. $total_price = $total_price + $item->price;
  198. $cate_name = "";
  199. $categories = isset($recipe->categories)?$recipe->categories->pluck('category_id'):NULL;
  200. if($categories){
  201. $categories = \App\Models\Categories::whereIn('id',$categories)->pluck('name')->toArray();
  202. $cate_name = isset($categories[0])?$categories[0]:"";
  203. }
  204. @endphp
  205. @php
  206. $extra_options = NULL;
  207. $opt = [];
  208. if(!empty($item->extra_options)){
  209. $extra_options = json_decode($item->extra_options);
  210. if($business_type!="ClothsStore"){
  211. //$opt = "<ul>";
  212. foreach($extra_options as $option){
  213. $itm = \App\Models\ExtraOptionItems::find($option->id);
  214. if(isset($itm)){
  215. $opt[] = $itm->name;
  216. // $opt.="<li>".$itm->name.' <span class="ml-2 badge badge-danger">'.number_format($itm->price,2).'</span>';
  217. $extra_price = $extra_price+$itm->price;
  218. $total_price = $total_price+$itm->price;
  219. // dump($extra_price);
  220. if(isset($option->sub_items)){
  221. foreach($option->sub_items as $sub){
  222. $itm = \App\ExtraOptionItems::find($sub->sub_item_id);
  223. $extra_price = $extra_price+$itm->price;
  224. $total_price = $total_price+$itm->price;
  225. }
  226. }
  227. //$opt.="</li>";
  228. }
  229. }
  230. // $opt.="</ul>";
  231. }
  232. if($business_type=="ClothsStore"){
  233. foreach($extra_options as $option){
  234. if(!empty($option->size) && empty($option->color))
  235. echo ($option->size);
  236. if(empty($option->size) && !empty($option->color)){
  237. $color = '<div style="width: 15px; height: 15px; background-color:'.$option->color.'; border-radius: 20px"></div>';
  238. echo ($color);
  239. }
  240. if(!empty($option->size) && !empty($option->color)){
  241. $color = '<div style="width: 15px; height: 15px; background-color:'.$option->color.'; border-radius: 20px;"></div>';
  242. echo ($option->size. " : ".$color);
  243. }
  244. }
  245. }
  246. }
  247. @endphp
  248. {!! isset($item->recipes)?$item->recipes->name:"" !!}</p>
  249. </td>
  250. <td class="tableitem"><p class="itemtext">{!! $item->qty !!}</td>
  251. <td class="tableitem"><p class="itemtext">{!! $currency !!} {!! number_format($extra_price+$item->price) !!}</td>
  252. <td class="tableitem"><p class="itemtext">{!! $currency !!} {!! number_format($item->qty*($extra_price+$item->price)) !!}</td>
  253. </tr>
  254. @php
  255. $total_price = $item->qty * $total_price ;
  256. @endphp
  257. @endforeach
  258. <tr class="tabletitle">
  259. <td></td>
  260. <td></td>
  261. <th class="Rate">{{__('label.delivery_fee')}}</th>
  262. <th class="payment">{!! $currency !!} {!! $order->delivery_fee !!}</th>
  263. </tr>
  264. <tr class="tabletitle">
  265. <td></td>
  266. <td></td>
  267. <th class="Rate">{{__('label.total_amount')}}</th>
  268. <th class="payment">{!! $currency !!} {!! number_format($order->delivery_fee+$total_price) !!}</td>
  269. </tr>
  270. @endif
  271. </table>
  272. </div><!--End Table-->
  273. <div id="legalcopy">
  274. </p>
  275. @if(isset($order->customers) && isset($order->customers->customer_addresses) && $order->customers->customer_addresses->count() > 0 ))
  276. <p class="legal"><strong>{{__('label.delivery_notes')}}:</strong> @if(isset($order->customers) && isset($order->customers->customer_addresses))
  277. {!! $order->customers->customer_addresses[0]->instructions !!} @endif </p>
  278. @endif
  279. </div>
  280. <div style="border-top: 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 8px">
  281. {!! \Illuminate\Support\Facades\Auth::user()->restaurants->name !!} , {!! \Illuminate\Support\Facades\Auth::user()->restaurants->address !!} {!! \Illuminate\Support\Facades\Auth::user()->restaurants->phone_number !!}
  282. </div>
  283. </div><!--End InvoiceBot-->
  284. </div><!--End Invoice-->