codigo actual del servidor, con avances de joan

This commit is contained in:
Jose Sanchez
2023-08-07 15:52:04 -04:00
commit 3cd9b8bbe8
3070 changed files with 532255 additions and 0 deletions

View File

@@ -0,0 +1,112 @@
@extends('backend.layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{translate('Seller Withdraw Request')}}</h5>
</div>
<div class="card-body">
<table class="table aiz-table mb-0">
<thead>
<tr>
<th data-breakpoints="lg">#</th>
<th data-breakpoints="lg">{{translate('Date')}}</th>
<th>{{translate('Seller')}}</th>
<th data-breakpoints="lg">{{translate('Total Amount to Pay')}}</th>
<th>{{translate('Requested Amount')}}</th>
<th data-breakpoints="lg" width="40%">{{ translate('Message') }}</th>
<th data-breakpoints="lg">{{ translate('Status') }}</th>
<th data-breakpoints="lg" width="15%" class="text-right">{{translate('Options')}}</th>
</tr>
</thead>
<tbody>
@foreach($seller_withdraw_requests as $key => $seller_withdraw_request)
@php $user = \App\Models\User::find($seller_withdraw_request->user_id); @endphp
@if ($user && $user->shop)
<tr>
<td>{{ ($key+1) + ($seller_withdraw_requests->currentPage() - 1)*$seller_withdraw_requests->perPage() }}</td>
<td>{{ $seller_withdraw_request->created_at }}</td>
<td>{{ $user->name }} ({{ $user->shop->name }})</td>
<td>{{ single_price($user->shop->admin_to_pay) }}</td>
<td>{{ single_price($seller_withdraw_request->amount) }}</td>
<td>
{{ $seller_withdraw_request->message }}
</td>
<td>
@if ($seller_withdraw_request->status == 1)
<span class="badge badge-inline badge-success">{{translate('Paid')}}</span>
@else
<span class="badge badge-inline badge-info">{{translate('Pending')}}</span>
@endif
</td>
<td class="text-right">
<a onclick="show_seller_payment_modal('{{$seller_withdraw_request->user_id}}','{{ $seller_withdraw_request->id }}');" class="btn btn-soft-warning btn-icon btn-circle btn-sm" href="javascript:void(0);" title="{{ translate('Pay Now') }}">
<i class="las la-money-bill"></i>
</a>
@can('pay_to_seller')
<a onclick="show_message_modal('{{ $seller_withdraw_request->id }}');" class="btn btn-soft-success btn-icon btn-circle btn-sm" href="javascript:void(0);" title="{{ translate('Message View') }}">
<i class="las la-eye"></i>
</a>
@endcan
@can('seller_payment_history')
<a href="{{route('sellers.payment_history', encrypt($seller_withdraw_request->user_id))}}" class="btn btn-soft-primary btn-icon btn-circle btn-sm" title="{{ translate('Payment History') }}">
<i class="las la-history"></i>
</a>
@endcan
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="aiz-pagination">
{{ $seller_withdraw_requests->links() }}
</div>
</div>
</div>
@endsection
@section('modal')
<!-- payment Modal -->
<div class="modal fade" id="payment_modal">
<div class="modal-dialog">
<div class="modal-content" id="payment-modal-content">
</div>
</div>
</div>
<!-- Message View Modal -->
<div class="modal fade" id="message_modal">
<div class="modal-dialog">
<div class="modal-content" id="message-modal-content">
</div>
</div>
</div>
@endsection
@section('script')
<script type="text/javascript">
function show_seller_payment_modal(id, seller_withdraw_request_id){
$.post('{{ route('withdraw_request.payment_modal') }}',{_token:'{{ @csrf_token() }}', id:id, seller_withdraw_request_id:seller_withdraw_request_id}, function(data){
$('#payment-modal-content').html(data);
$('#payment_modal').modal('show', {backdrop: 'static'});
$('.demo-select2-placeholder').select2();
});
}
function show_message_modal(id){
$.post('{{ route('withdraw_request.message_modal') }}',{_token:'{{ @csrf_token() }}', id:id}, function(data){
$('#message-modal-content').html(data);
$('#message_modal').modal('show', {backdrop: 'static'});
});
}
</script>
@endsection

View File

@@ -0,0 +1,106 @@
<form class="form-horizontal" action="{{ route('commissions.pay_to_seller') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="modal-header">
<h5 class="modal-title h6">{{translate('Pay to seller')}}</h5>
<button type="button" class="close" data-dismiss="modal">
</button>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered" >
<tbody>
<tr>
@if($user->shop->admin_to_pay >= 0)
<td>{{ translate('Due to seller') }}</td>
<td>{{ single_price($user->shop->admin_to_pay) }}</td>
@endif
</tr>
<tr>
@if($seller_withdraw_request->amount > $user->shop->admin_to_pay)
<td>{{ translate('Requested Amount is ') }}</td>
<td>{{ single_price($seller_withdraw_request->amount) }}</td>
@endif
</tr>
@if ($user->shop->bank_payment_status == 1)
<tr>
<td>{{ translate('Bank Name') }}</td>
<td>{{ $user->shop->bank_name }}</td>
</tr>
<tr>
<td>{{ translate('Bank Account Name') }}</td>
<td>{{ $user->shop->bank_acc_name }}</td>
</tr>
<tr>
<td>{{ translate('Bank Account Number') }}</td>
<td>{{ $user->shop->bank_acc_no }}</td>
</tr>
<tr>
<td>{{ translate('Bank Routing Number') }}</td>
<td>{{ $user->shop->bank_routing_no }}</td>
</tr>
@endif
</tbody>
</table>
@if ($user->shop->admin_to_pay > 0)
<input type="hidden" name="shop_id" value="{{ $user->shop->id }}">
<input type="hidden" name="payment_withdraw" value="withdraw_request">
<input type="hidden" name="withdraw_request_id" value="{{ $seller_withdraw_request->id }}">
<div class="form-group row">
<label class="col-sm-3 col-from-label" for="amount">{{translate('Requested Amount')}}</label>
<div class="col-sm-9">
@if ($seller_withdraw_request->amount > $user->shop->admin_to_pay)
<input type="number" lang="en" min="0" step="0.01" name="amount" id="amount" value="{{ $user->shop->admin_to_pay }}" class="form-control" required>
@else
<input type="number" lang="en" min="0" step="0.01" name="amount" id="amount" value="{{ $seller_withdraw_request->amount }}" class="form-control" required>
@endif
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-from-label" for="payment_option">{{translate('Payment Method')}}</label>
<div class="col-sm-9">
<select name="payment_option" id="payment_option" class="form-control demo-select2-placeholder" required>
<option value="">{{translate('Select Payment Method')}}</option>
@if($user->shop->cash_on_delivery_status == 1)
<option value="cash">{{translate('Cash')}}</option>
@endif
@if($user->shop->bank_payment_status == 1)
<option value="bank_payment">{{translate('Bank Payment')}}</option>
@endif
</select>
</div>
</div>
<div class="form-group row" id="txn_div">
<label class="col-md-3 col-from-label" for="txn_code">{{translate('Txn Code')}}</label>
<div class="col-md-9">
<input type="text" name="txn_code" id="txn_code" class="form-control">
</div>
</div>
@endif
</div>
<div class="modal-footer">
@if ($user->shop->admin_to_pay > 0)
<button type="submit" class="btn btn-primary">{{translate('Pay')}}</button>
@endif
<button type="button" class="btn btn-light" data-dismiss="modal">{{translate('Cancel')}}</button>
</div>
</form>
<script>
$(document).ready(function(){
$('#payment_option').on('change', function() {
if ( this.value == 'bank_payment')
{
$("#txn_div").show();
}
else
{
$("#txn_div").hide();
}
});
$("#txn_div").hide();
AIZ.plugins.bootstrapSelect('refresh');
});
</script>

View File

@@ -0,0 +1,18 @@
<div class="modal-header">
<h5 class="modal-title h6">{{translate('Seller Message')}}</h5>
<button type="button" class="close" data-dismiss="modal">
</button>
</div>
<div class="modal-body">
<div class="from-group row">
<div class="col-lg-2">
<label>{{translate('Message')}}</label>
</div>
<div class="col-lg-10">
<textarea name="meta_description" rows="8" class="form-control">{{ $seller_withdraw_request->message }}</textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light" data-dismiss="modal">{{translate('Cancel')}}</button>
</div>