예제 #1
0
파일: taxes.py 프로젝트: cuberskulk/shoop
 def __str__(self):
     text = super(Tax, self).__str__()
     if self.rate is not None:
         text += " ({})".format(format_percent(self.rate, digits=3))
     if self.amount is not None:
         text += " ({})".format(format_money(self.amount))
     return text
예제 #2
0
 def __str__(self):
     text = super(Tax, self).__str__()
     if self.rate is not None:
         text += " ({})".format(format_percent(self.rate, digits=3))
     if self.amount is not None:
         text += " ({})".format(format_money(self.amount))
     return text
예제 #3
0
파일: create.py 프로젝트: sebad78/shoop
def encode_line(line):
    return {
        "sku": line.sku,
        "text": line.text,
        "quantity": format_decimal(line.quantity, locale=get_current_babel_locale()),
        "unitPrice": format_money(line.base_unit_price.amount),
        "discountAmount": format_money(line.discount_amount.amount),
        "taxlessTotal": format_money(line.taxless_price.amount),
        "taxPercentage": format_percent(line.tax_rate, 2),
        "taxfulTotal": format_money(line.taxful_price.amount)
    }
예제 #4
0
def encode_line(line):
    return {
        "sku": line.sku,
        "text": line.text,
        "quantity": format_decimal(line.quantity, locale=get_current_babel_locale()),
        "unitPrice": format_money(line.base_unit_price.amount),
        "discountAmount": format_money(line.discount_amount.amount),
        "taxlessTotal": format_money(line.taxless_price.amount),
        "taxPercentage": format_percent(line.tax_rate, 2),
        "taxfulTotal": format_money(line.taxful_price.amount)
    }
예제 #5
0
def percent(value, ndigits=0):
    return format_percent(value, ndigits)
예제 #6
0
def percent(value, ndigits=3):
    return format_percent(value, ndigits)
예제 #7
0
파일: list.py 프로젝트: taedori81/shoop
def _format_rate(tax_rule):
    if tax_rule.rate is None:
        return ""
    return format_percent(tax_rule.rate, digits=3)
예제 #8
0
 def format_percentage(self, instance, *args, **kwargs):
     if not instance.discount_percentage:
         return ""
     return format_percent(instance.discount_percentage)
예제 #9
0
def _format_rate(tax_rule):
    if tax_rule.rate is None:
        return ""
    return format_percent(tax_rule.rate, digits=3)
예제 #10
0
 def format_percentage(self, instance, *args, **kwargs):
     if not instance.discount_percentage:
         return ""
     return format_percent(instance.discount_percentage)