Skip to content
Browse files

After a ring is complete, a new ring now starts cleanly.

  • Loading branch information...
1 parent 78fbc3a commit 368c2efccfd1771a4ae81efbe6e3fba6a8d8b865 @maxolasersquad committed Jan 24, 2014
Showing with 8 additions and 2 deletions.
  1. +7 −1 static/js/input.js
  2. +1 −1 templates/register/index.html
View
8 static/js/input.js
@@ -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);
@@ -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);
@@ -83,7 +90,6 @@ Orthosie.input = {
}
});
break;
-
}
$('#register_input').html('');
},
View
2 templates/register/index.html
@@ -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'>

0 comments on commit 368c2ef

Please sign in to comment.
Something went wrong with that request. Please try again.