当前位置: 首页>>代码示例>>Python>>正文


Python Invoice.use_tax方法代码示例

本文整理汇总了Python中InvoiceGenerator.api.Invoice.use_tax方法的典型用法代码示例。如果您正苦于以下问题:Python Invoice.use_tax方法的具体用法?Python Invoice.use_tax怎么用?Python Invoice.use_tax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InvoiceGenerator.api.Invoice的用法示例。


在下文中一共展示了Invoice.use_tax方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_generate_proforma

# 需要导入模块: from InvoiceGenerator.api import Invoice [as 别名]
# 或者: from InvoiceGenerator.api.Invoice import use_tax [as 别名]
    def test_generate_proforma(self):
        provider = Provider('Pupik')
        provider.address = 'Kubelikova blah blah blah'
        provider.zip_code = '12655465'
        provider.city = 'Frantisek'
        provider.vat_id = 'CZ8590875682'
        provider.ir = '785684523'
        provider.email = '[email protected]'
        provider.bank_account = '2600420569/2010'
        provider.bank_name = 'RB'
        provider.note = u'zapsaná v obchodním rejstříku vedeném městským soudem v Praze,\noddíl C, vložka 176551'

        client = Client('Kkkk')
        client.summary = 'Bla blah blah'
        client.address = 'Kubelikova blah blah blah'
        client.zip_code = '12655465'
        client.city = 'Frantisek'
        client.vat_id = 'CZ8590875682'
        client.ir = '785684523'
        client.phone = '785684523'
        client.email = '[email protected]'
        client.note = u'zapsaná v obchodním rejstříku vedeném městským soudem v Praze,\noddíl C, vložka 176551'

        invoice = Invoice(client, provider, Creator('blah'))
        invoice.number = 'F20140007'
        invoice.use_tax = True
        invoice.title = u"Proforma faktura"
        invoice.add_item(Item(32, 600.6, description=u"Krátký popis", tax=50))
        invoice.add_item(Item(32, 2.5, tax=20))
        invoice.add_item(
            Item(
                5,
                25.42,
                description=u"Dlouhý popis blah blah blah blah blah blah blah blah blah blah blah "
                            u"blah blah blah blah blah blah blah blah blah blah blah blah blah blah "
                            u"blah blah blah blah blah blah blah blah blah blah blah",
                tax=20,
            ),
        )
        for i in range(1, 26):
            invoice.add_item(Item(5, 25.42, description=u"Popis", tax=0))
        invoice.specific_symbol = 666
        invoice.date = datetime.date.today()
        invoice.variable_symbol = '000000001'
        invoice.number = 'F20140001'
        invoice.payback = datetime.date.today()
        invoice.currency = u'Kč'
        invoice.currency_locale = 'cs_CZ.UTF-8'
        invoice.rounding_result = True

        tmp_file = NamedTemporaryFile(delete=False)
        pdf = ProformaInvoice(invoice)
        pdf.gen(tmp_file.name, True)

        pdf = PdfFileReader(tmp_file)
        pdf_string = pdf.pages[1].extractText()
        self.assertTrue(u"Celkem s DPH: 32⁄255,-⁄K…" in pdf_string)
开发者ID:creckx,项目名称:InvoiceGenerator,代码行数:59,代码来源:test_pdf.py

示例2: test_price_tax_rounding

# 需要导入模块: from InvoiceGenerator.api import Invoice [as 别名]
# 或者: from InvoiceGenerator.api.Invoice import use_tax [as 别名]
 def test_price_tax_rounding(self):
     """
     Test, that the price that sums up to 1756.5 gets rounded according to rounding strategy.
     """
     invoice = Invoice(Client('Foo'), Provider('Bar'), Creator('Blah'))
     invoice.add_item(Item(5, 290, tax=21))
     invoice.rounding_result = True
     invoice.use_tax = True
     self.assertEqual(1754, invoice.price_tax)
     invoice.rounding_strategy = decimal.ROUND_HALF_UP
     self.assertEqual(1755, invoice.price_tax)
开发者ID:PetrDlouhy,项目名称:InvoiceGenerator,代码行数:13,代码来源:test_api.py

示例3: test_generate_with_vat

