forked from DGNum/gestioCOF
e60e347a53
- kfet/base_col_1.html for one column content. - kfet/base_col_2.html for two columns content (left for fixed content, right for main content).
227 lines
9.6 KiB
HTML
227 lines
9.6 KiB
HTML
{% extends "kfet/base_col_2.html" %}
|
|
{% load l10n %}
|
|
{% load widget_tweaks %}
|
|
|
|
{% block title %}Nouveau relevé - {{ checkout.name }}{% endblock %}
|
|
{% block header-title %}Création d'un relevé pour la caisse {{ checkout.name }}{% endblock %}
|
|
|
|
{% block fixed-content %}
|
|
{% include "kfet/left_checkout.html" %}
|
|
{% endblock %}
|
|
|
|
{% block main-content %}
|
|
<form action="" method="post">
|
|
{% csrf_token %}
|
|
<div class="content-right-block">
|
|
<h2>Général</h2>
|
|
<div class="content-form statement-create-summary">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<label for="{{ form.not_count.id_for_label }}" class="control-label">{{ form.not_count.label }}</label>
|
|
</td>
|
|
<td>{{ form.not_count }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Ancienne balance</td>
|
|
<td>
|
|
<span id="balance_old">{{ checkout.balance|unlocalize }}</span> €
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Nouvelle balance</td>
|
|
<td><span id="balance_new">0</span> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Pris</td>
|
|
<td><span id="amount_taken">0</span> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Erreur</td>
|
|
<td><span id="amount_error">0</span> €</td>
|
|
</tr>
|
|
</table>
|
|
{% if not perms.kfet.add_checkoutstatement %}
|
|
{% include "kfet/form_authentication_snippet.html" %}
|
|
{% endif %}
|
|
<br>
|
|
<div class="row text-center">
|
|
<input type="submit" value="Enregistrer" class="btn btn-lg btn-primary">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="content-right-block">
|
|
<h2>Pris</h2>
|
|
<div id="detail_taken">
|
|
<div class="table-responsive">
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<td>5€</td>
|
|
<td>10€</td>
|
|
<td>20€</td>
|
|
<td>50€</td>
|
|
<td>100€</td>
|
|
<td>200€</td>
|
|
<td>500€</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><input id="id_taken_5" name="taken_5" data-value="5" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_10" name="taken_10" data-value="10" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_20" name="taken_20" data-value="20" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_50" name="taken_50" data-value="50" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_100" name="taken_100" data-value="100" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_200" name="taken_200" data-value="200" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_500" name="taken_500" data-value="500" min="0" value="0" type="number" class="form-control" required></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<td>2€</td>
|
|
<td>1€</td>
|
|
<td>0.50€</td>
|
|
<td>0.20€</td>
|
|
<td>0.10€</td>
|
|
<td>0.05€</td>
|
|
<td>0.02€</td>
|
|
<td>0.01€</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><input id="id_taken_2" name="taken_2" data-value="2" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_1" name="taken_1" data-value="1" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_05" name="taken_05" data-value="0.5" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_02" name="taken_02" data-value="0.2" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_01" name="taken_01" data-value="0.1" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_005" name="taken_005" data-value="0.05" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_002" name="taken_002" data-value="0.02" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_taken_001" name="taken_001" data-value="0.01" min="0" value="0" type="number" class="form-control" required></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<tr><td>Chèques</td></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<input id="id_taken_cheque" name="taken_cheque" data-value="1" min="0" step="0.01" value="0" type="number" class="form-control" required>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="content-right-block">
|
|
<h2>En caisse</h2>
|
|
<div id="detail_balance">
|
|
<div class="table-responsive">
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<td>5€</td>
|
|
<td>10€</td>
|
|
<td>20€</td>
|
|
<td>50€</td>
|
|
<td>100€</td>
|
|
<td>200€</td>
|
|
<td>500€</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><input id="id_balance_5" name="balance_5" data-value="5" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_10" name="balance_10" data-value="10" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_20" name="balance_20" data-value="20" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_50" name="balance_50" data-value="50" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_100" name="balance_100" data-value="100" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_200" name="balance_200" data-value="200" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_500" name="balance_500" data-value="500" min="0" value="0" type="number" class="form-control" required></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<td>2€</td>
|
|
<td>1€</td>
|
|
<td>0.50€</td>
|
|
<td>0.20€</td>
|
|
<td>0.10€</td>
|
|
<td>0.05€</td>
|
|
<td>0.02€</td>
|
|
<td>0.01€</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><input id="id_balance_2" name="balance_2" data-value="2" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_1" name="balance_1" data-value="1" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_05" name="balance_05" data-value="0.5" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_02" name="balance_02" data-value="0.2" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_01" name="balance_01" data-value="0.1" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_005" name="balance_005" data-value="0.05" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_002" name="balance_002" data-value="0.02" min="0" value="0" type="number" class="form-control" required></td>
|
|
<td><input id="id_balance_001" name="balance_001" data-value="0.01" min="0" value="0" type="number" class="form-control" required></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('#id_not_count').on('change', function() {
|
|
if ($(this).prop('checked')) {
|
|
$('#detail_balance input').prop('disabled', true);
|
|
} else {
|
|
$('#detail_balance input').prop('disabled', false);
|
|
}
|
|
updateAmounts();
|
|
});
|
|
|
|
$('#detail_balance input, #detail_taken input').on('input', function() {
|
|
updateAmounts();
|
|
});
|
|
|
|
function getTotal(id_container) {
|
|
var total = 0;
|
|
$('#'+id_container+' input').each(function() {
|
|
total += parseFloat($(this).attr('data-value')) * parseFloat($(this).val());
|
|
});
|
|
return total;
|
|
}
|
|
|
|
function updateAmounts() {
|
|
var balance_old = parseFloat($('#balance_old').text());
|
|
var taken = getTotal('detail_taken');
|
|
if ($('#id_not_count').prop('checked')) {
|
|
var error = 0;
|
|
var balance_new = balance_old - taken;
|
|
} else {
|
|
var balance_new = getTotal('detail_balance');
|
|
var error = balance_new + taken - balance_old;
|
|
}
|
|
$('#balance_new').text(balance_new.toFixed(2));
|
|
$('#amount_taken').text(taken.toFixed(2));
|
|
$('#amount_error').text(error.toFixed(2));
|
|
}
|
|
});
|
|
</script>
|
|
|
|
{% endblock %}
|