Skip to content

Commit

Permalink
After a ring is complete, a new ring now starts cleanly.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxolasersquad committed Jan 25, 2014
1 parent 78fbc3a commit 368c2ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion static/js/input.js
Expand Up @@ -45,6 +45,10 @@ Orthosie.input = {
dataType: 'json',
success: function(data, status) {
if (data.success) {
if ($('#transactions').data('status') == 'end') {
$('#transactions>table>tbody').html('');
$('#transactions').data('status', 'ring');
}
$('#transactions>table').append('<tr><td>' + data.vendor + ' ' + data.name + '</td><td>' + data.quantity + ' @ $' + data.price + '</td></tr>');
$('#sub_total_value').html('$' + data.subtotal);
$('#tax_total_value').html('$' + data.taxtotal);
Expand Down Expand Up @@ -73,6 +77,9 @@ Orthosie.input = {
type: 'POST',
dataType: 'json',
success: function(data, status) {
if (data.total <= 0) {
$('#transactions').data('status', 'end');
}
$('#sub_total_value').html('$' + data.subtotal);
$('#tax_total_value').html('$' + data.taxtotal);
$('#paid_total_value').html('$' + data.paidtotal);
Expand All @@ -83,7 +90,6 @@ Orthosie.input = {
}
});
break;

}
$('#register_input').html('');
},
Expand Down
2 changes: 1 addition & 1 deletion templates/register/index.html
Expand Up @@ -52,7 +52,7 @@
<div id='input'>
{% include "register/input.html" %}
</div>
<div id='transactions' class="container">
<div id='transactions' class="container" data-status="ring">
{% include "register/transactions.html" %}
</div>
<div id='totals'>
Expand Down

0 comments on commit 368c2ef

Please sign in to comment.