# Path: netvisor/schemas/common.py
# class RejectUnknownFieldsSchema(Schema):
#     @pre_dump
#     def check_unknown_fields(self, data):
#         field_names = set()
#         for field_name, field in self.fields.items():
#             attribute = getattr(field, 'attribute', None)
#             field_names.add(field_name if attribute is None else attribute)
#         for k in data:
#             if k not in field_names:
#                 raise ValidationError("Unknown field name: '{}'".format(k))
# 
# Path: netvisor/schemas/fields.py
# class Decimal(fields.Decimal):
#     def _deserialize(self, value, attr, data):
#         return super(Decimal, self)._deserialize(
#             value.replace(',', '.'),
#             attr,
#             data
#         )
# 
#     def serialize(self, attr, obj, accessor=None):
#         value = super(Decimal, self).serialize(attr, obj, accessor)
#         if value is missing:
#             return value
#         return str(value).replace('.', ',')
# 
# class List(fields.List):
#     def _deserialize(self, value, attr, data):
#         if not is_collection(value) and value is not None:
#             value = [value]
#         return super(List, self)._deserialize(value, attr, data)


from marshmallow import fields, post_dump
from ..common import RejectUnknownFieldsSchema
from ..fields import Decimal, List
    invoice_type = fields.String()
    sales_invoice_status = fields.String(attribute='status')
    sales_invoice_free_text_before_lines = fields.String(
        attribute='free_text_before_lines'
    )
    sales_invoice_free_text_after_lines = fields.String(
        attribute='free_text_after_lines'
    )
    sales_invoice_our_reference = fields.String(attribute='our_reference')
    sales_invoice_your_reference = fields.String(attribute='your_reference')
    sales_invoice_private_comment = fields.String(attribute='private_comment')
    invoicing_customer_identifier = fields.String()
    invoicing_customer_name = fields.String()
    invoicing_customer_name_extension = fields.String()
    invoicing_customer_address_line = fields.String()
    invoicing_customer_additional_address_line = fields.String()
    invoicing_customer_post_number = fields.String()
    invoicing_customer_town = fields.String()
    invoicing_customer_country_code = fields.String()
    delivery_address_name = fields.String()
    delivery_address_name_extension = fields.String()
    delivery_address_line = fields.String()
    delivery_address_post_number = fields.String()
    delivery_address_town = fields.String()
    delivery_address_country_code = fields.String()
    delivery_method = fields.String()
    delivery_term = fields.String()
    payment_term_net_days = fields.Integer()
    payment_term_cash_discount_days = fields.Integer()
    payment_term_cash_discount = Decimal()

# Path: netvisor/schemas/common.py
# class RejectUnknownFieldsSchema(Schema):
#     @pre_dump
#     def check_unknown_fields(self, data):
#         field_names = set()
#         for field_name, field in self.fields.items():
#             attribute = getattr(field, 'attribute', None)
#             field_names.add(field_name if attribute is None else attribute)
#         for k in data:
#             if k not in field_names:
#                 raise ValidationError("Unknown field name: '{}'".format(k))
# 
# Path: netvisor/schemas/fields.py
# class Decimal(fields.Decimal):
#     def _deserialize(self, value, attr, data):
#         return super(Decimal, self)._deserialize(
#             value.replace(',', '.'),
#             attr,
#             data
#         )
# 
#     def serialize(self, attr, obj, accessor=None):
#         value = super(Decimal, self).serialize(attr, obj, accessor)
#         if value is missing:
#             return value
#         return str(value).replace('.', ',')
# 
# class List(fields.List):
#     def _deserialize(self, value, attr, data):
#         if not is_collection(value) and value is not None:
#             value = [value]
#         return super(List, self)._deserialize(value, attr, data)


# Path: netvisor/schemas/sales_invoices/create.py
from marshmallow import fields, post_dump
from ..common import RejectUnknownFieldsSchema
from ..fields import Decimal, List

    invoice_type = fields.String()
    sales_invoice_status = fields.String(attribute='status')
    sales_invoice_free_text_before_lines = fields.String(
        attribute='free_text_before_lines'
    )
    sales_invoice_free_text_after_lines = fields.String(
        attribute='free_text_after_lines'
    )
    sales_invoice_our_reference = fields.String(attribute='our_reference')
    sales_invoice_your_reference = fields.String(attribute='your_reference')
    sales_invoice_private_comment = fields.String(attribute='private_comment')
    invoicing_customer_identifier = fields.String()
    invoicing_customer_name = fields.String()
    invoicing_customer_name_extension = fields.String()
    invoicing_customer_address_line = fields.String()
    invoicing_customer_additional_address_line = fields.String()
    invoicing_customer_post_number = fields.String()
    invoicing_customer_town = fields.String()
    invoicing_customer_country_code = fields.String()
    delivery_address_name = fields.String()
    delivery_address_name_extension = fields.String()
    delivery_address_line = fields.String()
    delivery_address_post_number = fields.String()
    delivery_address_town = fields.String()
    delivery_address_country_code = fields.String()
    delivery_method = fields.String()
    delivery_term = fields.String()
    payment_term_net_days = fields.Integer()
    payment_term_cash_discount_days = fields.Integer()
    payment_term_cash_discount = Decimal()

    invoice_lines = List(