Esempio n. 1
0
 def sub_total(self):
     grand_total = 0
     for obj in self.rows.all():
         total = obj.quantity * obj.rate
         discount = get_discount_with_percent(total, obj.discount)
         grand_total += total - discount
     return grand_total
Esempio n. 2
0
 def sub_total(self):
     grand_total = 0
     for obj in self.rows.all():
         total = obj.quantity * obj.rate
         discount = get_discount_with_percent(total, obj.discount)
         grand_total += total - discount
     return grand_total
Esempio n. 3
0
 def total(self):
     amount = self.sub_total
     if self.tax == "exclusive":
         amount = self.sub_total + self.tax_amount
     if self.discount:
         discount = get_discount_with_percent(amount, self.discount)
         amount = amount - discount
     return amount
Esempio n. 4
0
 def total(self):
     amount = self.sub_total
     if self.tax == "exclusive":
         amount = self.sub_total + self.tax_amount
     if self.discount:
         discount = get_discount_with_percent(amount, self.discount)
         amount = amount - discount
     return amount
Esempio n. 5
0
 def get_total(self):
     rate = float(self.rate)
     tax_scheme = None
     if self.purchase.tax == 'inclusive':
         tax_scheme = self.purchase.tax_scheme or self.tax_scheme
         if tax_scheme:
             rate = (100 * rate) / (100 + tax_scheme.percent)
     total = float(self.quantity) * rate
     discount = get_discount_with_percent(total, self.discount)
     if self.purchase.tax == 'inclusive':
         if not tax_scheme:
             tax_scheme = self.purchase.tax_scheme or self.tax_scheme
         if tax_scheme:
             discount = (100 * discount) / (100 + tax_scheme.percent)
     return total - discount
Esempio n. 6
0
 def get_total(self):
     rate = float(self.rate)
     tax_scheme = None
     if self.purchase.tax == 'inclusive':
         tax_scheme = self.purchase.tax_scheme or self.tax_scheme
         if tax_scheme:
             rate = (100 * rate) / (100 + tax_scheme.percent)
     total = float(self.quantity) * rate
     discount = get_discount_with_percent(total, self.discount)
     if self.purchase.tax == 'inclusive':
         if not tax_scheme:
             tax_scheme = self.purchase.tax_scheme or self.tax_scheme
         if tax_scheme:
             discount = (100 * discount) / (100 + tax_scheme.percent)
     return total - discount
Esempio n. 7
0
 def get_total(self):
     total = float(self.quantity) * float(self.rate)
     discount = get_discount_with_percent(total, self.discount)
     return total - discount