コード例 #1
0
ファイル: cart.py プロジェクト: Peter-YAN/shoppingcart
 def tax_amount(self):
     """
     :return: Tax amount.
     """
     tax_amount = 0.0
     
     if self.__cart.tax_type == 'included':
         total = self.sub_total() - self.discount_amount()
     else:
         total = self.untaxed_amount()
     tax_amount = calculate(total, self.__taxes, self.__cart.tax_type, self.__cart.currency_rate, self.__cart.price_accuracy)    
     return tax_amount
コード例 #2
0
ファイル: cart.py プロジェクト: veeshi/shoppingcart
    def tax_amount(self):
        """
        :return: Tax amount.
        """
        tax_amount = 0.0

        if self.__cart.tax_type == 'included':
            total = self.sub_total() - self.discount_amount()
        else:
            total = self.untaxed_amount()
        tax_amount = calculate(total, self.__taxes, self.__cart.tax_type,
                               self.__cart.currency_rate,
                               self.__cart.price_accuracy)
        return tax_amount
コード例 #3
0
ファイル: cart.py プロジェクト: Peter-YAN/shoppingcart
 def total_tax(self):
     """
     :return: Total tax amount.
     """
     total_tax = 0.0
     
     if self.tax_type == 'included':
         total = self.sub_total() - self.total_discount()
     else:
         total = self.total_untaxed_amount()
     total_tax = calculate(total, self.__taxes, self.tax_type, self.currency_rate, self.price_accuracy)
     for cart_item in self.get_items():
         total_tax += cart_item.tax_amount()
     return round(total_tax, self.price_accuracy)
コード例 #4
0
ファイル: cart.py プロジェクト: veeshi/shoppingcart
    def total_tax(self):
        """
        :return: Total tax amount.
        """
        total_tax = 0.0

        if self.tax_type == 'included':
            total = self.sub_total() - self.total_discount()
        else:
            total = self.total_untaxed_amount()
        total_tax = calculate(total, self.__taxes, self.tax_type,
                              self.currency_rate, self.price_accuracy)
        for cart_item in self.get_items():
            total_tax += cart_item.tax_amount()
        return round(total_tax, self.price_accuracy)