forked from DGNum/gestioCOF
101 lines
2.8 KiB
HTML
101 lines
2.8 KiB
HTML
{% extends 'kfet/base_col_2.html' %}
|
|
{% load l10n staticfiles widget_tweaks bootstrap %}
|
|
|
|
{% block extra_head %}
|
|
<link rel="stylesheet" type="text/css" href="{% static 'kfet/vendor/multiple-select/multiple-select.css' %}">
|
|
<script type="text/javascript" src="{% static 'kfet/vendor/multiple-select/multiple-select.js' %}"></script>
|
|
{{ filter_form.media }}
|
|
<script type="text/javascript" src="{% url 'js_reverse' %}" ></script>
|
|
<script type="text/javascript" src="{% static 'kfet/js/history.js' %}"></script>
|
|
<script type="text/javascript" src="{% static 'kfet/vendor/moment/moment-timezone-with-data-2012-2022.min.js' %}"></script>
|
|
{% endblock %}
|
|
|
|
{% block title %}Historique{% endblock %}
|
|
{% block header-title %}Historique{% endblock %}
|
|
|
|
{% block fixed %}
|
|
|
|
<aside>
|
|
<div class="heading">
|
|
<span id="nb_opes"></span>
|
|
<span class="sub">opérations</span>
|
|
</div>
|
|
<div class="text" id="history-form">
|
|
{{ filter_form|bootstrap}}
|
|
</div>
|
|
<div class="buttons">
|
|
<button class="btn btn-primary" id="btn-fetch">Valider</button>
|
|
</div>
|
|
</aside>
|
|
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
|
|
<table id="history" class="table">
|
|
</table>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
settings = { 'subvention_cof': parseFloat({{ kfet_config.subvention_cof|unlocalize }})}
|
|
|
|
window.lock = 0;
|
|
|
|
khistory = new KHistory();
|
|
|
|
var $from_date = $('#id_start');
|
|
var $to_date = $('#id_end');
|
|
var $checkout = $('#id_checkout');
|
|
var $account = $('#id_account');
|
|
|
|
function getHistory() {
|
|
data = $("#history-form").find("input, select, textarea").serialize();
|
|
|
|
khistory.fetch(data).done(function () {
|
|
var nb_opes = khistory.$container.find('.entry:not(.canceled)').length;
|
|
$('#nb_opes').text(nb_opes);
|
|
});
|
|
}
|
|
|
|
let defaults_datetimepicker = {
|
|
timeZone : 'Europe/Paris',
|
|
format : 'YYYY-MM-DD HH:mm',
|
|
stepping : 5,
|
|
locale : 'fr',
|
|
showTodayButton: true,
|
|
widgetPositioning: {
|
|
horizontal: "left",
|
|
vertical: "bottom",
|
|
}
|
|
};
|
|
|
|
$from_date.datetimepicker($.extend({}, defaults_datetimepicker, {
|
|
defaultDate: moment().subtract(24, 'hours'),
|
|
}));
|
|
$to_date.datetimepicker($.extend({}, defaults_datetimepicker, {
|
|
defaultDate: moment(),
|
|
}));
|
|
|
|
$("#from_date").on("dp.change", function (e) {
|
|
$('#to_date').data("DateTimePicker").minDate(e.date);
|
|
});
|
|
$("#to_date").on("dp.change", function (e) {
|
|
$('#from_date').data("DateTimePicker").maxDate(e.date);
|
|
});
|
|
|
|
$("#btn-fetch").on('click', function() {
|
|
khistory.reset();
|
|
getHistory();
|
|
});
|
|
|
|
$(document).on('keydown', function (e) {
|
|
if (e.keyCode == 46) {
|
|
// DEL (Suppr)
|
|
khistory.cancel_selected()
|
|
}
|
|
});
|
|
getHistory();
|
|
});
|
|
</script>
|
|
|
|
{% endblock %}
|