show.blade.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. @extends('layouts.admin.app')
  2. @section('content')
  3. <!-- Main content -->
  4. <section class="content">
  5. @include('layouts.errors-and-messages')
  6. <!-- Default box -->
  7. <div class="box">
  8. <div class="box-header">
  9. <div class="row">
  10. <div class="col-md-6">
  11. <h2>
  12. <a href="{{ route('admin.customers.show', $customer->id) }}">{{$customer->name}}</a> <br />
  13. <small>{{$customer->email}}</small> <br />
  14. <small>reference: <strong>{{$order->reference}}</strong></small>
  15. </h2>
  16. </div>
  17. <div class="col-md-3 col-md-offset-3">
  18. <h2><a href="{{route('admin.orders.invoice.generate', $order['id'])}}" class="btn btn-primary btn-block">Download Invoice</a></h2>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="box">
  24. <div class="box-body">
  25. <h4> <i class="fa fa-shopping-bag"></i> Order Information</h4>
  26. <table class="table">
  27. <thead>
  28. <tr>
  29. <td class="col-md-3">Date</td>
  30. <td class="col-md-3">Customer</td>
  31. <td class="col-md-3">Payment</td>
  32. <td class="col-md-3">Status</td>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. <tr>
  37. <td>{{ date('M d, Y h:i a', strtotime($order['created_at'])) }}</td>
  38. <td><a href="{{ route('admin.customers.show', $customer->id) }}">{{ $customer->name }}</a></td>
  39. <td><strong>{{ $order['payment'] }}</strong></td>
  40. <td><button type="button" class="btn btn-info btn-block">{{ $currentStatus->name }}</button></td>
  41. </tr>
  42. </tbody>
  43. <tbody>
  44. <tr>
  45. <td></td>
  46. <td></td>
  47. <td class="bg-warning">Subtotal</td>
  48. <td class="bg-warning">{{ $order['total_products'] }}</td>
  49. </tr>
  50. <tr>
  51. <td></td>
  52. <td></td>
  53. <td class="bg-warning">Tax</td>
  54. <td class="bg-warning">{{ $order['tax'] }}</td>
  55. </tr>
  56. <tr>
  57. <td></td>
  58. <td></td>
  59. <td class="bg-warning">Discount</td>
  60. <td class="bg-warning">{{ $order['discounts'] }}</td>
  61. </tr>
  62. <tr>
  63. <td></td>
  64. <td></td>
  65. <td class="bg-success text-bold">Order Total</td>
  66. <td class="bg-success text-bold">{{ $order['total'] }}</td>
  67. </tr>
  68. @if($order['total_paid'] != $order['total'])
  69. <tr>
  70. <td></td>
  71. <td></td>
  72. <td class="bg-danger text-bold">Total paid</td>
  73. <td class="bg-danger text-bold">{{ $order['total_paid'] }}</td>
  74. </tr>
  75. @endif
  76. </tbody>
  77. </table>
  78. </div>
  79. <!-- /.box-body -->
  80. </div>
  81. @if($order)
  82. @if($order->total != $order->total_paid)
  83. <p class="alert alert-danger">
  84. Ooops, there is discrepancy in the total amount of the order and the amount paid. <br />
  85. Total order amount: <strong>{{ config('cart.currency') }} {{ $order->total }}</strong> <br>
  86. Total amount paid <strong>{{ config('cart.currency') }} {{ $order->total_paid }}</strong>
  87. </p>
  88. @endif
  89. <div class="box">
  90. @if(!$items->isEmpty())
  91. <div class="box-body">
  92. <h4> <i class="fa fa-gift"></i> Items</h4>
  93. <table class="table">
  94. <thead>
  95. <th class="col-md-2">SKU</th>
  96. <th class="col-md-2">Name</th>
  97. <th class="col-md-2">Description</th>
  98. <th class="col-md-2">Quantity</th>
  99. <th class="col-md-2">Price</th>
  100. </thead>
  101. <tbody>
  102. @foreach($items as $item)
  103. <tr>
  104. <td>{{ $item->sku }}</td>
  105. <td>{{ $item->name }}</td>
  106. <td>
  107. {!! $item->description !!}
  108. @php($pattr = \App\Shop\ProductAttributes\ProductAttribute::find($item->product_attribute_id))
  109. @if(!is_null($pattr))<br>
  110. @foreach($pattr->attributesValues as $it)
  111. <p class="label label-primary">{{ $it->attribute->name }} : {{ $it->value }}</p>
  112. @endforeach
  113. @endif
  114. </td>
  115. <td>{{ $item->pivot->quantity }}</td>
  116. <td>{{ $item->price }}</td>
  117. </tr>
  118. @endforeach
  119. </tbody>
  120. </table>
  121. </div>
  122. @endif
  123. <div class="box-body">
  124. <div class="row">
  125. <div class="col-md-6">
  126. <h4> <i class="fa fa-map-marker"></i> Address</h4>
  127. <table class="table">
  128. <thead>
  129. <th>Address 1</th>
  130. <th>Address 2</th>
  131. <th>City</th>
  132. <th>Province</th>
  133. <th>Zip</th>
  134. <th>Country</th>
  135. <th>Phone</th>
  136. </thead>
  137. <tbody>
  138. <tr>
  139. <td>{{ $order->address->address_1 }}</td>
  140. <td>{{ $order->address->address_2 }}</td>
  141. <td>{{ $order->address->city }}</td>
  142. <td>
  143. @if(isset($order->address->province))
  144. {{ $order->address->province->name }}
  145. @endif
  146. </td>
  147. <td>{{ $order->address->zip }}</td>
  148. <td>{{ $order->address->country->name }}</td>
  149. <td>{{ $order->address->phone }}</td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <!-- /.box -->
  158. <div class="box-footer">
  159. <div class="btn-group">
  160. <a href="{{ route('admin.orders.index') }}" class="btn btn-default">Back</a>
  161. @if($user->hasPermission('update-order'))<a href="{{ route('admin.orders.edit', $order->id) }}" class="btn btn-primary">Edit</a>@endif
  162. </div>
  163. </div>
  164. @endif
  165. </section>
  166. <!-- /.content -->
  167. @endsection