@extends('layouts.app')

@section('title',"Formas de pago")

@section('content')
<div class="card">
	<div class="card-header header-elements-inline">
		<h5 class="card-title"><i class="icon-clipboard "></i> Tipo de cambio </h5>
		<div class="header-elements">
			<div class="list-icons">
        		<a class="list-icons-item" data-action="collapse"></a>
        		<a class="list-icons-item" data-action="reload"></a>
        		<a class="list-icons-item" data-action="remove"></a>
        	</div>
    	</div>
	</div>
	<div class="card-body mt-2">
		<div class="row">
			<div class="col-6 ">
				<button type="button" class="btn btn-primary"  onclick="reload_divisas(this); return false">
					<i class="icon-spinner9"></i> Reload
				</button>
			</div>
		</div>
		<div class="row justify-content-center">
			<div class="col-2 ">
				<label for=""><b>Fecha:</b></label>
				<input type="text" name="fecha" id="fecha" class="form-control" onchange="change_date(); return false" value="<?php echo date('m/Y'); ?>">
			</div>
		</div>
	</div>
	<table class="table table-bordered table-hover datatable">
		<thead>
			<th>Fecha</th>
			<th>Compra</th>
			<th>Venta</th>
			<th>Imp. Gen Ventas</th>
			<th>Imp. Sel Consumo</th>
			<th>Imp. Hotelero</th>
			<th>Renta 4ta</th>
			<th width="10%">Acciones</th>
		</thead>
	</table>
</div>
<div class="response-ajax"></div>
	@section('scripts')
		<script>
			$('.sub_utilitys').addClass('nav-item-open nav-item-expanded');
			var url = 'tcambio',search = $('#fecha').val();
			var columns = [
			        {data: 'fecha'},
			        {data: 'compra'},
			        {data: 'venta'},
			        {data: 'imp_g_ventas'},
			        {data: 'imp_s_consumo'},  
			        {data: 'imp_hotelero'}, 
			        {data: 'renta'}, 
			        {data: 'action'}, 
			    ];
		</script>
		<script>
			function change_date(){
				search = $('#fecha').val();
				$('.datatable').DataTable().ajax.reload();
			}
		</script>
		<script>
			$.fn.datepicker.defaults.format = "mm/yyyy";
			$('#fecha').datepicker({
			    weekStart: 1,
			    daysOfWeekHighlighted: "6,0",
			    autoclose: true,
			    todayHighlight: true,
			    viewMode: "months", 
			    minViewMode: "months"
			});
		</script>
		<script src="{!! asset('assets/datatables/datatables_custom.js') !!}"></script>
		<script src="{!! asset('assets/views_functions/tcambio.js') !!}"></script>
	@endsection
@endsection