});
this.save('orders',orders);
},
+ remove_all_orders: function(){
+ this.save('orders',[]);
+ },
get_orders: function(){
return this.load('orders',[]);
},
this.$('.button.show_orders').click(function(){
self.pos.pos_widget.screen_selector.show_popup('unsent-orders');
});
+ this.$('.button.delete_orders').click(function(){
+ self.pos.pos_widget.screen_selector.show_popup('confirm',{
+ message: _t('Delete Unsent Orders ?'),
+ comment: _t('This operation will permanently destroy all unsent orders from the local storage. You will lose all the data. This operation cannot be undone.'),
+ confirm: function(){
+ self.pos.db.remove_all_orders();
+ self.pos.set({synch: { state:'connected', pending: 0 }});
+ },
+ });
+ });
_.each(this.eans, function(ean, name){
self.$('.button.'+name).click(function(){
self.$('input.ean').val(ean);
<p class="category">Unsent Orders</p>
<ul>
<li class="button show_orders">Show All Unsent Orders</li>
+ <li class="button delete_orders">Delete All Unsent Orders</li>
</ul>
<p class="category">Hardware Status</p>