|
@@ -133,7 +133,14 @@ class Sum(ioex.calcex.Figure):
|
|
|
|
|
|
class _ItemCollection():
|
|
|
|
|
|
- def __init__(self, items=None):
|
|
|
+ def __init__(
|
|
|
+ self,
|
|
|
+ debitor_address=None,
|
|
|
+ items=None
|
|
|
+ ):
|
|
|
+ if debitor_address is not None:
|
|
|
+ assert isinstance(debitor_address, str)
|
|
|
+ self.debitor_address = debitor_address
|
|
|
if items is not None:
|
|
|
assert isinstance(items, list)
|
|
|
assert all([isinstance(i, Item) for i in items])
|
|
@@ -157,7 +164,7 @@ class Invoice(_Object, _ItemCollection, _YamlInitConstructor, _YamlVarsRepresent
|
|
|
invoice_id,
|
|
|
discounts=None,
|
|
|
invoice_url=None,
|
|
|
- items=None
|
|
|
+ **kwargs
|
|
|
):
|
|
|
assert isinstance(creditor, str)
|
|
|
self.creditor = creditor
|
|
@@ -177,7 +184,7 @@ class Invoice(_Object, _ItemCollection, _YamlInitConstructor, _YamlVarsRepresent
|
|
|
if invoice_url:
|
|
|
assert isinstance(invoice_url, str)
|
|
|
self.invoice_url = invoice_url
|
|
|
- _ItemCollection.__init__(self, items)
|
|
|
+ _ItemCollection.__init__(self, **kwargs)
|
|
|
|
|
|
|
|
|
class Order(_Object, _ItemCollection, _YamlInitConstructor, _YamlVarsRepresenter):
|
|
@@ -187,8 +194,8 @@ class Order(_Object, _ItemCollection, _YamlInitConstructor, _YamlVarsRepresenter
|
|
|
def __init__(self, platform, order_id, order_date,
|
|
|
customer_id=None,
|
|
|
discounts=None,
|
|
|
- items=None,
|
|
|
platform_view_url=None,
|
|
|
+ **kwargs
|
|
|
):
|
|
|
assert type(platform) is str
|
|
|
self.platform = platform
|
|
@@ -212,7 +219,7 @@ class Order(_Object, _ItemCollection, _YamlInitConstructor, _YamlVarsRepresenter
|
|
|
if platform_view_url:
|
|
|
assert isinstance(platform_view_url, str)
|
|
|
self.platform_view_url = platform_view_url
|
|
|
- _ItemCollection.__init__(self, items)
|
|
|
+ _ItemCollection.__init__(self, **kwargs)
|
|
|
|
|
|
|
|
|
class Distance(ioex.calcex.Figure):
|