def test_reverse_charge_no_address(event): tr = TaxRule( event=event, eu_reverse_charge=True, rate=Decimal('10.00'), price_includes_tax=False ) assert not tr.is_reverse_charge(None) assert tr.tax_applicable(None)
def test_reverse_charge_no_country(event): tr = TaxRule( event=event, eu_reverse_charge=True, rate=Decimal('10.00'), price_includes_tax=False ) ia = InvoiceAddress( ) assert not tr.is_reverse_charge(ia) assert tr.tax_applicable(ia)
def test_reverse_charge_individual_3rdc(event): tr = TaxRule( event=event, eu_reverse_charge=True, home_country=Country('DE'), rate=Decimal('10.00'), price_includes_tax=False ) ia = InvoiceAddress( is_business=False, country=Country('US') ) assert not tr.is_reverse_charge(ia) assert not tr.tax_applicable(ia)
def test_custom_rules_business(event): tr = TaxRule( event=event, rate=Decimal('10.00'), price_includes_tax=False, custom_rules=json.dumps([ {'country': 'ZZ', 'address_type': 'business', 'action': 'no'}, ]) ) ia = InvoiceAddress( is_business=True, country=Country('AT') ) assert not tr.is_reverse_charge(ia) assert not tr.tax_applicable(ia) ia = InvoiceAddress( is_business=False, country=Country('DE') ) assert not tr.is_reverse_charge(ia) assert tr.tax_applicable(ia)
def test_reverse_charge_disabled(event): tr = TaxRule( event=event, eu_reverse_charge=False, home_country=Country('DE'), rate=Decimal('10.00'), price_includes_tax=False ) ia = InvoiceAddress( is_business=True, vat_id='AT12346', vat_id_validated=True, country=Country('AT') ) assert not tr.is_reverse_charge(ia) assert tr.tax_applicable(ia)
def test_custom_rules_override(event): tr = TaxRule( event=event, eu_reverse_charge=True, home_country=Country('DE'), rate=Decimal('10.00'), price_includes_tax=False, custom_rules=json.dumps([ {'country': 'ZZ', 'address_type': '', 'action': 'vat'} ]) ) ia = InvoiceAddress( is_business=True, vat_id='AT12346', vat_id_validated=True, country=Country('AT') ) assert not tr.is_reverse_charge(ia) assert tr.tax_applicable(ia)