+++ /dev/null
-from datetime import date
-
-from drafthorse.models.document import Document, IncludedNote
-from drafthorse.utils import prettify
-
-"""
-doc = Document()
-doc.context.guideline_parameter.id = "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort"
-doc.header.id = "RE1337"
-doc.header.name = "RECHNUNG"
-doc.header.type_code = "380"
-doc.header.issue_date_time.value = date.today()
-doc.header.languages.add("de")
-n = IncludedNote()
-n.content.add("Test Node 1")
-n.content.add("Test Node 2")
-doc.header.notes.add(n)
-
-doc.trade.agreement.seller.name = "Lieferant GmbH"
-"""
-
-samplexml = open("sample.xml", "rb").read()
-doc = Document.parse(samplexml)
-print(prettify(doc.serialize()))
import sys
-from decimal import Decimal
-
-from datetime import date, datetime
-
import xml.etree.cElementTree as ET
from collections import OrderedDict
+from datetime import datetime
+from decimal import Decimal
from drafthorse.utils import validate_xml
from . import NS_UDT
-from .fields import Field
from .container import Container
+from .fields import Field
class BaseElementMeta(type):
-from .container import Container, StringContainer, CurrencyContainer, IDContainer
from . import BASIC
+from .container import (Container, CurrencyContainer, IDContainer,
+ StringContainer)
class Field:
from . import BASIC, COMFORT, EXTENDED, NS_RAM
-from .accounting import (AccountingAccount, BillingSpecifiedPeriod,
- TradeAllowanceCharge, ApplicableTradeTax)
+from .accounting import (AccountingAccount, ApplicableTradeTax,
+ BillingSpecifiedPeriod, TradeAllowanceCharge)
from .delivery import SupplyChainEvent
from .elements import Element
from .fields import (CurrencyField, Field, MultiField, QuantityField,
origxml = prettify(open(os.path.join(os.path.dirname(__file__), 'samples', filename), 'r').read())
doc = Document.parse(origxml)
generatedxml = prettify(doc.serialize())
- assert generatedxml.decode().strip() == origxml.decode().strip()
\ No newline at end of file
+ assert generatedxml.decode().strip() == origxml.decode().strip()