Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Asistencia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
Asistencia
Commits
13a75ffd
Commit
13a75ffd
authored
Aug 29, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
montos de policias arreglado
parent
fbd03f73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
194 deletions
+185
-194
monto_policias.js
src/main/webapp/js/pages/monto_policias.js
+184
-191
montoPolicias.jsp
src/main/webapp/vistas/montoPolicias.jsp
+1
-3
No files found.
src/main/webapp/js/pages/monto_policias.js
View file @
13a75ffd
function
getColumns
()
{
let
columns
=
[
{
title
:
`N°`
,
data
:
`id`
,
className
:
'text-center'
},
{
title
:
`POLICIA`
,
data
:
`policia_nombres`
,
className
:
`text-center`
,
},
{
title
:
`SEDE`
,
data
:
`sede_descripcion`
,
className
:
`text-center`
,
},
{
title
:
`HORARIO`
,
data
:
`horario`
,
className
:
'text-center'
},
{
title
:
`FECHA ENTRADA`
,
data
:
`fecha_entrada`
,
className
:
'text-center'
},
{
title
:
`MARC. ENTRADA`
,
data
:
`marcacion_entrada`
,
className
:
'text-center'
},
{
title
:
`MARC. SALIDA`
,
data
:
`marcacion_salida`
,
className
:
'text-center'
},
{
title
:
`FECHA SALIDA`
,
data
:
`fecha_salida`
,
className
:
'text-center'
},
{
title
:
`ROL`
,
data
:
`tiporol_descripcion`
,
className
:
'text-center'
},
{
title
:
`COSTO HORA`
,
data
:
`costo_hora`
,
className
:
'text-center'
},
{
title
:
`TIEMPO LABORADO`
,
data
:
`tiempo_laborado`
,
className
:
'text-center'
},
{
title
:
`MONTO`
,
data
:
`monto`
,
className
:
'text-center'
},
{
title
:
`DCTO POR NO MARCAR`
,
data
:
`descuento_no_marco`
,
className
:
'text-center'
},
{
title
:
`TIEMPO EXTRA`
,
data
:
`tiempo_extra`
,
className
:
'text-center'
},
{
title
:
`MONTO EXTRAS`
,
data
:
`monto_extras`
,
className
:
'text-center'
},
{
title
:
`ESTADO EXTRAS`
,
data
:
`estado_extras`
,
className
:
'text-center'
},
{
title
:
`MONTO TOTAL`
,
data
:
`monto_total`
,
className
:
'text-center'
},
];
let
columns
=
[
{
title
:
`N°`
,
data
:
`id`
,
className
:
'text-center'
},
{
title
:
`POLICIA`
,
data
:
`policia_nombres`
,
className
:
`text-center`
,
},
{
title
:
`SEDE`
,
data
:
`sede_descripcion`
,
className
:
`text-center`
,
},
{
title
:
`HORARIO`
,
data
:
`horario`
,
className
:
'text-center'
},
{
title
:
`FECHA ENTRADA`
,
data
:
`fecha_entrada`
,
className
:
'text-center'
},
{
title
:
`MARC. ENTRADA`
,
data
:
`marcacion_entrada`
,
className
:
'text-center'
},
{
title
:
`MARC. SALIDA`
,
data
:
`marcacion_salida`
,
className
:
'text-center'
},
{
title
:
`FECHA SALIDA`
,
data
:
`fecha_salida`
,
className
:
'text-center'
},
{
title
:
`ROL`
,
data
:
`tiporol_descripcion`
,
className
:
'text-center'
},
{
title
:
`COSTO HORA`
,
data
:
`costo_hora`
,
className
:
'text-center'
},
{
title
:
`TIEMPO LABORADO`
,
data
:
`tiempo_laborado`
,
className
:
'text-center'
},
{
title
:
`MONTO`
,
data
:
`monto`
,
className
:
'text-center'
},
{
title
:
`DCTO POR NO MARCAR`
,
data
:
`descuento_no_marco`
,
className
:
'text-center'
},
{
title
:
`TIEMPO EXTRA`
,
data
:
`tiempo_extra`
,
className
:
'text-center'
},
{
title
:
`MONTO EXTRAS`
,
data
:
`monto_extras`
,
className
:
'text-center'
},
{
title
:
`ESTADO EXTRAS`
,
data
:
`estado_extras`
,
className
:
'text-center'
},
{
title
:
`MONTO TOTAL`
,
data
:
`monto_total`
,
className
:
'text-center'
},
];
return
columns
;
}
function
getColumnDefs
()
{
let
columnDefs
=
[
{
orderable
:
false
,
width
:
'3%'
,
targets
:
0
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'10%'
,
targets
:
1
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'30%'
,
targets
:
2
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
3
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
4
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'3%'
,
targets
:
5
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'10%'
,
targets
:
6
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'30%'
,
targets
:
7
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
8
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
9
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'3%'
,
targets
:
10
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'10%'
,
targets
:
11
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'30%'
,
targets
:
12
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
13
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
14
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
15
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
16
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
17
,
className
:
"text-center"
},
];
return
columnDefs
;
return
columns
;
}
function
listarPolicias
(
selectorName
)
{
axios
.
get
(
URI_POLICIAS
).
then
((
result
)
=>
{
let
policias
=
result
.
data
;
policias
=
_
.
orderBy
(
policias
,
p
=>
p
.
nombres
);
let
html
=
`<option value="">[TODOS]</option>`
;
policias
.
forEach
(
p
=>
html
+=
`<option documento_identidad="
${
p
.
dni
}
" value="
${
p
.
id
}
">
${
p
.
nombres
}
</option>`
);
$
(
`
${
selectorName
}
`
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
ajaxWebService
.
get
(
URI_POLICIAS
).
then
((
result
)
=>
{
let
policias
=
result
.
data
;
policias
=
_
.
orderBy
(
policias
,
p
=>
p
.
nombres
);
let
html
=
`<option value="">[TODOS]</option>`
;
policias
.
forEach
(
p
=>
html
+=
`<option documento_identidad="
${
p
.
dni
}
" value="
${
p
.
id
}
">
${
p
.
nombres
}
</option>`
);
$
(
`
${
selectorName
}
`
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
}
function
listarSedes
(
selectorName
)
{
axios
.
get
(
URI_SEDES
).
then
((
result
)
=>
{
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
let
html
=
`<option value="">[TODOS]</option>`
;
sedes
.
forEach
(
sede
=>
html
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
$
(
`
${
selectorName
}
`
).
html
(
html
);
});
ajaxWebService
.
get
(
URI_SEDES
).
then
((
result
)
=>
{
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
let
html
=
`<option value="">[TODOS]</option>`
;
sedes
.
forEach
(
sede
=>
html
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
$
(
`
${
selectorName
}
`
).
html
(
html
);
});
}
function
defaultConfigDateRangePicker
(
selectorName
)
{
$
(
selectorName
).
daterangepicker
({
"autoApply"
:
true
,
"locale"
:
{
"format"
:
"DD/MM/YYYY"
,
"separator"
:
" - "
,
"applyLabel"
:
"Apply"
,
"cancelLabel"
:
"Cancel"
,
"fromLabel"
:
"From"
,
"toLabel"
:
"To"
,
"customRangeLabel"
:
"Custom"
,
"weekLabel"
:
"W"
,
"daysOfWeek"
:
[
"Do"
,
"Lu"
,
"Ma"
,
"Mi"
,
"Ju"
,
"Vi"
,
"Sa"
],
"monthNames"
:
[
"Enero"
,
"Febrero"
,
"Marzo"
,
"Abril"
,
"Mayo"
,
"Junio"
,
"Julio"
,
"Agosto"
,
"Setiembre"
,
"Octubre"
,
"Noviembre"
,
"Diciembre"
],
"firstDay"
:
1
},
"startDate"
:
"17/08/2018"
,
"endDate"
:
"23/08/2018"
},
function
(
start
,
end
,
label
)
{
$
(
selectorName
).
daterangepicker
({
"autoApply"
:
true
,
"locale"
:
{
"format"
:
"DD/MM/YYYY"
,
"separator"
:
" - "
,
"applyLabel"
:
"Apply"
,
"cancelLabel"
:
"Cancel"
,
"fromLabel"
:
"From"
,
"toLabel"
:
"To"
,
"customRangeLabel"
:
"Custom"
,
"weekLabel"
:
"W"
,
"daysOfWeek"
:
[
"Do"
,
"Lu"
,
"Ma"
,
"Mi"
,
"Ju"
,
"Vi"
,
"Sa"
],
"monthNames"
:
[
"Enero"
,
"Febrero"
,
"Marzo"
,
"Abril"
,
"Mayo"
,
"Junio"
,
"Julio"
,
"Agosto"
,
"Setiembre"
,
"Octubre"
,
"Noviembre"
,
"Diciembre"
],
"firstDay"
:
1
},
"startDate"
:
"17/08/2018"
,
"endDate"
:
"23/08/2018"
},
function
(
start
,
end
,
label
)
{
// console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$
(
selectorName
).
datepicker
(
'setDate'
,
'now'
);
});
$
(
selectorName
).
datepicker
(
'setDate'
,
'now'
);
}
function
mostrarReporte
(
objParams
=
{})
{
axios
.
get
(
URI_POLICIA_REPORTE_MONTOS
,
objParams
).
then
((
response
)
=>
{
response
.
data
=
formatResponse
(
response
);
let
columns
=
getColumns
();
let
columnDefs
=
getColumnDefs
();
ajaxWebService
.
get
(
URI_POLICIA_REPORTE_MONTOS
,
objParams
).
then
((
response
)
=>
{
let
columns
=
getColumns
();
let
wrapsNameDatatable
=
`divDatatable`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
footer
=
false
;
let
wrapsNameDatatable
=
`divDatatable`
;
let
classNameForDatatable
=
`display table table-bordered`
;
makeDatatable
(
{
data
:
response
.
data
.
data
,
columns
,
columnDefs
,
wrapsNameDatatable
,
classNameForDatatable
,
footer
}
);
});
makeDatatable
(
wrapsNameDatatable
,
{
data
:
response
.
data
,
columns
},
classNameForDatatable
,
);
});
}
function
verReporte
()
{
debugger
let
rango_fechas
=
$
(
"#dpRangoFechas"
).
val
();
let
split_fechas
=
rango_fechas
.
split
(
"-"
).
map
(
f
=>
f
.
trim
());
let
fecha_inicio
=
split_fechas
[
0
];
let
policia_nombres
=
$
(
"#cboPoliciasFiltro option:selected"
).
text
();
let
sede_descripcion
=
$
(
"#cboSedesFiltro option:selected"
).
text
();
policia_nombres
=
policia_nombres
.
includes
(
"TODOS"
)
?
""
:
policia_nombres
sede_descripcion
=
sede_descripcion
.
includes
(
"TODOS"
)
?
""
:
sede_descripcion
let
params
=
cleanQueryParams
({
fecha_entrada
:
fecha_inicio
,
policia_nombres
,
sede_descripcion
});
mostrarReporte
({
params
});
}
$
().
ready
(
function
()
{
defaultConfigDataTable
(
);
listarPolicias
(
"#cboPolicia
sFiltro"
);
listarSedes
(
"#cboSedesFiltro
"
);
defaultConfigDateRangePicker
(
"#dpRangoFechas"
);
$
(
"#btnVerTodos"
).
click
(
mostra
rReporte
);
listarPolicias
(
"#cboPoliciasFiltro"
);
listarSedes
(
"#cboSede
sFiltro"
);
defaultConfigDateRangePicker
(
"#dpRangoFechas
"
);
$
(
"#btnVerTodos"
).
click
(
mostrarReporte
);
$
(
"#btnVerReporte"
).
click
(
ve
rReporte
);
});
\ No newline at end of file
src/main/webapp/vistas/montoPolicias.jsp
View file @
13a75ffd
...
...
@@ -45,7 +45,7 @@
</div>
<div
class=
"panel-footer"
>
<div
class=
"text-center"
>
<button
class=
"btn btn-primary"
id=
"btnVerR
oles
"
><i
class=
"icon-eye4"
></i>
Ver reporte
</button>
<button
class=
"btn btn-primary"
id=
"btnVerR
eporte
"
><i
class=
"icon-eye4"
></i>
Ver reporte
</button>
<button
class=
"btn btn-primary"
id=
"btnVerTodos"
><i
class=
"icon-eye4"
></i>
Ver Todos
</button>
</div>
</div>
...
...
@@ -71,12 +71,10 @@
<
%@
include
file=
"templates/footer-body.jsp"
%
>
<!--js de la pagina-->
<script
src=
"../plantilla/assets/js/plugins/tables/datatables/datatables.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/core/libraries/jquery_ui/interactions.min.js"
></script>
<script
src=
"../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"
></script>
<script
src=
"../js/lib/sweetalert2.min.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/lodash.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/axios.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/plugins/forms/inputs/formatter.min.js"
></script>
<script
src=
"../plantilla/assets/js/plugins/forms/selects/select2.min.js"
></script>
<script
src=
"../plantilla/assets/js/plugins/ui/moment/moment.min.js"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment