2024-04-10 21:18:33 -04:00
|
|
|
@extends('layout.base')
|
|
|
|
|
2024-05-13 16:54:59 -04:00
|
|
|
@include('layout.head.styles.datatables')
|
|
|
|
@include('layout.head.styles.datatables.searchbuilder')
|
|
|
|
@include('layout.head.styles.datatables.buttons')
|
|
|
|
|
|
|
|
@push('page_styles')
|
|
|
|
<style>
|
|
|
|
#table_container {
|
|
|
|
margin-left: 1rem;
|
|
|
|
margin-right: 1rem;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
@endpush
|
|
|
|
|
2024-04-10 21:18:33 -04:00
|
|
|
@section('page_content')
|
|
|
|
<div class="ui container">
|
|
|
|
<h1 class="ui header">Movimientos Contables</h1>
|
2024-05-13 16:54:59 -04:00
|
|
|
<form class="ui form" id="movimientos_form">
|
|
|
|
<div class="fields">
|
|
|
|
<div class="six wide field">
|
|
|
|
<label for="sociedad">Sociedad</label>
|
|
|
|
<div class="ui selection search multiple dropdown" id="sociedades">
|
|
|
|
<input type="hidden" name="sociedad[]"/>
|
|
|
|
<i class="dropdown icon"></i>
|
|
|
|
<div class="default text">Sociedad</div>
|
|
|
|
<div class="menu">
|
|
|
|
@foreach($sociedades as $sociedad)
|
|
|
|
<div class="item" data-value="{{$sociedad->rut}}">{{$sociedad->razon}}</div>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="three wide field">
|
|
|
|
<label for="mes">Mes</label>
|
|
|
|
<div class="ui calendar" id="mes">
|
|
|
|
<div class="ui right icon input">
|
2024-09-24 21:10:57 -03:00
|
|
|
<input type="text" name="mes"/>
|
2024-05-13 16:54:59 -04:00
|
|
|
<i class="calendar icon"></i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label></label>
|
|
|
|
<button class="ui circular icon button">
|
|
|
|
<i class="sync alternate icon"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div id="table_container">
|
2024-10-01 13:11:15 -03:00
|
|
|
<table id="tabla_movimientos" class="ui compact table">
|
2024-05-13 16:54:59 -04:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Sigla</th>
|
|
|
|
<th>Banco</th>
|
|
|
|
<th>Cuenta</th>
|
|
|
|
<th>Fecha</th>
|
|
|
|
<th>ISO Fecha</th>
|
|
|
|
<th>Mes</th>
|
|
|
|
<th>Año</th>
|
|
|
|
<th class="right aligned">Valor</th>
|
|
|
|
<th>Valor</th>
|
|
|
|
<th>Glosa</th>
|
2024-09-24 21:02:28 -03:00
|
|
|
<th>Centro de Costo</th>
|
2024-05-13 16:54:59 -04:00
|
|
|
<th>Detalle</th>
|
|
|
|
<th>Editar</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody id="movimientos"></tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2024-10-01 13:11:15 -03:00
|
|
|
@include('contabilidad.movimientos.edit_modal')
|
2024-04-10 21:18:33 -04:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@include('layout.body.scripts.datatables')
|
|
|
|
@include('layout.body.scripts.datatables.searchbuilder')
|
|
|
|
@include('layout.body.scripts.datatables.buttons')
|
2024-06-18 22:41:03 -04:00
|
|
|
@include('layout.body.scripts.rut')
|
2024-04-10 21:18:33 -04:00
|
|
|
|
|
|
|
@push('page_scripts')
|
|
|
|
<script>
|
2024-06-18 22:41:03 -04:00
|
|
|
class CentrosCostos {
|
|
|
|
static data = []
|
|
|
|
static get() {
|
|
|
|
if (this.data.length === 0) {
|
|
|
|
this.data = JSON.parse('{!! json_encode($centros) !!}')
|
|
|
|
}
|
|
|
|
return this.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
@endpush
|
|
|
|
@push('page_scripts')
|
2024-10-01 13:11:15 -03:00
|
|
|
@include('contabilidad.movimientos.scripts.event_handler')
|
|
|
|
@include('contabilidad.movimientos.scripts.loading_handler')
|
|
|
|
@include('contabilidad.movimientos.scripts.control_form')
|
|
|
|
@include('contabilidad.movimientos.scripts.movimientos_table')
|
|
|
|
@include('contabilidad.movimientos.scripts.edit_modal')
|
|
|
|
@include('contabilidad.movimientos.scripts.edit_form')
|
|
|
|
@include('contabilidad.movimientos.scripts.movimientos_handler')
|
|
|
|
@include('contabilidad.movimientos.scripts.results_handler')
|
2024-06-18 22:41:03 -04:00
|
|
|
<script>
|
|
|
|
const app = {
|
|
|
|
handlers: {},
|
|
|
|
setup() {
|
|
|
|
this.handlers.results = new ResultsHandler()
|
|
|
|
this.handlers.loading = new LoadingHandler({id: '#movimientos_form'})
|
2024-10-01 13:11:15 -03:00
|
|
|
this.handlers.movimientos = new MovimientosHandler({
|
|
|
|
urls: {
|
|
|
|
get: '{{$urls->api}}/contabilidad/movimientos/sociedad/mes',
|
|
|
|
edit: '{{$urls->api}}/contabilidad/movimientos/edit',
|
|
|
|
remove: '{{$urls->api}}/contabilidad/movimiento',
|
|
|
|
},
|
|
|
|
loadingHandler: this.handlers.loading,
|
|
|
|
resultsHandler: this.handlers.results
|
|
|
|
})
|
2024-09-24 21:02:28 -03:00
|
|
|
this.handlers.forms = {
|
|
|
|
edit: new EditForm({ids: {modal: '#movimientos_modal', data: '#movimientos_data', form: '#movimientos_edit',}})
|
|
|
|
}
|
|
|
|
this.handlers.modals = {
|
|
|
|
edit: new EditModal({ids: {modal: '#movimientos_modal'}, editForm: this.handlers.forms.edit})
|
|
|
|
}
|
2024-06-18 22:41:03 -04:00
|
|
|
this.handlers.events = new EventHandler({movimientosHandler: this.handlers.movimientos, modalHandler: this.handlers.modals.edit})
|
2024-10-01 13:11:15 -03:00
|
|
|
this.handlers.table = new MovimientosTable({ids: {table: '#tabla_movimientos', buttons: {edit: '.edit_button', remove: '.remove_button'}}, eventHandler: this.handlers.events})
|
2024-09-24 21:02:28 -03:00
|
|
|
this.handlers.forms.control = new ControlForm({ids: {form: '#movimientos_form', sociedades: '#sociedades', mes: '#mes',},})
|
|
|
|
|
|
|
|
this.handlers.forms.edit.setup()
|
2024-05-13 16:54:59 -04:00
|
|
|
}
|
2024-04-10 21:18:33 -04:00
|
|
|
}
|
|
|
|
$(document).ready(() => {
|
2024-06-18 22:41:03 -04:00
|
|
|
app.setup()
|
2024-04-10 21:18:33 -04:00
|
|
|
})
|
|
|
|
</script>
|
|
|
|
@endpush
|