示例#1
0
 def total(self):
     total = self.subtotal + self.vat  # subtotal with vat
     total *= (
         (100 - Decimal(self.discount)) / 100)  # subtract discount amount
     total -= self.credit  # subtract credit
     #total -= self.already_paid  # subtract already paid
     return round_to_two_places(total)
示例#2
0
 def total(self):
     return round_to_two_places(self.subtotal + self.vat)
示例#3
0
 def unit_price_with_vat(self):
     tax_rate = self.tax_rate if self.tax_rate else 0
     return round_to_two_places(
         Decimal(self.unit_price) * Decimal((100 + tax_rate) / 100))
示例#4
0
 def vat(self):
     return round_to_two_places(self.subtotal * self.tax_rate /
                                100 if self.tax_rate else 0)
示例#5
0
 def subtotal(self):
     return round_to_two_places(self.unit_price * self.quantity)
示例#6
0
 def vat(self):
     vat = 0
     for item in self.invoiceitem_set.all():
         vat += item.vat
     return round_to_two_places(vat)
示例#7
0
 def discount_value(self):
     total = self.subtotal + self.vat  # subtotal with vat
     discount_value = total * (Decimal(self.discount) / 100
                               )  # subtract discount amount
     return round_to_two_places(discount_value)
示例#8
0
 def total(self):
     return round_to_two_places(self.subtotal + self.vat)
示例#9
0
 def subtotal(self):
     sum = 0
     for item in self.invoiceitem_set.all():
         sum += item.subtotal
     return round_to_two_places(sum)
示例#10
0
 def vat(self):
     return round_to_two_places(self.subtotal * self.tax_rate / 100 if self.tax_rate else 0)
示例#11
0
 def unit_price_with_vat(self):
     tax_rate = self.tax_rate if self.tax_rate else 0
     return round_to_two_places(Decimal(self.unit_price) * Decimal((100 + tax_rate) / 100))
示例#12
0
 def subtotal(self):
     return round_to_two_places(self.unit_price * self.quantity)
示例#13
0
 def total(self):
     total = self.subtotal + self.vat  # subtotal with vat
     total *= ((100 - Decimal(self.discount)) / 100)  # subtract discount amount
     total -= self.credit  # subtract credit
     #total -= self.already_paid  # subtract already paid
     return round_to_two_places(total)
示例#14
0
 def discount_value(self):
     total = self.subtotal + self.vat  # subtotal with vat
     discount_value = total * (Decimal(self.discount) / 100)  # subtract discount amount
     return round_to_two_places(discount_value)
示例#15
0
 def vat(self):
     vat = 0
     for item in self.invoiceitem_set.all():
         vat += item.vat
     return round_to_two_places(vat)
示例#16
0
 def subtotal(self):
     sum = 0
     for item in self.invoiceitem_set.all():
         sum += item.subtotal
     return round_to_two_places(sum)