1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561 |
- @extends('layouts.app')
- @section('page-title')| Order History @endsection
- @section('content')
- <link href="{!! env('APP_ASSETS') !!}css/order-history.css" rel="stylesheet" type="text/css">
- <link href="{!! env('APP_ASSETS') !!}vendor_components/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
- <style>
- #discount-info{
- position: absolute;
- height: auto;
- width: 400px;
- border: 1px solid;
- bottom: 15%;
- background: #fff;
- left: 22%;
- border-radius: 5px;
- padding: 15px;
- display: none;
- z-index: 1;
- box-shadow: 0px 2px 3px #091E4240, 0px 0px 1px #091E424F;
- }
- span.info,.close-popup{
- cursor: pointer;
- position: relative;
- top: -2px;
- }
- #discount-info.active{
- display: block;
- }
- .item-list .list-group-item{
- background-color: transparent !important;
- }
- #only-loyalty-points{
- display:none;
- }
- #only-loyalty-points.active{
- display:block;
- }
- .item-list .list-group{
- margin-left: 18px !important;
- }
- .content{
- padding-left:10px;
- }
- @-webkit-keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27); }
- to { background-color: inherit; }
- }
- @-moz-keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27);; }
- to { background-color: inherit; }
- }
- @-o-keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27);; }
- to { background-color: inherit; }
- }
- @keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27);; }
- to { background-color: inherit; }
- }
- .special {
- -webkit-animation: special 1s infinite; /* Safari 4+ */
- -moz-animation: special 1s infinite; /* Fx 5+ */
- -o-animation: special 1s infinite; /* Opera 12+ */
- animation: special 1s infinite; /* IE 10+ */
- }
- .page-link{
- padding: .5em 1em !important;
- border-radius: 2px;
- border: 0;
- margin: 0;
- min-width: 50px !important;
- text-align: center;
- }
- .page-item.active .page-link{
- background-color: #4c95dd;
- }
- table.dataTable {
- clear: both;
- margin-top: 6px !important;
- margin-bottom: 6px !important;
- max-width: none !important;
- border-collapse: collapse !important;
- font-family: 'Open Sans';
- }
- /*table.dataTable td{
- border-width: 1px;
- }*/
- .theme-primary .pagination li a:hover {
- background-color: #000 !important;
- }
- .table > :not(:last-child) > :last-child > * {
- border-bottom-color: transparent;
- }
- table.dataTable th{font-weight: 700 !important;}
- .dataTables_paginate {
- width: 100%;
- text-align: center;
- }
- div.dataTables_wrapper div.dataTables_paginate ul.pagination{
- justify-content: center !important;
- }
- .right-panel-footer {
- background-color: #fff7e8;
- }
- .actions{
- position:absolute; top: 25px; right: 0
- }
- .content-wrapper {
- width: calc(100% - 290px);
- background-color: #fff !important;
- }
- .actions li{ margin:0 !important; padding:0}
- @media(max-width:767px)
- {
- .sm-w-50{
- width:50%;
- }
- }
- .pl-10{
- padding-left: 10px;
- }
- .pr-10{
- padding-right: 10px;
- }
- .page-top-title{
- padding-left: 0;
- }
- html[dir="rtl"] .row.pt-15.pl-10.pr-10{
- margin: 0 !important;
- }
- #print-recipt{
- display: none; }
- </style>
- @php
- $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
- $lang = $resto->default_lang;
- app()->setLocale($lang);
- if(session('app_lang') !==null){
- $lang = session('app_lang');
- app()->setLocale($lang);
- }
- $restuarant1 = $resto ;
- $resto_metas = \App\Helpers\CommonMethods::getRestoMetas($restuarant1);
- $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
- $is_tax_info = isset($resto_metas['DISPLAY_TAX_INFO'])?$resto_metas['DISPLAY_TAX_INFO']:"";
- $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants";
- $translations = \App\Models\Translations::whereIn('item_key',['delivery','delivered','rejected','cancelled','close'])->get();
- $tr_ar = [];
- $tr_en = [];
- foreach($translations as $tr){
- if($tr->lang_id=="en")
- $tr_en[ucwords($tr->item_key)]= $tr->item_val;
- else
- $tr_ar[ucwords($tr->item_key)]= $tr->item_val;
- }
- @endphp
- @if($lang=="ar")
- <style>
- #show-order-detail .modal-header{
- display: block !important;
- }
- .btn-close{
- float: left;
- position: relative;
- top: -21px;
- }
- </style>
- @endif
- <div class="content-wrapper">
- <div class="container-full">
- <section class="content">
- <div class="row ">
- <div class="col-md-10">
- <div class="page-top-title">
- <h3 class="title m-0">{{__('label.order_history')}}</h3>
- </div>
- </div>
- </div>
- <div class="row pt-15 pl-10 pr-10">
- <div class="card cust_card p-15 rounded-1">
- <form class="row g-3 ordhistory" action="{!! env('APP_URL') !!}order/history">
- <div class="col-md-4 sm-pl-0">
- <input type="text" class="form-control" name="order_ref" value="{!! isset($_GET['order_ref'])?$_GET['order_ref']:"" !!}" placeholder="{{__('label.id')}}" id="inputID">
- </div>
- <div class="col-md-8 sm-pl-0">
- <input type="text" class="form-control" name="phone_number" value="{!! isset($_GET['phone_number'])?$_GET['phone_number']:"" !!}" placeholder="{{__('label.phone_number')}}" id="inputPassword4">
- </div>
- <div class="col-12 sm-pl-0">
- <select class="form-control form-select " name="outlet_id" title="{{__('label.outlets')}}" data-live-search="true">
- <option value="">Choose Outlet</option>
- @php
- $outlets = \App\Models\Outlets::whereNull('deleted_at')->where('resto_id',\App\Helpers\CommonMethods::getRestuarantID())->where('active',1)->get();
- @endphp
- @if(isset($outlets))
- @foreach($outlets as $outlet)
- <option @if(isset($_GET['outlet_id']) && !empty($_GET['outlet_id']) && $_GET['outlet_id']==$outlet->id) selected @endif value="{!! $outlet->id !!}">{!! $outlet->name !!}</option>
- @endforeach
- @endif
- </select>
- </div>
- <div class="col-12 sm-pl-0">
- <input type="text" class="form-control" id="date_range" value="{!! isset($_GET['date_range'])?$_GET['date_range']:"" !!}" name="date_range" placeholder="{{__('label.date_range')}}">
- </div>
- <div class="col-12 sm-pl-0">
- <select class="form-control form-select" name="order_status" data-live-search="true" title="{{__('label.order_status')}}">
- <option value="">Choose Order Status</option>
- <option value="Placed" @if(isset($_GET['order_status']) && $_GET['order_status']=="Placed") selected @endif>{{__('label.placed')}}</option>
- <option value="Accepted" @if(isset($_GET['order_status']) && $_GET['order_status']=="Accepted") selected @endif>{{__('label.in_preparation')}}</option>
- <option value="On_Road" @if(isset($_GET['order_status']) && $_GET['order_status']=="On_Road") selected @endif>{{__('label.in_routeready')}}</option>
- <option value="Has_Delivered" @if(isset($_GET['order_status']) && $_GET['order_status']=="Has_Delivered") selected @endif>{{__('label.delivered')}}</option>
- <option value="Cancelled" @if(isset($_GET['order_status']) && $_GET['order_status']=="Cancelled") selected @endif>{{__('label.cancelled')}}</option>
- <option value="Rejected" @if(isset($_GET['order_status']) && $_GET['order_status']=="Rejected") selected @endif>{{__('label.rejected')}}</option>
- <option value="Close" @if(isset($_GET['order_status']) && $_GET['order_status']=="Close") selected @endif>{{__('label.rejected_by_user')}}</option>
- <option value="Close" @if(isset($_GET['order_status']) && $_GET['order_status']=="Fail") selected @endif>{{__('label.order_status_fail')}}</option>
- </select>
- </div>
- <div class="col-12 sm-pl-0">
- <select class="form-control form-select selectpicker">
- <option>{{__('label.select_option')}}</option>
- </select>
- </div>
- <div class="col-12 sm-pl-0">
- <select class="form-control form-select selectpicker">
- <option>{{__('label.select_option')}}</option>
- </select>
- </div>
- <div class="col-6 sm-pl-0">
- <button type="submit" class="btn btn-outline-primary btn-md rounded-0 sm-w-50">{{__('label.search')}}</button>
- </div>
- </form>
- </div>
- <div class="card p-15 rounded-1 sm-pl-0">
- <div class="jumbotron p-0">
- <div class="row">
- <div class="col-md-12 sm-pl-3">
- <div class="table-responsive order-his-tbl">
- <table id="example" class="table table-striped" >
- <thead>
- <tr>
- <th>{{__('label.id')}}</th>
- <th>{{__('label.status')}}</th>
- <th>{{__('label.customer')}}</th>
- <th>{{__('label.mobile_no')}}</th>
- <th>{{__('label.type')}}</th>
- <th>{{__('label.payment_mode')}}</th>
- <th>{{__('label.total')}}</th>
- <th>{{__('label.channel')}}</th>
- <th>{{__('label.order_at')}}</th>
- <th>{{__('label.deliver_at')}}</th>
- </tr>
- </thead>
- <tbody>
- @if(isset($orders) && $orders->count() > 0)
- @php
- $country_code = "";
- if(isset($restuarant1->countries))
- $country_code = $restuarant1->countries->country_code;
- @endphp
- @php
- $custom_status['Placed'] = ['Accepted'=>'Accepted','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
- $custom_status['Send_to_Kitchen'] = [' <a href="#!" class="print1">On_Road'=>'On the Way','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
- $custom_status['On_Road'] = ['Has_Delivered'=>'Delivered','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
- $custom_statuses = ['Rejected_by_User'=>'Rejected by User','Accepted'=>'Accepted','Rejected'=>'Rejected','Placed'=>'Placed','Send_to_Kitchen'=>'Send to Kitchen','On_Road'=>'On the Way', 'Has_Delivered'=>'Delivered','Served'=>"Served",
- "Cancelled_by_Customer"=>"Cancelled","Close"=>"Close","Fail"=>"Fail"];
- $custom_status['Accepted'] = ['On_Road'=>'On the Way','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User'];
- @endphp
- @foreach($orders as $order)
- <tr class="order-detail" data-id="{!! $order->id !!}">
- <td> {!! $order->order_ref !!}</td>
- @if(app()->getLocale()=="en")
- <td>{!! isset($custom_statuses[$order->status])?$custom_statuses[$order->status]:"" !!}</td>
- @else
- <td>{!! $tr_ar[isset($custom_statuses[$order->status])?$custom_statuses[$order->status]:""] !!}</td>
- @endif
- @php
- $customer_name = $order->customer_name;
- if(empty($customer_name)){
- $customer_name = $order->customers->name;
- }
- @endphp
- <td>{!! $customer_name !!}</td>
- @php
- $new_phone = "";
- if(isset($order->customers) && isset($order->customers->users)){
- $pos = strpos($order->customers->users->email,$country_code);
- if ($pos !== false) {
- $new_phone = substr_replace($order->customers->users->email, '', $pos, strlen($country_code));
- }else{
- $new_phone = $order->customers->users->email;
- }
- }
- @endphp
- <td>{!! $new_phone !!}</td>
- <td>{!! app()->getLocale()=="en"?$order->order_type:$tr_ar[ucwords($order->order_type)] !!}</td>
- <td>{!! $order->payment_mode=="COD"?__('label.cash'):__('label.card') !!} </td>
- <td>{!! $currency !!} {!! $order->getActualPriceAttribute() !!}</td>
- <td>{!! $order->campaign_type!!}</td>
- <td>{!! \App\Helpers\CommonMethods::formatDateTime($order->created_at) !!}</td>
- <td>{!! \App\Helpers\CommonMethods::formatDateTime($order->updated_at) !!}</td>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <!-- /.content -->
- </div>
- </div>
- <!-- /.content-wrapper -->
- <div class="modal fade" id="show-order-detail" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="staticBackdropLabel">{{__('label.order_detail')}}</h5>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
- </div>
- <div class="modal-body">
- <div class="order-section" style="max-height: 500px; overflow-x: auto;">
- <div class="row">
- <div class="col-sm-12">
- <div class="boxs">
- <div class="box-header with-border">
- <div class="d-flex justify-content-between align-items-center">
- <p class="fw-bold" rel="order_ref"></p>
- <p rel="order_placed"></p>
- <p class="p-2 inkitchen-btn" id="toggle"></p>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-sm-12 mt-1 text-end">
- <a href="#!" class="print">
- <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-printer-fill" viewBox="0 0 16 16">
- <path d="M5 1a2 2 0 0 0-2 2v1h10V3a2 2 0 0 0-2-2H5zm6 8H5a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z"/>
- <path d="M0 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-1v-2a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2H2a2 2 0 0 1-2-2V7zm2.5 1a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1z"/>
- </svg>
- </a>
- </div>
- </div>
- <div class="row right-panel-box">
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div>
- <p class="text-fade mb-0">{{__('label.brand')}}</p>
- <p rel="brand_name"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div>
- <p class="text-fade mb-0">{{__('label.outlets')}}</p>
- <p rel="outlet_name"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row right-panel-box">
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div>
- <p class="text-fade mb-0">{{__('label.order_type')}}</p>
- <p>
- <i class="icon-Dinner"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span></i>
- <span rel="order_type"></span>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6 for-delivery">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.delivery_at')}}</p>
- <p rel="delivery_at"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6 for-pickup" style="display:none">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.pickup_at')}}</p>
- <p rel="delivery_at"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row right-panel-box">
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.customers')}}</p>
- <p rel="customer"> <br>
- <i class="mdi mdi-crown org-color"></i>
- <small class="org-color">Ordered 5 times </small>
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.phone_number')}}</p>
- <p rel="phone"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row right-panel-box">
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.payment_mode')}}</p>
- <p rel="payment"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.channel')}}</p>
- <p rel="channel"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row right-panel-box">
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.address')}}</p>
- <p rel="address"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.delivery_notes')}}</p>
- <p rel="delivery_notes"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--<div class="row right-panel-box for-delivery" id="google-map-link">
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">Formatted Address</p>
- <p rel="formatted_address"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">Share Google map link</p>
- <p rel="google-map-link"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>-->
- <div class="row right-panel-box">
- <div class="col-md-12">
- <div class="boxs" style="position: relative">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.address')}}</p>
- <p rel="address"></p>
- </div>
- </div>
- </div>
- <div class="actions">
- <ul class="list-inline">
- <li class="list-inline-item"><a href="#!" class="address-actions" data-action="copy-clipboard"><svg data-v-10e82b3e="" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="" style="color: var(--color-midnight); width: 20px; height: 20px;"><path fill-rule="evenodd" d="M16 5.5H6a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h10a.5.5 0 00.5-.5V6a.5.5 0 00-.5-.5zM6 4a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2H6z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M1.25 4A2.75 2.75 0 014 1.25h6a.75.75 0 010 1.5H4c-.69 0-1.25.56-1.25 1.25v6a.75.75 0 01-1.5 0V4z" clip-rule="evenodd"></path></svg></a></li>
- <li class="list-inline-item"><a href="#!" class="address-actions" data-action="google-map"><svg data-v-2740a47f="" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="" style="width: 20px; height: 20px;"><path d="M16.45 7.7c0 3.152-2.19 4.965-3.831 6.72-.983 1.051-1.769 4.48-1.769 4.48s-.784-3.426-1.764-4.475C7.443 12.671 5.25 10.855 5.25 7.7a5.6 5.6 0 1111.2 0v0z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.61 7.7a2.24 2.24 0 104.48 0 2.24 2.24 0 00-4.48 0z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></a></li>
- <li class="list-inline-item">
- <a href="#!" class="address-actions" data-action="whatsapp">
- <svg data-v-2740a47f="" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="" style="width: 20px; height: 20px;"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.071 4.013a9.192 9.192 0 016.502-2.663 9.192 9.192 0 019.207 9.143v.01A9.222 9.222 0 015.803 18.33l-2.92.925a.75.75 0 01-.937-.954l.932-2.763a9.027 9.027 0 01-1.528-5.042v-.003a9.192 9.192 0 012.721-6.48zM10.572 2.1l-.002.75a7.692 7.692 0 00-7.72 7.65 7.527 7.527 0 001.464 4.473.75.75 0 01.107.685l-.58 1.72 1.84-.583a.75.75 0 01.638.088 7.722 7.722 0 0011.96-6.387 7.692 7.692 0 00-7.705-7.646l-.002-.75zM8.548 5.878c.223.115.47.313.606.628.055.126.132.314.212.51l.177.43c.07.167.134.316.186.428.026.056.045.096.058.12v.002a1.149 1.149 0 01.058 1.17 1.27 1.27 0 01-.282.38 5.126 5.126 0 01-.07.063l-.048.045a6.172 6.172 0 002.386 2.02c.085-.116.18-.253.252-.367.156-.246.41-.47.777-.513.277-.032.52.062.614.098l.009.004c.2.076 1.063.497 1.425.673l.136.066c.019.009.04.02.064.03.077.037.173.082.246.123.085.047.297.166.434.4.04.068.067.14.083.213a1.81 1.81 0 01-.216 1.572c-.796 1.379-2.173 1.81-3.55 1.667-1.356-.14-2.785-.827-3.962-1.76-1.178-.934-2.19-2.183-2.63-3.538-.452-1.393-.293-2.904.899-4.163.401-.436 1-.53 1.429-.496.233.018.482.078.707.195zm5.91 7.139l-.066-.031-.175-.085a155.61 155.61 0 00-1.056-.508 6 6 0 01-.39.508c-.133.15-.35.327-.67.366a1.22 1.22 0 01-.686-.133 7.672 7.672 0 01-3.436-2.979l-.01-.016a1.033 1.033 0 01-.085-.922c.086-.216.248-.379.276-.408a8.417 8.417 0 01.24-.234 15.217 15.217 0 01-.242-.552l-.19-.463a46.22 46.22 0 00-.15-.365.524.524 0 00-.313.012c-.76.8-.875 1.717-.565 2.672.323.995 1.113 2.016 2.135 2.826 1.021.81 2.188 1.34 3.184 1.443.963.1 1.683-.193 2.108-.943a.728.728 0 01.038-.061.312.312 0 00.052-.127zM7.515 7.194l-.002.003.002-.003zm.346.018H7.86h.002zm4.226 4.58zm-2.29-3.779z" fill="currentColor"></path></svg>
- </a>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- @if( $business_type=="Florist")
- <div class="row right-panel-box" >
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.receiver_name')}}</p>
- <p rel="recipient_name"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.receiver_phone')}}</p>
- <p rel="recipient_phone"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row right-panel-box" >
- <div class="col-md-12">
- <div class="boxs">
- <div class="box-body">
- <div class="d-flex align-items-start">
- <div class="">
- <p class="text-fade mb-0">{{__('label.greeting_message')}}</p>
- <p rel="greeting_message"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- @endif
- </div>
- <div class="row mt-0 right-panel-footer position-relative">
- <div id="discount-info">
- <ul class="list-group list-group-flush">
- <li class="list-group-item">Discount Code : <strong><span id="discount-code"></span></strong></li>
- <li class="list-group-item">Discount Name : <strong><span id="discount-name"></span></strong></li>
- <li class="list-group-item">Discount Amount : <strong><span id="discount-amount"></span></strong></li>
- <li class="list-group-item">Start DateTime : <strong><span id="discount-start-datetime"></span></strong></li>
- <li class="list-group-item">End DateTime : <strong><span id="discount-end-datetime"></span></strong></li>
- <li class="list-group-item text-end">
- <span class="close-popup">
- <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
- <path fill="currentColor" d="m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275q.275.275.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 13.4Z"/></svg>
- </span>
- </li>
- </ul>
- </div>
- <div class="col-12" id="show-recipes">
- </div>
- <div class="col-12 calc_div">
- <div class="box-header border-0 p-15 mt-0 pb-0">
- <div class="d-flex justify-content-between align-items-center m-0">
- <p>{{__('label.sub_total')}}:</p>
- <p class="sub_total"></p>
- </div>
- <div class="discount_with text-success d-flex justify-content-between align-items-center m-0">
- <p>{{__('label.discounts')}} ( <span rel="discount_code"></span> ) ( <span rel="discount_amount"></span> ): <span class="info">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 32 32"><path fill="currentColor" d="M17 22v-8h-4v2h2v6h-3v2h8v-2h-3zM16 8a1.5 1.5 0 1 0 1.5 1.5A1.5 1.5 0 0 0 16 8z"/>
- <path fill="currentColor" d="M16 30a14 14 0 1 1 14-14a14 14 0 0 1-14 14Zm0-26a12 12 0 1 0 12 12A12 12 0 0 0 16 4Z"/></svg>
- </span> </p>
- <p class="discount_total">AED 0</p>
- </div>
- <div id="only-delivery">
- <div class="d-flex justify-content-between align-items-center m-0">
- <p>{{__('label.delivery_fee')}}:</p>
- <p class="delivery_fee"></p>
- </div>
- <div class="delivery_discount_with text-success d-flex justify-content-between align-items-center m-0">
- <p>{{__('label.delivery_discounts')}}:</p>
- <p class="delivery_discount_total">AED 0</p>
- </div>
- </div>
- <div id="only-loyalty-points" class="text-success">
- <div class="d-flex justify-content-between align-items-center m-0">
- <p>{{__('label.loyalty_points')}}:</p>
- <p class="loyalty_amount"></p>
- </div>
- </div>
- @if(!empty($is_tax_info))
- <div class="d-flex fw-bold justify-content-between align-items-center m-0">
- <p>{{__('label.tax_info')}}:</p>
- <p class="tax_info"></p>
- </div>
- @endif
- <div class="d-flex fw-bold justify-content-between align-items-center m-0">
- <p class="">{{__('label.total')}}:</p>
- <p class="total_txt"></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{__('label.close')}}</button>
- </div>
- </div>
- </div>
- </div>
- <div id="print-recipt"> </div>
- @endsection
- @section('js')
- {{-- <script src="{!! env('APP_ASSETS') !!}vendor_components/bootstrap-select/dist/js/bootstrap-select.js"></script>--}}
- <script type="text/javascript" src="{!! env('APP_ASSETS') !!}vendor_components/bootstrap-daterangepicker/daterangepicker.min.js"></script>
- <script>
- var resto_id = 0;
- var order_object = null;
- var order_id = 0;
- var lang = "{!! $lang !!}";
- $(function () {
- $("body").on("click",".info,.close-popup",function (){
- $("#discount-info").toggleClass('active')
- });
- $("body").on("click",".address-actions",function(){
- var _actions = $(this).data("action");
- if(_actions=="google-map"){
- var map = "https://maps.google.com/?q="+order_object.geo_location;
- window.open(map,"_blank");
- return false;
- }
- if(_actions=="whatsapp"){
- var template = order_text_template(order_object,"whatsapp");
- //console.log(encodeURIComponent(template));
- window.open("https://api.whatsapp.com/send?text="+(template),"_blank");
- }
- if(_actions=="copy-clipboard"){
- var template = order_text_template(order_object,"copy-clipboard");
- //console.log(encodeURIComponent(template));
- navigator.clipboard.writeText(template);
- }
- });
- $("body").on("click",".print",function () {
- $.ajax({
- url:"{!! env('APP_URL') !!}show/order/detail/"+order_id+"?action=print",
- success:function (response) {
- $('#print-recipt').html(response);
- $('#print-recipt').printThis();
- }
- });
- });
- var _already_clicked = false;
- $("body").on("click",".order-detail",function(){
- if(!_already_clicked){
- //_already_clicked = true;
- var id = $(this).data("id");
- order_id = id;
- // $(".mlist_li.selected").removeClass('selected');
- $("#show-recipes").html('');
- //$(this).addClass('selected');
- $(".discount_with").removeClass('active');
- $(".delivery_discount_with").removeClass('active');
- $("p[rel]").each(function(){
- $(this).html(progress_img);
- });
- $("#show-recipes").html(progress_img);
- $(".sub_total, .delivery_fee, .delivery_discount_total, .total_txt, .tax_info").html(progress_img);
- $.ajax({
- url:"{!! env('APP_URL') !!}show/order/detail/"+id,
- success:function (response) {
- $("p[rel]").each(function(){
- $(this).html('');
- });
- $("#show-recipes").html('');
- $("#show-order-detail").modal('show');
- $(".sub_total, .delivery_fee, .delivery_discount_total, .total_txt,.tax_info").html('');
- order_object = {
- geo_location:response.customer.geo_points!=""?response.customer.geo_points:response.customer.geo_location,
- order_ref:response.order_info.order_ref,
- brand_name:response.business_info.business_name,
- outlet_name:response.business_info.outlet_name,
- customer:response.customer.customer_name,
- phone:response.customer.customer_phone,
- payment:response.order_info.payment,
- delivery_at:response.order_info.delivery_at,
- address:response.customer.deliveryAddress,
- sub_total_price:response.basket.sub_total.formatted_price,
- delivery_fee:response.basket.delivery_fee.formatted_price,
- is_discount:response.basket.is_discount,
- discounted_amount:response.basket.discounted_amount.formatted_price,
- is_delivery_discount:response.basket.is_delivery_discount,
- delivery_discount_fee:response.basket.delivery_discounted_amount.formatted_price,
- total_price:response.basket.is_discount?response.basket.discounted_total_price.formatted_price:response.basket.grand_total.formatted_price,
- delivery_update_status_url:response.delivery_boy.delivery_update_status_url,
- link_expire_time:response.delivery_boy.link_expire_time
- };
- $("#accept-modal input[name=preparation_time]").val(response.order_info.estimated_time.preparation_time);
- $("#accept-modal input[name=preperation_delivery]").val(response.order_info.estimated_time.preparation_delivery_time);
- $("#accept-modal select[name=preparation_type]").val(response.order_info.estimated_time.time_type);
- $(".change-status").attr('data-id',id);
- $(".change-status-reject").attr('data-id',id);
- var o_t = response.order_info.order_type.toLowerCase();
- $(".for-delivery").hide();
- $(".for-pickup").hide();
- $(".for-"+o_t).show();
- if(o_t=="pickup"){
- $("#only-delivery").hide();
- }
- $("p[rel=order_placed]").html(response.order_info.order_placed);
- $("p[rel=order_ref]").html(response.order_info.order_ref);
- $("p[rel=brand_name]").html(response.business_info.business_name);
- $("p[rel=outlet_name]").html(response.business_info.outlet_name);
- $(".inkitchen-btn").removeClass('org-bg');
- $(".inkitchen-btn").removeClass('bg-danger');
- $(".inkitchen-btn").removeClass('green-bg');
- $(".inkitchen-btn").addClass(response.order_info.bg);
- $(".inkitchen-btn").html(response.order_info.status);
- $("p[rel=order_type]").html(response.order_info.order_type);
- if(response.order_info.status=="New"){
- $(".reject").show();
- $(".accept").hide();
- }else{
- $(".accept").show();
- $(".reject").hide();
- }
- if(response.order_info.order_type=="Dine in"){
- $("#address").hide();
- $("#table").show();
- $("#google-map-link").hide();
- }else{
- $("#address").show();
- $("#table").hide();
- if(response.order_info.order_type=="Delivery")
- $("#google-map-link").show();
- else
- $("#google-map-link").hide();
- }
- $(".change-status").html(response.order_info.next_status_label);
- $(".change-status").attr('data-status',response.order_info.next_status);
- $("p[rel=delivery_at]").html(response.order_info.delivery_at);
- $("p[rel=payment]").html(response.order_info.payment);
- $("p[rel=channel]").html(response.order_info.channel);
- $("p[rel=order_instructions]").html(response.order_info.order_instructions);
- $("p[rel=customer]").html(response.customer.customer_name);
- $("p[rel=phone]").html(response.customer.customer_phone);
- $("p[rel=delivery_notes]").html(response.customer.delivery_instructions);
- $("p[rel=address]").html(response.customer.deliveryAddress);
- //BASKET INFORMATION
- var items = response.basket.items?response.basket.items:null;
- if(items){
- $(items).each(function(index, item){
- $("#show-recipes").append(show_item(item));
- });
- }
- var is_discount = response.basket.is_discount;
- var is_loyalty = response.basket.is_loyalty;
- if(is_discount){
- $(".discount_with").addClass('active');
- $(".discount_total").html(response.basket.discounted_amount.formatted_price);
- }else{
- $(".discount_with").removeClass('active');
- $(".discount_total").html(0);
- }
- if(is_loyalty){
- $("#only-loyalty-points").addClass('active');
- $(".loyalty_amount").html(response.basket.loyalty_amount.formatted_price);
- }else{
- $("#only-loyalty-points").removeClass('active');
- $(".loyalty_amount").html(0);
- }
- var is_delivery_discount = response.basket.is_delivery_discount;
- if(is_delivery_discount){
- $(".delivery_discount_with ").addClass('active');
- $(".delivery_discount_total ").html(response.basket.delivery_discounted_amount.formatted_price);
- $("span[rel=discount_code]").html(response.basket.discount_info.discount_code);
- $("#discount-code").html(response.basket.discount_info.discount_code);
- $("#discount-name").html(response.basket.discount_info.discount_name);
- $("#discount-amount, span[rel=discount_amount]").html(response.basket.discount_info.discount_amount);
- $("#discount-start-datetime").html(response.basket.discount_info.start_date);
- $("#discount-end-datetime").html(response.basket.discount_info.end_date);
- }else{
- $(".delivery_discount_with").removeClass('active');
- $(".delivery_discount_total").html(0);
- $("span[rel=discount_code]").html('');
- $("#discount-code").html('');
- $("#discount-name").html('');
- $("#discount-amount, span[rel=discount_amount]").html('');
- $("#discount-start-datetime").html('');
- $("#discount-end-datetime").html('');
- }
- $(".sub_total").html(response.basket.sub_total.formatted_price);
- $(".delivery_fee").html(response.basket.delivery_fee.formatted_price);
- $(".tax_info").html(response.order_info.tax_info);
- if(is_discount)
- $(".total_txt").html(response.basket.discounted_total_price.formatted_price);
- else
- $(".total_txt").html(response.basket.grand_total.formatted_price);
- },
- cache: false
- });
- $(".no-order").hide();
- $(".order-section").show();
- }
- });
- $("body").on("click",".order-detail1",function(){
- $("#show-recipes").html('');
- var id = $(this).data('id');
- order_id = id;
- $.ajax({
- url:"{!! env('APP_URL') !!}get/order/detail/"+id,
- success:function (response) {
- response = $.parseJSON(response);
- var discount_with_order = response.discount_with_order?response.discount_with_order:null;
- order_object = response;
- $("#show-recipes").html('');
- $("#show-order-detail").modal('show');
- var price = 0;
- var delivery_fee = 0;
- $(".change-status").attr('data-id',id);
- $(".change-status-reject").attr('data-id',id);
- var o_t = response.order_type.toLowerCase();
- $(".for-delivery").hide();
- $(".for-pickup").hide();
- $(".for-"+o_t).show();
- $.each(response,function (i,v) {
- $("p[rel="+i+"]").text(v);
- $("span[rel="+i+"]").text(v);
- if(i=="delivery_fee"){
- delivery_fee = v;
- $(".delivery_fee").html("{{ $currency }} "+v);
- }
- if(i=="geo_location"){
- $("p[rel=google-map-link]").html('<a target="_blank" href="https://maps.google.com/?q='+v+'">Share</a>');
- //$("p[rel=google-map-link]").html('<a target="_blank" href="https://maps.googleapis.com/maps/api/staticmap?zoom=15&size=900x500&markers=color:yellow|label:D|'+v+'&key=AIzaSyBFh6fzq8G7dgWLfz8kccvTlmPCSI_uWXQ">Share</a>');
- }
- if(i=="order_type"){
- if(v=="Delivery")
- $("#google-map-link").show();
- else
- $("#google-map-link").hide();
- }
- if(i=="status"){
- $(".inkitchen-btn").html(v);
- $(".inkitchen-btn").addClass();
- if(v=="New"){
- $(".reject").show();
- $(".accept").hide();
- }else{
- $(".accept").show();
- $(".reject").hide();
- }
- }
- if(i=="bg"){
- $(".inkitchen-btn").removeClass('org-bg');
- $(".inkitchen-btn").removeClass('bg-danger');
- $(".inkitchen-btn").removeClass('green-bg');
- $(".inkitchen-btn").addClass(v);
- }
- if(i=="next_action"){
- if(v=="Accepted")
- $(".change-status").html('Accept');
- else
- $(".change-status").html(v);
- }
- if(i=="next_status"){
- $(".change-status").attr('data-status',v);
- }
- if(i=="recipes"){
- var recipes = v;
- /* if(recipes){
- $.each(recipes,function(m,n){
- console.log(n);
- $("#show-recipes").append(show_recipe(n));
- price+=parseFloat(n.total_price);
- if(n.extra_options){
- $.each(n.extra_options,function(c,d){
- price+=(parseInt(n.quantity) * parseFloat(d.price));
- });
- }
- });
- $(".sub_total").html('{{ $currency }} '+price);
- }*/
- if(recipes){
- console.log(recipes);
- /*$.each(recipes,function(m,n){
- console.log(n);
- $("#show-recipes").append(show_recipe(n));
- price+=parseFloat(n.total_price);
- console.log("price: "+price);
- @if($business_type!="ClothsStore")
- if(n.extra_options){
- $.each(n.extra_options,function(c,d){
- price+=(parseInt(n.quantity) * parseFloat(d.price));
- });
- }
- @endif
- });*/
- if(discount_with_order){
- $.each(recipes,function(m,n){
- $("#show-recipes").append(show_recipe_with_discount(n,discount_with_order));
- // price+=parseFloat(n.total_price);
- var discount_amount = discount_with_order.discount_value!=""?parseFloat(discount_with_order.discount_value):0;
- var discount_type = discount_with_order.discount_type!=""?discount_with_order.discount_type:"";
- if(n.extra_options){
- $.each(n.extra_options,function(c,d){
- //console.log("extra-option: ",d.price);
- if(discount_amount > 0 && discount_type!=""){
- if(discount_type=="percentage"){
- var d_price = parseFloat(d.price) - (parseFloat(d.price) * (discount_amount/100));
- console.log(d_price);
- price+=d_price;
- }else{
- var d_price = parseFloat(d.price) - discount_amount/100;
- price+=d_price;
- }
- }else{
- console.log(n);
- price+=parseFloat(d.price);
- }
- });
- }
- price+=parseFloat(n.total_price);
- });
- }
- else{
- $.each(recipes,function(m,n){
- $("#show-recipes").append(show_recipe(n));
- var discount_amount = n.discount_amount!=""?parseFloat(n.discount_amount):0;
- var discount_type = n.discount_type!=""?n.discount_type:"";
- if(discount_amount > 0 && discount_type!=""){
- if(discount_type=="%"){
- var d_price = parseFloat(n.total_price) - (parseFloat(n.total_price) * (discount_amount/100));
- price+=d_price;
- }else{
- var d_price = parseFloat(n.total_price) - discount_amount/100;
- price+=d_price;
- }
- }else{
- price+=parseFloat(n.total_price);
- }
- @if($business_type!="ClothsStore")
- if(n.extra_options){
- $.each(n.extra_options,function(c,d){
- if(d.price && d.price!=""){
- if(discount_amount > 0 && discount_type!=""){
- if(discount_type=="%"){
- var d_price = parseFloat(d.price) - (parseFloat(d.price) * (discount_amount/100));
- console.log(d_price);
- price+=d_price;
- }else{
- var d_price = parseFloat(d.price) - discount_amount/100;
- price+=d_price;
- }
- }else{
- price+=(parseInt(n.quantity) * parseFloat(d.price));
- }
- }
- });
- }
- @endif
- });
- }
- if(price==0)
- price=response.total_price;
- $(".sub_total").html('{{ $currency }} '+(price?price:0));
- } }
- $(".total_txt").html("{{ $currency }} "+(price+delivery_fee));
- });
- }
- });
- });
- $("body").on("click",".order-row",function () {
- var id = $(this).data('id');
- window.location = "{!! env('APP_URL') !!}order/show/"+id;
- });
- $("body").on("click",'.order-status',function (e) {
- // alert();
- var status = $(this).data('status');
- var order_id = $(this).data('id');
- $.ajax({
- url:"{!! env('APP_URL') !!}update/order/status",
- type:"POST",
- data:{
- id:order_id,
- status:status,
- "_token":"{!! csrf_token() !!}"
- },
- success:function () {
- location.reload();
- }
- });
- e.preventDefault();
- e.stopPropagation();
- });
- $('#example').DataTable({
- "bSort": true,
- "searching": false,
- "paging": true,
- "info": false,
- "bLengthChange": false,
- "aaSorting": [[0,'desc']],
- language: {
- paginate: {
- next: '<img src="{!! env("APP_ASSETS") !!}images/icons/next.png">', // or '→'
- previous: '<img src="{!! env("APP_ASSETS") !!}images/icons/preivew.png">' // or '←'
- }
- },
- });
- $("td nav").addClass('d-flex justify-content-center');
- // $('#example_wrapper .row:last').find('.col-md-5').first().remove()
- var start = moment().subtract(6, 'days');
- var end = moment();
- $('#date_range').daterangepicker({
- @if(!isset($_GET['date_range']))
- startDate: start,
- endDate: end,
- @endif
- ranges: {
- 'Today': [moment(), moment()],
- 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
- 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
- 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
- 'This Month': [moment().startOf('month'), moment().endOf('month')],
- 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
- }
- }, cb);
- cb(start, end);
- })
- /*function show_recipe(recipe){
- console.log(recipe);
- var str='<div class="box-header border-1 ">\n' +
- ' <div class="ml-5">\n' +
- ' <div class="d-flex justify-content-between align-items-center">\n' +
- ' <p>'+recipe.quantity+'x '+recipe.recipe_name+'</p>\n' ;
- if(recipe.total_price > 0)
- str+= ' <p>{{ $currency }} '+recipe.total_price+'</p>\n';
- if(recipe.extra_options){
- str+='<dl>';
- if(recipe.extra_options){
- $.each(recipe.extra_options,function(c,d){
- str+="<dt>"+d.name+" : {{ $currency }} "+d.price;
- if(d.sub_items){
- //str+="<ul>";
- $.each(d.sub_items,function(m,n){
- console.log("Sub Items");
- str+="<dd>"+n.name+"</dd>";
- });
- //str+="</dt>";
- }
- str+="</li>"
- });
- }
- str+='<dl>';
- }
- str+=
- ' </div>\n' +
- ' </div>\n' +
- ' </div>';
- return str;
- }*/
- function show_recipe_with_discount(recipe,with_discount){
- var discount_amount = 0;
- if(with_discount.discount_type=="percentage")
- discount_amount = parseFloat(with_discount.discount_value)/100;
- else
- discount_amount = parseFloat(with_discount.discounted_amount);
- var str='<div class="box-header border-1 ">\n' +
- ' <div class="ml-5">\n' +
- ' <div class="d-flex justify-content-between align-items-center">\n' +
- ' <p><span class="badge rounded-pill bg-secondary mx-2">'+recipe.quantity+' </span><img src="'+recipe.recipe_image+'" style="border-radius:10px; margin:0 3px" height="40px" width="40px" /> '+recipe.recipe_name+'</p>\n' ;
- if(recipe.total_price > 0){
- var price = parseFloat(recipe.total_price);
- var discounted_price = 0;
- if(with_discount.discount_type=="percentage"){
- discounted_price = parseFloat(price) - (parseFloat(price) * (parseFloat(with_discount.discount_value)/100));
- console.log(discounted_price);
- }
- //price = price - (price * (discount_amount/100));
- if(discounted_price > 0)
- price = "<span>"+discounted_price+"</span>" +"<span style='margin-left:10px; color:red'><del>"+price+"</del></span>"+ "</span>";
- else
- price = "<span>"+discounted_price+"</span>" + "</span>";
- str+= ' <p>{{ $currency }} '+price+'</p>\n';
- }
- if(recipe.extra_options){
- str+='<dl>';
- if(recipe.extra_options){
- console.log(recipe.extra_options);
- $.each(recipe.extra_options,function(c,d){
- @if($business_type=="ClothsStore")
- if(c=="color")
- str+='<div style="width: 20px; height: 20px; background-color: '+d+'; border-radius: 20px; float:left"></div>';
- if(c=="size")
- str+='<div style="float:right;font-size: 14px;margin-left: 8px;font-weight: 700;"> '+d+'</div>';
- @else
- if(d.price && d.price!=""){
- console.log('In d.price: '+d.price);
- var price = parseFloat(d.price);
- if(discount_amount > 0){
- var _pric = parseFloat(price) - (parseFloat(price) * (parseFloat(with_discount.discount_value)/100));
- price += _pric;
- price = "<span>"+_pric+"</span>" + "<span style='margin-left:10px; color:red'><del>"+d.price+"</del></span>";
- }
- str+="<dt>"+d.name+" : {{ $currency }} "+price;
- if(d.sub_items){
- //str+="<ul>";
- $.each(d.sub_items,function(m,n){
- console.log("Sub Items");
- str+="<dd>"+n.name+"</dd>";
- });
- //str+="</dt>";
- }
- str+="</li>"
- }else{
- str+="<dt>"+d.name+"</dt>";
- }
- @endif
- });
- }
- str+='<dl>';
- }
- str+=
- ' </div>\n' +
- ' </div>\n' +
- ' </div>';
- return str;
- }
- function show_recipe(recipe){
- var discount_amount = parseFloat(recipe.discount_amount);
- var str='<div class="box-header border-1 ">\n' +
- ' <div class="ml-5">\n' +
- ' <div class="d-flex justify-content-between align-items-center">\n' +
- ' <p><span class="badge rounded-pill bg-secondary mx-2">'+recipe.quantity+' </span><img src="'+recipe.recipe_image+'" style="border-radius:10px; margin:0 3px" height="40px" width="40px" /> '+recipe.recipe_name+'</p>\n' ;
- if(recipe.total_price > 0){
- var price = parseFloat(recipe.total_price);
- if(discount_amount > 0){
- if(recipe.discount_type=="%"){
- price = price - (price * (discount_amount/100));
- price = "<span>"+price+"</span>" + "<span style='margin-left:10px; color:red'><del>"+recipe.total_price+"</del></span>";
- }
- }
- str+= ' <p>{{ $currency }} '+price+'</p>\n';
- }
- if(recipe.extra_options){
- str+='<dl>';
- if(recipe.extra_options){
- $.each(recipe.extra_options,function(c,d){
- @if($business_type=="ClothsStore")
- if(c=="color")
- str+='<div style="width: 20px; height: 20px; background-color: '+d+'; border-radius: 20px; float:left"></div>';
- if(c=="size")
- str+='<div style="float:right;font-size: 14px;margin-left: 8px;font-weight: 700;"> '+d+'</div>';
- @else
- if(d.price && d.price!=""){
- var price = parseFloat(d.price);
- console.log("p: "+d.price);
- if(discount_amount > 0){
- if(recipe.discount_type=="%"){
- price = price - (price * (discount_amount/100));
- price = "<span>"+price+"</span>" + "<span style='margin-left:10px; color:red'><del>"+d.price+"</del></span>";
- }
- }
- var extItemName = d.name;
- @if($lang=='ar')
- extItemName = d.name_ar;
- @endif
- str+="<dt>"+
- extItemName
- +" : {{ $currency }} "+price;
- if(d.sub_items){
- //str+="<ul>";
- $.each(d.sub_items,function(m,n){
- console.log("Sub Items");
- str+="<dd>"+n.name+"</dd>";
- });
- //str+="</dt>";
- }
- str+="</li>";
- }else{
- var extItemName = d.name;
- @if($lang=='ar')
- extItemName = d.name_ar;
- @endif
- str+="<dt>"+
- extItemName;
- if(d.sub_items){
- //str+="<ul>";
- $.each(d.sub_items,function(m,n){
- console.log("Sub Items");
- str+="<dd>"+n.name+"</dd>";
- });
- //str+="</dt>";
- }
- str+="</li>";
- }
- @endif
- });
- }
- str+='<dl>';
- }
- str+=
- ' </div>\n' +
- ' </div>\n' +
- ' </div>';
- return str;
- }
- function order_text_template(object,action){
- console.log(object);
- var sep = "%0A";
- if(action=="copy-clipboard")
- sep = "\n";
- var map = "https://maps.google.com/?q="+object.geo_location;
- var str = "I would like to share an order with you:"+sep+sep;
- str += "*OrderID:* "+object.order_ref+' '+sep;
- str += " *Business:* "+object.brand_name.replaceAll('&','%26')+' '+sep;
- str += " *Outlet:* "+object.outlet_name.replaceAll('&','%26')+' '+sep;
- str += " *Customer Name:* "+object.customer+' '+sep;
- str += " *Customer Phone No:* "+object.phone+' '+sep;
- str += " *Payment Method:* "+object.payment+' '+sep;
- str += " *Delivery Date:* "+object.delivery_at+' '+sep;
- str += " *Delivery Address:* "+object.address+' '+sep;
- if(action=="copy-clipboard")
- str += ' *Map:* '+(map)+' '+sep;
- else
- str += ' *Map:* '+encodeURIComponent(map)+' '+sep;
- str += ' *Sub Total:* '+object.sub_total_price+sep;
- if(object.is_discount){
- str += ' *Discount:* '+object.discounted_amount+sep;
- }
- str += ' *Delivery Fee:* '+object.delivery_fee+sep;
- if(object.is_delivery_discount){
- str += ' *Delivery Discount:* '+object.delivery_discount_fee+sep;
- }
- str += ' *Total:* '+(parseFloat(object.total_price))+sep;
- str += ' *Mark as delivered:* '+(object.delivery_update_status_url)+' (Link will expire at '+ object.link_expire_time +')'+sep;
- return str;
- }
- function cb(start, end) {
- $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
- // alert(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
- }
- function show_item(item){
- var show_item= '<div class="item-list p-3"><div class="d-flex justify-content-between align-items-center">'+
- '<p><span class="badge rounded-pill bg-secondary mx-2">'+item.quantity+'</span>'+
- '<img src="'+item.item_image+'" style="border-radius:10px; margin:0 3px" height="40px" width="40px"> '+item.item_name+'</p>';
- if(item.item_price.normal_price > 0)
- show_item+=' <p> <span>'+item.item_price.formatted_price+'</span></p>';
- show_item+=' </div>' +
- sub_items(item.sub_items)
- '</div>';
- return show_item;
- }
- function sub_items(sub_items){
- // console.log(sub_items.length);
- var _list = "";
- if(sub_items && sub_items.length > 0){
- _list = '<ul class="list-group col-sm-6 list-group-flush">';
- $(sub_items).each(function(index,item){
- var _pull_class = (lang=="en"?"pull-right":"pull-left");
- //_list+='<li class="list-group-item"><span class="badge rounded-pill bg-secondary mx-2">'+item.quantity+'</span> '+item.name+'</li>';
- _list+='<li class="list-group-item"><span class="badge rounded-pill bg-secondary mx-2">'+item.quantity+'</span> '+item.name+' '+(typeof item.price !=="undefined" && item.price.formatted_price ?'<span class="fw-bold text-end '+_pull_class+'">'+item.price.formatted_price+'</span>':"")+'</li>';
- });
- _list+='</ul>'
- }
- return _list;
- }
- </script>
- @endsection
|