Exemple #1
0
 def get_taxed_price(self, context, price, tax_class):
     if price.includes_tax:
         taxful = price
         taxless = TaxlessPrice(price.amount / Decimal('1.2'))
     else:
         taxful = TaxfulPrice(price.amount * Decimal('1.2'))
         taxless = price
     tax_amount = taxful.amount - taxless.amount
     base_amount = taxless.amount
     taxes = [
         SourceLineTax(Tax(), 'fifth', tax_amount, base_amount),
     ]
     DummyTaxModule.calculations_done += 1
     return TaxedPrice(taxful, taxless, taxes)
Exemple #2
0
def tax(code, rate=None, amount=None):
    return Tax(code=code, name=('Tax ' + code), rate=rate, amount=amount)
Exemple #3
0
def create_tax(code, rate=None, amount=None):
    return Tax(code=code, name=("Tax " + code), rate=rate, amount=amount)