show.blade.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. @extends('seller.layouts.app')
  2. @section('panel_content')
  3. <div class="card">
  4. <div class="card-header">
  5. <h1 class="h2 fs-16 mb-0">{{ translate('Order Details') }}</h1>
  6. </div>
  7. <div class="card-body">
  8. <div class="row gutters-2">
  9. <div class="col text-md-left text-center">
  10. </div>
  11. @php
  12. $delivery_status = $order->delivery_status;
  13. $payment_status = $order->orderDetails->where('seller_id', Auth::user()->id)->first()->payment_status;
  14. @endphp
  15. @if (get_setting('product_manage_by_admin') == 0)
  16. @if ($order->product_storehouse_total > 0)
  17. @if (!$order->product_storehouse_status)
  18. <div class="col-md-2 d-flex flex-nowrap justify-content-end align-items-end ml-auto">
  19. <button id="payment_for_storehouse" type="button" class="btn btn-primary">{{ translate('Payment For Storehouse') }}</button>
  20. </div>
  21. @else
  22. <div class="col-md-2 d-flex flex-nowrap justify-content-end align-items-end ml-auto">
  23. <button type="button" class="btn btn-primary" disabled>{{ translate('Picked up') }}</button>
  24. </div>
  25. @endif
  26. @endif
  27. <div class="col-md-3 ml-auto">
  28. <label for="update_payment_status">{{ translate('Payment Status') }}</label>
  29. @if ($order->payment_type == 'cash_on_delivery' && $payment_status == 'unpaid')
  30. <select class="form-control aiz-selectpicker" data-minimum-results-for-search="Infinity"
  31. id="update_payment_status">
  32. <option value="unpaid" @if ($payment_status == 'unpaid') selected @endif>
  33. {{ translate('Unpaid') }}</option>
  34. <option value="paid" @if ($payment_status == 'paid') selected @endif>
  35. {{ translate('Paid') }}</option>
  36. </select>
  37. @else
  38. <input type="text" class="form-control" value="{{ translate($payment_status) }}" disabled>
  39. @endif
  40. </div>
  41. <!--<div class="col-md-3 ml-auto">-->
  42. <!-- <label for="update_delivery_status">{{ translate('Delivery Status') }}</label>-->
  43. <!-- @if ($delivery_status != 'delivered' && $delivery_status != 'cancelled')-->
  44. <!-- <select class="form-control aiz-selectpicker" data-minimum-results-for-search="Infinity"-->
  45. <!-- id="update_delivery_status">-->
  46. <!-- <option value="pending" @if ($delivery_status == 'pending') selected @endif>-->
  47. <!-- {{ translate('Pending') }}</option>-->
  48. <!-- <option value="confirmed" @if ($delivery_status == 'confirmed') selected @endif>-->
  49. <!-- {{ translate('Confirmed') }}</option>-->
  50. <!-- <option value="picked_up" @if ($delivery_status == 'picked_up') selected @endif>-->
  51. <!-- {{ translate('Picked Up') }}</option>-->
  52. <!-- <option value="on_the_way" @if ($delivery_status == 'on_the_way') selected @endif>-->
  53. <!-- {{ translate('On The Way') }}</option>-->
  54. <!-- <option value="delivered" @if ($delivery_status == 'delivered') selected @endif>-->
  55. <!-- {{ translate('Delivered') }}</option>-->
  56. <!-- <option value="cancelled" @if ($delivery_status == 'cancelled') selected @endif>-->
  57. <!-- {{ translate('Cancel') }}</option>-->
  58. <!-- </select>-->
  59. <!-- @else-->
  60. <!-- <input type="text" class="form-control" value="{{ $delivery_status }}" disabled>-->
  61. <!-- @endif-->
  62. <!--</div>-->
  63. @endif
  64. </div>
  65. <div class="row gutters-5 mt-2">
  66. <div class="col text-md-left text-center">
  67. @if(json_decode($order->shipping_address))
  68. <address>
  69. <strong class="text-main">
  70. <!--{{ json_decode($order->shipping_address)->name }}-->
  71. </strong><br>
  72. {{-- {{ json_decode($order->shipping_address)->email }}--}}
  73. @php
  74. $emailArray = str_split(json_decode($order->shipping_address)->email);
  75. $email = '';
  76. foreach ($emailArray as $key => $stock) {
  77. if($key < 3)
  78. $email .= $stock;
  79. else
  80. $email .= "*";
  81. $email .= "*";
  82. }
  83. echo '';
  84. @endphp
  85. <br>
  86. {{-- {{ json_decode($order->shipping_address)->phone }}--}}
  87. @php
  88. $phoneArray = str_split(json_decode($order->shipping_address)->phone);
  89. $phone = '';
  90. foreach ($phoneArray as $key => $stock) {
  91. if($key < 3)
  92. $phone .= $stock;
  93. else
  94. $phone .= "*";
  95. }
  96. echo $phone;
  97. @endphp
  98. <br>
  99. {{-- {{ json_decode($order->shipping_address)->address }}--}}
  100. @php
  101. $addressArray = str_split(json_decode($order->shipping_address)->address);
  102. $address = '';
  103. foreach ($addressArray as $key => $stock) {
  104. if($key < 3)
  105. $address .= $stock;
  106. else
  107. $address .= "*";
  108. }
  109. echo $address;
  110. @endphp
  111. ,
  112. {{-- {{ json_decode($order->shipping_address)->city }}--}}
  113. @php
  114. $cityArray = str_split(json_decode($order->shipping_address)->city);
  115. $city= '';
  116. foreach ($cityArray as $key => $stock) {
  117. $city .= "*";
  118. }
  119. echo $city;
  120. @endphp
  121. ,
  122. {{-- {{ json_decode($order->shipping_address)->postal_code }}--}}
  123. @php
  124. $postal_codeArray = str_split(json_decode($order->shipping_address)->postal_code);
  125. $postal_code= '';
  126. foreach ($postal_codeArray as $key => $stock) {
  127. $postal_code .= "*";
  128. }
  129. echo $postal_code;
  130. @endphp
  131. <br>
  132. {{-- {{ json_decode($order->shipping_address)->country }}--}}
  133. @php
  134. $countryArray = str_split(json_decode($order->shipping_address)->country);
  135. $country= '';
  136. foreach ($countryArray as $key => $stock) {
  137. $country .= "*";
  138. }
  139. echo $country;
  140. @endphp
  141. </address>
  142. @else
  143. <address>
  144. <strong class="text-main">
  145. {{ $order->user->name }}
  146. </strong><br>
  147. {{-- {{ $order->user->email }}--}}
  148. @php
  149. $emailArray = str_split($order->user->email);
  150. $email= '';
  151. foreach ($emailArray as $key => $stock) {
  152. if($key < 3)
  153. $email .= $stock;
  154. else
  155. $email .= "*";
  156. }
  157. echo $email;
  158. @endphp
  159. <br>
  160. {{-- {{ $order->user->phone }}--}}
  161. @php
  162. $phoneArray = str_split($order->user->phone);
  163. $phone= '';
  164. foreach ($phoneArray as $key => $stock) {
  165. if($key < 3)
  166. $phone .= $stock;
  167. else
  168. $phone .= "*";
  169. }
  170. echo $phone;
  171. @endphp
  172. <br>
  173. </address>
  174. @endif
  175. @if ($order->manual_payment && is_array(json_decode($order->manual_payment_data, true)))
  176. <br>
  177. <strong class="text-main">{{ translate('Payment Information') }}</strong><br>
  178. {{ translate('Name') }}: {{ json_decode($order->manual_payment_data)->name }},
  179. {{ translate('Amount') }}:
  180. {{ single_price(json_decode($order->manual_payment_data)->amount) }},
  181. {{ translate('TRX ID') }}: {{ json_decode($order->manual_payment_data)->trx_id }}
  182. <br>
  183. <a href="{{ uploaded_asset(json_decode($order->manual_payment_data)->photo) }}"
  184. target="_blank"><img
  185. src="{{ uploaded_asset(json_decode($order->manual_payment_data)->photo) }}" alt=""
  186. height="100"></a>
  187. @endif
  188. </div>
  189. <div class="col-md-4 ml-auto">
  190. <table>
  191. <tbody>
  192. <tr>
  193. <td class="text-main text-bold">{{ translate('Order #') }}</td>
  194. <td class="text-info text-bold text-right">{{ $order->code }}</td>
  195. </tr>
  196. <tr>
  197. <td class="text-main text-bold">{{ translate('Order Status') }}</td>
  198. <td class="text-right">
  199. @if ($delivery_status == 'delivered')
  200. <span
  201. class="badge badge-inline badge-success">{{ translate(ucfirst(str_replace('_', ' ', $delivery_status))) }}</span>
  202. @else
  203. <span
  204. class="badge badge-inline badge-info">{{ translate(ucfirst(str_replace('_', ' ', $delivery_status))) }}</span>
  205. @endif
  206. </td>
  207. </tr>
  208. <tr>
  209. <td class="text-main text-bold">{{ translate('Order Date') }}</td>
  210. <td class="text-right">{{ date('d-m-Y h:i A', $order->date) }}</td>
  211. </tr>
  212. <tr>
  213. <td class="text-main text-bold">{{ translate('Total amount') }}</td>
  214. <td class="text-right">
  215. {{ single_price($order->grand_total) }}
  216. </td>
  217. </tr>
  218. <tr>
  219. <td class="text-main text-bold">{{ translate('Payment method') }}</td>
  220. <td class="text-right">
  221. {{ translate(ucfirst(str_replace('_', ' ', $order->payment_type))) }}</td>
  222. </tr>
  223. <tr>
  224. <td class="text-main text-bold">{{ translate('Additional Info') }}</td>
  225. <td class="text-right">{{ $order->additional_info }}</td>
  226. </tr>
  227. </tbody>
  228. </table>
  229. </div>
  230. </div>
  231. <hr class="new-section-sm bord-no">
  232. <div class="row">
  233. <div class="col-lg-12 table-responsive">
  234. <table class="table-bordered aiz-table invoice-summary table">
  235. <thead>
  236. <tr class="bg-trans-dark">
  237. <th data-breakpoints="lg" class="min-col">#</th>
  238. <th width="10%">{{ translate('Photo') }}</th>
  239. <th class="text-uppercase">{{ translate('Description') }}</th>
  240. <th data-breakpoints="lg" class="text-uppercase">{{ translate('Delivery Type') }}</th>
  241. <th data-breakpoints="lg" class="min-col text-uppercase text-center">
  242. {{ translate('Qty') }}
  243. </th>
  244. <th data-breakpoints="lg" class="min-col text-uppercase text-center">
  245. {{ translate('Price') }}</th>
  246. <th data-breakpoints="lg" class="min-col text-uppercase text-right">
  247. {{ translate('Total') }}</th>
  248. </tr>
  249. </thead>
  250. <tbody>
  251. @foreach ($order->orderDetails as $key => $orderDetail)
  252. <tr>
  253. <td>{{ $key + 1 }}</td>
  254. <td>
  255. @if ($orderDetail->product != null && $orderDetail->product->auction_product == 0)
  256. <a href="{{ route('product', $orderDetail->product->slug) }}"
  257. target="_blank"><img height="50"
  258. src="{{ uploaded_asset($orderDetail->product->thumbnail_img) }}"></a>
  259. @elseif ($orderDetail->product != null && $orderDetail->product->auction_product == 1)
  260. <a href="{{ route('auction-product', $orderDetail->product->slug) }}"
  261. target="_blank"><img height="50"
  262. src="{{ uploaded_asset($orderDetail->product->thumbnail_img) }}"></a>
  263. @else
  264. <strong>{{ translate('N/A') }}</strong>
  265. @endif
  266. </td>
  267. <td>
  268. @if ($orderDetail->product != null && $orderDetail->product->auction_product == 0)
  269. <strong><a href="{{ route('product', $orderDetail->product->slug) }}"
  270. target="_blank"
  271. class="text-muted">{{ $orderDetail->product->getTranslation('name') }}</a></strong>
  272. <small>{{ $orderDetail->variation }}</small>
  273. @elseif ($orderDetail->product != null && $orderDetail->product->auction_product == 1)
  274. <strong><a href="{{ route('auction-product', $orderDetail->product->slug) }}"
  275. target="_blank"
  276. class="text-muted">{{ $orderDetail->product->getTranslation('name') }}</a></strong>
  277. @else
  278. <strong>{{ translate('Product Unavailable') }}</strong>
  279. @endif
  280. </td>
  281. <td>
  282. @if ($order->shipping_type != null && $order->shipping_type == 'home_delivery')
  283. {{ translate('Home Delivery') }}
  284. @elseif ($order->shipping_type == 'pickup_point')
  285. @if ($order->pickup_point != null)
  286. {{ $order->pickup_point->getTranslation('name') }}
  287. ({{ translate('Pickup Point') }})
  288. @else
  289. {{ translate('Pickup Point') }}
  290. @endif
  291. @endif
  292. </td>
  293. <td class="text-center">{{ $orderDetail->quantity }}</td>
  294. <td class="text-center">
  295. {{ single_price($orderDetail->price / $orderDetail->quantity) }}</td>
  296. <td class="text-center">{{ single_price($orderDetail->price) }}</td>
  297. </tr>
  298. @endforeach
  299. </tbody>
  300. </table>
  301. </div>
  302. </div>
  303. <div class="clearfix float-right">
  304. <table class="table">
  305. <tbody>
  306. @if ($order->product_storehouse_total > 0)
  307. <tr>
  308. <td>
  309. <strong class="text-muted">{{ translate('Storehouse Price') }} :</strong>
  310. </td>
  311. <td>
  312. {{ single_price($order->product_storehouse_total) }}
  313. </td>
  314. </tr>
  315. <tr>
  316. <td>
  317. <strong class="text-muted">{{ translate('Profit') }} :</strong>
  318. </td>
  319. <td>
  320. {{ single_price($order->grand_total - $order->product_storehouse_total) }}
  321. </td>
  322. </tr>
  323. @endif
  324. <tr>
  325. <td>
  326. <strong class="text-muted">{{ translate('Sub Total') }} :</strong>
  327. </td>
  328. <td>
  329. {{ single_price($order->orderDetails->sum('price')) }}
  330. </td>
  331. </tr>
  332. <tr>
  333. <td>
  334. <strong class="text-muted">{{ translate('Tax') }} :</strong>
  335. </td>
  336. <td>
  337. {{ single_price($order->orderDetails->sum('tax')) }}
  338. </td>
  339. </tr>
  340. <tr>
  341. <td>
  342. <strong class="text-muted">{{ translate('Shipping') }} :</strong>
  343. </td>
  344. <td>
  345. {{ single_price($order->orderDetails->sum('shipping_cost')) }}
  346. </td>
  347. </tr>
  348. <tr>
  349. <td>
  350. <strong class="text-muted">{{ translate('Coupon') }} :</strong>
  351. </td>
  352. <td>
  353. {{ single_price($order->coupon_discount) }}
  354. </td>
  355. </tr>
  356. <tr>
  357. <td>
  358. <strong class="text-muted">{{ translate('TOTAL') }} :</strong>
  359. </td>
  360. <td class="text-muted h5">
  361. {{ single_price($order->grand_total) }}
  362. </td>
  363. </tr>
  364. </tbody>
  365. </table>
  366. <div class="no-print text-right">
  367. <a href="{{ route('seller.invoice.download', $order->id) }}" type="button"
  368. class="btn btn-icon btn-light"><i class="las la-print"></i></a>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. @if( $express->express_info )
  374. <?php date_default_timezone_set("PRC");?>
  375. <style>
  376. .table {
  377. border-collapse: collapse;
  378. margin:20px 0px;
  379. }
  380. .table, th, td {
  381. border: 2px solid #f0fafe;
  382. }
  383. </style>
  384. <table class="table">
  385. <tr>
  386. <td colspan="2" style="text-align:center; background-color:#f0fafe;"><b>{{ translate('Express information') }} </b> </td>
  387. </tr>
  388. <tr>
  389. <td style="width:100px;"> {{ translate('courier company') }}:</td>
  390. <td> {{ $express->express_name }} </td>
  391. </tr>
  392. <tr>
  393. <td> {{ translate('shipment number') }} :</td>
  394. <td> {{ $express->express_code }} </td>
  395. </tr>
  396. <tr>
  397. <td colspan="2" style="text-align:center;background-color:#f0fafe;"><b>{{ translate('Logistics tracking information') }}</b></td>
  398. </tr>
  399. @if( $express->express_info )
  400. @foreach ($express->express_info as $key => $ex )
  401. <?php
  402. if( strtotime( $express->express_time[$key] ) < time() ){ ?>
  403. <tr><td colspan="2"> {{ $express->express_stime[$key] }} {{ $ex }} </td></tr>
  404. <?php } ?>
  405. @endforeach
  406. @endif
  407. </table>
  408. @endif
  409. @endsection
  410. @section('modal')
  411. <!-- Payment For Storehouse Modal -->
  412. <div class="modal fade" id="payment_for_storehouse_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  413. <div class="modal-dialog modal-dialog-centered" role="document">
  414. <div class="modal-content">
  415. <div class="modal-header">
  416. <h5 class="modal-title" id="exampleModalLabel">{{ translate('Payment For Storehouse') }}</h5>
  417. <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  418. </div>
  419. <div class="modal-body">
  420. <input type="hidden" name="order_id" value="{{encrypt($order->id)}}">
  421. <div class="row">
  422. <div class="col-12">
  423. <h5 class="text-center">{{ translate('Pay with wallet')}} {{single_price($order->product_storehouse_total)}}</h5>
  424. </div>
  425. </div>
  426. <div class="row">
  427. <div class="col-md-9">
  428. <input type="password" lang="en" class="form-control mb-3" id="tpwd" name="tpwd"
  429. placeholder="{{ translate('Transaction password') }}" max=6 required>
  430. </div>
  431. </div>
  432. <div class="form-group text-right">
  433. <button type="button" class="btn btn-sm btn-light transition-3d-hover mr-3" data-dismiss="modal">{{translate('Cancel')}}</button>
  434. <button id="payment_button" type="button" class="btn btn-sm btn-primary transition-3d-hover mr-1">{{translate('Payment')}}</button>
  435. </div>
  436. </div>
  437. </div>
  438. </div>
  439. </div>
  440. <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
  441. @endsection
  442. @section('script')
  443. <script type="text/javascript">
  444. $('#payment_for_storehouse').on('click', function () {
  445. var tpwd = '{{ $tpwd }}'
  446. if (!tpwd) {
  447. location.href="/seller/transaction"
  448. return
  449. } else {
  450. $('#payment_for_storehouse_modal').modal('show');
  451. }
  452. })
  453. // 付款
  454. $('#payment_button').on('click', function () {
  455. var tpwd = '{{ $tpwd }}'
  456. var pwd = $("#tpwd").val();
  457. if (md5(pwd) != tpwd) {
  458. AIZ.plugins.notify('danger',
  459. '{{ translate('password error') }}');
  460. return;
  461. }
  462. $.post('{{ route('seller.orders.payment_for_storehouse_product') }}', {
  463. _token: '{{ @csrf_token() }}',
  464. order_id: '{{encrypt($order->id)}}'
  465. }, function (data) {
  466. console.log(data)
  467. if (data.success == 1) {
  468. $('#order_details').modal('hide');
  469. AIZ.plugins.notify('success', '{{ translate('Order status has been updated') }}');
  470. location.reload().setTimeOut(500);
  471. } else {
  472. AIZ.plugins.notify('danger', data.message ? data.message : '{{ translate('Something went wrong') }}');
  473. }
  474. });
  475. })
  476. $('#update_delivery_status').on('change', function () {
  477. return false;
  478. var order_id = {{ $order->id }};
  479. var status = $('#update_delivery_status').val();
  480. $.post('{{ route('seller.orders.update_delivery_status') }}', {
  481. _token: '{{ @csrf_token() }}',
  482. order_id: order_id,
  483. status: status
  484. }, function (data) {
  485. $('#order_details').modal('hide');
  486. AIZ.plugins.notify('success', '{{ translate('Order status has been updated') }}');
  487. location.reload().setTimeOut(500);
  488. });
  489. });
  490. $('#update_payment_status').on('change', function () {
  491. var order_id = {{ $order->id }};
  492. var status = $('#update_payment_status').val();
  493. $.post('{{ route('seller.orders.update_payment_status') }}', {
  494. _token: '{{ @csrf_token() }}',
  495. order_id: order_id,
  496. status: status
  497. }, function (data) {
  498. $('#order_details').modal('hide');
  499. //console.log(data);
  500. AIZ.plugins.notify('success', '{{ translate('Payment status has been updated') }}');
  501. location.reload().setTimeOut(500);
  502. });
  503. });
  504. </script>
  505. @endsection