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)
def total(self): return round_to_two_places(self.subtotal + self.vat)
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))
def vat(self): return round_to_two_places(self.subtotal * self.tax_rate / 100 if self.tax_rate else 0)
def subtotal(self): return round_to_two_places(self.unit_price * self.quantity)
def vat(self): vat = 0 for item in self.invoiceitem_set.all(): vat += item.vat return round_to_two_places(vat)
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)
def subtotal(self): sum = 0 for item in self.invoiceitem_set.all(): sum += item.subtotal return round_to_two_places(sum)
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))
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)
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)