PyCheval 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycheval-0.3.2 → pycheval-0.3.3}/PKG-INFO +1 -1
- {pycheval-0.3.2 → pycheval-0.3.3}/pyproject.toml +1 -1
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/generate.py +10 -10
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/locale/de/LC_MESSAGES/pycheval.mo +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/money.py +7 -5
- {pycheval-0.3.2 → pycheval-0.3.3}/LICENSE +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/README.md +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/__init__.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/_locale.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/_test_data.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/const.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/countries.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/exc.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/format.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/locale/de/LC_MESSAGES/pycheval.po +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/model.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/parse.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/pdf_common.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/pdf_embed.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/pdf_extract.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/pdf_parse.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/py.typed +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/quantities.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/type_codes.py +0 -0
- {pycheval-0.3.2 → pycheval-0.3.3}/src/pycheval/types.py +0 -0
|
@@ -162,28 +162,28 @@ def _generate_trade_party(
|
|
|
162
162
|
ET.SubElement(el, "ram:ID").text = id
|
|
163
163
|
for global_id in party.global_ids:
|
|
164
164
|
_scheme_id_element(el, "ram:GlobalID", global_id)
|
|
165
|
-
if party.name
|
|
165
|
+
if party.name:
|
|
166
166
|
ET.SubElement(el, "ram:Name").text = party.name
|
|
167
|
-
if party.description
|
|
167
|
+
if party.description:
|
|
168
168
|
ET.SubElement(el, "ram:Description").text = party.description
|
|
169
|
-
if party.legal_id
|
|
169
|
+
if party.legal_id or party.trading_business_name:
|
|
170
170
|
legal_el = ET.SubElement(el, "ram:SpecifiedLegalOrganization")
|
|
171
|
-
if party.legal_id
|
|
171
|
+
if party.legal_id:
|
|
172
172
|
_scheme_id_element(legal_el, "ram:ID", party.legal_id)
|
|
173
|
-
if party.trading_business_name
|
|
173
|
+
if party.trading_business_name:
|
|
174
174
|
ET.SubElement(
|
|
175
175
|
legal_el, "ram:TradingBusinessName"
|
|
176
176
|
).text = party.trading_business_name
|
|
177
|
-
if party.contact
|
|
177
|
+
if party.contact:
|
|
178
178
|
_generate_trade_contact(el, party.contact)
|
|
179
|
-
if party.address
|
|
179
|
+
if party.address:
|
|
180
180
|
_address_element(el, party.address)
|
|
181
|
-
if party.email
|
|
181
|
+
if party.email:
|
|
182
182
|
_email_element(el, "ram:URIUniversalCommunication", party.email)
|
|
183
|
-
if party.tax_number
|
|
183
|
+
if party.tax_number:
|
|
184
184
|
tax = ET.SubElement(el, "ram:SpecifiedTaxRegistration")
|
|
185
185
|
ET.SubElement(tax, "ram:ID", schemeID="FC").text = party.tax_number
|
|
186
|
-
if party.vat_id
|
|
186
|
+
if party.vat_id:
|
|
187
187
|
tax = ET.SubElement(el, "ram:SpecifiedTaxRegistration")
|
|
188
188
|
ET.SubElement(tax, "ram:ID", schemeID="VA").text = party.vat_id
|
|
189
189
|
|
|
Binary file
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import locale
|
|
4
4
|
import re
|
|
5
|
-
from decimal import Decimal
|
|
5
|
+
from decimal import ROUND_HALF_UP, Decimal
|
|
6
6
|
from typing import Literal, cast
|
|
7
7
|
|
|
8
8
|
|
|
@@ -42,8 +42,6 @@ class Money:
|
|
|
42
42
|
value.currency,
|
|
43
43
|
):
|
|
44
44
|
return False
|
|
45
|
-
if self.amount.as_tuple().exponent != value.amount.as_tuple().exponent:
|
|
46
|
-
return False
|
|
47
45
|
return True
|
|
48
46
|
|
|
49
47
|
def __repr__(self) -> str:
|
|
@@ -79,11 +77,15 @@ class Money:
|
|
|
79
77
|
return formatted_amount + (separated and " " or "") + currency
|
|
80
78
|
|
|
81
79
|
def __mul__(self, other: Decimal) -> Money:
|
|
82
|
-
value = (self.amount * other).quantize(
|
|
80
|
+
value = (self.amount * other).quantize(
|
|
81
|
+
Decimal("1.00"), rounding=ROUND_HALF_UP
|
|
82
|
+
)
|
|
83
83
|
return Money(value, self.currency)
|
|
84
84
|
|
|
85
85
|
def __truediv__(self, other: Decimal) -> Money:
|
|
86
|
-
value = (self.amount / other).quantize(
|
|
86
|
+
value = (self.amount / other).quantize(
|
|
87
|
+
Decimal("1.00"), rounding=ROUND_HALF_UP
|
|
88
|
+
)
|
|
87
89
|
return Money(value, self.currency)
|
|
88
90
|
|
|
89
91
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|