Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  update_summary: function(){
  2.             var order = this.pos.get('selectedOrder');
  3.             var total     = order ? order.getTotalTaxIncluded() : 0;
  4.             var taxes     = order ? total - order.getTotalTaxExcluded() : 0;
  5.             var discount = 0;
  6.             var discount_id = self.$('#discount-card-select').val();
  7.             if (discount_id){
  8.                  
  9.                  var discount_card = new module.PaymentScreenDiscountWidget(this, {});
  10.         var discont_line = discount_card.fetch('pos.discount.cards',['type', 'value'],[['id','=', discount_id]])
  11.             .then(function(discount_val)
  12.             {
  13.                 var type =  discount_val[0].type;
  14.                 var value = discount_val[0].value;
  15.                 if (type === 'fi'){
  16.                      discount  = value;
  17.                 }
  18.                 else{
  19.                     discount  = value;
  20.                 }
  21.                 console.log("discount value.........................",value)
  22.             });
  23.        
  24.  
  25.            
  26.             }
  27.            
  28.            
  29.             console.log("discount value fianl....................val",discount);
  30.             this.el.querySelector('.summary .total > .value').textContent = this.format_currency(total);
  31.             this.el.querySelector('.summary .total .subentry .value').textContent = this.format_currency(taxes);
  32.             this.el.querySelector('.summary .total .discount .value').textContent = this.format_currency(discount);
  33.  
  34.         },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement