本文整理匯總了Python中InvoiceGenerator.api.Invoice.reason方法的典型用法代碼示例。如果您正苦於以下問題:Python Invoice.reason方法的具體用法?Python Invoice.reason怎麽用?Python Invoice.reason使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InvoiceGenerator.api.Invoice
的用法示例。
在下文中一共展示了Invoice.reason方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_generate
# 需要導入模塊: from InvoiceGenerator.api import Invoice [as 別名]
# 或者: from InvoiceGenerator.api.Invoice import reason [as 別名]
def test_generate(self):
provider = Provider('Pupik')
provider.address = 'Kubelikova blah blah blah'
provider.zip = '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 = '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.title = u"Testovací 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.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)
pdf = SimpleInvoice(invoice)
pdf.gen(tmp_file.name, True)
invoice.number = 1
invoice.reason = u"Položka navíc"
tmp_file1 = NamedTemporaryFile(delete=False)
pdf = CorrectingInvoice(invoice)
pdf.gen(tmp_file1.name)