Texte dernier relevé ne s'affiche pas s'il n'y a en pas

This commit is contained in:
Aurélien Delobelle 2016-08-21 16:45:25 +02:00
parent 1ad265ef0f
commit a6b961d2ab

View file

@ -49,11 +49,7 @@
<div> <div>
<b>En caisse:</b> <span id="checkout-balance"></span> <b>En caisse:</b> <span id="checkout-balance"></span>
</div> </div>
<div> <div id="last_statement">
<b>Dernier relevé: </b><br>
<span id="checkout-last_statement_balance"></span>
à <span id="checkout-last_statement_at"></span>
par <span id="checkout-last_statement_by_trigramme"></span>
</div> </div>
<div class="buttons"> <div class="buttons">
</div> </div>
@ -259,9 +255,17 @@ $(document).ready(function() {
'last_statement_by_first_name': '', 'last_statement_by_first_name': '',
'last_statement_by_last_name' : '' , 'last_statement_by_last_name' : '' ,
} }
var last_statement_container = $('#last_statement');
var last_statement_html_default = '<b>Dernier relevé: </b><br><span id="checkout-last_statement_balance"></span>€ à <span id="checkout-last_statement_at"></span> par <span id="checkout-last_statement_by_trigramme"></span>';
// Display data // Display data
function displayCheckoutData() { function displayCheckoutData() {
if (checkout_data['last_statement_at']) {
last_statement_container.html(last_statement_html_default);
} else {
last_statement_container.html('');
}
for (var elem in checkout_data) { for (var elem in checkout_data) {
$('#checkout-'+elem).text(checkout_data[elem]); $('#checkout-'+elem).text(checkout_data[elem]);
} }