# 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
# -*- coding: utf-8 -*-
"""
    netvisor.schemas.sales_invoices.create
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2013-2016 by Fast Monkeys Oy.
    :license: MIT, see LICENSE for more details.
"""




# 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

# -*- coding: utf-8 -*-
"""
    netvisor.schemas.sales_invoices.create
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2013-2016 by Fast Monkeys Oy.
    :license: MIT, see LICENSE for more details.
"""




class VatPercentageSchema(RejectUnknownFieldsSchema):