Ajout validé par + Fix annulations

- La personne validant une commande apparaît dans l'historique K-Psul
- 2 fix annulation K-Psul
This commit is contained in:
Aurélien Delobelle 2016-08-22 17:01:26 +02:00
parent abb4be62aa
commit 170a827e99
2 changed files with 12 additions and 5 deletions

View file

@ -4,7 +4,6 @@
#history span { #history span {
display:inline-block; display:inline-block;
height:100%;
} }
#history .day { #history .day {
@ -40,6 +39,10 @@
width:90px; width:90px;
} }
#history .opegroup .valid_by {
padding-left:20px
}
#history .ope { #history .ope {
position:relative; position:relative;
height:25px; height:25px;

View file

@ -945,7 +945,7 @@ $(document).ready(function() {
// ----- // -----
var history_container = $('#history'); var history_container = $('#history');
var history_operationgroup_html = '<div class="opegroup"><span class="time"></span><span class="trigramme"></span><span class="amount"></span></div>'; var history_operationgroup_html = '<div class="opegroup"><span class="time"></span><span class="trigramme"></span><span class="amount"></span><span class="valid_by"></span></div>';
var history_operation_html = '<div class="ope"><span class="amount"></span><span class="infos1"></span><span class="infos2"></span></div>'; var history_operation_html = '<div class="ope"><span class="amount"></span><span class="infos1"></span><span class="infos2"></span></div>';
function getOpeHtml(ope, is_cof=false, trigramme='') { function getOpeHtml(ope, is_cof=false, trigramme='') {
@ -994,12 +994,16 @@ $(document).ready(function() {
} else { } else {
var amount = amountToUKF(amount, opegroup['is_cof']); var amount = amountToUKF(amount, opegroup['is_cof']);
} }
var valid_by = '';
if (opegroup['valid_by__trigramme'])
valid_by = 'Par '+opegroup['valid_by__trigramme'];
opegroup_html opegroup_html
.attr('data-opegroup', opegroup['id']) .attr('data-opegroup', opegroup['id'])
.find('.time').text(at_formated).end() .find('.time').text(at_formated).end()
.find('.amount').text(amount).end() .find('.amount').text(amount).end()
.find('.trigramme').text(trigramme).end(); .find('.trigramme').text(trigramme).end()
.find('.valid_by').text(valid_by).end();
return opegroup_html; return opegroup_html;
} }
@ -1152,9 +1156,9 @@ $(document).ready(function() {
}); });
function cancelOpeGroup(opegroup) { function cancelOpeGroup(opegroup) {
var opegroup_html = history_container.find('[data-opegroup='+opegroup['id']+']'); var opegroup_html = history_container.find('.opegroup[data-opegroup='+opegroup['id']+']');
if (opegroup_html.find('.trigramme').text() == 'LIQ') { if (opegroup_html.find('.trigramme').text() == 'LIQ') {
var amount = (- parseFloat(opegroup['amount']).tofixed(2))+'€'; var amount = (- parseFloat(opegroup['amount']).toFixed(2))+'€';
} else { } else {
var amount = amountToUKF(opegroup['amount'], opegroup['on_acc__is_cof']); var amount = amountToUKF(opegroup['amount'], opegroup['on_acc__is_cof']);
} }