# 需要导入模块: from InvoiceGenerator.api import Invoice [as 别名]
# 或者: from InvoiceGenerator.api.Invoice import use_tax [as 别名]
    def test_generate_with_vat(self):
        os.environ["INVOICE_LANG"] = "en"
        invoice = Invoice(Client('Kkkk'), Provider('Pupik'), Creator('blah'))
        invoice.number = 'F20140001'
        invoice.use_tax = True
        invoice.add_item(Item(32, 600))
        invoice.add_item(Item(60, 50, tax=10))
        invoice.add_item(Item(50, 60, tax=5))
        invoice.add_item(Item(5, 600, tax=50))
        invoice.currency_locale = 'en_US.UTF-8'
        invoice.currency = 'USD'

        tmp_file = NamedTemporaryFile(delete=False)

        pdf = SimpleInvoice(invoice)
        pdf.gen(tmp_file.name)

        pdf = PdfFileReader(tmp_file)
        pdf_string = pdf.pages[0].extractText()
        self.assertTrue(u"$3,000.00" in pdf_string)
        self.assertTrue(u"Total with tax: $30,150.00" in pdf_string)
        self.assertTrue(u"Creator: blah" in pdf_string)
开发者ID:creckx,项目名称:InvoiceGenerator,代码行数:24,代码来源:test_pdf.py

示例4: test_generate

# 需要导入模块: from InvoiceGenerator.api import Invoice [as 别名]
# 或者: from InvoiceGenerator.api.Invoice import use_tax [as 别名]
    def test_generate(self):
        provider = Provider('Pupik')
        provider.address = 'Kubelikova blah blah blah'
        provider.zip_code = '12655465'
        provider.city = 'Frantisek'
        provider.vat_id = 'CZ8590875682'
        provider.ir = '785684523'
        provider.email = '[email protected]'
        provider.bank_account = '2600420569'
        provider.bank_code = '2010'
        provider.bank_name = 'RB'
        provider.note = u'zapsaná v obchodním rejstříku vedeném městským soudem v Praze,\noddíl C, vložka 176551'

        client = Client('Kkkk')
        client.summary = 'Bla blah blah'
        client.address = 'Kubelikova blah blah blah'
        client.zip_code = '12655465'
        client.city = 'Frantisek'
        client.vat_id = 'CZ8590875682'
        client.ir = '785684523'
        client.phone = '785684523'
        client.email = '[email protected]'
        client.note = u'zapsaná v obchodním rejstříku vedeném městským soudem v Praze,\noddíl C, vložka 176551'

        invoice = Invoice(client, provider, Creator('blah'))
        invoice.use_tax = True
        invoice.title = u"Testovací faktura"
        invoice.add_item(Item(32, '600.6', description=u"Krátký popis", tax=15))
        invoice.add_item(Item(32, '2.5', tax=21))
        invoice.add_item(
            Item(
                5, '25.42',
                description=u"Dlouhý popis blah blah blah blah blah blah blah blah blah blah blah "
                            u"blah blah blah blah blah blah blah blah blah blah blah blah blah blah "
                            u"blah blah blah blah blah blah blah blah blah blah blah",
                tax=21,),)
        for i in range(1, 26):
            invoice.add_item(Item(5, '25.42', description=u"Popis", tax=0))
        invoice.specific_symbol = 666
        invoice.taxable_date = datetime.date.today()
        invoice.variable_symbol = '000000001'
        invoice.number = 'F20140001'
        invoice.payback = datetime.date.today()
        invoice.currency = u'Kč'
        invoice.currency_locale = 'cs_CZ.UTF-8'
        invoice.rounding_result = True

        tmp_file = NamedTemporaryFile(delete=False)
        SimpleInvoice(invoice).gen(tmp_file.name)
        xml_string = tmp_file.read()

        root = self.assertXmlDocument(xml_string)
        self.assertXpathValues(
            root,
            './dataPack/dataPackItem/invoice/partnerIdentity/address/street/text()',
            'Kubelikova blah blah blah',
        )
        self.assertXpathValues(
            root,
            './dataPack/dataPackItem/invoice/invoiceHeader/number/numberRequested/text()',
            'F20140001',
        )
        self.assertXpathValues(
            root,
            './dataPack/dataPackItem/invoice/invoiceDetail/invoiceItem/text/text()',
            'Popis',
        )
        self.assertXpathValues(
            root,
            './dataPack/dataPackItem/invoice/invoiceSummary/priceLow/text/text()',
            '22102.080',
        )
        self.assertXpathValues(
            root,
            './dataPack/dataPackItem/invoice/invoiceSummary/priceHighVAT/text/text()',
            '43.4910',
        )
开发者ID:creckx,项目名称:InvoiceGenerator,代码行数:79,代码来源:test_pohoda.py


注:本文中的InvoiceGenerator.api.Invoice.use_tax方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。