index.blade.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. @extends('backend.layouts.app')
  2. @section('content')
  3. <!-- Basic Data Tables -->
  4. <!--===================================================-->
  5. <div class="card">
  6. <div class="card-header">
  7. <h5 class="mb-0 h6">{{translate('Refund Request All')}}</h5>
  8. </div>
  9. <div class="card-body">
  10. <table class="table aiz-table">
  11. <thead>
  12. <tr>
  13. <th>#</th>
  14. <th>{{translate('Order Code')}}</th>
  15. <th data-breakpoints="lg">{{translate('Seller Name')}}</th>
  16. <th data-breakpoints="lg">{{translate('Product')}}</th>
  17. <th data-breakpoints="lg">{{translate('Price')}}</th>
  18. <th data-breakpoints="lg">{{translate('Seller Approval')}}</th>
  19. <th>{{translate('Refund Status')}}</th>
  20. <th data-breakpoints="lg" width="15%" class="text-right">{{translate('Options')}}</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. @foreach($refunds as $key => $refund)
  25. <tr>
  26. <td>{{ ($key+1) + ($refunds->currentPage() - 1)*$refunds->perPage() }}</td>
  27. <td>
  28. @if($refund->order != null)
  29. {{ optional($refund->order)->code }}
  30. @else
  31. {{ translate('Order deleted') }}
  32. @endif
  33. </td>
  34. <td>
  35. @if ($refund->seller != null)
  36. {{ $refund->seller->name }}
  37. @endif
  38. </td>
  39. <td>
  40. @if ($refund->orderDetail != null && $refund->orderDetail->product != null)
  41. <a href="{{ route('product', $refund->orderDetail->product->slug) }}" target="_blank" class="media-block">
  42. <div class="row">
  43. <div class="col-auto">
  44. <img src="{{ uploaded_asset($refund->orderDetail->product->thumbnail_img) }}" alt="Image" class="size-50px">
  45. </div>
  46. <div class="col">
  47. <div class="media-body text-truncate-2">{{ $refund->orderDetail->product->getTranslation('name') }}</div>
  48. </div>
  49. </div>
  50. </a>
  51. @endif
  52. </td>
  53. <td>
  54. @if ($refund->orderDetail != null)
  55. {{single_price($refund->orderDetail->price)}}
  56. @endif
  57. </td>
  58. <td>
  59. @if ($refund->orderDetail != null && $refund->orderDetail->product != null && $refund->orderDetail->product->added_by == 'admin')
  60. <span class="badge badge-inline badge-warning">{{translate('Own Product')}}</span>
  61. @else
  62. @if ($refund->seller_approval == 1)
  63. <span class="badge badge-inline badge-success">{{translate('Approved')}}</span>
  64. @elseif ($refund->seller_approval == 2)
  65. <span class="badge badge-inline badge-danger">{{translate('Rejected')}}</span>
  66. @else
  67. <span class="badge badge-inline badge-primary">{{translate('Pending')}}</span>
  68. @endif
  69. @endif
  70. </td>
  71. <td>
  72. @if ($refund->refund_status == 1)
  73. <span class="badge badge-inline badge-success">{{translate('Paid')}}</span>
  74. @else
  75. <span class="badge badge-inline badge-warning">{{translate('Non-Paid')}}</span>
  76. @endif
  77. </td>
  78. <td class="text-right">
  79. <a class="btn btn-soft-success btn-icon btn-circle btn-sm" onclick="refund_request_money('{{ $refund->id }}')" title="{{ translate('Refund Now') }}">
  80. <i class="las la-backward"></i>
  81. </a>
  82. <a class="btn btn-soft-danger btn-icon btn-circle btn-sm" onclick="reject_refund_request('{{ route('reject_reason_show', $refund->id )}}', '{{$refund->id}}', '{{ optional($refund->order)->code }}')" title="{{ translate('Reject Refund Request') }}">
  83. <i class="las la-trash"></i>
  84. </a>
  85. <a href="{{ route('reason_show', $refund->id) }}" class="btn btn-soft-primary btn-icon btn-circle btn-sm" title="{{ translate('View Reason') }}">
  86. <i class="las la-eye"></i>
  87. </a>
  88. </td>
  89. </tr>
  90. @endforeach
  91. </tbody>
  92. </table>
  93. <div class="clearfix">
  94. <div class="pull-right">
  95. {{ $refunds->appends(request()->input())->links() }}
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. @endsection
  101. @section('modal')
  102. <div class="modal fade reject_refund_request" id="modal-basic">
  103. <div class="modal-dialog">
  104. <div class="modal-content">
  105. <form class="form-horizontal member-block" action="{{ route('reject_refund_request')}}" method="POST">
  106. @csrf
  107. <input type="hidden" name="refund_id" id="refund_id" value="">
  108. <div class="modal-header">
  109. <h5 class="modal-title h6">{{translate('Reject Refund Request !')}}</h5>
  110. <button type="button" class="close" data-dismiss="modal"></button>
  111. </div>
  112. <div class="modal-body">
  113. <div class="form-group row">
  114. <label class="col-md-3 col-form-label">{{translate('Order Code')}}</label>
  115. <div class="col-md-9">
  116. <input type="text" value="" id="order_id" class="form-control" disabled>
  117. </div>
  118. </div>
  119. <div class="form-group row">
  120. <label class="col-md-3 col-form-label">{{translate('Reject Reason')}}</label>
  121. <div class="col-md-9">
  122. <textarea type="text" name="reject_reason" id="reject_reason" rows="5" class="form-control" placeholder="{{translate('Reject Reason')}}" required></textarea>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="modal-footer">
  127. <button type="button" class="btn btn-light" data-dismiss="modal">{{translate('Close')}}</button>
  128. <button type="submit" class="btn btn-success">{{translate('Submit')}}</button>
  129. </div>
  130. </form>
  131. </div>
  132. </div>
  133. </div>
  134. @endsection
  135. @section('script')
  136. <script type="text/javascript">
  137. function update_refund_approval(el){
  138. $.post('{{ route('vendor_refund_approval') }}',{_token:'{{ @csrf_token() }}', el:el}, function(data){
  139. if (data == 1) {
  140. AIZ.plugins.notify('success', '{{ translate('Approval has been done successfully') }}');
  141. }
  142. else {
  143. AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
  144. }
  145. });
  146. }
  147. function refund_request_money(el){
  148. $.post('{{ route('refund_request_money_by_admin') }}',{_token:'{{ @csrf_token() }}', el:el}, function(data){
  149. if (data == 1) {
  150. location.reload();
  151. AIZ.plugins.notify('success', '{{ translate('Refund has been sent successfully') }}');
  152. }
  153. else {
  154. AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
  155. }
  156. });
  157. }
  158. function reject_refund_request(url, id, order_id){
  159. $.get(url, function(data){
  160. $('.reject_refund_request').modal('show');
  161. $('#refund_id').val(id);
  162. $('#order_id').val(order_id);
  163. $('#reject_reason').html(data);
  164. });
  165. }
  166. </script>
  167. @endsection