Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX QR code generator if invoice with bank_account and bank_code sepa… #42

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
before_install:
- sudo locale-gen 'cs_CZ.UTF-8'
install:
Expand Down
5 changes: 3 additions & 2 deletions InvoiceGenerator/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

import collections
import decimal
from decimal import Decimal

Expand Down Expand Up @@ -304,7 +305,7 @@ def difference_in_rounding(self):
return Decimal(self._round_price(price)) - price

def _get_grouped_items_by_tax(self):
table = {}
table = collections.OrderedDict()
for item in self.items:
if item.tax not in table:
table[item.tax] = {'total': item.total, 'total_tax': item.total_tax, 'tax': item.count_tax()}
Expand Down Expand Up @@ -356,7 +357,7 @@ def _fill(self, invoice):
from qrplatba import QRPlatbaGenerator

qr_kwargs = {
'account': invoice.provider.bank_account,
'account': invoice.provider.bank_account_str(),
'amount': invoice.use_tax and invoice.price_tax or invoice.price,
'x_ss': invoice.specific_symbol,
}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def read(fname):
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_generate_breakdown_vat_table(self):
invoice.add_item(Item(500, 5, tax=0))
invoice.add_item(Item(5, 500, tax=0))

expected = [(0.00, 5000.0, 5000.0, 0), (50.0, 2000.0, 3000.0, 1000.0)]
expected = [(50.0, 2000.0, 3000.0, 1000.0), (0.00, 5000.0, 5000.0, 0)]

self.assertEquals(expected, invoice.generate_breakdown_vat_table())

Expand Down
6 changes: 3 additions & 3 deletions tests/test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def test_generate(self):

pdf = PdfFileReader(tmp_file1)
pdf_string = pdf.pages[1].extractText()
self.assertTrue(u"Celkem s DPH: 32255,-K…" in pdf_string)
self.assertTrue(u"Vytvoil: blah" in pdf_string)
self.assertTrue(u"Celkem s DPH: 32 255,- K…" in pdf_string)
self.assertTrue(u"Vytvoil: blah" in pdf_string)

def test_generate_proforma(self):
provider = Provider('Pupik')
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_generate_proforma(self):

pdf = PdfFileReader(tmp_file)
pdf_string = pdf.pages[1].extractText()
self.assertTrue(u"Celkem s DPH: 32255,-K…" in pdf_string)
self.assertTrue(u"Celkem s DPH: 32 255,- K…" in pdf_string)

def test_generate_with_vat(self):
os.environ["INVOICE_LANG"] = "en"
Expand Down