# Path: netvisor/schemas/common.py
# class DateSchema(FlattenElementSchema):
#     text = fields.Date(load_from='#text')
# 
# class DecimalSchema(FlattenElementSchema):
#     text = Decimal(load_from='#text')
# 
# class StringSchema(FlattenElementSchema):
#     text = fields.String(load_from='#text')
# 
# Path: netvisor/schemas/fields.py
# class Boolean(fields.Boolean):
#     def __init__(self, true, false, **kwargs):
#         super(Boolean, self).__init__(**kwargs)
#         self.truthy = [true]
#         self.falsy = [false]
# 
#     def _serialize(self, value, attr, obj):
#         if value:
#             return self.truthy[0]
#         else:
#             return self.falsy[0]
# 
# 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 Schema, fields, post_load
from ..common import DateSchema, DecimalSchema, StringSchema
from ..fields import Boolean, Decimal, List
# -*- coding: utf-8 -*-
"""
    netvisor.schemas.sales_invoices.get
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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



class VatPercentageSchema(Schema):
    percentage = Decimal(required=True, load_from='#text')
    code = fields.String(required=True, load_from='@vatcode')


class SalesInvoiceProductLineSchema(Schema):
    name = fields.String(load_from='product_name')
    identifier = fields.Nested(

# Path: netvisor/schemas/common.py
# class DateSchema(FlattenElementSchema):
#     text = fields.Date(load_from='#text')
# 
# class DecimalSchema(FlattenElementSchema):
#     text = Decimal(load_from='#text')
# 
# class StringSchema(FlattenElementSchema):
#     text = fields.String(load_from='#text')
# 
# Path: netvisor/schemas/fields.py
# class Boolean(fields.Boolean):
#     def __init__(self, true, false, **kwargs):
#         super(Boolean, self).__init__(**kwargs)
#         self.truthy = [true]
#         self.falsy = [false]
# 
#     def _serialize(self, value, attr, obj):
#         if value:
#             return self.truthy[0]
#         else:
#             return self.falsy[0]
# 
# 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/get.py
from marshmallow import Schema, fields, post_load
from ..common import DateSchema, DecimalSchema, StringSchema
from ..fields import Boolean, Decimal, List

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

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



class VatPercentageSchema(Schema):
    percentage = Decimal(required=True, load_from='#text')
    code = fields.String(required=True, load_from='@vatcode')


class SalesInvoiceProductLineSchema(Schema):
    name = fields.String(load_from='product_name')
    identifier = fields.Nested(

        StringSchema,