File: /var/www/vhost/disk-apps/agile-selling-wpb/resources/views/orders/orders.blade.php
@extends('modules.head') @section('contenido')
<div class="box-header">
@if(Auth::user()->rol_id == 1 || Auth::user()->rol_id == 2)
<a class="auxiliar" href="{{url('/ordersReports/generate/report')}}">
<button type="button" class="btn pull-left btnAux" data-dismiss="modal">
<i class="fa fa-file"></i>{{ Lang::get('messages.screen_orders_tag1')}}
</button>
</a>
@endif
@if(Auth::user()->rol_id == 1 || Auth::user()->rol_id == 2 || Auth::user()->rol_id == 8)
<a class="auxiliar" onclick="getReturnInProgress()" style="margin-left: 5px;">
<button type="button" class="btn btnAux" data-dismiss="modal">
<i class="fa fa-file"></i>{{ Lang::get('messages.screen_orders_tag16')}}
</button>
</a>
{{-- <a class="auxiliar-black" href="{{url('/orders/add')}}">
<button class="btn btnAdd pull-right">
<i class="fa fa-plus"></i>{{ Lang::get('messages.screen_orders_tag2')}}
</button>
</a> --}}
@endif
</div>
<div class="containerOrderFilter">
<div id="message-orders-notAccepted" class="ordersNotAccepted"><i class="fa fa-exclamation-circle"></i>
<p id="text-orders-notAccepted" class="text-red"></p>
</div>
<form class="form-inline formFilter" id="form-filter">
<p>Multiple Filter</p>
<div class="form-group">
<label for="code_client">BP Code</label>
<input type="text" class="form-control" id="code_client" placeholder="C1234">
</div>
<div class="form-group">
<label for="code_plu">Item No</label>
<input type="text" class="form-control" id="code_plu" placeholder="SD-23">
</div>
<button type="button" class="btn btn-default" id="button_filter">Send</button>
<button type="button" class="btn btn-default" id="button_clear">Clear</button>
</form>
</div>
<!-- LISTADO Productos-->
<div class="box">
<div class="box-header">
<h3 class="box-title">{{ Lang::get('messages.screen_orders_tag3')}}</h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive hideScrollOffset">
<table id="example2" class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
<thead>
<tr role="row">
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag4')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag5')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag6')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.orders.sales_order') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.orders.delivery_order') }}</th>
<!-- <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.orders.auth_code') }}</th> -->
{{-- <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.orders.ref_authorization') }}</th> --}}
<!-- <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag7')}}</th> -->
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag8')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag10')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.orders.payment_state') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.screen_orders_tag9') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.screen_orders_tag18') }}</th>
<!-- <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
$parameter->name_delivery_man}}</th> -->
{{-- @if(Auth::user()->rol->id==1 || Auth::user()->rol->id==6) --}}
<!-- <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{
Lang::get('messages.screen_orders_tag11')}}</th> -->
{{-- @endif --}}
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.screen_orders_tag17') }}</th>
</tr>
</thead>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.MODAL VER INFO admin -->
@include('orders.infoOrder')
@include('orders.modal_calification')
@include('orders.modal_returns');
<script src="{{ asset('js/jQuery/jquery-2.2.3.min.js') }}"></script>
<script src="{{ asset('js/orders.js') }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
_table = $('#example2').DataTable({
'paging': true,
'lengthChange': true,
'searching': true,
'info': true,
'autoWidth': true,
"ordering": false,
"scrollX": true,
responsive: true,
processing: true,
serverSide: true,
"language": {
url: 'https://cdn.datatables.net/plug-ins/1.10.19/i18n/Spanish.json'
},
ajax: '{{ route('orders.table', ["code_client" => $code_client, "code_plu" => $code_plu]) }}',
columns: [
{
name: 'code',
data: 'code',
},
{
name: 'creation_date',
data: 'creation_date',
render: function (data) {
var date = new Date(data);
var month = date.getMonth() + 1;
return (month.length > 1 ? "0" + month: month ) + "/" + date.getDate() + "/" + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
}
},
{
name: 'client.first_name',
data: 'client',
render: function (data) {
return data.first_name + ' - ' + data.document;
}
},
{
name: 'order_reference',
data: 'order_reference',
},
{
name: 'bo_doc_delivery',
data: 'bo_doc_delivery',
},
{
name: 'orderState.name',
data: 'order_state',
render: function (data) {
return data.name;
}
},
{
name: 'sucursal.name',
data: 'sucursal',
},
{
name: 'gw_code_transaction',
data: 'gw_state',
},
{
name: 'deliveryMan.first_name',
data: 'delivery_man',
render: function (data) {
return data ? data.first_name + ' ' + data.last_name : '';
}
},
{
data: 'bo_credit_card_number',
name: 'bo_credit_card_number'
},
{
data: 'actions',
name: 'actions'
},
]
});
$('#button_filter').on('click', function () {
var inputs = document.getElementById("form-filter").elements;
var code_client = inputs["code_client"].value;
var code_plu = inputs["code_plu"].value;
if(code_client == "" || code_plu == ""){
swal("Alert!","Complete all the information","warning");
return
}else{
window.location.href = `/orders/${code_client}/${code_plu}`;
}
});
$('#button_clear').on('click', function () {
window.location.href = `/orders`;
});
});
</script>
@if ($code_client != '0' && $code_plu != '0')
<script>
var inputs = document.getElementById("form-filter").elements["code_client"].value = '{{$code_client}}';
var inputs = document.getElementById("form-filter").elements["code_plu"].value = '{{$code_plu}}';
</script>
@endif
@endsection