Created
December 17, 2018 14:56
-
-
Save blaggacao/d8bcd2496d6d76a396bf4b6c43e0ebf0 to your computer and use it in GitHub Desktop.
generateDS UBL2.0 DIAN bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Generated Sun Dec 16 19:02:41 2018 by generateDS.py version 2.30.8. | |
# Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] | |
# | |
# Command line options: | |
# ('-o', 'invoice.py') | |
# ('-s', 'invoicesubs.py') | |
# ('--no-collect-includes', '') | |
# | |
# Command line arguments: | |
# ../odoo/facturark/facturark/XSD/DIAN/DIAN_UBL.xsd | |
# | |
# Command line: | |
# generateDS-2.30.8/generateDS.py -o "invoice.py" -s "invoicesubs.py" --no-collect-includes ../odoo/facturark/facturark/XSD/DIAN/DIAN_UBL.xsd | |
# | |
# Current working directory (os.getcwd()): | |
# generateDS | |
# | |
import sys | |
import re as re_ | |
import base64 | |
import datetime as datetime_ | |
import warnings as warnings_ | |
try: | |
from lxml import etree as etree_ | |
except ImportError: | |
from xml.etree import ElementTree as etree_ | |
Validate_simpletypes_ = True | |
if sys.version_info.major == 2: | |
BaseStrType_ = basestring | |
else: | |
BaseStrType_ = str | |
def parsexml_(infile, parser=None, **kwargs): | |
if parser is None: | |
# Use the lxml ElementTree compatible parser so that, e.g., | |
# we ignore comments. | |
try: | |
parser = etree_.ETCompatXMLParser() | |
except AttributeError: | |
# fallback to xml.etree | |
parser = etree_.XMLParser() | |
doc = etree_.parse(infile, parser=parser, **kwargs) | |
return doc | |
def parsexmlstring_(instring, parser=None, **kwargs): | |
if parser is None: | |
# Use the lxml ElementTree compatible parser so that, e.g., | |
# we ignore comments. | |
try: | |
parser = etree_.ETCompatXMLParser() | |
except AttributeError: | |
# fallback to xml.etree | |
parser = etree_.XMLParser() | |
element = etree_.fromstring(instring, parser=parser, **kwargs) | |
return element | |
# | |
# Namespace prefix definition table (and other attributes, too) | |
# | |
# The module generatedsnamespaces, if it is importable, must contain | |
# a dictionary named GeneratedsNamespaceDefs. This Python dictionary | |
# should map element type names (strings) to XML schema namespace prefix | |
# definitions. The export method for any class for which there is | |
# a namespace prefix definition, will export that definition in the | |
# XML representation of that element. See the export method of | |
# any generated element type class for a example of the use of this | |
# table. | |
# A sample table is: | |
# | |
# # File: generatedsnamespaces.py | |
# | |
# GenerateDSNamespaceDefs = { | |
# "ElementtypeA": "http://www.xxx.com/namespaceA", | |
# "ElementtypeB": "http://www.xxx.com/namespaceB", | |
# } | |
# | |
try: | |
from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ | |
except ImportError: | |
GenerateDSNamespaceDefs_ = {} | |
# | |
# The root super-class for element type classes | |
# | |
# Calls to the methods in these classes are generated by generateDS.py. | |
# You can replace these methods by re-implementing the following class | |
# in a module named generatedssuper.py. | |
try: | |
from generatedssuper import GeneratedsSuper | |
except ImportError as exp: | |
class GeneratedsSuper(object): | |
tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$') | |
class _FixedOffsetTZ(datetime_.tzinfo): | |
def __init__(self, offset, name): | |
self.__offset = datetime_.timedelta(minutes=offset) | |
self.__name = name | |
def utcoffset(self, dt): | |
return self.__offset | |
def tzname(self, dt): | |
return self.__name | |
def dst(self, dt): | |
return None | |
def gds_format_string(self, input_data, input_name=''): | |
return input_data | |
def gds_validate_string(self, input_data, node=None, input_name=''): | |
if not input_data: | |
return '' | |
else: | |
return input_data | |
def gds_format_base64(self, input_data, input_name=''): | |
return base64.b64encode(input_data) | |
def gds_validate_base64(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_integer(self, input_data, input_name=''): | |
return '%d' % input_data | |
def gds_validate_integer(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_integer_list(self, input_data, input_name=''): | |
return '%s' % ' '.join(input_data) | |
def gds_validate_integer_list( | |
self, input_data, node=None, input_name=''): | |
values = input_data.split() | |
for value in values: | |
try: | |
int(value) | |
except (TypeError, ValueError): | |
raise_parse_error(node, 'Requires sequence of integers') | |
return values | |
def gds_format_float(self, input_data, input_name=''): | |
return ('%.15f' % input_data).rstrip('0') | |
def gds_validate_float(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_float_list(self, input_data, input_name=''): | |
return '%s' % ' '.join(input_data) | |
def gds_validate_float_list( | |
self, input_data, node=None, input_name=''): | |
values = input_data.split() | |
for value in values: | |
try: | |
float(value) | |
except (TypeError, ValueError): | |
raise_parse_error(node, 'Requires sequence of floats') | |
return values | |
def gds_format_double(self, input_data, input_name=''): | |
return '%e' % input_data | |
def gds_validate_double(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_double_list(self, input_data, input_name=''): | |
return '%s' % ' '.join(input_data) | |
def gds_validate_double_list( | |
self, input_data, node=None, input_name=''): | |
values = input_data.split() | |
for value in values: | |
try: | |
float(value) | |
except (TypeError, ValueError): | |
raise_parse_error(node, 'Requires sequence of doubles') | |
return values | |
def gds_format_boolean(self, input_data, input_name=''): | |
return ('%s' % input_data).lower() | |
def gds_validate_boolean(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_boolean_list(self, input_data, input_name=''): | |
return '%s' % ' '.join(input_data) | |
def gds_validate_boolean_list( | |
self, input_data, node=None, input_name=''): | |
values = input_data.split() | |
for value in values: | |
if value not in ('true', '1', 'false', '0', ): | |
raise_parse_error( | |
node, | |
'Requires sequence of booleans ' | |
'("true", "1", "false", "0")') | |
return values | |
def gds_validate_datetime(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_datetime(self, input_data, input_name=''): | |
if input_data.microsecond == 0: | |
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % ( | |
input_data.year, | |
input_data.month, | |
input_data.day, | |
input_data.hour, | |
input_data.minute, | |
input_data.second, | |
) | |
else: | |
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % ( | |
input_data.year, | |
input_data.month, | |
input_data.day, | |
input_data.hour, | |
input_data.minute, | |
input_data.second, | |
('%f' % (float(input_data.microsecond) / 1000000))[2:], | |
) | |
if input_data.tzinfo is not None: | |
tzoff = input_data.tzinfo.utcoffset(input_data) | |
if tzoff is not None: | |
total_seconds = tzoff.seconds + (86400 * tzoff.days) | |
if total_seconds == 0: | |
_svalue += 'Z' | |
else: | |
if total_seconds < 0: | |
_svalue += '-' | |
total_seconds *= -1 | |
else: | |
_svalue += '+' | |
hours = total_seconds // 3600 | |
minutes = (total_seconds - (hours * 3600)) // 60 | |
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes) | |
return _svalue | |
@classmethod | |
def gds_parse_datetime(cls, input_data): | |
tz = None | |
if input_data[-1] == 'Z': | |
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') | |
input_data = input_data[:-1] | |
else: | |
results = GeneratedsSuper.tzoff_pattern.search(input_data) | |
if results is not None: | |
tzoff_parts = results.group(2).split(':') | |
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) | |
if results.group(1) == '-': | |
tzoff *= -1 | |
tz = GeneratedsSuper._FixedOffsetTZ( | |
tzoff, results.group(0)) | |
input_data = input_data[:-6] | |
time_parts = input_data.split('.') | |
if len(time_parts) > 1: | |
micro_seconds = int(float('0.' + time_parts[1]) * 1000000) | |
input_data = '%s.%s' % ( | |
time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), ) | |
dt = datetime_.datetime.strptime( | |
input_data, '%Y-%m-%dT%H:%M:%S.%f') | |
else: | |
dt = datetime_.datetime.strptime( | |
input_data, '%Y-%m-%dT%H:%M:%S') | |
dt = dt.replace(tzinfo=tz) | |
return dt | |
def gds_validate_date(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_date(self, input_data, input_name=''): | |
_svalue = '%04d-%02d-%02d' % ( | |
input_data.year, | |
input_data.month, | |
input_data.day, | |
) | |
try: | |
if input_data.tzinfo is not None: | |
tzoff = input_data.tzinfo.utcoffset(input_data) | |
if tzoff is not None: | |
total_seconds = tzoff.seconds + (86400 * tzoff.days) | |
if total_seconds == 0: | |
_svalue += 'Z' | |
else: | |
if total_seconds < 0: | |
_svalue += '-' | |
total_seconds *= -1 | |
else: | |
_svalue += '+' | |
hours = total_seconds // 3600 | |
minutes = (total_seconds - (hours * 3600)) // 60 | |
_svalue += '{0:02d}:{1:02d}'.format( | |
hours, minutes) | |
except AttributeError: | |
pass | |
return _svalue | |
@classmethod | |
def gds_parse_date(cls, input_data): | |
tz = None | |
if input_data[-1] == 'Z': | |
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') | |
input_data = input_data[:-1] | |
else: | |
results = GeneratedsSuper.tzoff_pattern.search(input_data) | |
if results is not None: | |
tzoff_parts = results.group(2).split(':') | |
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) | |
if results.group(1) == '-': | |
tzoff *= -1 | |
tz = GeneratedsSuper._FixedOffsetTZ( | |
tzoff, results.group(0)) | |
input_data = input_data[:-6] | |
dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d') | |
dt = dt.replace(tzinfo=tz) | |
return dt.date() | |
def gds_validate_time(self, input_data, node=None, input_name=''): | |
return input_data | |
def gds_format_time(self, input_data, input_name=''): | |
if input_data.microsecond == 0: | |
_svalue = '%02d:%02d:%02d' % ( | |
input_data.hour, | |
input_data.minute, | |
input_data.second, | |
) | |
else: | |
_svalue = '%02d:%02d:%02d.%s' % ( | |
input_data.hour, | |
input_data.minute, | |
input_data.second, | |
('%f' % (float(input_data.microsecond) / 1000000))[2:], | |
) | |
if input_data.tzinfo is not None: | |
tzoff = input_data.tzinfo.utcoffset(input_data) | |
if tzoff is not None: | |
total_seconds = tzoff.seconds + (86400 * tzoff.days) | |
if total_seconds == 0: | |
_svalue += 'Z' | |
else: | |
if total_seconds < 0: | |
_svalue += '-' | |
total_seconds *= -1 | |
else: | |
_svalue += '+' | |
hours = total_seconds // 3600 | |
minutes = (total_seconds - (hours * 3600)) // 60 | |
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes) | |
return _svalue | |
def gds_validate_simple_patterns(self, patterns, target): | |
# pat is a list of lists of strings/patterns. | |
# The target value must match at least one of the patterns | |
# in order for the test to succeed. | |
found1 = True | |
for patterns1 in patterns: | |
found2 = False | |
for patterns2 in patterns1: | |
mo = re_.search(patterns2, target) | |
if mo is not None and len(mo.group(0)) == len(target): | |
found2 = True | |
break | |
if not found2: | |
found1 = False | |
break | |
return found1 | |
@classmethod | |
def gds_parse_time(cls, input_data): | |
tz = None | |
if input_data[-1] == 'Z': | |
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') | |
input_data = input_data[:-1] | |
else: | |
results = GeneratedsSuper.tzoff_pattern.search(input_data) | |
if results is not None: | |
tzoff_parts = results.group(2).split(':') | |
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) | |
if results.group(1) == '-': | |
tzoff *= -1 | |
tz = GeneratedsSuper._FixedOffsetTZ( | |
tzoff, results.group(0)) | |
input_data = input_data[:-6] | |
if len(input_data.split('.')) > 1: | |
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f') | |
else: | |
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S') | |
dt = dt.replace(tzinfo=tz) | |
return dt.time() | |
def gds_str_lower(self, instring): | |
return instring.lower() | |
def get_path_(self, node): | |
path_list = [] | |
self.get_path_list_(node, path_list) | |
path_list.reverse() | |
path = '/'.join(path_list) | |
return path | |
Tag_strip_pattern_ = re_.compile(r'\{.*\}') | |
def get_path_list_(self, node, path_list): | |
if node is None: | |
return | |
tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) | |
if tag: | |
path_list.append(tag) | |
self.get_path_list_(node.getparent(), path_list) | |
def get_class_obj_(self, node, default_class=None): | |
class_obj1 = default_class | |
if 'xsi' in node.nsmap: | |
classname = node.get('{%s}type' % node.nsmap['xsi']) | |
if classname is not None: | |
names = classname.split(':') | |
if len(names) == 2: | |
classname = names[1] | |
class_obj2 = globals().get(classname) | |
if class_obj2 is not None: | |
class_obj1 = class_obj2 | |
return class_obj1 | |
def gds_build_any(self, node, type_name=None): | |
return None | |
@classmethod | |
def gds_reverse_node_mapping(cls, mapping): | |
return dict(((v, k) for k, v in mapping.items())) | |
@staticmethod | |
def gds_encode(instring): | |
if sys.version_info.major == 2: | |
if ExternalEncoding: | |
encoding = ExternalEncoding | |
else: | |
encoding = 'utf-8' | |
return instring.encode(encoding) | |
else: | |
return instring | |
@staticmethod | |
def convert_unicode(instring): | |
if isinstance(instring, str): | |
result = quote_xml(instring) | |
elif sys.version_info.major == 2 and isinstance(instring, unicode): | |
result = quote_xml(instring).encode('utf8') | |
else: | |
result = GeneratedsSuper.gds_encode(str(instring)) | |
return result | |
def __eq__(self, other): | |
if type(self) != type(other): | |
return False | |
return self.__dict__ == other.__dict__ | |
def __ne__(self, other): | |
return not self.__eq__(other) | |
def getSubclassFromModule_(module, class_): | |
'''Get the subclass of a class from a specific module.''' | |
name = class_.__name__ + 'Sub' | |
if hasattr(module, name): | |
return getattr(module, name) | |
else: | |
return None | |
# | |
# If you have installed IPython you can uncomment and use the following. | |
# IPython is available from http://ipython.scipy.org/. | |
# | |
## from IPython.Shell import IPShellEmbed | |
## args = '' | |
## ipshell = IPShellEmbed(args, | |
## banner = 'Dropping into IPython', | |
## exit_msg = 'Leaving Interpreter, back to program.') | |
# Then use the following line where and when you want to drop into the | |
# IPython shell: | |
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit') | |
# | |
# Globals | |
# | |
ExternalEncoding = '' | |
Tag_pattern_ = re_.compile(r'({.*})?(.*)') | |
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") | |
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') | |
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL) | |
# Change this to redirect the generated superclass module to use a | |
# specific subclass module. | |
CurrentSubclassModule_ = None | |
# | |
# Support/utility functions. | |
# | |
def showIndent(outfile, level, pretty_print=True): | |
if pretty_print: | |
for idx in range(level): | |
outfile.write(' ') | |
def quote_xml(inStr): | |
"Escape markup chars, but do not modify CDATA sections." | |
if not inStr: | |
return '' | |
s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr) | |
s2 = '' | |
pos = 0 | |
matchobjects = CDATA_pattern_.finditer(s1) | |
for mo in matchobjects: | |
s3 = s1[pos:mo.start()] | |
s2 += quote_xml_aux(s3) | |
s2 += s1[mo.start():mo.end()] | |
pos = mo.end() | |
s3 = s1[pos:] | |
s2 += quote_xml_aux(s3) | |
return s2 | |
def quote_xml_aux(inStr): | |
s1 = inStr.replace('&', '&') | |
s1 = s1.replace('<', '<') | |
s1 = s1.replace('>', '>') | |
return s1 | |
def quote_attrib(inStr): | |
s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr) | |
s1 = s1.replace('&', '&') | |
s1 = s1.replace('<', '<') | |
s1 = s1.replace('>', '>') | |
if '"' in s1: | |
if "'" in s1: | |
s1 = '"%s"' % s1.replace('"', """) | |
else: | |
s1 = "'%s'" % s1 | |
else: | |
s1 = '"%s"' % s1 | |
return s1 | |
def quote_python(inStr): | |
s1 = inStr | |
if s1.find("'") == -1: | |
if s1.find('\n') == -1: | |
return "'%s'" % s1 | |
else: | |
return "'''%s'''" % s1 | |
else: | |
if s1.find('"') != -1: | |
s1 = s1.replace('"', '\\"') | |
if s1.find('\n') == -1: | |
return '"%s"' % s1 | |
else: | |
return '"""%s"""' % s1 | |
def get_all_text_(node): | |
if node.text is not None: | |
text = node.text | |
else: | |
text = '' | |
for child in node: | |
if child.tail is not None: | |
text += child.tail | |
return text | |
def find_attr_value_(attr_name, node): | |
attrs = node.attrib | |
attr_parts = attr_name.split(':') | |
value = None | |
if len(attr_parts) == 1: | |
value = attrs.get(attr_name) | |
elif len(attr_parts) == 2: | |
prefix, name = attr_parts | |
namespace = node.nsmap.get(prefix) | |
if namespace is not None: | |
value = attrs.get('{%s}%s' % (namespace, name, )) | |
return value | |
class GDSParseError(Exception): | |
pass | |
def raise_parse_error(node, msg): | |
msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) | |
raise GDSParseError(msg) | |
class MixedContainer: | |
# Constants for category: | |
CategoryNone = 0 | |
CategoryText = 1 | |
CategorySimple = 2 | |
CategoryComplex = 3 | |
# Constants for content_type: | |
TypeNone = 0 | |
TypeText = 1 | |
TypeString = 2 | |
TypeInteger = 3 | |
TypeFloat = 4 | |
TypeDecimal = 5 | |
TypeDouble = 6 | |
TypeBoolean = 7 | |
TypeBase64 = 8 | |
def __init__(self, category, content_type, name, value): | |
self.category = category | |
self.content_type = content_type | |
self.name = name | |
self.value = value | |
def getCategory(self): | |
return self.category | |
def getContenttype(self, content_type): | |
return self.content_type | |
def getValue(self): | |
return self.value | |
def getName(self): | |
return self.name | |
def export(self, outfile, level, name, namespace, | |
pretty_print=True): | |
if self.category == MixedContainer.CategoryText: | |
# Prevent exporting empty content as empty lines. | |
if self.value.strip(): | |
outfile.write(self.value) | |
elif self.category == MixedContainer.CategorySimple: | |
self.exportSimple(outfile, level, name) | |
else: # category == MixedContainer.CategoryComplex | |
self.value.export( | |
outfile, level, namespace, name_=name, | |
pretty_print=pretty_print) | |
def exportSimple(self, outfile, level, name): | |
if self.content_type == MixedContainer.TypeString: | |
outfile.write('<%s>%s</%s>' % ( | |
self.name, self.value, self.name)) | |
elif self.content_type == MixedContainer.TypeInteger or \ | |
self.content_type == MixedContainer.TypeBoolean: | |
outfile.write('<%s>%d</%s>' % ( | |
self.name, self.value, self.name)) | |
elif self.content_type == MixedContainer.TypeFloat or \ | |
self.content_type == MixedContainer.TypeDecimal: | |
outfile.write('<%s>%f</%s>' % ( | |
self.name, self.value, self.name)) | |
elif self.content_type == MixedContainer.TypeDouble: | |
outfile.write('<%s>%g</%s>' % ( | |
self.name, self.value, self.name)) | |
elif self.content_type == MixedContainer.TypeBase64: | |
outfile.write('<%s>%s</%s>' % ( | |
self.name, | |
base64.b64encode(self.value), | |
self.name)) | |
def to_etree(self, element): | |
if self.category == MixedContainer.CategoryText: | |
# Prevent exporting empty content as empty lines. | |
if self.value.strip(): | |
if len(element) > 0: | |
if element[-1].tail is None: | |
element[-1].tail = self.value | |
else: | |
element[-1].tail += self.value | |
else: | |
if element.text is None: | |
element.text = self.value | |
else: | |
element.text += self.value | |
elif self.category == MixedContainer.CategorySimple: | |
subelement = etree_.SubElement( | |
element, '%s' % self.name) | |
subelement.text = self.to_etree_simple() | |
else: # category == MixedContainer.CategoryComplex | |
self.value.to_etree(element) | |
def to_etree_simple(self): | |
if self.content_type == MixedContainer.TypeString: | |
text = self.value | |
elif (self.content_type == MixedContainer.TypeInteger or | |
self.content_type == MixedContainer.TypeBoolean): | |
text = '%d' % self.value | |
elif (self.content_type == MixedContainer.TypeFloat or | |
self.content_type == MixedContainer.TypeDecimal): | |
text = '%f' % self.value | |
elif self.content_type == MixedContainer.TypeDouble: | |
text = '%g' % self.value | |
elif self.content_type == MixedContainer.TypeBase64: | |
text = '%s' % base64.b64encode(self.value) | |
return text | |
def exportLiteral(self, outfile, level, name): | |
if self.category == MixedContainer.CategoryText: | |
showIndent(outfile, level) | |
outfile.write( | |
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % ( | |
self.category, self.content_type, | |
self.name, self.value)) | |
elif self.category == MixedContainer.CategorySimple: | |
showIndent(outfile, level) | |
outfile.write( | |
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % ( | |
self.category, self.content_type, | |
self.name, self.value)) | |
else: # category == MixedContainer.CategoryComplex | |
showIndent(outfile, level) | |
outfile.write( | |
'model_.MixedContainer(%d, %d, "%s",\n' % ( | |
self.category, self.content_type, self.name,)) | |
self.value.exportLiteral(outfile, level + 1) | |
showIndent(outfile, level) | |
outfile.write(')\n') | |
class MemberSpec_(object): | |
def __init__(self, name='', data_type='', container=0, | |
optional=0, child_attrs=None, choice=None): | |
self.name = name | |
self.data_type = data_type | |
self.container = container | |
self.child_attrs = child_attrs | |
self.choice = choice | |
self.optional = optional | |
def set_name(self, name): self.name = name | |
def get_name(self): return self.name | |
def set_data_type(self, data_type): self.data_type = data_type | |
def get_data_type_chain(self): return self.data_type | |
def get_data_type(self): | |
if isinstance(self.data_type, list): | |
if len(self.data_type) > 0: | |
return self.data_type[-1] | |
else: | |
return 'xs:string' | |
else: | |
return self.data_type | |
def set_container(self, container): self.container = container | |
def get_container(self): return self.container | |
def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs | |
def get_child_attrs(self): return self.child_attrs | |
def set_choice(self, choice): self.choice = choice | |
def get_choice(self): return self.choice | |
def set_optional(self, optional): self.optional = optional | |
def get_optional(self): return self.optional | |
def _cast(typ, value): | |
if typ is None or value is None: | |
return value | |
return typ(value) | |
# | |
# Data representation classes. | |
# | |
class InvoiceType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, UBLExtensions=None, UBLVersionID=None, CustomizationID=None, ProfileID=None, ID=None, UUID=None, IssueDate=None, IssueTime=None, InvoiceTypeCode=None, Note=None, DocumentCurrencyCode=None, AccountingCostCode=None, AccountingCost=None, LineCountNumeric=None, InvoicePeriod=None, OrderReference=None, BillingReference=None, DespatchDocumentReference=None, ReceiptDocumentReference=None, OriginatorDocumentReference=None, ContractDocumentReference=None, AdditionalDocumentReference=None, AccountingSupplierParty=None, AccountingCustomerParty=None, PayeeParty=None, BuyerCustomerParty=None, SellerSupplierParty=None, TaxRepresentativeParty=None, Delivery=None, DeliveryTerms=None, PaymentMeans=None, PaymentTerms=None, PrepaidPayment=None, AllowanceCharge=None, PaymentExchangeRate=None, PaymentAlternativeExchangeRate=None, TaxTotal=None, LegalMonetaryTotal=None, InvoiceLine=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.UBLExtensions = UBLExtensions | |
self.UBLVersionID = UBLVersionID | |
self.CustomizationID = CustomizationID | |
self.ProfileID = ProfileID | |
self.ID = ID | |
self.UUID = UUID | |
self.IssueDate = IssueDate | |
self.IssueTime = IssueTime | |
self.InvoiceTypeCode = InvoiceTypeCode | |
if Note is None: | |
self.Note = [] | |
else: | |
self.Note = Note | |
self.DocumentCurrencyCode = DocumentCurrencyCode | |
self.AccountingCostCode = AccountingCostCode | |
self.AccountingCost = AccountingCost | |
self.LineCountNumeric = LineCountNumeric | |
self.InvoicePeriod = InvoicePeriod | |
if OrderReference is None: | |
self.OrderReference = [] | |
else: | |
self.OrderReference = OrderReference | |
if BillingReference is None: | |
self.BillingReference = [] | |
else: | |
self.BillingReference = BillingReference | |
if DespatchDocumentReference is None: | |
self.DespatchDocumentReference = [] | |
else: | |
self.DespatchDocumentReference = DespatchDocumentReference | |
if ReceiptDocumentReference is None: | |
self.ReceiptDocumentReference = [] | |
else: | |
self.ReceiptDocumentReference = ReceiptDocumentReference | |
if OriginatorDocumentReference is None: | |
self.OriginatorDocumentReference = [] | |
else: | |
self.OriginatorDocumentReference = OriginatorDocumentReference | |
if ContractDocumentReference is None: | |
self.ContractDocumentReference = [] | |
else: | |
self.ContractDocumentReference = ContractDocumentReference | |
if AdditionalDocumentReference is None: | |
self.AdditionalDocumentReference = [] | |
else: | |
self.AdditionalDocumentReference = AdditionalDocumentReference | |
self.AccountingSupplierParty = AccountingSupplierParty | |
self.AccountingCustomerParty = AccountingCustomerParty | |
self.PayeeParty = PayeeParty | |
self.BuyerCustomerParty = BuyerCustomerParty | |
self.SellerSupplierParty = SellerSupplierParty | |
self.TaxRepresentativeParty = TaxRepresentativeParty | |
if Delivery is None: | |
self.Delivery = [] | |
else: | |
self.Delivery = Delivery | |
self.DeliveryTerms = DeliveryTerms | |
if PaymentMeans is None: | |
self.PaymentMeans = [] | |
else: | |
self.PaymentMeans = PaymentMeans | |
if PaymentTerms is None: | |
self.PaymentTerms = [] | |
else: | |
self.PaymentTerms = PaymentTerms | |
if PrepaidPayment is None: | |
self.PrepaidPayment = [] | |
else: | |
self.PrepaidPayment = PrepaidPayment | |
if AllowanceCharge is None: | |
self.AllowanceCharge = [] | |
else: | |
self.AllowanceCharge = AllowanceCharge | |
self.PaymentExchangeRate = PaymentExchangeRate | |
self.PaymentAlternativeExchangeRate = PaymentAlternativeExchangeRate | |
if TaxTotal is None: | |
self.TaxTotal = [] | |
else: | |
self.TaxTotal = TaxTotal | |
self.LegalMonetaryTotal = LegalMonetaryTotal | |
if InvoiceLine is None: | |
self.InvoiceLine = [] | |
else: | |
self.InvoiceLine = InvoiceLine | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, InvoiceType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if InvoiceType.subclass: | |
return InvoiceType.subclass(*args_, **kwargs_) | |
else: | |
return InvoiceType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_UBLExtensions(self): | |
return self.UBLExtensions | |
def set_UBLExtensions(self, UBLExtensions): | |
self.UBLExtensions = UBLExtensions | |
def get_UBLVersionID(self): | |
return self.UBLVersionID | |
def set_UBLVersionID(self, UBLVersionID): | |
self.UBLVersionID = UBLVersionID | |
def get_CustomizationID(self): | |
return self.CustomizationID | |
def set_CustomizationID(self, CustomizationID): | |
self.CustomizationID = CustomizationID | |
def get_ProfileID(self): | |
return self.ProfileID | |
def set_ProfileID(self, ProfileID): | |
self.ProfileID = ProfileID | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_UUID(self): | |
return self.UUID | |
def set_UUID(self, UUID): | |
self.UUID = UUID | |
def get_IssueDate(self): | |
return self.IssueDate | |
def set_IssueDate(self, IssueDate): | |
self.IssueDate = IssueDate | |
def get_IssueTime(self): | |
return self.IssueTime | |
def set_IssueTime(self, IssueTime): | |
self.IssueTime = IssueTime | |
def get_InvoiceTypeCode(self): | |
return self.InvoiceTypeCode | |
def set_InvoiceTypeCode(self, InvoiceTypeCode): | |
self.InvoiceTypeCode = InvoiceTypeCode | |
def get_Note(self): | |
return self.Note | |
def set_Note(self, Note): | |
self.Note = Note | |
def add_Note(self, value): | |
self.Note.append(value) | |
def add_Note(self, value): | |
self.Note.append(value) | |
def insert_Note_at(self, index, value): | |
self.Note.insert(index, value) | |
def replace_Note_at(self, index, value): | |
self.Note[index] = value | |
def get_DocumentCurrencyCode(self): | |
return self.DocumentCurrencyCode | |
def set_DocumentCurrencyCode(self, DocumentCurrencyCode): | |
self.DocumentCurrencyCode = DocumentCurrencyCode | |
def get_AccountingCostCode(self): | |
return self.AccountingCostCode | |
def set_AccountingCostCode(self, AccountingCostCode): | |
self.AccountingCostCode = AccountingCostCode | |
def get_AccountingCost(self): | |
return self.AccountingCost | |
def set_AccountingCost(self, AccountingCost): | |
self.AccountingCost = AccountingCost | |
def get_LineCountNumeric(self): | |
return self.LineCountNumeric | |
def set_LineCountNumeric(self, LineCountNumeric): | |
self.LineCountNumeric = LineCountNumeric | |
def get_InvoicePeriod(self): | |
return self.InvoicePeriod | |
def set_InvoicePeriod(self, InvoicePeriod): | |
self.InvoicePeriod = InvoicePeriod | |
def get_OrderReference(self): | |
return self.OrderReference | |
def set_OrderReference(self, OrderReference): | |
self.OrderReference = OrderReference | |
def add_OrderReference(self, value): | |
self.OrderReference.append(value) | |
def add_OrderReference(self, value): | |
self.OrderReference.append(value) | |
def insert_OrderReference_at(self, index, value): | |
self.OrderReference.insert(index, value) | |
def replace_OrderReference_at(self, index, value): | |
self.OrderReference[index] = value | |
def get_BillingReference(self): | |
return self.BillingReference | |
def set_BillingReference(self, BillingReference): | |
self.BillingReference = BillingReference | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def insert_BillingReference_at(self, index, value): | |
self.BillingReference.insert(index, value) | |
def replace_BillingReference_at(self, index, value): | |
self.BillingReference[index] = value | |
def get_DespatchDocumentReference(self): | |
return self.DespatchDocumentReference | |
def set_DespatchDocumentReference(self, DespatchDocumentReference): | |
self.DespatchDocumentReference = DespatchDocumentReference | |
def add_DespatchDocumentReference(self, value): | |
self.DespatchDocumentReference.append(value) | |
def add_DespatchDocumentReference(self, value): | |
self.DespatchDocumentReference.append(value) | |
def insert_DespatchDocumentReference_at(self, index, value): | |
self.DespatchDocumentReference.insert(index, value) | |
def replace_DespatchDocumentReference_at(self, index, value): | |
self.DespatchDocumentReference[index] = value | |
def get_ReceiptDocumentReference(self): | |
return self.ReceiptDocumentReference | |
def set_ReceiptDocumentReference(self, ReceiptDocumentReference): | |
self.ReceiptDocumentReference = ReceiptDocumentReference | |
def add_ReceiptDocumentReference(self, value): | |
self.ReceiptDocumentReference.append(value) | |
def add_ReceiptDocumentReference(self, value): | |
self.ReceiptDocumentReference.append(value) | |
def insert_ReceiptDocumentReference_at(self, index, value): | |
self.ReceiptDocumentReference.insert(index, value) | |
def replace_ReceiptDocumentReference_at(self, index, value): | |
self.ReceiptDocumentReference[index] = value | |
def get_OriginatorDocumentReference(self): | |
return self.OriginatorDocumentReference | |
def set_OriginatorDocumentReference(self, OriginatorDocumentReference): | |
self.OriginatorDocumentReference = OriginatorDocumentReference | |
def add_OriginatorDocumentReference(self, value): | |
self.OriginatorDocumentReference.append(value) | |
def add_OriginatorDocumentReference(self, value): | |
self.OriginatorDocumentReference.append(value) | |
def insert_OriginatorDocumentReference_at(self, index, value): | |
self.OriginatorDocumentReference.insert(index, value) | |
def replace_OriginatorDocumentReference_at(self, index, value): | |
self.OriginatorDocumentReference[index] = value | |
def get_ContractDocumentReference(self): | |
return self.ContractDocumentReference | |
def set_ContractDocumentReference(self, ContractDocumentReference): | |
self.ContractDocumentReference = ContractDocumentReference | |
def add_ContractDocumentReference(self, value): | |
self.ContractDocumentReference.append(value) | |
def add_ContractDocumentReference(self, value): | |
self.ContractDocumentReference.append(value) | |
def insert_ContractDocumentReference_at(self, index, value): | |
self.ContractDocumentReference.insert(index, value) | |
def replace_ContractDocumentReference_at(self, index, value): | |
self.ContractDocumentReference[index] = value | |
def get_AdditionalDocumentReference(self): | |
return self.AdditionalDocumentReference | |
def set_AdditionalDocumentReference(self, AdditionalDocumentReference): | |
self.AdditionalDocumentReference = AdditionalDocumentReference | |
def add_AdditionalDocumentReference(self, value): | |
self.AdditionalDocumentReference.append(value) | |
def add_AdditionalDocumentReference(self, value): | |
self.AdditionalDocumentReference.append(value) | |
def insert_AdditionalDocumentReference_at(self, index, value): | |
self.AdditionalDocumentReference.insert(index, value) | |
def replace_AdditionalDocumentReference_at(self, index, value): | |
self.AdditionalDocumentReference[index] = value | |
def get_AccountingSupplierParty(self): | |
return self.AccountingSupplierParty | |
def set_AccountingSupplierParty(self, AccountingSupplierParty): | |
self.AccountingSupplierParty = AccountingSupplierParty | |
def get_AccountingCustomerParty(self): | |
return self.AccountingCustomerParty | |
def set_AccountingCustomerParty(self, AccountingCustomerParty): | |
self.AccountingCustomerParty = AccountingCustomerParty | |
def get_PayeeParty(self): | |
return self.PayeeParty | |
def set_PayeeParty(self, PayeeParty): | |
self.PayeeParty = PayeeParty | |
def get_BuyerCustomerParty(self): | |
return self.BuyerCustomerParty | |
def set_BuyerCustomerParty(self, BuyerCustomerParty): | |
self.BuyerCustomerParty = BuyerCustomerParty | |
def get_SellerSupplierParty(self): | |
return self.SellerSupplierParty | |
def set_SellerSupplierParty(self, SellerSupplierParty): | |
self.SellerSupplierParty = SellerSupplierParty | |
def get_TaxRepresentativeParty(self): | |
return self.TaxRepresentativeParty | |
def set_TaxRepresentativeParty(self, TaxRepresentativeParty): | |
self.TaxRepresentativeParty = TaxRepresentativeParty | |
def get_Delivery(self): | |
return self.Delivery | |
def set_Delivery(self, Delivery): | |
self.Delivery = Delivery | |
def add_Delivery(self, value): | |
self.Delivery.append(value) | |
def add_Delivery(self, value): | |
self.Delivery.append(value) | |
def insert_Delivery_at(self, index, value): | |
self.Delivery.insert(index, value) | |
def replace_Delivery_at(self, index, value): | |
self.Delivery[index] = value | |
def get_DeliveryTerms(self): | |
return self.DeliveryTerms | |
def set_DeliveryTerms(self, DeliveryTerms): | |
self.DeliveryTerms = DeliveryTerms | |
def get_PaymentMeans(self): | |
return self.PaymentMeans | |
def set_PaymentMeans(self, PaymentMeans): | |
self.PaymentMeans = PaymentMeans | |
def add_PaymentMeans(self, value): | |
self.PaymentMeans.append(value) | |
def add_PaymentMeans(self, value): | |
self.PaymentMeans.append(value) | |
def insert_PaymentMeans_at(self, index, value): | |
self.PaymentMeans.insert(index, value) | |
def replace_PaymentMeans_at(self, index, value): | |
self.PaymentMeans[index] = value | |
def get_PaymentTerms(self): | |
return self.PaymentTerms | |
def set_PaymentTerms(self, PaymentTerms): | |
self.PaymentTerms = PaymentTerms | |
def add_PaymentTerms(self, value): | |
self.PaymentTerms.append(value) | |
def add_PaymentTerms(self, value): | |
self.PaymentTerms.append(value) | |
def insert_PaymentTerms_at(self, index, value): | |
self.PaymentTerms.insert(index, value) | |
def replace_PaymentTerms_at(self, index, value): | |
self.PaymentTerms[index] = value | |
def get_PrepaidPayment(self): | |
return self.PrepaidPayment | |
def set_PrepaidPayment(self, PrepaidPayment): | |
self.PrepaidPayment = PrepaidPayment | |
def add_PrepaidPayment(self, value): | |
self.PrepaidPayment.append(value) | |
def add_PrepaidPayment(self, value): | |
self.PrepaidPayment.append(value) | |
def insert_PrepaidPayment_at(self, index, value): | |
self.PrepaidPayment.insert(index, value) | |
def replace_PrepaidPayment_at(self, index, value): | |
self.PrepaidPayment[index] = value | |
def get_AllowanceCharge(self): | |
return self.AllowanceCharge | |
def set_AllowanceCharge(self, AllowanceCharge): | |
self.AllowanceCharge = AllowanceCharge | |
def add_AllowanceCharge(self, value): | |
self.AllowanceCharge.append(value) | |
def add_AllowanceCharge(self, value): | |
self.AllowanceCharge.append(value) | |
def insert_AllowanceCharge_at(self, index, value): | |
self.AllowanceCharge.insert(index, value) | |
def replace_AllowanceCharge_at(self, index, value): | |
self.AllowanceCharge[index] = value | |
def get_PaymentExchangeRate(self): | |
return self.PaymentExchangeRate | |
def set_PaymentExchangeRate(self, PaymentExchangeRate): | |
self.PaymentExchangeRate = PaymentExchangeRate | |
def get_PaymentAlternativeExchangeRate(self): | |
return self.PaymentAlternativeExchangeRate | |
def set_PaymentAlternativeExchangeRate(self, PaymentAlternativeExchangeRate): | |
self.PaymentAlternativeExchangeRate = PaymentAlternativeExchangeRate | |
def get_TaxTotal(self): | |
return self.TaxTotal | |
def set_TaxTotal(self, TaxTotal): | |
self.TaxTotal = TaxTotal | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def insert_TaxTotal_at(self, index, value): | |
self.TaxTotal.insert(index, value) | |
def replace_TaxTotal_at(self, index, value): | |
self.TaxTotal[index] = value | |
def get_LegalMonetaryTotal(self): | |
return self.LegalMonetaryTotal | |
def set_LegalMonetaryTotal(self, LegalMonetaryTotal): | |
self.LegalMonetaryTotal = LegalMonetaryTotal | |
def get_InvoiceLine(self): | |
return self.InvoiceLine | |
def set_InvoiceLine(self, InvoiceLine): | |
self.InvoiceLine = InvoiceLine | |
def add_InvoiceLine(self, value): | |
self.InvoiceLine.append(value) | |
def add_InvoiceLine(self, value): | |
self.InvoiceLine.append(value) | |
def insert_InvoiceLine_at(self, index, value): | |
self.InvoiceLine.insert(index, value) | |
def replace_InvoiceLine_at(self, index, value): | |
self.InvoiceLine[index] = value | |
def hasContent_(self): | |
if ( | |
self.UBLExtensions is not None or | |
self.UBLVersionID is not None or | |
self.CustomizationID is not None or | |
self.ProfileID is not None or | |
self.ID is not None or | |
self.UUID is not None or | |
self.IssueDate is not None or | |
self.IssueTime is not None or | |
self.InvoiceTypeCode is not None or | |
self.Note or | |
self.DocumentCurrencyCode is not None or | |
self.AccountingCostCode is not None or | |
self.AccountingCost is not None or | |
self.LineCountNumeric is not None or | |
self.InvoicePeriod is not None or | |
self.OrderReference or | |
self.BillingReference or | |
self.DespatchDocumentReference or | |
self.ReceiptDocumentReference or | |
self.OriginatorDocumentReference or | |
self.ContractDocumentReference or | |
self.AdditionalDocumentReference or | |
self.AccountingSupplierParty is not None or | |
self.AccountingCustomerParty is not None or | |
self.PayeeParty is not None or | |
self.BuyerCustomerParty is not None or | |
self.SellerSupplierParty is not None or | |
self.TaxRepresentativeParty is not None or | |
self.Delivery or | |
self.DeliveryTerms is not None or | |
self.PaymentMeans or | |
self.PaymentTerms or | |
self.PrepaidPayment or | |
self.AllowanceCharge or | |
self.PaymentExchangeRate is not None or | |
self.PaymentAlternativeExchangeRate is not None or | |
self.TaxTotal or | |
self.LegalMonetaryTotal is not None or | |
self.InvoiceLine | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='InvoiceType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('InvoiceType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='InvoiceType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='InvoiceType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='InvoiceType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='InvoiceType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.UBLExtensions is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUBLExtensions>%s</%sUBLExtensions>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UBLExtensions), input_name='UBLExtensions')), namespaceprefix_ , eol_)) | |
if self.UBLVersionID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUBLVersionID>%s</%sUBLVersionID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UBLVersionID), input_name='UBLVersionID')), namespaceprefix_ , eol_)) | |
if self.CustomizationID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCustomizationID>%s</%sCustomizationID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CustomizationID), input_name='CustomizationID')), namespaceprefix_ , eol_)) | |
if self.ProfileID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sProfileID>%s</%sProfileID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ProfileID), input_name='ProfileID')), namespaceprefix_ , eol_)) | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.UUID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUUID>%s</%sUUID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UUID), input_name='UUID')), namespaceprefix_ , eol_)) | |
if self.IssueDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sIssueDate>%s</%sIssueDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.IssueDate), input_name='IssueDate')), namespaceprefix_ , eol_)) | |
if self.IssueTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sIssueTime>%s</%sIssueTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.IssueTime), input_name='IssueTime')), namespaceprefix_ , eol_)) | |
if self.InvoiceTypeCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInvoiceTypeCode>%s</%sInvoiceTypeCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InvoiceTypeCode), input_name='InvoiceTypeCode')), namespaceprefix_ , eol_)) | |
for Note_ in self.Note: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sNote>%s</%sNote>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(Note_), input_name='Note')), namespaceprefix_ , eol_)) | |
if self.DocumentCurrencyCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDocumentCurrencyCode>%s</%sDocumentCurrencyCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DocumentCurrencyCode), input_name='DocumentCurrencyCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCostCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCostCode>%s</%sAccountingCostCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCostCode), input_name='AccountingCostCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCost is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCost>%s</%sAccountingCost>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCost), input_name='AccountingCost')), namespaceprefix_ , eol_)) | |
if self.LineCountNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLineCountNumeric>%s</%sLineCountNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LineCountNumeric), input_name='LineCountNumeric')), namespaceprefix_ , eol_)) | |
if self.InvoicePeriod is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInvoicePeriod>%s</%sInvoicePeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InvoicePeriod), input_name='InvoicePeriod')), namespaceprefix_ , eol_)) | |
for OrderReference_ in self.OrderReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOrderReference>%s</%sOrderReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OrderReference_), input_name='OrderReference')), namespaceprefix_ , eol_)) | |
for BillingReference_ in self.BillingReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBillingReference>%s</%sBillingReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(BillingReference_), input_name='BillingReference')), namespaceprefix_ , eol_)) | |
for DespatchDocumentReference_ in self.DespatchDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDespatchDocumentReference>%s</%sDespatchDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DespatchDocumentReference_), input_name='DespatchDocumentReference')), namespaceprefix_ , eol_)) | |
for ReceiptDocumentReference_ in self.ReceiptDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sReceiptDocumentReference>%s</%sReceiptDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ReceiptDocumentReference_), input_name='ReceiptDocumentReference')), namespaceprefix_ , eol_)) | |
for OriginatorDocumentReference_ in self.OriginatorDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOriginatorDocumentReference>%s</%sOriginatorDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OriginatorDocumentReference_), input_name='OriginatorDocumentReference')), namespaceprefix_ , eol_)) | |
for ContractDocumentReference_ in self.ContractDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sContractDocumentReference>%s</%sContractDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ContractDocumentReference_), input_name='ContractDocumentReference')), namespaceprefix_ , eol_)) | |
for AdditionalDocumentReference_ in self.AdditionalDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalDocumentReference>%s</%sAdditionalDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(AdditionalDocumentReference_), input_name='AdditionalDocumentReference')), namespaceprefix_ , eol_)) | |
if self.AccountingSupplierParty is not None: | |
self.AccountingSupplierParty.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='AccountingSupplierParty', pretty_print=pretty_print) | |
if self.AccountingCustomerParty is not None: | |
self.AccountingCustomerParty.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='AccountingCustomerParty', pretty_print=pretty_print) | |
if self.PayeeParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPayeeParty>%s</%sPayeeParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PayeeParty), input_name='PayeeParty')), namespaceprefix_ , eol_)) | |
if self.BuyerCustomerParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBuyerCustomerParty>%s</%sBuyerCustomerParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BuyerCustomerParty), input_name='BuyerCustomerParty')), namespaceprefix_ , eol_)) | |
if self.SellerSupplierParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sSellerSupplierParty>%s</%sSellerSupplierParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SellerSupplierParty), input_name='SellerSupplierParty')), namespaceprefix_ , eol_)) | |
if self.TaxRepresentativeParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxRepresentativeParty>%s</%sTaxRepresentativeParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxRepresentativeParty), input_name='TaxRepresentativeParty')), namespaceprefix_ , eol_)) | |
for Delivery_ in self.Delivery: | |
Delivery_.export(outfile, level, namespaceprefix_='tns:', name_='Delivery', pretty_print=pretty_print) | |
if self.DeliveryTerms is not None: | |
self.DeliveryTerms.export(outfile, level, namespaceprefix_='tns:', name_='DeliveryTerms', pretty_print=pretty_print) | |
for PaymentMeans_ in self.PaymentMeans: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentMeans>%s</%sPaymentMeans>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PaymentMeans_), input_name='PaymentMeans')), namespaceprefix_ , eol_)) | |
for PaymentTerms_ in self.PaymentTerms: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentTerms>%s</%sPaymentTerms>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PaymentTerms_), input_name='PaymentTerms')), namespaceprefix_ , eol_)) | |
for PrepaidPayment_ in self.PrepaidPayment: | |
PrepaidPayment_.export(outfile, level, namespaceprefix_='tns:', name_='PrepaidPayment', pretty_print=pretty_print) | |
for AllowanceCharge_ in self.AllowanceCharge: | |
AllowanceCharge_.export(outfile, level, namespaceprefix_='tns:', name_='AllowanceCharge', pretty_print=pretty_print) | |
if self.PaymentExchangeRate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentExchangeRate>%s</%sPaymentExchangeRate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaymentExchangeRate), input_name='PaymentExchangeRate')), namespaceprefix_ , eol_)) | |
if self.PaymentAlternativeExchangeRate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentAlternativeExchangeRate>%s</%sPaymentAlternativeExchangeRate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaymentAlternativeExchangeRate), input_name='PaymentAlternativeExchangeRate')), namespaceprefix_ , eol_)) | |
for TaxTotal_ in self.TaxTotal: | |
TaxTotal_.export(outfile, level, namespaceprefix_='tns:', name_='TaxTotal', pretty_print=pretty_print) | |
if self.LegalMonetaryTotal is not None: | |
self.LegalMonetaryTotal.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='LegalMonetaryTotal', pretty_print=pretty_print) | |
for InvoiceLine_ in self.InvoiceLine: | |
InvoiceLine_.export(outfile, level, namespaceprefix_='tns:', name_='InvoiceLine', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'UBLExtensions': | |
UBLExtensions_ = child_.text | |
UBLExtensions_ = self.gds_validate_string(UBLExtensions_, node, 'UBLExtensions') | |
self.UBLExtensions = UBLExtensions_ | |
elif nodeName_ == 'UBLVersionID': | |
UBLVersionID_ = child_.text | |
UBLVersionID_ = self.gds_validate_string(UBLVersionID_, node, 'UBLVersionID') | |
self.UBLVersionID = UBLVersionID_ | |
elif nodeName_ == 'CustomizationID': | |
CustomizationID_ = child_.text | |
CustomizationID_ = self.gds_validate_string(CustomizationID_, node, 'CustomizationID') | |
self.CustomizationID = CustomizationID_ | |
elif nodeName_ == 'ProfileID': | |
ProfileID_ = child_.text | |
ProfileID_ = self.gds_validate_string(ProfileID_, node, 'ProfileID') | |
self.ProfileID = ProfileID_ | |
elif nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'UUID': | |
UUID_ = child_.text | |
UUID_ = self.gds_validate_string(UUID_, node, 'UUID') | |
self.UUID = UUID_ | |
elif nodeName_ == 'IssueDate': | |
IssueDate_ = child_.text | |
IssueDate_ = self.gds_validate_string(IssueDate_, node, 'IssueDate') | |
self.IssueDate = IssueDate_ | |
elif nodeName_ == 'IssueTime': | |
IssueTime_ = child_.text | |
IssueTime_ = self.gds_validate_string(IssueTime_, node, 'IssueTime') | |
self.IssueTime = IssueTime_ | |
elif nodeName_ == 'InvoiceTypeCode': | |
InvoiceTypeCode_ = child_.text | |
InvoiceTypeCode_ = self.gds_validate_string(InvoiceTypeCode_, node, 'InvoiceTypeCode') | |
self.InvoiceTypeCode = InvoiceTypeCode_ | |
elif nodeName_ == 'Note': | |
Note_ = child_.text | |
Note_ = self.gds_validate_string(Note_, node, 'Note') | |
self.Note.append(Note_) | |
elif nodeName_ == 'DocumentCurrencyCode': | |
DocumentCurrencyCode_ = child_.text | |
DocumentCurrencyCode_ = self.gds_validate_string(DocumentCurrencyCode_, node, 'DocumentCurrencyCode') | |
self.DocumentCurrencyCode = DocumentCurrencyCode_ | |
elif nodeName_ == 'AccountingCostCode': | |
AccountingCostCode_ = child_.text | |
AccountingCostCode_ = self.gds_validate_string(AccountingCostCode_, node, 'AccountingCostCode') | |
self.AccountingCostCode = AccountingCostCode_ | |
elif nodeName_ == 'AccountingCost': | |
AccountingCost_ = child_.text | |
AccountingCost_ = self.gds_validate_string(AccountingCost_, node, 'AccountingCost') | |
self.AccountingCost = AccountingCost_ | |
elif nodeName_ == 'LineCountNumeric': | |
LineCountNumeric_ = child_.text | |
LineCountNumeric_ = self.gds_validate_string(LineCountNumeric_, node, 'LineCountNumeric') | |
self.LineCountNumeric = LineCountNumeric_ | |
elif nodeName_ == 'InvoicePeriod': | |
InvoicePeriod_ = child_.text | |
InvoicePeriod_ = self.gds_validate_string(InvoicePeriod_, node, 'InvoicePeriod') | |
self.InvoicePeriod = InvoicePeriod_ | |
elif nodeName_ == 'OrderReference': | |
OrderReference_ = child_.text | |
OrderReference_ = self.gds_validate_string(OrderReference_, node, 'OrderReference') | |
self.OrderReference.append(OrderReference_) | |
elif nodeName_ == 'BillingReference': | |
BillingReference_ = child_.text | |
BillingReference_ = self.gds_validate_string(BillingReference_, node, 'BillingReference') | |
self.BillingReference.append(BillingReference_) | |
elif nodeName_ == 'DespatchDocumentReference': | |
DespatchDocumentReference_ = child_.text | |
DespatchDocumentReference_ = self.gds_validate_string(DespatchDocumentReference_, node, 'DespatchDocumentReference') | |
self.DespatchDocumentReference.append(DespatchDocumentReference_) | |
elif nodeName_ == 'ReceiptDocumentReference': | |
ReceiptDocumentReference_ = child_.text | |
ReceiptDocumentReference_ = self.gds_validate_string(ReceiptDocumentReference_, node, 'ReceiptDocumentReference') | |
self.ReceiptDocumentReference.append(ReceiptDocumentReference_) | |
elif nodeName_ == 'OriginatorDocumentReference': | |
OriginatorDocumentReference_ = child_.text | |
OriginatorDocumentReference_ = self.gds_validate_string(OriginatorDocumentReference_, node, 'OriginatorDocumentReference') | |
self.OriginatorDocumentReference.append(OriginatorDocumentReference_) | |
elif nodeName_ == 'ContractDocumentReference': | |
ContractDocumentReference_ = child_.text | |
ContractDocumentReference_ = self.gds_validate_string(ContractDocumentReference_, node, 'ContractDocumentReference') | |
self.ContractDocumentReference.append(ContractDocumentReference_) | |
elif nodeName_ == 'AdditionalDocumentReference': | |
AdditionalDocumentReference_ = child_.text | |
AdditionalDocumentReference_ = self.gds_validate_string(AdditionalDocumentReference_, node, 'AdditionalDocumentReference') | |
self.AdditionalDocumentReference.append(AdditionalDocumentReference_) | |
elif nodeName_ == 'AccountingSupplierParty': | |
obj_ = SupplierPartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AccountingSupplierParty = obj_ | |
obj_.original_tagname_ = 'AccountingSupplierParty' | |
elif nodeName_ == 'AccountingCustomerParty': | |
obj_ = CustomerPartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AccountingCustomerParty = obj_ | |
obj_.original_tagname_ = 'AccountingCustomerParty' | |
elif nodeName_ == 'PayeeParty': | |
PayeeParty_ = child_.text | |
PayeeParty_ = self.gds_validate_string(PayeeParty_, node, 'PayeeParty') | |
self.PayeeParty = PayeeParty_ | |
elif nodeName_ == 'BuyerCustomerParty': | |
BuyerCustomerParty_ = child_.text | |
BuyerCustomerParty_ = self.gds_validate_string(BuyerCustomerParty_, node, 'BuyerCustomerParty') | |
self.BuyerCustomerParty = BuyerCustomerParty_ | |
elif nodeName_ == 'SellerSupplierParty': | |
SellerSupplierParty_ = child_.text | |
SellerSupplierParty_ = self.gds_validate_string(SellerSupplierParty_, node, 'SellerSupplierParty') | |
self.SellerSupplierParty = SellerSupplierParty_ | |
elif nodeName_ == 'TaxRepresentativeParty': | |
TaxRepresentativeParty_ = child_.text | |
TaxRepresentativeParty_ = self.gds_validate_string(TaxRepresentativeParty_, node, 'TaxRepresentativeParty') | |
self.TaxRepresentativeParty = TaxRepresentativeParty_ | |
elif nodeName_ == 'Delivery': | |
obj_ = DeliveryType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Delivery.append(obj_) | |
obj_.original_tagname_ = 'Delivery' | |
elif nodeName_ == 'DeliveryTerms': | |
obj_ = DeliveryTermsType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DeliveryTerms = obj_ | |
obj_.original_tagname_ = 'DeliveryTerms' | |
elif nodeName_ == 'PaymentMeans': | |
PaymentMeans_ = child_.text | |
PaymentMeans_ = self.gds_validate_string(PaymentMeans_, node, 'PaymentMeans') | |
self.PaymentMeans.append(PaymentMeans_) | |
elif nodeName_ == 'PaymentTerms': | |
PaymentTerms_ = child_.text | |
PaymentTerms_ = self.gds_validate_string(PaymentTerms_, node, 'PaymentTerms') | |
self.PaymentTerms.append(PaymentTerms_) | |
elif nodeName_ == 'PrepaidPayment': | |
obj_ = PaymentType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.PrepaidPayment.append(obj_) | |
obj_.original_tagname_ = 'PrepaidPayment' | |
elif nodeName_ == 'AllowanceCharge': | |
obj_ = AllowanceChargeType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AllowanceCharge.append(obj_) | |
obj_.original_tagname_ = 'AllowanceCharge' | |
elif nodeName_ == 'PaymentExchangeRate': | |
PaymentExchangeRate_ = child_.text | |
PaymentExchangeRate_ = self.gds_validate_string(PaymentExchangeRate_, node, 'PaymentExchangeRate') | |
self.PaymentExchangeRate = PaymentExchangeRate_ | |
elif nodeName_ == 'PaymentAlternativeExchangeRate': | |
PaymentAlternativeExchangeRate_ = child_.text | |
PaymentAlternativeExchangeRate_ = self.gds_validate_string(PaymentAlternativeExchangeRate_, node, 'PaymentAlternativeExchangeRate') | |
self.PaymentAlternativeExchangeRate = PaymentAlternativeExchangeRate_ | |
elif nodeName_ == 'TaxTotal': | |
obj_ = TaxTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.TaxTotal.append(obj_) | |
obj_.original_tagname_ = 'TaxTotal' | |
elif nodeName_ == 'LegalMonetaryTotal': | |
obj_ = MonetaryTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.LegalMonetaryTotal = obj_ | |
obj_.original_tagname_ = 'LegalMonetaryTotal' | |
elif nodeName_ == 'InvoiceLine': | |
obj_ = InvoiceLineType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.InvoiceLine.append(obj_) | |
obj_.original_tagname_ = 'InvoiceLine' | |
# end class InvoiceType | |
class CreditNoteType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, UBLExtensions=None, UBLVersionID=None, CustomizationID=None, ProfileID=None, ID=None, UUID=None, IssueDate=None, IssueTime=None, Note=None, DocumentCurrencyCode=None, AccountingCostCode=None, AccountingCost=None, LineCountNumeric=None, InvoicePeriod=None, DiscrepancyResponse=None, OrderReference=None, BillingReference=None, DespatchDocumentReference=None, ReceiptDocumentReference=None, ContractDocumentReference=None, AdditionalDocumentReference=None, AccountingSupplierParty=None, AccountingCustomerParty=None, PayeeParty=None, TaxRepresentativeParty=None, TaxTotal=None, LegalMonetaryTotal=None, CreditNoteLine=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.UBLExtensions = UBLExtensions | |
self.UBLVersionID = UBLVersionID | |
self.CustomizationID = CustomizationID | |
self.ProfileID = ProfileID | |
self.ID = ID | |
self.UUID = UUID | |
self.IssueDate = IssueDate | |
self.IssueTime = IssueTime | |
if Note is None: | |
self.Note = [] | |
else: | |
self.Note = Note | |
self.DocumentCurrencyCode = DocumentCurrencyCode | |
self.AccountingCostCode = AccountingCostCode | |
self.AccountingCost = AccountingCost | |
self.LineCountNumeric = LineCountNumeric | |
self.InvoicePeriod = InvoicePeriod | |
if DiscrepancyResponse is None: | |
self.DiscrepancyResponse = [] | |
else: | |
self.DiscrepancyResponse = DiscrepancyResponse | |
if OrderReference is None: | |
self.OrderReference = [] | |
else: | |
self.OrderReference = OrderReference | |
if BillingReference is None: | |
self.BillingReference = [] | |
else: | |
self.BillingReference = BillingReference | |
if DespatchDocumentReference is None: | |
self.DespatchDocumentReference = [] | |
else: | |
self.DespatchDocumentReference = DespatchDocumentReference | |
if ReceiptDocumentReference is None: | |
self.ReceiptDocumentReference = [] | |
else: | |
self.ReceiptDocumentReference = ReceiptDocumentReference | |
if ContractDocumentReference is None: | |
self.ContractDocumentReference = [] | |
else: | |
self.ContractDocumentReference = ContractDocumentReference | |
if AdditionalDocumentReference is None: | |
self.AdditionalDocumentReference = [] | |
else: | |
self.AdditionalDocumentReference = AdditionalDocumentReference | |
self.AccountingSupplierParty = AccountingSupplierParty | |
self.AccountingCustomerParty = AccountingCustomerParty | |
self.PayeeParty = PayeeParty | |
self.TaxRepresentativeParty = TaxRepresentativeParty | |
if TaxTotal is None: | |
self.TaxTotal = [] | |
else: | |
self.TaxTotal = TaxTotal | |
self.LegalMonetaryTotal = LegalMonetaryTotal | |
if CreditNoteLine is None: | |
self.CreditNoteLine = [] | |
else: | |
self.CreditNoteLine = CreditNoteLine | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, CreditNoteType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if CreditNoteType.subclass: | |
return CreditNoteType.subclass(*args_, **kwargs_) | |
else: | |
return CreditNoteType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_UBLExtensions(self): | |
return self.UBLExtensions | |
def set_UBLExtensions(self, UBLExtensions): | |
self.UBLExtensions = UBLExtensions | |
def get_UBLVersionID(self): | |
return self.UBLVersionID | |
def set_UBLVersionID(self, UBLVersionID): | |
self.UBLVersionID = UBLVersionID | |
def get_CustomizationID(self): | |
return self.CustomizationID | |
def set_CustomizationID(self, CustomizationID): | |
self.CustomizationID = CustomizationID | |
def get_ProfileID(self): | |
return self.ProfileID | |
def set_ProfileID(self, ProfileID): | |
self.ProfileID = ProfileID | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_UUID(self): | |
return self.UUID | |
def set_UUID(self, UUID): | |
self.UUID = UUID | |
def get_IssueDate(self): | |
return self.IssueDate | |
def set_IssueDate(self, IssueDate): | |
self.IssueDate = IssueDate | |
def get_IssueTime(self): | |
return self.IssueTime | |
def set_IssueTime(self, IssueTime): | |
self.IssueTime = IssueTime | |
def get_Note(self): | |
return self.Note | |
def set_Note(self, Note): | |
self.Note = Note | |
def add_Note(self, value): | |
self.Note.append(value) | |
def add_Note(self, value): | |
self.Note.append(value) | |
def insert_Note_at(self, index, value): | |
self.Note.insert(index, value) | |
def replace_Note_at(self, index, value): | |
self.Note[index] = value | |
def get_DocumentCurrencyCode(self): | |
return self.DocumentCurrencyCode | |
def set_DocumentCurrencyCode(self, DocumentCurrencyCode): | |
self.DocumentCurrencyCode = DocumentCurrencyCode | |
def get_AccountingCostCode(self): | |
return self.AccountingCostCode | |
def set_AccountingCostCode(self, AccountingCostCode): | |
self.AccountingCostCode = AccountingCostCode | |
def get_AccountingCost(self): | |
return self.AccountingCost | |
def set_AccountingCost(self, AccountingCost): | |
self.AccountingCost = AccountingCost | |
def get_LineCountNumeric(self): | |
return self.LineCountNumeric | |
def set_LineCountNumeric(self, LineCountNumeric): | |
self.LineCountNumeric = LineCountNumeric | |
def get_InvoicePeriod(self): | |
return self.InvoicePeriod | |
def set_InvoicePeriod(self, InvoicePeriod): | |
self.InvoicePeriod = InvoicePeriod | |
def get_DiscrepancyResponse(self): | |
return self.DiscrepancyResponse | |
def set_DiscrepancyResponse(self, DiscrepancyResponse): | |
self.DiscrepancyResponse = DiscrepancyResponse | |
def add_DiscrepancyResponse(self, value): | |
self.DiscrepancyResponse.append(value) | |
def add_DiscrepancyResponse(self, value): | |
self.DiscrepancyResponse.append(value) | |
def insert_DiscrepancyResponse_at(self, index, value): | |
self.DiscrepancyResponse.insert(index, value) | |
def replace_DiscrepancyResponse_at(self, index, value): | |
self.DiscrepancyResponse[index] = value | |
def get_OrderReference(self): | |
return self.OrderReference | |
def set_OrderReference(self, OrderReference): | |
self.OrderReference = OrderReference | |
def add_OrderReference(self, value): | |
self.OrderReference.append(value) | |
def add_OrderReference(self, value): | |
self.OrderReference.append(value) | |
def insert_OrderReference_at(self, index, value): | |
self.OrderReference.insert(index, value) | |
def replace_OrderReference_at(self, index, value): | |
self.OrderReference[index] = value | |
def get_BillingReference(self): | |
return self.BillingReference | |
def set_BillingReference(self, BillingReference): | |
self.BillingReference = BillingReference | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def insert_BillingReference_at(self, index, value): | |
self.BillingReference.insert(index, value) | |
def replace_BillingReference_at(self, index, value): | |
self.BillingReference[index] = value | |
def get_DespatchDocumentReference(self): | |
return self.DespatchDocumentReference | |
def set_DespatchDocumentReference(self, DespatchDocumentReference): | |
self.DespatchDocumentReference = DespatchDocumentReference | |
def add_DespatchDocumentReference(self, value): | |
self.DespatchDocumentReference.append(value) | |
def add_DespatchDocumentReference(self, value): | |
self.DespatchDocumentReference.append(value) | |
def insert_DespatchDocumentReference_at(self, index, value): | |
self.DespatchDocumentReference.insert(index, value) | |
def replace_DespatchDocumentReference_at(self, index, value): | |
self.DespatchDocumentReference[index] = value | |
def get_ReceiptDocumentReference(self): | |
return self.ReceiptDocumentReference | |
def set_ReceiptDocumentReference(self, ReceiptDocumentReference): | |
self.ReceiptDocumentReference = ReceiptDocumentReference | |
def add_ReceiptDocumentReference(self, value): | |
self.ReceiptDocumentReference.append(value) | |
def add_ReceiptDocumentReference(self, value): | |
self.ReceiptDocumentReference.append(value) | |
def insert_ReceiptDocumentReference_at(self, index, value): | |
self.ReceiptDocumentReference.insert(index, value) | |
def replace_ReceiptDocumentReference_at(self, index, value): | |
self.ReceiptDocumentReference[index] = value | |
def get_ContractDocumentReference(self): | |
return self.ContractDocumentReference | |
def set_ContractDocumentReference(self, ContractDocumentReference): | |
self.ContractDocumentReference = ContractDocumentReference | |
def add_ContractDocumentReference(self, value): | |
self.ContractDocumentReference.append(value) | |
def add_ContractDocumentReference(self, value): | |
self.ContractDocumentReference.append(value) | |
def insert_ContractDocumentReference_at(self, index, value): | |
self.ContractDocumentReference.insert(index, value) | |
def replace_ContractDocumentReference_at(self, index, value): | |
self.ContractDocumentReference[index] = value | |
def get_AdditionalDocumentReference(self): | |
return self.AdditionalDocumentReference | |
def set_AdditionalDocumentReference(self, AdditionalDocumentReference): | |
self.AdditionalDocumentReference = AdditionalDocumentReference | |
def add_AdditionalDocumentReference(self, value): | |
self.AdditionalDocumentReference.append(value) | |
def add_AdditionalDocumentReference(self, value): | |
self.AdditionalDocumentReference.append(value) | |
def insert_AdditionalDocumentReference_at(self, index, value): | |
self.AdditionalDocumentReference.insert(index, value) | |
def replace_AdditionalDocumentReference_at(self, index, value): | |
self.AdditionalDocumentReference[index] = value | |
def get_AccountingSupplierParty(self): | |
return self.AccountingSupplierParty | |
def set_AccountingSupplierParty(self, AccountingSupplierParty): | |
self.AccountingSupplierParty = AccountingSupplierParty | |
def get_AccountingCustomerParty(self): | |
return self.AccountingCustomerParty | |
def set_AccountingCustomerParty(self, AccountingCustomerParty): | |
self.AccountingCustomerParty = AccountingCustomerParty | |
def get_PayeeParty(self): | |
return self.PayeeParty | |
def set_PayeeParty(self, PayeeParty): | |
self.PayeeParty = PayeeParty | |
def get_TaxRepresentativeParty(self): | |
return self.TaxRepresentativeParty | |
def set_TaxRepresentativeParty(self, TaxRepresentativeParty): | |
self.TaxRepresentativeParty = TaxRepresentativeParty | |
def get_TaxTotal(self): | |
return self.TaxTotal | |
def set_TaxTotal(self, TaxTotal): | |
self.TaxTotal = TaxTotal | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def insert_TaxTotal_at(self, index, value): | |
self.TaxTotal.insert(index, value) | |
def replace_TaxTotal_at(self, index, value): | |
self.TaxTotal[index] = value | |
def get_LegalMonetaryTotal(self): | |
return self.LegalMonetaryTotal | |
def set_LegalMonetaryTotal(self, LegalMonetaryTotal): | |
self.LegalMonetaryTotal = LegalMonetaryTotal | |
def get_CreditNoteLine(self): | |
return self.CreditNoteLine | |
def set_CreditNoteLine(self, CreditNoteLine): | |
self.CreditNoteLine = CreditNoteLine | |
def add_CreditNoteLine(self, value): | |
self.CreditNoteLine.append(value) | |
def add_CreditNoteLine(self, value): | |
self.CreditNoteLine.append(value) | |
def insert_CreditNoteLine_at(self, index, value): | |
self.CreditNoteLine.insert(index, value) | |
def replace_CreditNoteLine_at(self, index, value): | |
self.CreditNoteLine[index] = value | |
def hasContent_(self): | |
if ( | |
self.UBLExtensions is not None or | |
self.UBLVersionID is not None or | |
self.CustomizationID is not None or | |
self.ProfileID is not None or | |
self.ID is not None or | |
self.UUID is not None or | |
self.IssueDate is not None or | |
self.IssueTime is not None or | |
self.Note or | |
self.DocumentCurrencyCode is not None or | |
self.AccountingCostCode is not None or | |
self.AccountingCost is not None or | |
self.LineCountNumeric is not None or | |
self.InvoicePeriod is not None or | |
self.DiscrepancyResponse or | |
self.OrderReference or | |
self.BillingReference or | |
self.DespatchDocumentReference or | |
self.ReceiptDocumentReference or | |
self.ContractDocumentReference or | |
self.AdditionalDocumentReference or | |
self.AccountingSupplierParty is not None or | |
self.AccountingCustomerParty is not None or | |
self.PayeeParty is not None or | |
self.TaxRepresentativeParty is not None or | |
self.TaxTotal or | |
self.LegalMonetaryTotal is not None or | |
self.CreditNoteLine | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='CreditNoteType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('CreditNoteType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CreditNoteType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CreditNoteType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='CreditNoteType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='CreditNoteType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.UBLExtensions is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUBLExtensions>%s</%sUBLExtensions>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UBLExtensions), input_name='UBLExtensions')), namespaceprefix_ , eol_)) | |
if self.UBLVersionID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUBLVersionID>%s</%sUBLVersionID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UBLVersionID), input_name='UBLVersionID')), namespaceprefix_ , eol_)) | |
if self.CustomizationID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCustomizationID>%s</%sCustomizationID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CustomizationID), input_name='CustomizationID')), namespaceprefix_ , eol_)) | |
if self.ProfileID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sProfileID>%s</%sProfileID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ProfileID), input_name='ProfileID')), namespaceprefix_ , eol_)) | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.UUID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUUID>%s</%sUUID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UUID), input_name='UUID')), namespaceprefix_ , eol_)) | |
if self.IssueDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sIssueDate>%s</%sIssueDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.IssueDate), input_name='IssueDate')), namespaceprefix_ , eol_)) | |
if self.IssueTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sIssueTime>%s</%sIssueTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.IssueTime), input_name='IssueTime')), namespaceprefix_ , eol_)) | |
for Note_ in self.Note: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sNote>%s</%sNote>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(Note_), input_name='Note')), namespaceprefix_ , eol_)) | |
if self.DocumentCurrencyCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDocumentCurrencyCode>%s</%sDocumentCurrencyCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DocumentCurrencyCode), input_name='DocumentCurrencyCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCostCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCostCode>%s</%sAccountingCostCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCostCode), input_name='AccountingCostCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCost is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCost>%s</%sAccountingCost>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCost), input_name='AccountingCost')), namespaceprefix_ , eol_)) | |
if self.LineCountNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLineCountNumeric>%s</%sLineCountNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LineCountNumeric), input_name='LineCountNumeric')), namespaceprefix_ , eol_)) | |
if self.InvoicePeriod is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInvoicePeriod>%s</%sInvoicePeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InvoicePeriod), input_name='InvoicePeriod')), namespaceprefix_ , eol_)) | |
for DiscrepancyResponse_ in self.DiscrepancyResponse: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDiscrepancyResponse>%s</%sDiscrepancyResponse>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DiscrepancyResponse_), input_name='DiscrepancyResponse')), namespaceprefix_ , eol_)) | |
for OrderReference_ in self.OrderReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOrderReference>%s</%sOrderReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OrderReference_), input_name='OrderReference')), namespaceprefix_ , eol_)) | |
for BillingReference_ in self.BillingReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBillingReference>%s</%sBillingReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(BillingReference_), input_name='BillingReference')), namespaceprefix_ , eol_)) | |
for DespatchDocumentReference_ in self.DespatchDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDespatchDocumentReference>%s</%sDespatchDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DespatchDocumentReference_), input_name='DespatchDocumentReference')), namespaceprefix_ , eol_)) | |
for ReceiptDocumentReference_ in self.ReceiptDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sReceiptDocumentReference>%s</%sReceiptDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ReceiptDocumentReference_), input_name='ReceiptDocumentReference')), namespaceprefix_ , eol_)) | |
for ContractDocumentReference_ in self.ContractDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sContractDocumentReference>%s</%sContractDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ContractDocumentReference_), input_name='ContractDocumentReference')), namespaceprefix_ , eol_)) | |
for AdditionalDocumentReference_ in self.AdditionalDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalDocumentReference>%s</%sAdditionalDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(AdditionalDocumentReference_), input_name='AdditionalDocumentReference')), namespaceprefix_ , eol_)) | |
if self.AccountingSupplierParty is not None: | |
self.AccountingSupplierParty.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='AccountingSupplierParty', pretty_print=pretty_print) | |
if self.AccountingCustomerParty is not None: | |
self.AccountingCustomerParty.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='AccountingCustomerParty', pretty_print=pretty_print) | |
if self.PayeeParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPayeeParty>%s</%sPayeeParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PayeeParty), input_name='PayeeParty')), namespaceprefix_ , eol_)) | |
if self.TaxRepresentativeParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxRepresentativeParty>%s</%sTaxRepresentativeParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxRepresentativeParty), input_name='TaxRepresentativeParty')), namespaceprefix_ , eol_)) | |
for TaxTotal_ in self.TaxTotal: | |
TaxTotal_.export(outfile, level, namespaceprefix_='tns:', name_='TaxTotal', pretty_print=pretty_print) | |
if self.LegalMonetaryTotal is not None: | |
self.LegalMonetaryTotal.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='LegalMonetaryTotal', pretty_print=pretty_print) | |
for CreditNoteLine_ in self.CreditNoteLine: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCreditNoteLine>%s</%sCreditNoteLine>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CreditNoteLine_), input_name='CreditNoteLine')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'UBLExtensions': | |
UBLExtensions_ = child_.text | |
UBLExtensions_ = self.gds_validate_string(UBLExtensions_, node, 'UBLExtensions') | |
self.UBLExtensions = UBLExtensions_ | |
elif nodeName_ == 'UBLVersionID': | |
UBLVersionID_ = child_.text | |
UBLVersionID_ = self.gds_validate_string(UBLVersionID_, node, 'UBLVersionID') | |
self.UBLVersionID = UBLVersionID_ | |
elif nodeName_ == 'CustomizationID': | |
CustomizationID_ = child_.text | |
CustomizationID_ = self.gds_validate_string(CustomizationID_, node, 'CustomizationID') | |
self.CustomizationID = CustomizationID_ | |
elif nodeName_ == 'ProfileID': | |
ProfileID_ = child_.text | |
ProfileID_ = self.gds_validate_string(ProfileID_, node, 'ProfileID') | |
self.ProfileID = ProfileID_ | |
elif nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'UUID': | |
UUID_ = child_.text | |
UUID_ = self.gds_validate_string(UUID_, node, 'UUID') | |
self.UUID = UUID_ | |
elif nodeName_ == 'IssueDate': | |
IssueDate_ = child_.text | |
IssueDate_ = self.gds_validate_string(IssueDate_, node, 'IssueDate') | |
self.IssueDate = IssueDate_ | |
elif nodeName_ == 'IssueTime': | |
IssueTime_ = child_.text | |
IssueTime_ = self.gds_validate_string(IssueTime_, node, 'IssueTime') | |
self.IssueTime = IssueTime_ | |
elif nodeName_ == 'Note': | |
Note_ = child_.text | |
Note_ = self.gds_validate_string(Note_, node, 'Note') | |
self.Note.append(Note_) | |
elif nodeName_ == 'DocumentCurrencyCode': | |
DocumentCurrencyCode_ = child_.text | |
DocumentCurrencyCode_ = self.gds_validate_string(DocumentCurrencyCode_, node, 'DocumentCurrencyCode') | |
self.DocumentCurrencyCode = DocumentCurrencyCode_ | |
elif nodeName_ == 'AccountingCostCode': | |
AccountingCostCode_ = child_.text | |
AccountingCostCode_ = self.gds_validate_string(AccountingCostCode_, node, 'AccountingCostCode') | |
self.AccountingCostCode = AccountingCostCode_ | |
elif nodeName_ == 'AccountingCost': | |
AccountingCost_ = child_.text | |
AccountingCost_ = self.gds_validate_string(AccountingCost_, node, 'AccountingCost') | |
self.AccountingCost = AccountingCost_ | |
elif nodeName_ == 'LineCountNumeric': | |
LineCountNumeric_ = child_.text | |
LineCountNumeric_ = self.gds_validate_string(LineCountNumeric_, node, 'LineCountNumeric') | |
self.LineCountNumeric = LineCountNumeric_ | |
elif nodeName_ == 'InvoicePeriod': | |
InvoicePeriod_ = child_.text | |
InvoicePeriod_ = self.gds_validate_string(InvoicePeriod_, node, 'InvoicePeriod') | |
self.InvoicePeriod = InvoicePeriod_ | |
elif nodeName_ == 'DiscrepancyResponse': | |
DiscrepancyResponse_ = child_.text | |
DiscrepancyResponse_ = self.gds_validate_string(DiscrepancyResponse_, node, 'DiscrepancyResponse') | |
self.DiscrepancyResponse.append(DiscrepancyResponse_) | |
elif nodeName_ == 'OrderReference': | |
OrderReference_ = child_.text | |
OrderReference_ = self.gds_validate_string(OrderReference_, node, 'OrderReference') | |
self.OrderReference.append(OrderReference_) | |
elif nodeName_ == 'BillingReference': | |
BillingReference_ = child_.text | |
BillingReference_ = self.gds_validate_string(BillingReference_, node, 'BillingReference') | |
self.BillingReference.append(BillingReference_) | |
elif nodeName_ == 'DespatchDocumentReference': | |
DespatchDocumentReference_ = child_.text | |
DespatchDocumentReference_ = self.gds_validate_string(DespatchDocumentReference_, node, 'DespatchDocumentReference') | |
self.DespatchDocumentReference.append(DespatchDocumentReference_) | |
elif nodeName_ == 'ReceiptDocumentReference': | |
ReceiptDocumentReference_ = child_.text | |
ReceiptDocumentReference_ = self.gds_validate_string(ReceiptDocumentReference_, node, 'ReceiptDocumentReference') | |
self.ReceiptDocumentReference.append(ReceiptDocumentReference_) | |
elif nodeName_ == 'ContractDocumentReference': | |
ContractDocumentReference_ = child_.text | |
ContractDocumentReference_ = self.gds_validate_string(ContractDocumentReference_, node, 'ContractDocumentReference') | |
self.ContractDocumentReference.append(ContractDocumentReference_) | |
elif nodeName_ == 'AdditionalDocumentReference': | |
AdditionalDocumentReference_ = child_.text | |
AdditionalDocumentReference_ = self.gds_validate_string(AdditionalDocumentReference_, node, 'AdditionalDocumentReference') | |
self.AdditionalDocumentReference.append(AdditionalDocumentReference_) | |
elif nodeName_ == 'AccountingSupplierParty': | |
obj_ = SupplierPartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AccountingSupplierParty = obj_ | |
obj_.original_tagname_ = 'AccountingSupplierParty' | |
elif nodeName_ == 'AccountingCustomerParty': | |
obj_ = CustomerPartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AccountingCustomerParty = obj_ | |
obj_.original_tagname_ = 'AccountingCustomerParty' | |
elif nodeName_ == 'PayeeParty': | |
PayeeParty_ = child_.text | |
PayeeParty_ = self.gds_validate_string(PayeeParty_, node, 'PayeeParty') | |
self.PayeeParty = PayeeParty_ | |
elif nodeName_ == 'TaxRepresentativeParty': | |
TaxRepresentativeParty_ = child_.text | |
TaxRepresentativeParty_ = self.gds_validate_string(TaxRepresentativeParty_, node, 'TaxRepresentativeParty') | |
self.TaxRepresentativeParty = TaxRepresentativeParty_ | |
elif nodeName_ == 'TaxTotal': | |
obj_ = TaxTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.TaxTotal.append(obj_) | |
obj_.original_tagname_ = 'TaxTotal' | |
elif nodeName_ == 'LegalMonetaryTotal': | |
obj_ = MonetaryTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.LegalMonetaryTotal = obj_ | |
obj_.original_tagname_ = 'LegalMonetaryTotal' | |
elif nodeName_ == 'CreditNoteLine': | |
CreditNoteLine_ = child_.text | |
CreditNoteLine_ = self.gds_validate_string(CreditNoteLine_, node, 'CreditNoteLine') | |
self.CreditNoteLine.append(CreditNoteLine_) | |
# end class CreditNoteType | |
class DebitNoteType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, UBLExtensions=None, UBLVersionID=None, CustomizationID=None, ProfileID=None, ID=None, UUID=None, IssueDate=None, IssueTime=None, Note=None, DocumentCurrencyCode=None, AccountingCostCode=None, AccountingCost=None, LineCountNumeric=None, InvoicePeriod=None, DiscrepancyResponse=None, OrderReference=None, BillingReference=None, DespatchDocumentReference=None, ReceiptDocumentReference=None, ContractDocumentReference=None, AdditionalDocumentReference=None, AccountingSupplierParty=None, AccountingCustomerParty=None, PayeeParty=None, TaxRepresentativeParty=None, PrepaidPayment=None, PaymentExchangeRate=None, PaymentAlternativeExchangeRate=None, TaxTotal=None, LegalMonetaryTotal=None, DebitNoteLine=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.UBLExtensions = UBLExtensions | |
self.UBLVersionID = UBLVersionID | |
self.CustomizationID = CustomizationID | |
self.ProfileID = ProfileID | |
self.ID = ID | |
self.UUID = UUID | |
self.IssueDate = IssueDate | |
self.IssueTime = IssueTime | |
if Note is None: | |
self.Note = [] | |
else: | |
self.Note = Note | |
self.DocumentCurrencyCode = DocumentCurrencyCode | |
self.AccountingCostCode = AccountingCostCode | |
self.AccountingCost = AccountingCost | |
self.LineCountNumeric = LineCountNumeric | |
self.InvoicePeriod = InvoicePeriod | |
if DiscrepancyResponse is None: | |
self.DiscrepancyResponse = [] | |
else: | |
self.DiscrepancyResponse = DiscrepancyResponse | |
if OrderReference is None: | |
self.OrderReference = [] | |
else: | |
self.OrderReference = OrderReference | |
if BillingReference is None: | |
self.BillingReference = [] | |
else: | |
self.BillingReference = BillingReference | |
if DespatchDocumentReference is None: | |
self.DespatchDocumentReference = [] | |
else: | |
self.DespatchDocumentReference = DespatchDocumentReference | |
if ReceiptDocumentReference is None: | |
self.ReceiptDocumentReference = [] | |
else: | |
self.ReceiptDocumentReference = ReceiptDocumentReference | |
if ContractDocumentReference is None: | |
self.ContractDocumentReference = [] | |
else: | |
self.ContractDocumentReference = ContractDocumentReference | |
if AdditionalDocumentReference is None: | |
self.AdditionalDocumentReference = [] | |
else: | |
self.AdditionalDocumentReference = AdditionalDocumentReference | |
self.AccountingSupplierParty = AccountingSupplierParty | |
self.AccountingCustomerParty = AccountingCustomerParty | |
self.PayeeParty = PayeeParty | |
self.TaxRepresentativeParty = TaxRepresentativeParty | |
if PrepaidPayment is None: | |
self.PrepaidPayment = [] | |
else: | |
self.PrepaidPayment = PrepaidPayment | |
self.PaymentExchangeRate = PaymentExchangeRate | |
self.PaymentAlternativeExchangeRate = PaymentAlternativeExchangeRate | |
if TaxTotal is None: | |
self.TaxTotal = [] | |
else: | |
self.TaxTotal = TaxTotal | |
self.LegalMonetaryTotal = LegalMonetaryTotal | |
if DebitNoteLine is None: | |
self.DebitNoteLine = [] | |
else: | |
self.DebitNoteLine = DebitNoteLine | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, DebitNoteType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if DebitNoteType.subclass: | |
return DebitNoteType.subclass(*args_, **kwargs_) | |
else: | |
return DebitNoteType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_UBLExtensions(self): | |
return self.UBLExtensions | |
def set_UBLExtensions(self, UBLExtensions): | |
self.UBLExtensions = UBLExtensions | |
def get_UBLVersionID(self): | |
return self.UBLVersionID | |
def set_UBLVersionID(self, UBLVersionID): | |
self.UBLVersionID = UBLVersionID | |
def get_CustomizationID(self): | |
return self.CustomizationID | |
def set_CustomizationID(self, CustomizationID): | |
self.CustomizationID = CustomizationID | |
def get_ProfileID(self): | |
return self.ProfileID | |
def set_ProfileID(self, ProfileID): | |
self.ProfileID = ProfileID | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_UUID(self): | |
return self.UUID | |
def set_UUID(self, UUID): | |
self.UUID = UUID | |
def get_IssueDate(self): | |
return self.IssueDate | |
def set_IssueDate(self, IssueDate): | |
self.IssueDate = IssueDate | |
def get_IssueTime(self): | |
return self.IssueTime | |
def set_IssueTime(self, IssueTime): | |
self.IssueTime = IssueTime | |
def get_Note(self): | |
return self.Note | |
def set_Note(self, Note): | |
self.Note = Note | |
def add_Note(self, value): | |
self.Note.append(value) | |
def add_Note(self, value): | |
self.Note.append(value) | |
def insert_Note_at(self, index, value): | |
self.Note.insert(index, value) | |
def replace_Note_at(self, index, value): | |
self.Note[index] = value | |
def get_DocumentCurrencyCode(self): | |
return self.DocumentCurrencyCode | |
def set_DocumentCurrencyCode(self, DocumentCurrencyCode): | |
self.DocumentCurrencyCode = DocumentCurrencyCode | |
def get_AccountingCostCode(self): | |
return self.AccountingCostCode | |
def set_AccountingCostCode(self, AccountingCostCode): | |
self.AccountingCostCode = AccountingCostCode | |
def get_AccountingCost(self): | |
return self.AccountingCost | |
def set_AccountingCost(self, AccountingCost): | |
self.AccountingCost = AccountingCost | |
def get_LineCountNumeric(self): | |
return self.LineCountNumeric | |
def set_LineCountNumeric(self, LineCountNumeric): | |
self.LineCountNumeric = LineCountNumeric | |
def get_InvoicePeriod(self): | |
return self.InvoicePeriod | |
def set_InvoicePeriod(self, InvoicePeriod): | |
self.InvoicePeriod = InvoicePeriod | |
def get_DiscrepancyResponse(self): | |
return self.DiscrepancyResponse | |
def set_DiscrepancyResponse(self, DiscrepancyResponse): | |
self.DiscrepancyResponse = DiscrepancyResponse | |
def add_DiscrepancyResponse(self, value): | |
self.DiscrepancyResponse.append(value) | |
def add_DiscrepancyResponse(self, value): | |
self.DiscrepancyResponse.append(value) | |
def insert_DiscrepancyResponse_at(self, index, value): | |
self.DiscrepancyResponse.insert(index, value) | |
def replace_DiscrepancyResponse_at(self, index, value): | |
self.DiscrepancyResponse[index] = value | |
def get_OrderReference(self): | |
return self.OrderReference | |
def set_OrderReference(self, OrderReference): | |
self.OrderReference = OrderReference | |
def add_OrderReference(self, value): | |
self.OrderReference.append(value) | |
def add_OrderReference(self, value): | |
self.OrderReference.append(value) | |
def insert_OrderReference_at(self, index, value): | |
self.OrderReference.insert(index, value) | |
def replace_OrderReference_at(self, index, value): | |
self.OrderReference[index] = value | |
def get_BillingReference(self): | |
return self.BillingReference | |
def set_BillingReference(self, BillingReference): | |
self.BillingReference = BillingReference | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def insert_BillingReference_at(self, index, value): | |
self.BillingReference.insert(index, value) | |
def replace_BillingReference_at(self, index, value): | |
self.BillingReference[index] = value | |
def get_DespatchDocumentReference(self): | |
return self.DespatchDocumentReference | |
def set_DespatchDocumentReference(self, DespatchDocumentReference): | |
self.DespatchDocumentReference = DespatchDocumentReference | |
def add_DespatchDocumentReference(self, value): | |
self.DespatchDocumentReference.append(value) | |
def add_DespatchDocumentReference(self, value): | |
self.DespatchDocumentReference.append(value) | |
def insert_DespatchDocumentReference_at(self, index, value): | |
self.DespatchDocumentReference.insert(index, value) | |
def replace_DespatchDocumentReference_at(self, index, value): | |
self.DespatchDocumentReference[index] = value | |
def get_ReceiptDocumentReference(self): | |
return self.ReceiptDocumentReference | |
def set_ReceiptDocumentReference(self, ReceiptDocumentReference): | |
self.ReceiptDocumentReference = ReceiptDocumentReference | |
def add_ReceiptDocumentReference(self, value): | |
self.ReceiptDocumentReference.append(value) | |
def add_ReceiptDocumentReference(self, value): | |
self.ReceiptDocumentReference.append(value) | |
def insert_ReceiptDocumentReference_at(self, index, value): | |
self.ReceiptDocumentReference.insert(index, value) | |
def replace_ReceiptDocumentReference_at(self, index, value): | |
self.ReceiptDocumentReference[index] = value | |
def get_ContractDocumentReference(self): | |
return self.ContractDocumentReference | |
def set_ContractDocumentReference(self, ContractDocumentReference): | |
self.ContractDocumentReference = ContractDocumentReference | |
def add_ContractDocumentReference(self, value): | |
self.ContractDocumentReference.append(value) | |
def add_ContractDocumentReference(self, value): | |
self.ContractDocumentReference.append(value) | |
def insert_ContractDocumentReference_at(self, index, value): | |
self.ContractDocumentReference.insert(index, value) | |
def replace_ContractDocumentReference_at(self, index, value): | |
self.ContractDocumentReference[index] = value | |
def get_AdditionalDocumentReference(self): | |
return self.AdditionalDocumentReference | |
def set_AdditionalDocumentReference(self, AdditionalDocumentReference): | |
self.AdditionalDocumentReference = AdditionalDocumentReference | |
def add_AdditionalDocumentReference(self, value): | |
self.AdditionalDocumentReference.append(value) | |
def add_AdditionalDocumentReference(self, value): | |
self.AdditionalDocumentReference.append(value) | |
def insert_AdditionalDocumentReference_at(self, index, value): | |
self.AdditionalDocumentReference.insert(index, value) | |
def replace_AdditionalDocumentReference_at(self, index, value): | |
self.AdditionalDocumentReference[index] = value | |
def get_AccountingSupplierParty(self): | |
return self.AccountingSupplierParty | |
def set_AccountingSupplierParty(self, AccountingSupplierParty): | |
self.AccountingSupplierParty = AccountingSupplierParty | |
def get_AccountingCustomerParty(self): | |
return self.AccountingCustomerParty | |
def set_AccountingCustomerParty(self, AccountingCustomerParty): | |
self.AccountingCustomerParty = AccountingCustomerParty | |
def get_PayeeParty(self): | |
return self.PayeeParty | |
def set_PayeeParty(self, PayeeParty): | |
self.PayeeParty = PayeeParty | |
def get_TaxRepresentativeParty(self): | |
return self.TaxRepresentativeParty | |
def set_TaxRepresentativeParty(self, TaxRepresentativeParty): | |
self.TaxRepresentativeParty = TaxRepresentativeParty | |
def get_PrepaidPayment(self): | |
return self.PrepaidPayment | |
def set_PrepaidPayment(self, PrepaidPayment): | |
self.PrepaidPayment = PrepaidPayment | |
def add_PrepaidPayment(self, value): | |
self.PrepaidPayment.append(value) | |
def add_PrepaidPayment(self, value): | |
self.PrepaidPayment.append(value) | |
def insert_PrepaidPayment_at(self, index, value): | |
self.PrepaidPayment.insert(index, value) | |
def replace_PrepaidPayment_at(self, index, value): | |
self.PrepaidPayment[index] = value | |
def get_PaymentExchangeRate(self): | |
return self.PaymentExchangeRate | |
def set_PaymentExchangeRate(self, PaymentExchangeRate): | |
self.PaymentExchangeRate = PaymentExchangeRate | |
def get_PaymentAlternativeExchangeRate(self): | |
return self.PaymentAlternativeExchangeRate | |
def set_PaymentAlternativeExchangeRate(self, PaymentAlternativeExchangeRate): | |
self.PaymentAlternativeExchangeRate = PaymentAlternativeExchangeRate | |
def get_TaxTotal(self): | |
return self.TaxTotal | |
def set_TaxTotal(self, TaxTotal): | |
self.TaxTotal = TaxTotal | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def insert_TaxTotal_at(self, index, value): | |
self.TaxTotal.insert(index, value) | |
def replace_TaxTotal_at(self, index, value): | |
self.TaxTotal[index] = value | |
def get_LegalMonetaryTotal(self): | |
return self.LegalMonetaryTotal | |
def set_LegalMonetaryTotal(self, LegalMonetaryTotal): | |
self.LegalMonetaryTotal = LegalMonetaryTotal | |
def get_DebitNoteLine(self): | |
return self.DebitNoteLine | |
def set_DebitNoteLine(self, DebitNoteLine): | |
self.DebitNoteLine = DebitNoteLine | |
def add_DebitNoteLine(self, value): | |
self.DebitNoteLine.append(value) | |
def add_DebitNoteLine(self, value): | |
self.DebitNoteLine.append(value) | |
def insert_DebitNoteLine_at(self, index, value): | |
self.DebitNoteLine.insert(index, value) | |
def replace_DebitNoteLine_at(self, index, value): | |
self.DebitNoteLine[index] = value | |
def hasContent_(self): | |
if ( | |
self.UBLExtensions is not None or | |
self.UBLVersionID is not None or | |
self.CustomizationID is not None or | |
self.ProfileID is not None or | |
self.ID is not None or | |
self.UUID is not None or | |
self.IssueDate is not None or | |
self.IssueTime is not None or | |
self.Note or | |
self.DocumentCurrencyCode is not None or | |
self.AccountingCostCode is not None or | |
self.AccountingCost is not None or | |
self.LineCountNumeric is not None or | |
self.InvoicePeriod is not None or | |
self.DiscrepancyResponse or | |
self.OrderReference or | |
self.BillingReference or | |
self.DespatchDocumentReference or | |
self.ReceiptDocumentReference or | |
self.ContractDocumentReference or | |
self.AdditionalDocumentReference or | |
self.AccountingSupplierParty is not None or | |
self.AccountingCustomerParty is not None or | |
self.PayeeParty is not None or | |
self.TaxRepresentativeParty is not None or | |
self.PrepaidPayment or | |
self.PaymentExchangeRate is not None or | |
self.PaymentAlternativeExchangeRate is not None or | |
self.TaxTotal or | |
self.LegalMonetaryTotal is not None or | |
self.DebitNoteLine | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DebitNoteType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('DebitNoteType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DebitNoteType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DebitNoteType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='DebitNoteType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DebitNoteType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.UBLExtensions is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUBLExtensions>%s</%sUBLExtensions>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UBLExtensions), input_name='UBLExtensions')), namespaceprefix_ , eol_)) | |
if self.UBLVersionID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUBLVersionID>%s</%sUBLVersionID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UBLVersionID), input_name='UBLVersionID')), namespaceprefix_ , eol_)) | |
if self.CustomizationID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCustomizationID>%s</%sCustomizationID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CustomizationID), input_name='CustomizationID')), namespaceprefix_ , eol_)) | |
if self.ProfileID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sProfileID>%s</%sProfileID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ProfileID), input_name='ProfileID')), namespaceprefix_ , eol_)) | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.UUID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUUID>%s</%sUUID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UUID), input_name='UUID')), namespaceprefix_ , eol_)) | |
if self.IssueDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sIssueDate>%s</%sIssueDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.IssueDate), input_name='IssueDate')), namespaceprefix_ , eol_)) | |
if self.IssueTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sIssueTime>%s</%sIssueTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.IssueTime), input_name='IssueTime')), namespaceprefix_ , eol_)) | |
for Note_ in self.Note: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sNote>%s</%sNote>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(Note_), input_name='Note')), namespaceprefix_ , eol_)) | |
if self.DocumentCurrencyCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDocumentCurrencyCode>%s</%sDocumentCurrencyCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DocumentCurrencyCode), input_name='DocumentCurrencyCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCostCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCostCode>%s</%sAccountingCostCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCostCode), input_name='AccountingCostCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCost is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCost>%s</%sAccountingCost>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCost), input_name='AccountingCost')), namespaceprefix_ , eol_)) | |
if self.LineCountNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLineCountNumeric>%s</%sLineCountNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LineCountNumeric), input_name='LineCountNumeric')), namespaceprefix_ , eol_)) | |
if self.InvoicePeriod is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInvoicePeriod>%s</%sInvoicePeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InvoicePeriod), input_name='InvoicePeriod')), namespaceprefix_ , eol_)) | |
for DiscrepancyResponse_ in self.DiscrepancyResponse: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDiscrepancyResponse>%s</%sDiscrepancyResponse>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DiscrepancyResponse_), input_name='DiscrepancyResponse')), namespaceprefix_ , eol_)) | |
for OrderReference_ in self.OrderReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOrderReference>%s</%sOrderReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OrderReference_), input_name='OrderReference')), namespaceprefix_ , eol_)) | |
for BillingReference_ in self.BillingReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBillingReference>%s</%sBillingReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(BillingReference_), input_name='BillingReference')), namespaceprefix_ , eol_)) | |
for DespatchDocumentReference_ in self.DespatchDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDespatchDocumentReference>%s</%sDespatchDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DespatchDocumentReference_), input_name='DespatchDocumentReference')), namespaceprefix_ , eol_)) | |
for ReceiptDocumentReference_ in self.ReceiptDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sReceiptDocumentReference>%s</%sReceiptDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ReceiptDocumentReference_), input_name='ReceiptDocumentReference')), namespaceprefix_ , eol_)) | |
for ContractDocumentReference_ in self.ContractDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sContractDocumentReference>%s</%sContractDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ContractDocumentReference_), input_name='ContractDocumentReference')), namespaceprefix_ , eol_)) | |
for AdditionalDocumentReference_ in self.AdditionalDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalDocumentReference>%s</%sAdditionalDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(AdditionalDocumentReference_), input_name='AdditionalDocumentReference')), namespaceprefix_ , eol_)) | |
if self.AccountingSupplierParty is not None: | |
self.AccountingSupplierParty.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='AccountingSupplierParty', pretty_print=pretty_print) | |
if self.AccountingCustomerParty is not None: | |
self.AccountingCustomerParty.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='AccountingCustomerParty', pretty_print=pretty_print) | |
if self.PayeeParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPayeeParty>%s</%sPayeeParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PayeeParty), input_name='PayeeParty')), namespaceprefix_ , eol_)) | |
if self.TaxRepresentativeParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxRepresentativeParty>%s</%sTaxRepresentativeParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxRepresentativeParty), input_name='TaxRepresentativeParty')), namespaceprefix_ , eol_)) | |
for PrepaidPayment_ in self.PrepaidPayment: | |
PrepaidPayment_.export(outfile, level, namespaceprefix_='tns:', name_='PrepaidPayment', pretty_print=pretty_print) | |
if self.PaymentExchangeRate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentExchangeRate>%s</%sPaymentExchangeRate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaymentExchangeRate), input_name='PaymentExchangeRate')), namespaceprefix_ , eol_)) | |
if self.PaymentAlternativeExchangeRate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentAlternativeExchangeRate>%s</%sPaymentAlternativeExchangeRate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaymentAlternativeExchangeRate), input_name='PaymentAlternativeExchangeRate')), namespaceprefix_ , eol_)) | |
for TaxTotal_ in self.TaxTotal: | |
TaxTotal_.export(outfile, level, namespaceprefix_='tns:', name_='TaxTotal', pretty_print=pretty_print) | |
if self.LegalMonetaryTotal is not None: | |
self.LegalMonetaryTotal.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='LegalMonetaryTotal', pretty_print=pretty_print) | |
for DebitNoteLine_ in self.DebitNoteLine: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDebitNoteLine>%s</%sDebitNoteLine>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DebitNoteLine_), input_name='DebitNoteLine')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'UBLExtensions': | |
UBLExtensions_ = child_.text | |
UBLExtensions_ = self.gds_validate_string(UBLExtensions_, node, 'UBLExtensions') | |
self.UBLExtensions = UBLExtensions_ | |
elif nodeName_ == 'UBLVersionID': | |
UBLVersionID_ = child_.text | |
UBLVersionID_ = self.gds_validate_string(UBLVersionID_, node, 'UBLVersionID') | |
self.UBLVersionID = UBLVersionID_ | |
elif nodeName_ == 'CustomizationID': | |
CustomizationID_ = child_.text | |
CustomizationID_ = self.gds_validate_string(CustomizationID_, node, 'CustomizationID') | |
self.CustomizationID = CustomizationID_ | |
elif nodeName_ == 'ProfileID': | |
ProfileID_ = child_.text | |
ProfileID_ = self.gds_validate_string(ProfileID_, node, 'ProfileID') | |
self.ProfileID = ProfileID_ | |
elif nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'UUID': | |
UUID_ = child_.text | |
UUID_ = self.gds_validate_string(UUID_, node, 'UUID') | |
self.UUID = UUID_ | |
elif nodeName_ == 'IssueDate': | |
IssueDate_ = child_.text | |
IssueDate_ = self.gds_validate_string(IssueDate_, node, 'IssueDate') | |
self.IssueDate = IssueDate_ | |
elif nodeName_ == 'IssueTime': | |
IssueTime_ = child_.text | |
IssueTime_ = self.gds_validate_string(IssueTime_, node, 'IssueTime') | |
self.IssueTime = IssueTime_ | |
elif nodeName_ == 'Note': | |
Note_ = child_.text | |
Note_ = self.gds_validate_string(Note_, node, 'Note') | |
self.Note.append(Note_) | |
elif nodeName_ == 'DocumentCurrencyCode': | |
DocumentCurrencyCode_ = child_.text | |
DocumentCurrencyCode_ = self.gds_validate_string(DocumentCurrencyCode_, node, 'DocumentCurrencyCode') | |
self.DocumentCurrencyCode = DocumentCurrencyCode_ | |
elif nodeName_ == 'AccountingCostCode': | |
AccountingCostCode_ = child_.text | |
AccountingCostCode_ = self.gds_validate_string(AccountingCostCode_, node, 'AccountingCostCode') | |
self.AccountingCostCode = AccountingCostCode_ | |
elif nodeName_ == 'AccountingCost': | |
AccountingCost_ = child_.text | |
AccountingCost_ = self.gds_validate_string(AccountingCost_, node, 'AccountingCost') | |
self.AccountingCost = AccountingCost_ | |
elif nodeName_ == 'LineCountNumeric': | |
LineCountNumeric_ = child_.text | |
LineCountNumeric_ = self.gds_validate_string(LineCountNumeric_, node, 'LineCountNumeric') | |
self.LineCountNumeric = LineCountNumeric_ | |
elif nodeName_ == 'InvoicePeriod': | |
InvoicePeriod_ = child_.text | |
InvoicePeriod_ = self.gds_validate_string(InvoicePeriod_, node, 'InvoicePeriod') | |
self.InvoicePeriod = InvoicePeriod_ | |
elif nodeName_ == 'DiscrepancyResponse': | |
DiscrepancyResponse_ = child_.text | |
DiscrepancyResponse_ = self.gds_validate_string(DiscrepancyResponse_, node, 'DiscrepancyResponse') | |
self.DiscrepancyResponse.append(DiscrepancyResponse_) | |
elif nodeName_ == 'OrderReference': | |
OrderReference_ = child_.text | |
OrderReference_ = self.gds_validate_string(OrderReference_, node, 'OrderReference') | |
self.OrderReference.append(OrderReference_) | |
elif nodeName_ == 'BillingReference': | |
BillingReference_ = child_.text | |
BillingReference_ = self.gds_validate_string(BillingReference_, node, 'BillingReference') | |
self.BillingReference.append(BillingReference_) | |
elif nodeName_ == 'DespatchDocumentReference': | |
DespatchDocumentReference_ = child_.text | |
DespatchDocumentReference_ = self.gds_validate_string(DespatchDocumentReference_, node, 'DespatchDocumentReference') | |
self.DespatchDocumentReference.append(DespatchDocumentReference_) | |
elif nodeName_ == 'ReceiptDocumentReference': | |
ReceiptDocumentReference_ = child_.text | |
ReceiptDocumentReference_ = self.gds_validate_string(ReceiptDocumentReference_, node, 'ReceiptDocumentReference') | |
self.ReceiptDocumentReference.append(ReceiptDocumentReference_) | |
elif nodeName_ == 'ContractDocumentReference': | |
ContractDocumentReference_ = child_.text | |
ContractDocumentReference_ = self.gds_validate_string(ContractDocumentReference_, node, 'ContractDocumentReference') | |
self.ContractDocumentReference.append(ContractDocumentReference_) | |
elif nodeName_ == 'AdditionalDocumentReference': | |
AdditionalDocumentReference_ = child_.text | |
AdditionalDocumentReference_ = self.gds_validate_string(AdditionalDocumentReference_, node, 'AdditionalDocumentReference') | |
self.AdditionalDocumentReference.append(AdditionalDocumentReference_) | |
elif nodeName_ == 'AccountingSupplierParty': | |
obj_ = SupplierPartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AccountingSupplierParty = obj_ | |
obj_.original_tagname_ = 'AccountingSupplierParty' | |
elif nodeName_ == 'AccountingCustomerParty': | |
obj_ = CustomerPartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AccountingCustomerParty = obj_ | |
obj_.original_tagname_ = 'AccountingCustomerParty' | |
elif nodeName_ == 'PayeeParty': | |
PayeeParty_ = child_.text | |
PayeeParty_ = self.gds_validate_string(PayeeParty_, node, 'PayeeParty') | |
self.PayeeParty = PayeeParty_ | |
elif nodeName_ == 'TaxRepresentativeParty': | |
TaxRepresentativeParty_ = child_.text | |
TaxRepresentativeParty_ = self.gds_validate_string(TaxRepresentativeParty_, node, 'TaxRepresentativeParty') | |
self.TaxRepresentativeParty = TaxRepresentativeParty_ | |
elif nodeName_ == 'PrepaidPayment': | |
obj_ = PaymentType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.PrepaidPayment.append(obj_) | |
obj_.original_tagname_ = 'PrepaidPayment' | |
elif nodeName_ == 'PaymentExchangeRate': | |
PaymentExchangeRate_ = child_.text | |
PaymentExchangeRate_ = self.gds_validate_string(PaymentExchangeRate_, node, 'PaymentExchangeRate') | |
self.PaymentExchangeRate = PaymentExchangeRate_ | |
elif nodeName_ == 'PaymentAlternativeExchangeRate': | |
PaymentAlternativeExchangeRate_ = child_.text | |
PaymentAlternativeExchangeRate_ = self.gds_validate_string(PaymentAlternativeExchangeRate_, node, 'PaymentAlternativeExchangeRate') | |
self.PaymentAlternativeExchangeRate = PaymentAlternativeExchangeRate_ | |
elif nodeName_ == 'TaxTotal': | |
obj_ = TaxTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.TaxTotal.append(obj_) | |
obj_.original_tagname_ = 'TaxTotal' | |
elif nodeName_ == 'LegalMonetaryTotal': | |
obj_ = MonetaryTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.LegalMonetaryTotal = obj_ | |
obj_.original_tagname_ = 'LegalMonetaryTotal' | |
elif nodeName_ == 'DebitNoteLine': | |
DebitNoteLine_ = child_.text | |
DebitNoteLine_ = self.gds_validate_string(DebitNoteLine_, node, 'DebitNoteLine') | |
self.DebitNoteLine.append(DebitNoteLine_) | |
# end class DebitNoteType | |
class SupplierPartyType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, CustomerAssignedAccountID=None, AdditionalAccountID=None, DataSendingCapability=None, Party=None, DespatchContact=None, AccountingContact=None, SellerContact=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.CustomerAssignedAccountID = CustomerAssignedAccountID | |
self.AdditionalAccountID = AdditionalAccountID | |
self.DataSendingCapability = DataSendingCapability | |
self.Party = Party | |
self.DespatchContact = DespatchContact | |
self.AccountingContact = AccountingContact | |
self.SellerContact = SellerContact | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, SupplierPartyType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if SupplierPartyType.subclass: | |
return SupplierPartyType.subclass(*args_, **kwargs_) | |
else: | |
return SupplierPartyType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_CustomerAssignedAccountID(self): | |
return self.CustomerAssignedAccountID | |
def set_CustomerAssignedAccountID(self, CustomerAssignedAccountID): | |
self.CustomerAssignedAccountID = CustomerAssignedAccountID | |
def get_AdditionalAccountID(self): | |
return self.AdditionalAccountID | |
def set_AdditionalAccountID(self, AdditionalAccountID): | |
self.AdditionalAccountID = AdditionalAccountID | |
def get_DataSendingCapability(self): | |
return self.DataSendingCapability | |
def set_DataSendingCapability(self, DataSendingCapability): | |
self.DataSendingCapability = DataSendingCapability | |
def get_Party(self): | |
return self.Party | |
def set_Party(self, Party): | |
self.Party = Party | |
def get_DespatchContact(self): | |
return self.DespatchContact | |
def set_DespatchContact(self, DespatchContact): | |
self.DespatchContact = DespatchContact | |
def get_AccountingContact(self): | |
return self.AccountingContact | |
def set_AccountingContact(self, AccountingContact): | |
self.AccountingContact = AccountingContact | |
def get_SellerContact(self): | |
return self.SellerContact | |
def set_SellerContact(self, SellerContact): | |
self.SellerContact = SellerContact | |
def hasContent_(self): | |
if ( | |
self.CustomerAssignedAccountID is not None or | |
self.AdditionalAccountID is not None or | |
self.DataSendingCapability is not None or | |
self.Party is not None or | |
self.DespatchContact is not None or | |
self.AccountingContact is not None or | |
self.SellerContact is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='SupplierPartyType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('SupplierPartyType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SupplierPartyType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SupplierPartyType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='SupplierPartyType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='SupplierPartyType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.CustomerAssignedAccountID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCustomerAssignedAccountID>%s</%sCustomerAssignedAccountID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CustomerAssignedAccountID), input_name='CustomerAssignedAccountID')), namespaceprefix_ , eol_)) | |
if self.AdditionalAccountID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalAccountID>%s</%sAdditionalAccountID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AdditionalAccountID), input_name='AdditionalAccountID')), namespaceprefix_ , eol_)) | |
if self.DataSendingCapability is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDataSendingCapability>%s</%sDataSendingCapability>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DataSendingCapability), input_name='DataSendingCapability')), namespaceprefix_ , eol_)) | |
if self.Party is not None: | |
self.Party.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='Party', pretty_print=pretty_print) | |
if self.DespatchContact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDespatchContact>%s</%sDespatchContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DespatchContact), input_name='DespatchContact')), namespaceprefix_ , eol_)) | |
if self.AccountingContact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingContact>%s</%sAccountingContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingContact), input_name='AccountingContact')), namespaceprefix_ , eol_)) | |
if self.SellerContact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sSellerContact>%s</%sSellerContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SellerContact), input_name='SellerContact')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'CustomerAssignedAccountID': | |
CustomerAssignedAccountID_ = child_.text | |
CustomerAssignedAccountID_ = self.gds_validate_string(CustomerAssignedAccountID_, node, 'CustomerAssignedAccountID') | |
self.CustomerAssignedAccountID = CustomerAssignedAccountID_ | |
elif nodeName_ == 'AdditionalAccountID': | |
AdditionalAccountID_ = child_.text | |
AdditionalAccountID_ = self.gds_validate_string(AdditionalAccountID_, node, 'AdditionalAccountID') | |
self.AdditionalAccountID = AdditionalAccountID_ | |
elif nodeName_ == 'DataSendingCapability': | |
DataSendingCapability_ = child_.text | |
DataSendingCapability_ = self.gds_validate_string(DataSendingCapability_, node, 'DataSendingCapability') | |
self.DataSendingCapability = DataSendingCapability_ | |
elif nodeName_ == 'Party': | |
obj_ = PartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Party = obj_ | |
obj_.original_tagname_ = 'Party' | |
elif nodeName_ == 'DespatchContact': | |
DespatchContact_ = child_.text | |
DespatchContact_ = self.gds_validate_string(DespatchContact_, node, 'DespatchContact') | |
self.DespatchContact = DespatchContact_ | |
elif nodeName_ == 'AccountingContact': | |
AccountingContact_ = child_.text | |
AccountingContact_ = self.gds_validate_string(AccountingContact_, node, 'AccountingContact') | |
self.AccountingContact = AccountingContact_ | |
elif nodeName_ == 'SellerContact': | |
SellerContact_ = child_.text | |
SellerContact_ = self.gds_validate_string(SellerContact_, node, 'SellerContact') | |
self.SellerContact = SellerContact_ | |
# end class SupplierPartyType | |
class CustomerPartyType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, CustomerAssignedAccountID=None, SupplierAssignedAccountID=None, AdditionalAccountID=None, Party=None, DeliveryContact=None, AccountingContact=None, BuyerContact=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.CustomerAssignedAccountID = CustomerAssignedAccountID | |
self.SupplierAssignedAccountID = SupplierAssignedAccountID | |
self.AdditionalAccountID = AdditionalAccountID | |
self.Party = Party | |
self.DeliveryContact = DeliveryContact | |
self.AccountingContact = AccountingContact | |
self.BuyerContact = BuyerContact | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, CustomerPartyType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if CustomerPartyType.subclass: | |
return CustomerPartyType.subclass(*args_, **kwargs_) | |
else: | |
return CustomerPartyType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_CustomerAssignedAccountID(self): | |
return self.CustomerAssignedAccountID | |
def set_CustomerAssignedAccountID(self, CustomerAssignedAccountID): | |
self.CustomerAssignedAccountID = CustomerAssignedAccountID | |
def get_SupplierAssignedAccountID(self): | |
return self.SupplierAssignedAccountID | |
def set_SupplierAssignedAccountID(self, SupplierAssignedAccountID): | |
self.SupplierAssignedAccountID = SupplierAssignedAccountID | |
def get_AdditionalAccountID(self): | |
return self.AdditionalAccountID | |
def set_AdditionalAccountID(self, AdditionalAccountID): | |
self.AdditionalAccountID = AdditionalAccountID | |
def get_Party(self): | |
return self.Party | |
def set_Party(self, Party): | |
self.Party = Party | |
def get_DeliveryContact(self): | |
return self.DeliveryContact | |
def set_DeliveryContact(self, DeliveryContact): | |
self.DeliveryContact = DeliveryContact | |
def get_AccountingContact(self): | |
return self.AccountingContact | |
def set_AccountingContact(self, AccountingContact): | |
self.AccountingContact = AccountingContact | |
def get_BuyerContact(self): | |
return self.BuyerContact | |
def set_BuyerContact(self, BuyerContact): | |
self.BuyerContact = BuyerContact | |
def hasContent_(self): | |
if ( | |
self.CustomerAssignedAccountID is not None or | |
self.SupplierAssignedAccountID is not None or | |
self.AdditionalAccountID is not None or | |
self.Party is not None or | |
self.DeliveryContact is not None or | |
self.AccountingContact is not None or | |
self.BuyerContact is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='CustomerPartyType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('CustomerPartyType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CustomerPartyType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CustomerPartyType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='CustomerPartyType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='CustomerPartyType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.CustomerAssignedAccountID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCustomerAssignedAccountID>%s</%sCustomerAssignedAccountID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CustomerAssignedAccountID), input_name='CustomerAssignedAccountID')), namespaceprefix_ , eol_)) | |
if self.SupplierAssignedAccountID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sSupplierAssignedAccountID>%s</%sSupplierAssignedAccountID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SupplierAssignedAccountID), input_name='SupplierAssignedAccountID')), namespaceprefix_ , eol_)) | |
if self.AdditionalAccountID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalAccountID>%s</%sAdditionalAccountID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AdditionalAccountID), input_name='AdditionalAccountID')), namespaceprefix_ , eol_)) | |
if self.Party is not None: | |
self.Party.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='Party', pretty_print=pretty_print) | |
if self.DeliveryContact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDeliveryContact>%s</%sDeliveryContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DeliveryContact), input_name='DeliveryContact')), namespaceprefix_ , eol_)) | |
if self.AccountingContact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingContact>%s</%sAccountingContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingContact), input_name='AccountingContact')), namespaceprefix_ , eol_)) | |
if self.BuyerContact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBuyerContact>%s</%sBuyerContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BuyerContact), input_name='BuyerContact')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'CustomerAssignedAccountID': | |
CustomerAssignedAccountID_ = child_.text | |
CustomerAssignedAccountID_ = self.gds_validate_string(CustomerAssignedAccountID_, node, 'CustomerAssignedAccountID') | |
self.CustomerAssignedAccountID = CustomerAssignedAccountID_ | |
elif nodeName_ == 'SupplierAssignedAccountID': | |
SupplierAssignedAccountID_ = child_.text | |
SupplierAssignedAccountID_ = self.gds_validate_string(SupplierAssignedAccountID_, node, 'SupplierAssignedAccountID') | |
self.SupplierAssignedAccountID = SupplierAssignedAccountID_ | |
elif nodeName_ == 'AdditionalAccountID': | |
AdditionalAccountID_ = child_.text | |
AdditionalAccountID_ = self.gds_validate_string(AdditionalAccountID_, node, 'AdditionalAccountID') | |
self.AdditionalAccountID = AdditionalAccountID_ | |
elif nodeName_ == 'Party': | |
obj_ = PartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Party = obj_ | |
obj_.original_tagname_ = 'Party' | |
elif nodeName_ == 'DeliveryContact': | |
DeliveryContact_ = child_.text | |
DeliveryContact_ = self.gds_validate_string(DeliveryContact_, node, 'DeliveryContact') | |
self.DeliveryContact = DeliveryContact_ | |
elif nodeName_ == 'AccountingContact': | |
AccountingContact_ = child_.text | |
AccountingContact_ = self.gds_validate_string(AccountingContact_, node, 'AccountingContact') | |
self.AccountingContact = AccountingContact_ | |
elif nodeName_ == 'BuyerContact': | |
BuyerContact_ = child_.text | |
BuyerContact_ = self.gds_validate_string(BuyerContact_, node, 'BuyerContact') | |
self.BuyerContact = BuyerContact_ | |
# end class CustomerPartyType | |
class PartyType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, MarkCareIndicator=None, MarkAttentionIndicator=None, WebsiteURI=None, LogoReferenceID=None, EndpointID=None, PartyIdentification=None, PartyName=None, Language=None, PostalAddress=None, PhysicalLocation=None, PartyTaxScheme=None, PartyLegalEntity=None, Contact=None, Person=None, AgentParty=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.MarkCareIndicator = MarkCareIndicator | |
self.MarkAttentionIndicator = MarkAttentionIndicator | |
self.WebsiteURI = WebsiteURI | |
self.LogoReferenceID = LogoReferenceID | |
self.EndpointID = EndpointID | |
if PartyIdentification is None: | |
self.PartyIdentification = [] | |
else: | |
self.PartyIdentification = PartyIdentification | |
if PartyName is None: | |
self.PartyName = [] | |
else: | |
self.PartyName = PartyName | |
self.Language = Language | |
self.PostalAddress = PostalAddress | |
self.PhysicalLocation = PhysicalLocation | |
if PartyTaxScheme is None: | |
self.PartyTaxScheme = [] | |
else: | |
self.PartyTaxScheme = PartyTaxScheme | |
if PartyLegalEntity is None: | |
self.PartyLegalEntity = [] | |
else: | |
self.PartyLegalEntity = PartyLegalEntity | |
self.Contact = Contact | |
if Person is None: | |
self.Person = [] | |
else: | |
self.Person = Person | |
self.AgentParty = AgentParty | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, PartyType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if PartyType.subclass: | |
return PartyType.subclass(*args_, **kwargs_) | |
else: | |
return PartyType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_MarkCareIndicator(self): | |
return self.MarkCareIndicator | |
def set_MarkCareIndicator(self, MarkCareIndicator): | |
self.MarkCareIndicator = MarkCareIndicator | |
def get_MarkAttentionIndicator(self): | |
return self.MarkAttentionIndicator | |
def set_MarkAttentionIndicator(self, MarkAttentionIndicator): | |
self.MarkAttentionIndicator = MarkAttentionIndicator | |
def get_WebsiteURI(self): | |
return self.WebsiteURI | |
def set_WebsiteURI(self, WebsiteURI): | |
self.WebsiteURI = WebsiteURI | |
def get_LogoReferenceID(self): | |
return self.LogoReferenceID | |
def set_LogoReferenceID(self, LogoReferenceID): | |
self.LogoReferenceID = LogoReferenceID | |
def get_EndpointID(self): | |
return self.EndpointID | |
def set_EndpointID(self, EndpointID): | |
self.EndpointID = EndpointID | |
def get_PartyIdentification(self): | |
return self.PartyIdentification | |
def set_PartyIdentification(self, PartyIdentification): | |
self.PartyIdentification = PartyIdentification | |
def add_PartyIdentification(self, value): | |
self.PartyIdentification.append(value) | |
def add_PartyIdentification(self, value): | |
self.PartyIdentification.append(value) | |
def insert_PartyIdentification_at(self, index, value): | |
self.PartyIdentification.insert(index, value) | |
def replace_PartyIdentification_at(self, index, value): | |
self.PartyIdentification[index] = value | |
def get_PartyName(self): | |
return self.PartyName | |
def set_PartyName(self, PartyName): | |
self.PartyName = PartyName | |
def add_PartyName(self, value): | |
self.PartyName.append(value) | |
def add_PartyName(self, value): | |
self.PartyName.append(value) | |
def insert_PartyName_at(self, index, value): | |
self.PartyName.insert(index, value) | |
def replace_PartyName_at(self, index, value): | |
self.PartyName[index] = value | |
def get_Language(self): | |
return self.Language | |
def set_Language(self, Language): | |
self.Language = Language | |
def get_PostalAddress(self): | |
return self.PostalAddress | |
def set_PostalAddress(self, PostalAddress): | |
self.PostalAddress = PostalAddress | |
def get_PhysicalLocation(self): | |
return self.PhysicalLocation | |
def set_PhysicalLocation(self, PhysicalLocation): | |
self.PhysicalLocation = PhysicalLocation | |
def get_PartyTaxScheme(self): | |
return self.PartyTaxScheme | |
def set_PartyTaxScheme(self, PartyTaxScheme): | |
self.PartyTaxScheme = PartyTaxScheme | |
def add_PartyTaxScheme(self, value): | |
self.PartyTaxScheme.append(value) | |
def add_PartyTaxScheme(self, value): | |
self.PartyTaxScheme.append(value) | |
def insert_PartyTaxScheme_at(self, index, value): | |
self.PartyTaxScheme.insert(index, value) | |
def replace_PartyTaxScheme_at(self, index, value): | |
self.PartyTaxScheme[index] = value | |
def get_PartyLegalEntity(self): | |
return self.PartyLegalEntity | |
def set_PartyLegalEntity(self, PartyLegalEntity): | |
self.PartyLegalEntity = PartyLegalEntity | |
def add_PartyLegalEntity(self, value): | |
self.PartyLegalEntity.append(value) | |
def add_PartyLegalEntity(self, value): | |
self.PartyLegalEntity.append(value) | |
def insert_PartyLegalEntity_at(self, index, value): | |
self.PartyLegalEntity.insert(index, value) | |
def replace_PartyLegalEntity_at(self, index, value): | |
self.PartyLegalEntity[index] = value | |
def get_Contact(self): | |
return self.Contact | |
def set_Contact(self, Contact): | |
self.Contact = Contact | |
def get_Person(self): | |
return self.Person | |
def set_Person(self, Person): | |
self.Person = Person | |
def add_Person(self, value): | |
self.Person.append(value) | |
def add_Person(self, value): | |
self.Person.append(value) | |
def insert_Person_at(self, index, value): | |
self.Person.insert(index, value) | |
def replace_Person_at(self, index, value): | |
self.Person[index] = value | |
def get_AgentParty(self): | |
return self.AgentParty | |
def set_AgentParty(self, AgentParty): | |
self.AgentParty = AgentParty | |
def hasContent_(self): | |
if ( | |
self.MarkCareIndicator is not None or | |
self.MarkAttentionIndicator is not None or | |
self.WebsiteURI is not None or | |
self.LogoReferenceID is not None or | |
self.EndpointID is not None or | |
self.PartyIdentification or | |
self.PartyName or | |
self.Language is not None or | |
self.PostalAddress is not None or | |
self.PhysicalLocation is not None or | |
self.PartyTaxScheme or | |
self.PartyLegalEntity or | |
self.Contact is not None or | |
self.Person or | |
self.AgentParty is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PartyType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('PartyType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PartyType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PartyType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='PartyType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PartyType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.MarkCareIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMarkCareIndicator>%s</%sMarkCareIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MarkCareIndicator), input_name='MarkCareIndicator')), namespaceprefix_ , eol_)) | |
if self.MarkAttentionIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMarkAttentionIndicator>%s</%sMarkAttentionIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MarkAttentionIndicator), input_name='MarkAttentionIndicator')), namespaceprefix_ , eol_)) | |
if self.WebsiteURI is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sWebsiteURI>%s</%sWebsiteURI>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.WebsiteURI), input_name='WebsiteURI')), namespaceprefix_ , eol_)) | |
if self.LogoReferenceID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLogoReferenceID>%s</%sLogoReferenceID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LogoReferenceID), input_name='LogoReferenceID')), namespaceprefix_ , eol_)) | |
if self.EndpointID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sEndpointID>%s</%sEndpointID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EndpointID), input_name='EndpointID')), namespaceprefix_ , eol_)) | |
for PartyIdentification_ in self.PartyIdentification: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPartyIdentification>%s</%sPartyIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PartyIdentification_), input_name='PartyIdentification')), namespaceprefix_ , eol_)) | |
for PartyName_ in self.PartyName: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPartyName>%s</%sPartyName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PartyName_), input_name='PartyName')), namespaceprefix_ , eol_)) | |
if self.Language is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLanguage>%s</%sLanguage>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Language), input_name='Language')), namespaceprefix_ , eol_)) | |
if self.PostalAddress is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPostalAddress>%s</%sPostalAddress>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PostalAddress), input_name='PostalAddress')), namespaceprefix_ , eol_)) | |
if self.PhysicalLocation is not None: | |
self.PhysicalLocation.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='PhysicalLocation', pretty_print=pretty_print) | |
for PartyTaxScheme_ in self.PartyTaxScheme: | |
PartyTaxScheme_.export(outfile, level, namespaceprefix_='tns:', name_='PartyTaxScheme', pretty_print=pretty_print) | |
for PartyLegalEntity_ in self.PartyLegalEntity: | |
PartyLegalEntity_.export(outfile, level, namespaceprefix_='tns:', name_='PartyLegalEntity', pretty_print=pretty_print) | |
if self.Contact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sContact>%s</%sContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Contact), input_name='Contact')), namespaceprefix_ , eol_)) | |
for Person_ in self.Person: | |
Person_.export(outfile, level, namespaceprefix_='tns:', name_='Person', pretty_print=pretty_print) | |
if self.AgentParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAgentParty>%s</%sAgentParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AgentParty), input_name='AgentParty')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'MarkCareIndicator': | |
MarkCareIndicator_ = child_.text | |
MarkCareIndicator_ = self.gds_validate_string(MarkCareIndicator_, node, 'MarkCareIndicator') | |
self.MarkCareIndicator = MarkCareIndicator_ | |
elif nodeName_ == 'MarkAttentionIndicator': | |
MarkAttentionIndicator_ = child_.text | |
MarkAttentionIndicator_ = self.gds_validate_string(MarkAttentionIndicator_, node, 'MarkAttentionIndicator') | |
self.MarkAttentionIndicator = MarkAttentionIndicator_ | |
elif nodeName_ == 'WebsiteURI': | |
WebsiteURI_ = child_.text | |
WebsiteURI_ = self.gds_validate_string(WebsiteURI_, node, 'WebsiteURI') | |
self.WebsiteURI = WebsiteURI_ | |
elif nodeName_ == 'LogoReferenceID': | |
LogoReferenceID_ = child_.text | |
LogoReferenceID_ = self.gds_validate_string(LogoReferenceID_, node, 'LogoReferenceID') | |
self.LogoReferenceID = LogoReferenceID_ | |
elif nodeName_ == 'EndpointID': | |
EndpointID_ = child_.text | |
EndpointID_ = self.gds_validate_string(EndpointID_, node, 'EndpointID') | |
self.EndpointID = EndpointID_ | |
elif nodeName_ == 'PartyIdentification': | |
PartyIdentification_ = child_.text | |
PartyIdentification_ = self.gds_validate_string(PartyIdentification_, node, 'PartyIdentification') | |
self.PartyIdentification.append(PartyIdentification_) | |
elif nodeName_ == 'PartyName': | |
PartyName_ = child_.text | |
PartyName_ = self.gds_validate_string(PartyName_, node, 'PartyName') | |
self.PartyName.append(PartyName_) | |
elif nodeName_ == 'Language': | |
Language_ = child_.text | |
Language_ = self.gds_validate_string(Language_, node, 'Language') | |
self.Language = Language_ | |
elif nodeName_ == 'PostalAddress': | |
PostalAddress_ = child_.text | |
PostalAddress_ = self.gds_validate_string(PostalAddress_, node, 'PostalAddress') | |
self.PostalAddress = PostalAddress_ | |
elif nodeName_ == 'PhysicalLocation': | |
obj_ = LocationType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.PhysicalLocation = obj_ | |
obj_.original_tagname_ = 'PhysicalLocation' | |
elif nodeName_ == 'PartyTaxScheme': | |
obj_ = PartyTaxSchemeType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.PartyTaxScheme.append(obj_) | |
obj_.original_tagname_ = 'PartyTaxScheme' | |
elif nodeName_ == 'PartyLegalEntity': | |
obj_ = PartyLegalEntityType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.PartyLegalEntity.append(obj_) | |
obj_.original_tagname_ = 'PartyLegalEntity' | |
elif nodeName_ == 'Contact': | |
Contact_ = child_.text | |
Contact_ = self.gds_validate_string(Contact_, node, 'Contact') | |
self.Contact = Contact_ | |
elif nodeName_ == 'Person': | |
obj_ = PersonType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Person.append(obj_) | |
obj_.original_tagname_ = 'Person' | |
elif nodeName_ == 'AgentParty': | |
AgentParty_ = child_.text | |
AgentParty_ = self.gds_validate_string(AgentParty_, node, 'AgentParty') | |
self.AgentParty = AgentParty_ | |
# end class PartyType | |
class LocationType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, Description=None, Conditions=None, CountrySubentity=None, CountrySubentityCode=None, ValidityPeriod=None, Address=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.Description = Description | |
self.Conditions = Conditions | |
self.CountrySubentity = CountrySubentity | |
self.CountrySubentityCode = CountrySubentityCode | |
if ValidityPeriod is None: | |
self.ValidityPeriod = [] | |
else: | |
self.ValidityPeriod = ValidityPeriod | |
self.Address = Address | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, LocationType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if LocationType.subclass: | |
return LocationType.subclass(*args_, **kwargs_) | |
else: | |
return LocationType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_Description(self): | |
return self.Description | |
def set_Description(self, Description): | |
self.Description = Description | |
def get_Conditions(self): | |
return self.Conditions | |
def set_Conditions(self, Conditions): | |
self.Conditions = Conditions | |
def get_CountrySubentity(self): | |
return self.CountrySubentity | |
def set_CountrySubentity(self, CountrySubentity): | |
self.CountrySubentity = CountrySubentity | |
def get_CountrySubentityCode(self): | |
return self.CountrySubentityCode | |
def set_CountrySubentityCode(self, CountrySubentityCode): | |
self.CountrySubentityCode = CountrySubentityCode | |
def get_ValidityPeriod(self): | |
return self.ValidityPeriod | |
def set_ValidityPeriod(self, ValidityPeriod): | |
self.ValidityPeriod = ValidityPeriod | |
def add_ValidityPeriod(self, value): | |
self.ValidityPeriod.append(value) | |
def add_ValidityPeriod(self, value): | |
self.ValidityPeriod.append(value) | |
def insert_ValidityPeriod_at(self, index, value): | |
self.ValidityPeriod.insert(index, value) | |
def replace_ValidityPeriod_at(self, index, value): | |
self.ValidityPeriod[index] = value | |
def get_Address(self): | |
return self.Address | |
def set_Address(self, Address): | |
self.Address = Address | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.Description is not None or | |
self.Conditions is not None or | |
self.CountrySubentity is not None or | |
self.CountrySubentityCode is not None or | |
self.ValidityPeriod or | |
self.Address is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='LocationType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('LocationType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='LocationType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='LocationType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='LocationType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='LocationType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.Description is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDescription>%s</%sDescription>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Description), input_name='Description')), namespaceprefix_ , eol_)) | |
if self.Conditions is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sConditions>%s</%sConditions>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Conditions), input_name='Conditions')), namespaceprefix_ , eol_)) | |
if self.CountrySubentity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCountrySubentity>%s</%sCountrySubentity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CountrySubentity), input_name='CountrySubentity')), namespaceprefix_ , eol_)) | |
if self.CountrySubentityCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCountrySubentityCode>%s</%sCountrySubentityCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CountrySubentityCode), input_name='CountrySubentityCode')), namespaceprefix_ , eol_)) | |
for ValidityPeriod_ in self.ValidityPeriod: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sValidityPeriod>%s</%sValidityPeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ValidityPeriod_), input_name='ValidityPeriod')), namespaceprefix_ , eol_)) | |
if self.Address is not None: | |
self.Address.export(outfile, level, namespaceprefix_='tns:', name_='Address', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'Description': | |
Description_ = child_.text | |
Description_ = self.gds_validate_string(Description_, node, 'Description') | |
self.Description = Description_ | |
elif nodeName_ == 'Conditions': | |
Conditions_ = child_.text | |
Conditions_ = self.gds_validate_string(Conditions_, node, 'Conditions') | |
self.Conditions = Conditions_ | |
elif nodeName_ == 'CountrySubentity': | |
CountrySubentity_ = child_.text | |
CountrySubentity_ = self.gds_validate_string(CountrySubentity_, node, 'CountrySubentity') | |
self.CountrySubentity = CountrySubentity_ | |
elif nodeName_ == 'CountrySubentityCode': | |
CountrySubentityCode_ = child_.text | |
CountrySubentityCode_ = self.gds_validate_string(CountrySubentityCode_, node, 'CountrySubentityCode') | |
self.CountrySubentityCode = CountrySubentityCode_ | |
elif nodeName_ == 'ValidityPeriod': | |
ValidityPeriod_ = child_.text | |
ValidityPeriod_ = self.gds_validate_string(ValidityPeriod_, node, 'ValidityPeriod') | |
self.ValidityPeriod.append(ValidityPeriod_) | |
elif nodeName_ == 'Address': | |
obj_ = AddressType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Address = obj_ | |
obj_.original_tagname_ = 'Address' | |
# end class LocationType | |
class AddressType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, AddressTypeCode=None, AddressFormatCode=None, Postbox=None, Floor=None, Room=None, StreetName=None, AdditionalStreetName=None, BlockName=None, BuildingName=None, BuildingNumber=None, InhouseMail=None, Department=None, MarkAttention=None, MarkCare=None, PlotIdentification=None, CitySubdivisionName=None, CityName=None, PostalZone=None, CountrySubentity=None, CountrySubentityCode=None, Region=None, District=None, TimezoneOffset=None, AddressLine=None, Country=None, LocationCoordinate=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.AddressTypeCode = AddressTypeCode | |
self.AddressFormatCode = AddressFormatCode | |
self.Postbox = Postbox | |
self.Floor = Floor | |
self.Room = Room | |
self.StreetName = StreetName | |
self.AdditionalStreetName = AdditionalStreetName | |
self.BlockName = BlockName | |
self.BuildingName = BuildingName | |
self.BuildingNumber = BuildingNumber | |
self.InhouseMail = InhouseMail | |
self.Department = Department | |
self.MarkAttention = MarkAttention | |
self.MarkCare = MarkCare | |
self.PlotIdentification = PlotIdentification | |
self.CitySubdivisionName = CitySubdivisionName | |
self.CityName = CityName | |
self.PostalZone = PostalZone | |
self.CountrySubentity = CountrySubentity | |
self.CountrySubentityCode = CountrySubentityCode | |
self.Region = Region | |
self.District = District | |
self.TimezoneOffset = TimezoneOffset | |
if AddressLine is None: | |
self.AddressLine = [] | |
else: | |
self.AddressLine = AddressLine | |
self.Country = Country | |
self.LocationCoordinate = LocationCoordinate | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, AddressType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if AddressType.subclass: | |
return AddressType.subclass(*args_, **kwargs_) | |
else: | |
return AddressType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_AddressTypeCode(self): | |
return self.AddressTypeCode | |
def set_AddressTypeCode(self, AddressTypeCode): | |
self.AddressTypeCode = AddressTypeCode | |
def get_AddressFormatCode(self): | |
return self.AddressFormatCode | |
def set_AddressFormatCode(self, AddressFormatCode): | |
self.AddressFormatCode = AddressFormatCode | |
def get_Postbox(self): | |
return self.Postbox | |
def set_Postbox(self, Postbox): | |
self.Postbox = Postbox | |
def get_Floor(self): | |
return self.Floor | |
def set_Floor(self, Floor): | |
self.Floor = Floor | |
def get_Room(self): | |
return self.Room | |
def set_Room(self, Room): | |
self.Room = Room | |
def get_StreetName(self): | |
return self.StreetName | |
def set_StreetName(self, StreetName): | |
self.StreetName = StreetName | |
def get_AdditionalStreetName(self): | |
return self.AdditionalStreetName | |
def set_AdditionalStreetName(self, AdditionalStreetName): | |
self.AdditionalStreetName = AdditionalStreetName | |
def get_BlockName(self): | |
return self.BlockName | |
def set_BlockName(self, BlockName): | |
self.BlockName = BlockName | |
def get_BuildingName(self): | |
return self.BuildingName | |
def set_BuildingName(self, BuildingName): | |
self.BuildingName = BuildingName | |
def get_BuildingNumber(self): | |
return self.BuildingNumber | |
def set_BuildingNumber(self, BuildingNumber): | |
self.BuildingNumber = BuildingNumber | |
def get_InhouseMail(self): | |
return self.InhouseMail | |
def set_InhouseMail(self, InhouseMail): | |
self.InhouseMail = InhouseMail | |
def get_Department(self): | |
return self.Department | |
def set_Department(self, Department): | |
self.Department = Department | |
def get_MarkAttention(self): | |
return self.MarkAttention | |
def set_MarkAttention(self, MarkAttention): | |
self.MarkAttention = MarkAttention | |
def get_MarkCare(self): | |
return self.MarkCare | |
def set_MarkCare(self, MarkCare): | |
self.MarkCare = MarkCare | |
def get_PlotIdentification(self): | |
return self.PlotIdentification | |
def set_PlotIdentification(self, PlotIdentification): | |
self.PlotIdentification = PlotIdentification | |
def get_CitySubdivisionName(self): | |
return self.CitySubdivisionName | |
def set_CitySubdivisionName(self, CitySubdivisionName): | |
self.CitySubdivisionName = CitySubdivisionName | |
def get_CityName(self): | |
return self.CityName | |
def set_CityName(self, CityName): | |
self.CityName = CityName | |
def get_PostalZone(self): | |
return self.PostalZone | |
def set_PostalZone(self, PostalZone): | |
self.PostalZone = PostalZone | |
def get_CountrySubentity(self): | |
return self.CountrySubentity | |
def set_CountrySubentity(self, CountrySubentity): | |
self.CountrySubentity = CountrySubentity | |
def get_CountrySubentityCode(self): | |
return self.CountrySubentityCode | |
def set_CountrySubentityCode(self, CountrySubentityCode): | |
self.CountrySubentityCode = CountrySubentityCode | |
def get_Region(self): | |
return self.Region | |
def set_Region(self, Region): | |
self.Region = Region | |
def get_District(self): | |
return self.District | |
def set_District(self, District): | |
self.District = District | |
def get_TimezoneOffset(self): | |
return self.TimezoneOffset | |
def set_TimezoneOffset(self, TimezoneOffset): | |
self.TimezoneOffset = TimezoneOffset | |
def get_AddressLine(self): | |
return self.AddressLine | |
def set_AddressLine(self, AddressLine): | |
self.AddressLine = AddressLine | |
def add_AddressLine(self, value): | |
self.AddressLine.append(value) | |
def add_AddressLine(self, value): | |
self.AddressLine.append(value) | |
def insert_AddressLine_at(self, index, value): | |
self.AddressLine.insert(index, value) | |
def replace_AddressLine_at(self, index, value): | |
self.AddressLine[index] = value | |
def get_Country(self): | |
return self.Country | |
def set_Country(self, Country): | |
self.Country = Country | |
def get_LocationCoordinate(self): | |
return self.LocationCoordinate | |
def set_LocationCoordinate(self, LocationCoordinate): | |
self.LocationCoordinate = LocationCoordinate | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.AddressTypeCode is not None or | |
self.AddressFormatCode is not None or | |
self.Postbox is not None or | |
self.Floor is not None or | |
self.Room is not None or | |
self.StreetName is not None or | |
self.AdditionalStreetName is not None or | |
self.BlockName is not None or | |
self.BuildingName is not None or | |
self.BuildingNumber is not None or | |
self.InhouseMail is not None or | |
self.Department is not None or | |
self.MarkAttention is not None or | |
self.MarkCare is not None or | |
self.PlotIdentification is not None or | |
self.CitySubdivisionName is not None or | |
self.CityName is not None or | |
self.PostalZone is not None or | |
self.CountrySubentity is not None or | |
self.CountrySubentityCode is not None or | |
self.Region is not None or | |
self.District is not None or | |
self.TimezoneOffset is not None or | |
self.AddressLine or | |
self.Country is not None or | |
self.LocationCoordinate is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='AddressType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('AddressType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='AddressType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='AddressType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='AddressType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='AddressType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.AddressTypeCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAddressTypeCode>%s</%sAddressTypeCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AddressTypeCode), input_name='AddressTypeCode')), namespaceprefix_ , eol_)) | |
if self.AddressFormatCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAddressFormatCode>%s</%sAddressFormatCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AddressFormatCode), input_name='AddressFormatCode')), namespaceprefix_ , eol_)) | |
if self.Postbox is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPostbox>%s</%sPostbox>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Postbox), input_name='Postbox')), namespaceprefix_ , eol_)) | |
if self.Floor is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sFloor>%s</%sFloor>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Floor), input_name='Floor')), namespaceprefix_ , eol_)) | |
if self.Room is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRoom>%s</%sRoom>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Room), input_name='Room')), namespaceprefix_ , eol_)) | |
if self.StreetName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sStreetName>%s</%sStreetName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.StreetName), input_name='StreetName')), namespaceprefix_ , eol_)) | |
if self.AdditionalStreetName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalStreetName>%s</%sAdditionalStreetName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AdditionalStreetName), input_name='AdditionalStreetName')), namespaceprefix_ , eol_)) | |
if self.BlockName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBlockName>%s</%sBlockName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BlockName), input_name='BlockName')), namespaceprefix_ , eol_)) | |
if self.BuildingName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBuildingName>%s</%sBuildingName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BuildingName), input_name='BuildingName')), namespaceprefix_ , eol_)) | |
if self.BuildingNumber is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBuildingNumber>%s</%sBuildingNumber>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BuildingNumber), input_name='BuildingNumber')), namespaceprefix_ , eol_)) | |
if self.InhouseMail is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInhouseMail>%s</%sInhouseMail>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InhouseMail), input_name='InhouseMail')), namespaceprefix_ , eol_)) | |
if self.Department is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDepartment>%s</%sDepartment>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Department), input_name='Department')), namespaceprefix_ , eol_)) | |
if self.MarkAttention is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMarkAttention>%s</%sMarkAttention>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MarkAttention), input_name='MarkAttention')), namespaceprefix_ , eol_)) | |
if self.MarkCare is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMarkCare>%s</%sMarkCare>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MarkCare), input_name='MarkCare')), namespaceprefix_ , eol_)) | |
if self.PlotIdentification is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPlotIdentification>%s</%sPlotIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PlotIdentification), input_name='PlotIdentification')), namespaceprefix_ , eol_)) | |
if self.CitySubdivisionName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCitySubdivisionName>%s</%sCitySubdivisionName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CitySubdivisionName), input_name='CitySubdivisionName')), namespaceprefix_ , eol_)) | |
if self.CityName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCityName>%s</%sCityName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CityName), input_name='CityName')), namespaceprefix_ , eol_)) | |
if self.PostalZone is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPostalZone>%s</%sPostalZone>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PostalZone), input_name='PostalZone')), namespaceprefix_ , eol_)) | |
if self.CountrySubentity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCountrySubentity>%s</%sCountrySubentity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CountrySubentity), input_name='CountrySubentity')), namespaceprefix_ , eol_)) | |
if self.CountrySubentityCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCountrySubentityCode>%s</%sCountrySubentityCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CountrySubentityCode), input_name='CountrySubentityCode')), namespaceprefix_ , eol_)) | |
if self.Region is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRegion>%s</%sRegion>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Region), input_name='Region')), namespaceprefix_ , eol_)) | |
if self.District is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDistrict>%s</%sDistrict>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.District), input_name='District')), namespaceprefix_ , eol_)) | |
if self.TimezoneOffset is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTimezoneOffset>%s</%sTimezoneOffset>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TimezoneOffset), input_name='TimezoneOffset')), namespaceprefix_ , eol_)) | |
for AddressLine_ in self.AddressLine: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAddressLine>%s</%sAddressLine>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(AddressLine_), input_name='AddressLine')), namespaceprefix_ , eol_)) | |
if self.Country is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCountry>%s</%sCountry>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Country), input_name='Country')), namespaceprefix_ , eol_)) | |
if self.LocationCoordinate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLocationCoordinate>%s</%sLocationCoordinate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LocationCoordinate), input_name='LocationCoordinate')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'AddressTypeCode': | |
AddressTypeCode_ = child_.text | |
AddressTypeCode_ = self.gds_validate_string(AddressTypeCode_, node, 'AddressTypeCode') | |
self.AddressTypeCode = AddressTypeCode_ | |
elif nodeName_ == 'AddressFormatCode': | |
AddressFormatCode_ = child_.text | |
AddressFormatCode_ = self.gds_validate_string(AddressFormatCode_, node, 'AddressFormatCode') | |
self.AddressFormatCode = AddressFormatCode_ | |
elif nodeName_ == 'Postbox': | |
Postbox_ = child_.text | |
Postbox_ = self.gds_validate_string(Postbox_, node, 'Postbox') | |
self.Postbox = Postbox_ | |
elif nodeName_ == 'Floor': | |
Floor_ = child_.text | |
Floor_ = self.gds_validate_string(Floor_, node, 'Floor') | |
self.Floor = Floor_ | |
elif nodeName_ == 'Room': | |
Room_ = child_.text | |
Room_ = self.gds_validate_string(Room_, node, 'Room') | |
self.Room = Room_ | |
elif nodeName_ == 'StreetName': | |
StreetName_ = child_.text | |
StreetName_ = self.gds_validate_string(StreetName_, node, 'StreetName') | |
self.StreetName = StreetName_ | |
elif nodeName_ == 'AdditionalStreetName': | |
AdditionalStreetName_ = child_.text | |
AdditionalStreetName_ = self.gds_validate_string(AdditionalStreetName_, node, 'AdditionalStreetName') | |
self.AdditionalStreetName = AdditionalStreetName_ | |
elif nodeName_ == 'BlockName': | |
BlockName_ = child_.text | |
BlockName_ = self.gds_validate_string(BlockName_, node, 'BlockName') | |
self.BlockName = BlockName_ | |
elif nodeName_ == 'BuildingName': | |
BuildingName_ = child_.text | |
BuildingName_ = self.gds_validate_string(BuildingName_, node, 'BuildingName') | |
self.BuildingName = BuildingName_ | |
elif nodeName_ == 'BuildingNumber': | |
BuildingNumber_ = child_.text | |
BuildingNumber_ = self.gds_validate_string(BuildingNumber_, node, 'BuildingNumber') | |
self.BuildingNumber = BuildingNumber_ | |
elif nodeName_ == 'InhouseMail': | |
InhouseMail_ = child_.text | |
InhouseMail_ = self.gds_validate_string(InhouseMail_, node, 'InhouseMail') | |
self.InhouseMail = InhouseMail_ | |
elif nodeName_ == 'Department': | |
Department_ = child_.text | |
Department_ = self.gds_validate_string(Department_, node, 'Department') | |
self.Department = Department_ | |
elif nodeName_ == 'MarkAttention': | |
MarkAttention_ = child_.text | |
MarkAttention_ = self.gds_validate_string(MarkAttention_, node, 'MarkAttention') | |
self.MarkAttention = MarkAttention_ | |
elif nodeName_ == 'MarkCare': | |
MarkCare_ = child_.text | |
MarkCare_ = self.gds_validate_string(MarkCare_, node, 'MarkCare') | |
self.MarkCare = MarkCare_ | |
elif nodeName_ == 'PlotIdentification': | |
PlotIdentification_ = child_.text | |
PlotIdentification_ = self.gds_validate_string(PlotIdentification_, node, 'PlotIdentification') | |
self.PlotIdentification = PlotIdentification_ | |
elif nodeName_ == 'CitySubdivisionName': | |
CitySubdivisionName_ = child_.text | |
CitySubdivisionName_ = self.gds_validate_string(CitySubdivisionName_, node, 'CitySubdivisionName') | |
self.CitySubdivisionName = CitySubdivisionName_ | |
elif nodeName_ == 'CityName': | |
CityName_ = child_.text | |
CityName_ = self.gds_validate_string(CityName_, node, 'CityName') | |
self.CityName = CityName_ | |
elif nodeName_ == 'PostalZone': | |
PostalZone_ = child_.text | |
PostalZone_ = self.gds_validate_string(PostalZone_, node, 'PostalZone') | |
self.PostalZone = PostalZone_ | |
elif nodeName_ == 'CountrySubentity': | |
CountrySubentity_ = child_.text | |
CountrySubentity_ = self.gds_validate_string(CountrySubentity_, node, 'CountrySubentity') | |
self.CountrySubentity = CountrySubentity_ | |
elif nodeName_ == 'CountrySubentityCode': | |
CountrySubentityCode_ = child_.text | |
CountrySubentityCode_ = self.gds_validate_string(CountrySubentityCode_, node, 'CountrySubentityCode') | |
self.CountrySubentityCode = CountrySubentityCode_ | |
elif nodeName_ == 'Region': | |
Region_ = child_.text | |
Region_ = self.gds_validate_string(Region_, node, 'Region') | |
self.Region = Region_ | |
elif nodeName_ == 'District': | |
District_ = child_.text | |
District_ = self.gds_validate_string(District_, node, 'District') | |
self.District = District_ | |
elif nodeName_ == 'TimezoneOffset': | |
TimezoneOffset_ = child_.text | |
TimezoneOffset_ = self.gds_validate_string(TimezoneOffset_, node, 'TimezoneOffset') | |
self.TimezoneOffset = TimezoneOffset_ | |
elif nodeName_ == 'AddressLine': | |
AddressLine_ = child_.text | |
AddressLine_ = self.gds_validate_string(AddressLine_, node, 'AddressLine') | |
self.AddressLine.append(AddressLine_) | |
elif nodeName_ == 'Country': | |
Country_ = child_.text | |
Country_ = self.gds_validate_string(Country_, node, 'Country') | |
self.Country = Country_ | |
elif nodeName_ == 'LocationCoordinate': | |
LocationCoordinate_ = child_.text | |
LocationCoordinate_ = self.gds_validate_string(LocationCoordinate_, node, 'LocationCoordinate') | |
self.LocationCoordinate = LocationCoordinate_ | |
# end class AddressType | |
class PartyTaxSchemeType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, RegistrationName=None, CompanyID=None, TaxLevelCode=None, ExemptionReasonCode=None, ExemptionReason=None, RegistrationAddress=None, TaxScheme=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.RegistrationName = RegistrationName | |
self.CompanyID = CompanyID | |
self.TaxLevelCode = TaxLevelCode | |
self.ExemptionReasonCode = ExemptionReasonCode | |
self.ExemptionReason = ExemptionReason | |
self.RegistrationAddress = RegistrationAddress | |
self.TaxScheme = TaxScheme | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, PartyTaxSchemeType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if PartyTaxSchemeType.subclass: | |
return PartyTaxSchemeType.subclass(*args_, **kwargs_) | |
else: | |
return PartyTaxSchemeType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_RegistrationName(self): | |
return self.RegistrationName | |
def set_RegistrationName(self, RegistrationName): | |
self.RegistrationName = RegistrationName | |
def get_CompanyID(self): | |
return self.CompanyID | |
def set_CompanyID(self, CompanyID): | |
self.CompanyID = CompanyID | |
def get_TaxLevelCode(self): | |
return self.TaxLevelCode | |
def set_TaxLevelCode(self, TaxLevelCode): | |
self.TaxLevelCode = TaxLevelCode | |
def get_ExemptionReasonCode(self): | |
return self.ExemptionReasonCode | |
def set_ExemptionReasonCode(self, ExemptionReasonCode): | |
self.ExemptionReasonCode = ExemptionReasonCode | |
def get_ExemptionReason(self): | |
return self.ExemptionReason | |
def set_ExemptionReason(self, ExemptionReason): | |
self.ExemptionReason = ExemptionReason | |
def get_RegistrationAddress(self): | |
return self.RegistrationAddress | |
def set_RegistrationAddress(self, RegistrationAddress): | |
self.RegistrationAddress = RegistrationAddress | |
def get_TaxScheme(self): | |
return self.TaxScheme | |
def set_TaxScheme(self, TaxScheme): | |
self.TaxScheme = TaxScheme | |
def hasContent_(self): | |
if ( | |
self.RegistrationName is not None or | |
self.CompanyID is not None or | |
self.TaxLevelCode is not None or | |
self.ExemptionReasonCode is not None or | |
self.ExemptionReason is not None or | |
self.RegistrationAddress is not None or | |
self.TaxScheme is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PartyTaxSchemeType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('PartyTaxSchemeType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PartyTaxSchemeType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PartyTaxSchemeType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='PartyTaxSchemeType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PartyTaxSchemeType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.RegistrationName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRegistrationName>%s</%sRegistrationName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RegistrationName), input_name='RegistrationName')), namespaceprefix_ , eol_)) | |
if self.CompanyID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCompanyID>%s</%sCompanyID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CompanyID), input_name='CompanyID')), namespaceprefix_ , eol_)) | |
if self.TaxLevelCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxLevelCode>%s</%sTaxLevelCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxLevelCode), input_name='TaxLevelCode')), namespaceprefix_ , eol_)) | |
if self.ExemptionReasonCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sExemptionReasonCode>%s</%sExemptionReasonCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ExemptionReasonCode), input_name='ExemptionReasonCode')), namespaceprefix_ , eol_)) | |
if self.ExemptionReason is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sExemptionReason>%s</%sExemptionReason>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ExemptionReason), input_name='ExemptionReason')), namespaceprefix_ , eol_)) | |
if self.RegistrationAddress is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRegistrationAddress>%s</%sRegistrationAddress>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RegistrationAddress), input_name='RegistrationAddress')), namespaceprefix_ , eol_)) | |
if self.TaxScheme is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxScheme>%s</%sTaxScheme>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxScheme), input_name='TaxScheme')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'RegistrationName': | |
RegistrationName_ = child_.text | |
RegistrationName_ = self.gds_validate_string(RegistrationName_, node, 'RegistrationName') | |
self.RegistrationName = RegistrationName_ | |
elif nodeName_ == 'CompanyID': | |
CompanyID_ = child_.text | |
CompanyID_ = self.gds_validate_string(CompanyID_, node, 'CompanyID') | |
self.CompanyID = CompanyID_ | |
elif nodeName_ == 'TaxLevelCode': | |
TaxLevelCode_ = child_.text | |
TaxLevelCode_ = self.gds_validate_string(TaxLevelCode_, node, 'TaxLevelCode') | |
self.TaxLevelCode = TaxLevelCode_ | |
elif nodeName_ == 'ExemptionReasonCode': | |
ExemptionReasonCode_ = child_.text | |
ExemptionReasonCode_ = self.gds_validate_string(ExemptionReasonCode_, node, 'ExemptionReasonCode') | |
self.ExemptionReasonCode = ExemptionReasonCode_ | |
elif nodeName_ == 'ExemptionReason': | |
ExemptionReason_ = child_.text | |
ExemptionReason_ = self.gds_validate_string(ExemptionReason_, node, 'ExemptionReason') | |
self.ExemptionReason = ExemptionReason_ | |
elif nodeName_ == 'RegistrationAddress': | |
RegistrationAddress_ = child_.text | |
RegistrationAddress_ = self.gds_validate_string(RegistrationAddress_, node, 'RegistrationAddress') | |
self.RegistrationAddress = RegistrationAddress_ | |
elif nodeName_ == 'TaxScheme': | |
TaxScheme_ = child_.text | |
TaxScheme_ = self.gds_validate_string(TaxScheme_, node, 'TaxScheme') | |
self.TaxScheme = TaxScheme_ | |
# end class PartyTaxSchemeType | |
class PartyLegalEntityType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, RegistrationName=None, CompanyID=None, RegistrationAddress=None, CorporateRegistrationScheme=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.RegistrationName = RegistrationName | |
self.CompanyID = CompanyID | |
self.RegistrationAddress = RegistrationAddress | |
self.CorporateRegistrationScheme = CorporateRegistrationScheme | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, PartyLegalEntityType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if PartyLegalEntityType.subclass: | |
return PartyLegalEntityType.subclass(*args_, **kwargs_) | |
else: | |
return PartyLegalEntityType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_RegistrationName(self): | |
return self.RegistrationName | |
def set_RegistrationName(self, RegistrationName): | |
self.RegistrationName = RegistrationName | |
def get_CompanyID(self): | |
return self.CompanyID | |
def set_CompanyID(self, CompanyID): | |
self.CompanyID = CompanyID | |
def get_RegistrationAddress(self): | |
return self.RegistrationAddress | |
def set_RegistrationAddress(self, RegistrationAddress): | |
self.RegistrationAddress = RegistrationAddress | |
def get_CorporateRegistrationScheme(self): | |
return self.CorporateRegistrationScheme | |
def set_CorporateRegistrationScheme(self, CorporateRegistrationScheme): | |
self.CorporateRegistrationScheme = CorporateRegistrationScheme | |
def hasContent_(self): | |
if ( | |
self.RegistrationName is not None or | |
self.CompanyID is not None or | |
self.RegistrationAddress is not None or | |
self.CorporateRegistrationScheme is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PartyLegalEntityType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('PartyLegalEntityType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PartyLegalEntityType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PartyLegalEntityType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='PartyLegalEntityType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PartyLegalEntityType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.RegistrationName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRegistrationName>%s</%sRegistrationName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RegistrationName), input_name='RegistrationName')), namespaceprefix_ , eol_)) | |
if self.CompanyID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCompanyID>%s</%sCompanyID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CompanyID), input_name='CompanyID')), namespaceprefix_ , eol_)) | |
if self.RegistrationAddress is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRegistrationAddress>%s</%sRegistrationAddress>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RegistrationAddress), input_name='RegistrationAddress')), namespaceprefix_ , eol_)) | |
if self.CorporateRegistrationScheme is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCorporateRegistrationScheme>%s</%sCorporateRegistrationScheme>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CorporateRegistrationScheme), input_name='CorporateRegistrationScheme')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'RegistrationName': | |
RegistrationName_ = child_.text | |
RegistrationName_ = self.gds_validate_string(RegistrationName_, node, 'RegistrationName') | |
self.RegistrationName = RegistrationName_ | |
elif nodeName_ == 'CompanyID': | |
CompanyID_ = child_.text | |
CompanyID_ = self.gds_validate_string(CompanyID_, node, 'CompanyID') | |
self.CompanyID = CompanyID_ | |
elif nodeName_ == 'RegistrationAddress': | |
RegistrationAddress_ = child_.text | |
RegistrationAddress_ = self.gds_validate_string(RegistrationAddress_, node, 'RegistrationAddress') | |
self.RegistrationAddress = RegistrationAddress_ | |
elif nodeName_ == 'CorporateRegistrationScheme': | |
CorporateRegistrationScheme_ = child_.text | |
CorporateRegistrationScheme_ = self.gds_validate_string(CorporateRegistrationScheme_, node, 'CorporateRegistrationScheme') | |
self.CorporateRegistrationScheme = CorporateRegistrationScheme_ | |
# end class PartyLegalEntityType | |
class PersonType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, FirstName=None, FamilyName=None, Title=None, MiddleName=None, NameSuffix=None, JobTitle=None, OrganizationDepartment=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.FirstName = FirstName | |
self.FamilyName = FamilyName | |
self.Title = Title | |
self.MiddleName = MiddleName | |
self.NameSuffix = NameSuffix | |
self.JobTitle = JobTitle | |
self.OrganizationDepartment = OrganizationDepartment | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, PersonType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if PersonType.subclass: | |
return PersonType.subclass(*args_, **kwargs_) | |
else: | |
return PersonType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_FirstName(self): | |
return self.FirstName | |
def set_FirstName(self, FirstName): | |
self.FirstName = FirstName | |
def get_FamilyName(self): | |
return self.FamilyName | |
def set_FamilyName(self, FamilyName): | |
self.FamilyName = FamilyName | |
def get_Title(self): | |
return self.Title | |
def set_Title(self, Title): | |
self.Title = Title | |
def get_MiddleName(self): | |
return self.MiddleName | |
def set_MiddleName(self, MiddleName): | |
self.MiddleName = MiddleName | |
def get_NameSuffix(self): | |
return self.NameSuffix | |
def set_NameSuffix(self, NameSuffix): | |
self.NameSuffix = NameSuffix | |
def get_JobTitle(self): | |
return self.JobTitle | |
def set_JobTitle(self, JobTitle): | |
self.JobTitle = JobTitle | |
def get_OrganizationDepartment(self): | |
return self.OrganizationDepartment | |
def set_OrganizationDepartment(self, OrganizationDepartment): | |
self.OrganizationDepartment = OrganizationDepartment | |
def hasContent_(self): | |
if ( | |
self.FirstName is not None or | |
self.FamilyName is not None or | |
self.Title is not None or | |
self.MiddleName is not None or | |
self.NameSuffix is not None or | |
self.JobTitle is not None or | |
self.OrganizationDepartment is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='PersonType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('PersonType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PersonType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PersonType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='PersonType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='PersonType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.FirstName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sFirstName>%s</%sFirstName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FirstName), input_name='FirstName')), namespaceprefix_ , eol_)) | |
if self.FamilyName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sFamilyName>%s</%sFamilyName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FamilyName), input_name='FamilyName')), namespaceprefix_ , eol_)) | |
if self.Title is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTitle>%s</%sTitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Title), input_name='Title')), namespaceprefix_ , eol_)) | |
if self.MiddleName is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMiddleName>%s</%sMiddleName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MiddleName), input_name='MiddleName')), namespaceprefix_ , eol_)) | |
if self.NameSuffix is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sNameSuffix>%s</%sNameSuffix>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.NameSuffix), input_name='NameSuffix')), namespaceprefix_ , eol_)) | |
if self.JobTitle is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sJobTitle>%s</%sJobTitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.JobTitle), input_name='JobTitle')), namespaceprefix_ , eol_)) | |
if self.OrganizationDepartment is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOrganizationDepartment>%s</%sOrganizationDepartment>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.OrganizationDepartment), input_name='OrganizationDepartment')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'FirstName': | |
FirstName_ = child_.text | |
FirstName_ = self.gds_validate_string(FirstName_, node, 'FirstName') | |
self.FirstName = FirstName_ | |
elif nodeName_ == 'FamilyName': | |
FamilyName_ = child_.text | |
FamilyName_ = self.gds_validate_string(FamilyName_, node, 'FamilyName') | |
self.FamilyName = FamilyName_ | |
elif nodeName_ == 'Title': | |
Title_ = child_.text | |
Title_ = self.gds_validate_string(Title_, node, 'Title') | |
self.Title = Title_ | |
elif nodeName_ == 'MiddleName': | |
MiddleName_ = child_.text | |
MiddleName_ = self.gds_validate_string(MiddleName_, node, 'MiddleName') | |
self.MiddleName = MiddleName_ | |
elif nodeName_ == 'NameSuffix': | |
NameSuffix_ = child_.text | |
NameSuffix_ = self.gds_validate_string(NameSuffix_, node, 'NameSuffix') | |
self.NameSuffix = NameSuffix_ | |
elif nodeName_ == 'JobTitle': | |
JobTitle_ = child_.text | |
JobTitle_ = self.gds_validate_string(JobTitle_, node, 'JobTitle') | |
self.JobTitle = JobTitle_ | |
elif nodeName_ == 'OrganizationDepartment': | |
OrganizationDepartment_ = child_.text | |
OrganizationDepartment_ = self.gds_validate_string(OrganizationDepartment_, node, 'OrganizationDepartment') | |
self.OrganizationDepartment = OrganizationDepartment_ | |
# end class PersonType | |
class AllowanceChargeType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, ChargeIndicator=None, AllowanceChargeReasonCode=None, AllowanceChargeReason=None, MultiplierFactorNumeric=None, PrepaidIndicator=None, SequenceNumeric=None, Amount=None, BaseAmount=None, AccountingCostCode=None, AccountingCost=None, TaxCategory=None, TaxTotal=None, PaymentMeans=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.ChargeIndicator = ChargeIndicator | |
self.AllowanceChargeReasonCode = AllowanceChargeReasonCode | |
self.AllowanceChargeReason = AllowanceChargeReason | |
self.MultiplierFactorNumeric = MultiplierFactorNumeric | |
self.PrepaidIndicator = PrepaidIndicator | |
self.SequenceNumeric = SequenceNumeric | |
self.Amount = Amount | |
self.BaseAmount = BaseAmount | |
self.AccountingCostCode = AccountingCostCode | |
self.AccountingCost = AccountingCost | |
if TaxCategory is None: | |
self.TaxCategory = [] | |
else: | |
self.TaxCategory = TaxCategory | |
self.TaxTotal = TaxTotal | |
if PaymentMeans is None: | |
self.PaymentMeans = [] | |
else: | |
self.PaymentMeans = PaymentMeans | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, AllowanceChargeType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if AllowanceChargeType.subclass: | |
return AllowanceChargeType.subclass(*args_, **kwargs_) | |
else: | |
return AllowanceChargeType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_ChargeIndicator(self): | |
return self.ChargeIndicator | |
def set_ChargeIndicator(self, ChargeIndicator): | |
self.ChargeIndicator = ChargeIndicator | |
def get_AllowanceChargeReasonCode(self): | |
return self.AllowanceChargeReasonCode | |
def set_AllowanceChargeReasonCode(self, AllowanceChargeReasonCode): | |
self.AllowanceChargeReasonCode = AllowanceChargeReasonCode | |
def get_AllowanceChargeReason(self): | |
return self.AllowanceChargeReason | |
def set_AllowanceChargeReason(self, AllowanceChargeReason): | |
self.AllowanceChargeReason = AllowanceChargeReason | |
def get_MultiplierFactorNumeric(self): | |
return self.MultiplierFactorNumeric | |
def set_MultiplierFactorNumeric(self, MultiplierFactorNumeric): | |
self.MultiplierFactorNumeric = MultiplierFactorNumeric | |
def get_PrepaidIndicator(self): | |
return self.PrepaidIndicator | |
def set_PrepaidIndicator(self, PrepaidIndicator): | |
self.PrepaidIndicator = PrepaidIndicator | |
def get_SequenceNumeric(self): | |
return self.SequenceNumeric | |
def set_SequenceNumeric(self, SequenceNumeric): | |
self.SequenceNumeric = SequenceNumeric | |
def get_Amount(self): | |
return self.Amount | |
def set_Amount(self, Amount): | |
self.Amount = Amount | |
def get_BaseAmount(self): | |
return self.BaseAmount | |
def set_BaseAmount(self, BaseAmount): | |
self.BaseAmount = BaseAmount | |
def get_AccountingCostCode(self): | |
return self.AccountingCostCode | |
def set_AccountingCostCode(self, AccountingCostCode): | |
self.AccountingCostCode = AccountingCostCode | |
def get_AccountingCost(self): | |
return self.AccountingCost | |
def set_AccountingCost(self, AccountingCost): | |
self.AccountingCost = AccountingCost | |
def get_TaxCategory(self): | |
return self.TaxCategory | |
def set_TaxCategory(self, TaxCategory): | |
self.TaxCategory = TaxCategory | |
def add_TaxCategory(self, value): | |
self.TaxCategory.append(value) | |
def add_TaxCategory(self, value): | |
self.TaxCategory.append(value) | |
def insert_TaxCategory_at(self, index, value): | |
self.TaxCategory.insert(index, value) | |
def replace_TaxCategory_at(self, index, value): | |
self.TaxCategory[index] = value | |
def get_TaxTotal(self): | |
return self.TaxTotal | |
def set_TaxTotal(self, TaxTotal): | |
self.TaxTotal = TaxTotal | |
def get_PaymentMeans(self): | |
return self.PaymentMeans | |
def set_PaymentMeans(self, PaymentMeans): | |
self.PaymentMeans = PaymentMeans | |
def add_PaymentMeans(self, value): | |
self.PaymentMeans.append(value) | |
def add_PaymentMeans(self, value): | |
self.PaymentMeans.append(value) | |
def insert_PaymentMeans_at(self, index, value): | |
self.PaymentMeans.insert(index, value) | |
def replace_PaymentMeans_at(self, index, value): | |
self.PaymentMeans[index] = value | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.ChargeIndicator is not None or | |
self.AllowanceChargeReasonCode is not None or | |
self.AllowanceChargeReason is not None or | |
self.MultiplierFactorNumeric is not None or | |
self.PrepaidIndicator is not None or | |
self.SequenceNumeric is not None or | |
self.Amount is not None or | |
self.BaseAmount is not None or | |
self.AccountingCostCode is not None or | |
self.AccountingCost is not None or | |
self.TaxCategory or | |
self.TaxTotal is not None or | |
self.PaymentMeans | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='AllowanceChargeType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('AllowanceChargeType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='AllowanceChargeType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='AllowanceChargeType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='AllowanceChargeType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='AllowanceChargeType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.ChargeIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sChargeIndicator>%s</%sChargeIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ChargeIndicator), input_name='ChargeIndicator')), namespaceprefix_ , eol_)) | |
if self.AllowanceChargeReasonCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAllowanceChargeReasonCode>%s</%sAllowanceChargeReasonCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AllowanceChargeReasonCode), input_name='AllowanceChargeReasonCode')), namespaceprefix_ , eol_)) | |
if self.AllowanceChargeReason is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAllowanceChargeReason>%s</%sAllowanceChargeReason>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AllowanceChargeReason), input_name='AllowanceChargeReason')), namespaceprefix_ , eol_)) | |
if self.MultiplierFactorNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMultiplierFactorNumeric>%s</%sMultiplierFactorNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MultiplierFactorNumeric), input_name='MultiplierFactorNumeric')), namespaceprefix_ , eol_)) | |
if self.PrepaidIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPrepaidIndicator>%s</%sPrepaidIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PrepaidIndicator), input_name='PrepaidIndicator')), namespaceprefix_ , eol_)) | |
if self.SequenceNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sSequenceNumeric>%s</%sSequenceNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SequenceNumeric), input_name='SequenceNumeric')), namespaceprefix_ , eol_)) | |
if self.Amount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAmount>%s</%sAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Amount), input_name='Amount')), namespaceprefix_ , eol_)) | |
if self.BaseAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBaseAmount>%s</%sBaseAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BaseAmount), input_name='BaseAmount')), namespaceprefix_ , eol_)) | |
if self.AccountingCostCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCostCode>%s</%sAccountingCostCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCostCode), input_name='AccountingCostCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCost is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCost>%s</%sAccountingCost>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCost), input_name='AccountingCost')), namespaceprefix_ , eol_)) | |
for TaxCategory_ in self.TaxCategory: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxCategory>%s</%sTaxCategory>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(TaxCategory_), input_name='TaxCategory')), namespaceprefix_ , eol_)) | |
if self.TaxTotal is not None: | |
self.TaxTotal.export(outfile, level, namespaceprefix_='cac:', name_='TaxTotal', pretty_print=pretty_print) | |
for PaymentMeans_ in self.PaymentMeans: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentMeans>%s</%sPaymentMeans>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PaymentMeans_), input_name='PaymentMeans')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'ChargeIndicator': | |
ChargeIndicator_ = child_.text | |
ChargeIndicator_ = self.gds_validate_string(ChargeIndicator_, node, 'ChargeIndicator') | |
self.ChargeIndicator = ChargeIndicator_ | |
elif nodeName_ == 'AllowanceChargeReasonCode': | |
AllowanceChargeReasonCode_ = child_.text | |
AllowanceChargeReasonCode_ = self.gds_validate_string(AllowanceChargeReasonCode_, node, 'AllowanceChargeReasonCode') | |
self.AllowanceChargeReasonCode = AllowanceChargeReasonCode_ | |
elif nodeName_ == 'AllowanceChargeReason': | |
AllowanceChargeReason_ = child_.text | |
AllowanceChargeReason_ = self.gds_validate_string(AllowanceChargeReason_, node, 'AllowanceChargeReason') | |
self.AllowanceChargeReason = AllowanceChargeReason_ | |
elif nodeName_ == 'MultiplierFactorNumeric': | |
MultiplierFactorNumeric_ = child_.text | |
MultiplierFactorNumeric_ = self.gds_validate_string(MultiplierFactorNumeric_, node, 'MultiplierFactorNumeric') | |
self.MultiplierFactorNumeric = MultiplierFactorNumeric_ | |
elif nodeName_ == 'PrepaidIndicator': | |
PrepaidIndicator_ = child_.text | |
PrepaidIndicator_ = self.gds_validate_string(PrepaidIndicator_, node, 'PrepaidIndicator') | |
self.PrepaidIndicator = PrepaidIndicator_ | |
elif nodeName_ == 'SequenceNumeric': | |
SequenceNumeric_ = child_.text | |
SequenceNumeric_ = self.gds_validate_string(SequenceNumeric_, node, 'SequenceNumeric') | |
self.SequenceNumeric = SequenceNumeric_ | |
elif nodeName_ == 'Amount': | |
Amount_ = child_.text | |
Amount_ = self.gds_validate_string(Amount_, node, 'Amount') | |
self.Amount = Amount_ | |
elif nodeName_ == 'BaseAmount': | |
BaseAmount_ = child_.text | |
BaseAmount_ = self.gds_validate_string(BaseAmount_, node, 'BaseAmount') | |
self.BaseAmount = BaseAmount_ | |
elif nodeName_ == 'AccountingCostCode': | |
AccountingCostCode_ = child_.text | |
AccountingCostCode_ = self.gds_validate_string(AccountingCostCode_, node, 'AccountingCostCode') | |
self.AccountingCostCode = AccountingCostCode_ | |
elif nodeName_ == 'AccountingCost': | |
AccountingCost_ = child_.text | |
AccountingCost_ = self.gds_validate_string(AccountingCost_, node, 'AccountingCost') | |
self.AccountingCost = AccountingCost_ | |
elif nodeName_ == 'TaxCategory': | |
TaxCategory_ = child_.text | |
TaxCategory_ = self.gds_validate_string(TaxCategory_, node, 'TaxCategory') | |
self.TaxCategory.append(TaxCategory_) | |
elif nodeName_ == 'TaxTotal': | |
obj_ = TaxTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.TaxTotal = obj_ | |
obj_.original_tagname_ = 'TaxTotal' | |
elif nodeName_ == 'PaymentMeans': | |
PaymentMeans_ = child_.text | |
PaymentMeans_ = self.gds_validate_string(PaymentMeans_, node, 'PaymentMeans') | |
self.PaymentMeans.append(PaymentMeans_) | |
# end class AllowanceChargeType | |
class PaymentType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, PaidAmount=None, ReceivedDate=None, PaidDate=None, PaidTime=None, InstructionID=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.PaidAmount = PaidAmount | |
self.ReceivedDate = ReceivedDate | |
self.PaidDate = PaidDate | |
self.PaidTime = PaidTime | |
self.InstructionID = InstructionID | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, PaymentType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if PaymentType.subclass: | |
return PaymentType.subclass(*args_, **kwargs_) | |
else: | |
return PaymentType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_PaidAmount(self): | |
return self.PaidAmount | |
def set_PaidAmount(self, PaidAmount): | |
self.PaidAmount = PaidAmount | |
def get_ReceivedDate(self): | |
return self.ReceivedDate | |
def set_ReceivedDate(self, ReceivedDate): | |
self.ReceivedDate = ReceivedDate | |
def get_PaidDate(self): | |
return self.PaidDate | |
def set_PaidDate(self, PaidDate): | |
self.PaidDate = PaidDate | |
def get_PaidTime(self): | |
return self.PaidTime | |
def set_PaidTime(self, PaidTime): | |
self.PaidTime = PaidTime | |
def get_InstructionID(self): | |
return self.InstructionID | |
def set_InstructionID(self, InstructionID): | |
self.InstructionID = InstructionID | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.PaidAmount is not None or | |
self.ReceivedDate is not None or | |
self.PaidDate is not None or | |
self.PaidTime is not None or | |
self.InstructionID is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='PaymentType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('PaymentType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PaymentType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PaymentType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='PaymentType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='PaymentType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.PaidAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaidAmount>%s</%sPaidAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaidAmount), input_name='PaidAmount')), namespaceprefix_ , eol_)) | |
if self.ReceivedDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sReceivedDate>%s</%sReceivedDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ReceivedDate), input_name='ReceivedDate')), namespaceprefix_ , eol_)) | |
if self.PaidDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaidDate>%s</%sPaidDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaidDate), input_name='PaidDate')), namespaceprefix_ , eol_)) | |
if self.PaidTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaidTime>%s</%sPaidTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PaidTime), input_name='PaidTime')), namespaceprefix_ , eol_)) | |
if self.InstructionID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInstructionID>%s</%sInstructionID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InstructionID), input_name='InstructionID')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'PaidAmount': | |
PaidAmount_ = child_.text | |
PaidAmount_ = self.gds_validate_string(PaidAmount_, node, 'PaidAmount') | |
self.PaidAmount = PaidAmount_ | |
elif nodeName_ == 'ReceivedDate': | |
ReceivedDate_ = child_.text | |
ReceivedDate_ = self.gds_validate_string(ReceivedDate_, node, 'ReceivedDate') | |
self.ReceivedDate = ReceivedDate_ | |
elif nodeName_ == 'PaidDate': | |
PaidDate_ = child_.text | |
PaidDate_ = self.gds_validate_string(PaidDate_, node, 'PaidDate') | |
self.PaidDate = PaidDate_ | |
elif nodeName_ == 'PaidTime': | |
PaidTime_ = child_.text | |
PaidTime_ = self.gds_validate_string(PaidTime_, node, 'PaidTime') | |
self.PaidTime = PaidTime_ | |
elif nodeName_ == 'InstructionID': | |
InstructionID_ = child_.text | |
InstructionID_ = self.gds_validate_string(InstructionID_, node, 'InstructionID') | |
self.InstructionID = InstructionID_ | |
# end class PaymentType | |
class TaxTotalType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, TaxAmount=None, RoundingAmount=None, TaxEvidenceIndicator=None, TaxSubtotal=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.TaxAmount = TaxAmount | |
self.RoundingAmount = RoundingAmount | |
self.TaxEvidenceIndicator = TaxEvidenceIndicator | |
if TaxSubtotal is None: | |
self.TaxSubtotal = [] | |
else: | |
self.TaxSubtotal = TaxSubtotal | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, TaxTotalType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if TaxTotalType.subclass: | |
return TaxTotalType.subclass(*args_, **kwargs_) | |
else: | |
return TaxTotalType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_TaxAmount(self): | |
return self.TaxAmount | |
def set_TaxAmount(self, TaxAmount): | |
self.TaxAmount = TaxAmount | |
def get_RoundingAmount(self): | |
return self.RoundingAmount | |
def set_RoundingAmount(self, RoundingAmount): | |
self.RoundingAmount = RoundingAmount | |
def get_TaxEvidenceIndicator(self): | |
return self.TaxEvidenceIndicator | |
def set_TaxEvidenceIndicator(self, TaxEvidenceIndicator): | |
self.TaxEvidenceIndicator = TaxEvidenceIndicator | |
def get_TaxSubtotal(self): | |
return self.TaxSubtotal | |
def set_TaxSubtotal(self, TaxSubtotal): | |
self.TaxSubtotal = TaxSubtotal | |
def add_TaxSubtotal(self, value): | |
self.TaxSubtotal.append(value) | |
def add_TaxSubtotal(self, value): | |
self.TaxSubtotal.append(value) | |
def insert_TaxSubtotal_at(self, index, value): | |
self.TaxSubtotal.insert(index, value) | |
def replace_TaxSubtotal_at(self, index, value): | |
self.TaxSubtotal[index] = value | |
def hasContent_(self): | |
if ( | |
self.TaxAmount is not None or | |
self.RoundingAmount is not None or | |
self.TaxEvidenceIndicator is not None or | |
self.TaxSubtotal | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='TaxTotalType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('TaxTotalType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='TaxTotalType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='TaxTotalType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='TaxTotalType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='TaxTotalType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.TaxAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxAmount>%s</%sTaxAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxAmount), input_name='TaxAmount')), namespaceprefix_ , eol_)) | |
if self.RoundingAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRoundingAmount>%s</%sRoundingAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RoundingAmount), input_name='RoundingAmount')), namespaceprefix_ , eol_)) | |
if self.TaxEvidenceIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxEvidenceIndicator>%s</%sTaxEvidenceIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxEvidenceIndicator), input_name='TaxEvidenceIndicator')), namespaceprefix_ , eol_)) | |
for TaxSubtotal_ in self.TaxSubtotal: | |
TaxSubtotal_.export(outfile, level, namespaceprefix_='tns:', name_='TaxSubtotal', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'TaxAmount': | |
TaxAmount_ = child_.text | |
TaxAmount_ = self.gds_validate_string(TaxAmount_, node, 'TaxAmount') | |
self.TaxAmount = TaxAmount_ | |
elif nodeName_ == 'RoundingAmount': | |
RoundingAmount_ = child_.text | |
RoundingAmount_ = self.gds_validate_string(RoundingAmount_, node, 'RoundingAmount') | |
self.RoundingAmount = RoundingAmount_ | |
elif nodeName_ == 'TaxEvidenceIndicator': | |
TaxEvidenceIndicator_ = child_.text | |
TaxEvidenceIndicator_ = self.gds_validate_string(TaxEvidenceIndicator_, node, 'TaxEvidenceIndicator') | |
self.TaxEvidenceIndicator = TaxEvidenceIndicator_ | |
elif nodeName_ == 'TaxSubtotal': | |
obj_ = TaxSubtotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.TaxSubtotal.append(obj_) | |
obj_.original_tagname_ = 'TaxSubtotal' | |
# end class TaxTotalType | |
class TaxSubtotalType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, TaxableAmount=None, TaxAmount=None, CalculationSequenceNumeric=None, TransactionCurrencyTaxAmount=None, Percent=None, BaseUnitMeasure=None, PerUnitAmount=None, TierRange=None, TierRatePercent=None, TaxCategory=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.TaxableAmount = TaxableAmount | |
self.TaxAmount = TaxAmount | |
self.CalculationSequenceNumeric = CalculationSequenceNumeric | |
self.TransactionCurrencyTaxAmount = TransactionCurrencyTaxAmount | |
self.Percent = Percent | |
self.BaseUnitMeasure = BaseUnitMeasure | |
self.PerUnitAmount = PerUnitAmount | |
self.TierRange = TierRange | |
self.TierRatePercent = TierRatePercent | |
self.TaxCategory = TaxCategory | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, TaxSubtotalType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if TaxSubtotalType.subclass: | |
return TaxSubtotalType.subclass(*args_, **kwargs_) | |
else: | |
return TaxSubtotalType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_TaxableAmount(self): | |
return self.TaxableAmount | |
def set_TaxableAmount(self, TaxableAmount): | |
self.TaxableAmount = TaxableAmount | |
def get_TaxAmount(self): | |
return self.TaxAmount | |
def set_TaxAmount(self, TaxAmount): | |
self.TaxAmount = TaxAmount | |
def get_CalculationSequenceNumeric(self): | |
return self.CalculationSequenceNumeric | |
def set_CalculationSequenceNumeric(self, CalculationSequenceNumeric): | |
self.CalculationSequenceNumeric = CalculationSequenceNumeric | |
def get_TransactionCurrencyTaxAmount(self): | |
return self.TransactionCurrencyTaxAmount | |
def set_TransactionCurrencyTaxAmount(self, TransactionCurrencyTaxAmount): | |
self.TransactionCurrencyTaxAmount = TransactionCurrencyTaxAmount | |
def get_Percent(self): | |
return self.Percent | |
def set_Percent(self, Percent): | |
self.Percent = Percent | |
def get_BaseUnitMeasure(self): | |
return self.BaseUnitMeasure | |
def set_BaseUnitMeasure(self, BaseUnitMeasure): | |
self.BaseUnitMeasure = BaseUnitMeasure | |
def get_PerUnitAmount(self): | |
return self.PerUnitAmount | |
def set_PerUnitAmount(self, PerUnitAmount): | |
self.PerUnitAmount = PerUnitAmount | |
def get_TierRange(self): | |
return self.TierRange | |
def set_TierRange(self, TierRange): | |
self.TierRange = TierRange | |
def get_TierRatePercent(self): | |
return self.TierRatePercent | |
def set_TierRatePercent(self, TierRatePercent): | |
self.TierRatePercent = TierRatePercent | |
def get_TaxCategory(self): | |
return self.TaxCategory | |
def set_TaxCategory(self, TaxCategory): | |
self.TaxCategory = TaxCategory | |
def hasContent_(self): | |
if ( | |
self.TaxableAmount is not None or | |
self.TaxAmount is not None or | |
self.CalculationSequenceNumeric is not None or | |
self.TransactionCurrencyTaxAmount is not None or | |
self.Percent is not None or | |
self.BaseUnitMeasure is not None or | |
self.PerUnitAmount is not None or | |
self.TierRange is not None or | |
self.TierRatePercent is not None or | |
self.TaxCategory is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='TaxSubtotalType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('TaxSubtotalType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='TaxSubtotalType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='TaxSubtotalType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='TaxSubtotalType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='TaxSubtotalType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.TaxableAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxableAmount>%s</%sTaxableAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxableAmount), input_name='TaxableAmount')), namespaceprefix_ , eol_)) | |
if self.TaxAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxAmount>%s</%sTaxAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxAmount), input_name='TaxAmount')), namespaceprefix_ , eol_)) | |
if self.CalculationSequenceNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCalculationSequenceNumeric>%s</%sCalculationSequenceNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CalculationSequenceNumeric), input_name='CalculationSequenceNumeric')), namespaceprefix_ , eol_)) | |
if self.TransactionCurrencyTaxAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTransactionCurrencyTaxAmount>%s</%sTransactionCurrencyTaxAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TransactionCurrencyTaxAmount), input_name='TransactionCurrencyTaxAmount')), namespaceprefix_ , eol_)) | |
if self.Percent is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPercent>%s</%sPercent>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Percent), input_name='Percent')), namespaceprefix_ , eol_)) | |
if self.BaseUnitMeasure is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBaseUnitMeasure>%s</%sBaseUnitMeasure>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BaseUnitMeasure), input_name='BaseUnitMeasure')), namespaceprefix_ , eol_)) | |
if self.PerUnitAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPerUnitAmount>%s</%sPerUnitAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PerUnitAmount), input_name='PerUnitAmount')), namespaceprefix_ , eol_)) | |
if self.TierRange is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTierRange>%s</%sTierRange>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TierRange), input_name='TierRange')), namespaceprefix_ , eol_)) | |
if self.TierRatePercent is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTierRatePercent>%s</%sTierRatePercent>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TierRatePercent), input_name='TierRatePercent')), namespaceprefix_ , eol_)) | |
if self.TaxCategory is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxCategory>%s</%sTaxCategory>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxCategory), input_name='TaxCategory')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'TaxableAmount': | |
TaxableAmount_ = child_.text | |
TaxableAmount_ = self.gds_validate_string(TaxableAmount_, node, 'TaxableAmount') | |
self.TaxableAmount = TaxableAmount_ | |
elif nodeName_ == 'TaxAmount': | |
TaxAmount_ = child_.text | |
TaxAmount_ = self.gds_validate_string(TaxAmount_, node, 'TaxAmount') | |
self.TaxAmount = TaxAmount_ | |
elif nodeName_ == 'CalculationSequenceNumeric': | |
CalculationSequenceNumeric_ = child_.text | |
CalculationSequenceNumeric_ = self.gds_validate_string(CalculationSequenceNumeric_, node, 'CalculationSequenceNumeric') | |
self.CalculationSequenceNumeric = CalculationSequenceNumeric_ | |
elif nodeName_ == 'TransactionCurrencyTaxAmount': | |
TransactionCurrencyTaxAmount_ = child_.text | |
TransactionCurrencyTaxAmount_ = self.gds_validate_string(TransactionCurrencyTaxAmount_, node, 'TransactionCurrencyTaxAmount') | |
self.TransactionCurrencyTaxAmount = TransactionCurrencyTaxAmount_ | |
elif nodeName_ == 'Percent': | |
Percent_ = child_.text | |
Percent_ = self.gds_validate_string(Percent_, node, 'Percent') | |
self.Percent = Percent_ | |
elif nodeName_ == 'BaseUnitMeasure': | |
BaseUnitMeasure_ = child_.text | |
BaseUnitMeasure_ = self.gds_validate_string(BaseUnitMeasure_, node, 'BaseUnitMeasure') | |
self.BaseUnitMeasure = BaseUnitMeasure_ | |
elif nodeName_ == 'PerUnitAmount': | |
PerUnitAmount_ = child_.text | |
PerUnitAmount_ = self.gds_validate_string(PerUnitAmount_, node, 'PerUnitAmount') | |
self.PerUnitAmount = PerUnitAmount_ | |
elif nodeName_ == 'TierRange': | |
TierRange_ = child_.text | |
TierRange_ = self.gds_validate_string(TierRange_, node, 'TierRange') | |
self.TierRange = TierRange_ | |
elif nodeName_ == 'TierRatePercent': | |
TierRatePercent_ = child_.text | |
TierRatePercent_ = self.gds_validate_string(TierRatePercent_, node, 'TierRatePercent') | |
self.TierRatePercent = TierRatePercent_ | |
elif nodeName_ == 'TaxCategory': | |
TaxCategory_ = child_.text | |
TaxCategory_ = self.gds_validate_string(TaxCategory_, node, 'TaxCategory') | |
self.TaxCategory = TaxCategory_ | |
# end class TaxSubtotalType | |
class MonetaryTotalType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, LineExtensionAmount=None, TaxExclusiveAmount=None, TaxInclusiveAmount=None, AllowanceTotalAmount=None, ChargeTotalAmount=None, PrepaidAmount=None, PayableRoundingAmount=None, PayableAmount=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.LineExtensionAmount = LineExtensionAmount | |
self.TaxExclusiveAmount = TaxExclusiveAmount | |
self.TaxInclusiveAmount = TaxInclusiveAmount | |
self.AllowanceTotalAmount = AllowanceTotalAmount | |
self.ChargeTotalAmount = ChargeTotalAmount | |
self.PrepaidAmount = PrepaidAmount | |
self.PayableRoundingAmount = PayableRoundingAmount | |
self.PayableAmount = PayableAmount | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, MonetaryTotalType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if MonetaryTotalType.subclass: | |
return MonetaryTotalType.subclass(*args_, **kwargs_) | |
else: | |
return MonetaryTotalType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_LineExtensionAmount(self): | |
return self.LineExtensionAmount | |
def set_LineExtensionAmount(self, LineExtensionAmount): | |
self.LineExtensionAmount = LineExtensionAmount | |
def get_TaxExclusiveAmount(self): | |
return self.TaxExclusiveAmount | |
def set_TaxExclusiveAmount(self, TaxExclusiveAmount): | |
self.TaxExclusiveAmount = TaxExclusiveAmount | |
def get_TaxInclusiveAmount(self): | |
return self.TaxInclusiveAmount | |
def set_TaxInclusiveAmount(self, TaxInclusiveAmount): | |
self.TaxInclusiveAmount = TaxInclusiveAmount | |
def get_AllowanceTotalAmount(self): | |
return self.AllowanceTotalAmount | |
def set_AllowanceTotalAmount(self, AllowanceTotalAmount): | |
self.AllowanceTotalAmount = AllowanceTotalAmount | |
def get_ChargeTotalAmount(self): | |
return self.ChargeTotalAmount | |
def set_ChargeTotalAmount(self, ChargeTotalAmount): | |
self.ChargeTotalAmount = ChargeTotalAmount | |
def get_PrepaidAmount(self): | |
return self.PrepaidAmount | |
def set_PrepaidAmount(self, PrepaidAmount): | |
self.PrepaidAmount = PrepaidAmount | |
def get_PayableRoundingAmount(self): | |
return self.PayableRoundingAmount | |
def set_PayableRoundingAmount(self, PayableRoundingAmount): | |
self.PayableRoundingAmount = PayableRoundingAmount | |
def get_PayableAmount(self): | |
return self.PayableAmount | |
def set_PayableAmount(self, PayableAmount): | |
self.PayableAmount = PayableAmount | |
def hasContent_(self): | |
if ( | |
self.LineExtensionAmount is not None or | |
self.TaxExclusiveAmount is not None or | |
self.TaxInclusiveAmount is not None or | |
self.AllowanceTotalAmount is not None or | |
self.ChargeTotalAmount is not None or | |
self.PrepaidAmount is not None or | |
self.PayableRoundingAmount is not None or | |
self.PayableAmount is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='MonetaryTotalType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('MonetaryTotalType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='MonetaryTotalType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='MonetaryTotalType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='MonetaryTotalType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" ', name_='MonetaryTotalType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.LineExtensionAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLineExtensionAmount>%s</%sLineExtensionAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LineExtensionAmount), input_name='LineExtensionAmount')), namespaceprefix_ , eol_)) | |
if self.TaxExclusiveAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxExclusiveAmount>%s</%sTaxExclusiveAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxExclusiveAmount), input_name='TaxExclusiveAmount')), namespaceprefix_ , eol_)) | |
if self.TaxInclusiveAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxInclusiveAmount>%s</%sTaxInclusiveAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxInclusiveAmount), input_name='TaxInclusiveAmount')), namespaceprefix_ , eol_)) | |
if self.AllowanceTotalAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAllowanceTotalAmount>%s</%sAllowanceTotalAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AllowanceTotalAmount), input_name='AllowanceTotalAmount')), namespaceprefix_ , eol_)) | |
if self.ChargeTotalAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sChargeTotalAmount>%s</%sChargeTotalAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ChargeTotalAmount), input_name='ChargeTotalAmount')), namespaceprefix_ , eol_)) | |
if self.PrepaidAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPrepaidAmount>%s</%sPrepaidAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PrepaidAmount), input_name='PrepaidAmount')), namespaceprefix_ , eol_)) | |
if self.PayableRoundingAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPayableRoundingAmount>%s</%sPayableRoundingAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PayableRoundingAmount), input_name='PayableRoundingAmount')), namespaceprefix_ , eol_)) | |
if self.PayableAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPayableAmount>%s</%sPayableAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PayableAmount), input_name='PayableAmount')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'LineExtensionAmount': | |
LineExtensionAmount_ = child_.text | |
LineExtensionAmount_ = self.gds_validate_string(LineExtensionAmount_, node, 'LineExtensionAmount') | |
self.LineExtensionAmount = LineExtensionAmount_ | |
elif nodeName_ == 'TaxExclusiveAmount': | |
TaxExclusiveAmount_ = child_.text | |
TaxExclusiveAmount_ = self.gds_validate_string(TaxExclusiveAmount_, node, 'TaxExclusiveAmount') | |
self.TaxExclusiveAmount = TaxExclusiveAmount_ | |
elif nodeName_ == 'TaxInclusiveAmount': | |
TaxInclusiveAmount_ = child_.text | |
TaxInclusiveAmount_ = self.gds_validate_string(TaxInclusiveAmount_, node, 'TaxInclusiveAmount') | |
self.TaxInclusiveAmount = TaxInclusiveAmount_ | |
elif nodeName_ == 'AllowanceTotalAmount': | |
AllowanceTotalAmount_ = child_.text | |
AllowanceTotalAmount_ = self.gds_validate_string(AllowanceTotalAmount_, node, 'AllowanceTotalAmount') | |
self.AllowanceTotalAmount = AllowanceTotalAmount_ | |
elif nodeName_ == 'ChargeTotalAmount': | |
ChargeTotalAmount_ = child_.text | |
ChargeTotalAmount_ = self.gds_validate_string(ChargeTotalAmount_, node, 'ChargeTotalAmount') | |
self.ChargeTotalAmount = ChargeTotalAmount_ | |
elif nodeName_ == 'PrepaidAmount': | |
PrepaidAmount_ = child_.text | |
PrepaidAmount_ = self.gds_validate_string(PrepaidAmount_, node, 'PrepaidAmount') | |
self.PrepaidAmount = PrepaidAmount_ | |
elif nodeName_ == 'PayableRoundingAmount': | |
PayableRoundingAmount_ = child_.text | |
PayableRoundingAmount_ = self.gds_validate_string(PayableRoundingAmount_, node, 'PayableRoundingAmount') | |
self.PayableRoundingAmount = PayableRoundingAmount_ | |
elif nodeName_ == 'PayableAmount': | |
PayableAmount_ = child_.text | |
PayableAmount_ = self.gds_validate_string(PayableAmount_, node, 'PayableAmount') | |
self.PayableAmount = PayableAmount_ | |
# end class MonetaryTotalType | |
class DeliveryType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, Quantity=None, MinimumQuantity=None, MaximumQuantity=None, ActualDeliveryDate=None, ActualDeliveryTime=None, LatestDeliveryDate=None, LatestDeliveryTime=None, TrackingID=None, DeliveryAddress=None, DeliveryLocation=None, RequestedDeliveryPeriod=None, PromisedDeliveryPeriod=None, EstimatedDeliveryPeriod=None, DeliveryParty=None, Despatch=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.Quantity = Quantity | |
self.MinimumQuantity = MinimumQuantity | |
self.MaximumQuantity = MaximumQuantity | |
self.ActualDeliveryDate = ActualDeliveryDate | |
self.ActualDeliveryTime = ActualDeliveryTime | |
self.LatestDeliveryDate = LatestDeliveryDate | |
self.LatestDeliveryTime = LatestDeliveryTime | |
self.TrackingID = TrackingID | |
self.DeliveryAddress = DeliveryAddress | |
self.DeliveryLocation = DeliveryLocation | |
self.RequestedDeliveryPeriod = RequestedDeliveryPeriod | |
self.PromisedDeliveryPeriod = PromisedDeliveryPeriod | |
self.EstimatedDeliveryPeriod = EstimatedDeliveryPeriod | |
self.DeliveryParty = DeliveryParty | |
self.Despatch = Despatch | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, DeliveryType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if DeliveryType.subclass: | |
return DeliveryType.subclass(*args_, **kwargs_) | |
else: | |
return DeliveryType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_Quantity(self): | |
return self.Quantity | |
def set_Quantity(self, Quantity): | |
self.Quantity = Quantity | |
def get_MinimumQuantity(self): | |
return self.MinimumQuantity | |
def set_MinimumQuantity(self, MinimumQuantity): | |
self.MinimumQuantity = MinimumQuantity | |
def get_MaximumQuantity(self): | |
return self.MaximumQuantity | |
def set_MaximumQuantity(self, MaximumQuantity): | |
self.MaximumQuantity = MaximumQuantity | |
def get_ActualDeliveryDate(self): | |
return self.ActualDeliveryDate | |
def set_ActualDeliveryDate(self, ActualDeliveryDate): | |
self.ActualDeliveryDate = ActualDeliveryDate | |
def get_ActualDeliveryTime(self): | |
return self.ActualDeliveryTime | |
def set_ActualDeliveryTime(self, ActualDeliveryTime): | |
self.ActualDeliveryTime = ActualDeliveryTime | |
def get_LatestDeliveryDate(self): | |
return self.LatestDeliveryDate | |
def set_LatestDeliveryDate(self, LatestDeliveryDate): | |
self.LatestDeliveryDate = LatestDeliveryDate | |
def get_LatestDeliveryTime(self): | |
return self.LatestDeliveryTime | |
def set_LatestDeliveryTime(self, LatestDeliveryTime): | |
self.LatestDeliveryTime = LatestDeliveryTime | |
def get_TrackingID(self): | |
return self.TrackingID | |
def set_TrackingID(self, TrackingID): | |
self.TrackingID = TrackingID | |
def get_DeliveryAddress(self): | |
return self.DeliveryAddress | |
def set_DeliveryAddress(self, DeliveryAddress): | |
self.DeliveryAddress = DeliveryAddress | |
def get_DeliveryLocation(self): | |
return self.DeliveryLocation | |
def set_DeliveryLocation(self, DeliveryLocation): | |
self.DeliveryLocation = DeliveryLocation | |
def get_RequestedDeliveryPeriod(self): | |
return self.RequestedDeliveryPeriod | |
def set_RequestedDeliveryPeriod(self, RequestedDeliveryPeriod): | |
self.RequestedDeliveryPeriod = RequestedDeliveryPeriod | |
def get_PromisedDeliveryPeriod(self): | |
return self.PromisedDeliveryPeriod | |
def set_PromisedDeliveryPeriod(self, PromisedDeliveryPeriod): | |
self.PromisedDeliveryPeriod = PromisedDeliveryPeriod | |
def get_EstimatedDeliveryPeriod(self): | |
return self.EstimatedDeliveryPeriod | |
def set_EstimatedDeliveryPeriod(self, EstimatedDeliveryPeriod): | |
self.EstimatedDeliveryPeriod = EstimatedDeliveryPeriod | |
def get_DeliveryParty(self): | |
return self.DeliveryParty | |
def set_DeliveryParty(self, DeliveryParty): | |
self.DeliveryParty = DeliveryParty | |
def get_Despatch(self): | |
return self.Despatch | |
def set_Despatch(self, Despatch): | |
self.Despatch = Despatch | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.Quantity is not None or | |
self.MinimumQuantity is not None or | |
self.MaximumQuantity is not None or | |
self.ActualDeliveryDate is not None or | |
self.ActualDeliveryTime is not None or | |
self.LatestDeliveryDate is not None or | |
self.LatestDeliveryTime is not None or | |
self.TrackingID is not None or | |
self.DeliveryAddress is not None or | |
self.DeliveryLocation is not None or | |
self.RequestedDeliveryPeriod is not None or | |
self.PromisedDeliveryPeriod is not None or | |
self.EstimatedDeliveryPeriod is not None or | |
self.DeliveryParty is not None or | |
self.Despatch is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DeliveryType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('DeliveryType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DeliveryType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DeliveryType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='DeliveryType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DeliveryType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.Quantity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sQuantity>%s</%sQuantity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Quantity), input_name='Quantity')), namespaceprefix_ , eol_)) | |
if self.MinimumQuantity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMinimumQuantity>%s</%sMinimumQuantity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MinimumQuantity), input_name='MinimumQuantity')), namespaceprefix_ , eol_)) | |
if self.MaximumQuantity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sMaximumQuantity>%s</%sMaximumQuantity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.MaximumQuantity), input_name='MaximumQuantity')), namespaceprefix_ , eol_)) | |
if self.ActualDeliveryDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sActualDeliveryDate>%s</%sActualDeliveryDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ActualDeliveryDate), input_name='ActualDeliveryDate')), namespaceprefix_ , eol_)) | |
if self.ActualDeliveryTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sActualDeliveryTime>%s</%sActualDeliveryTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ActualDeliveryTime), input_name='ActualDeliveryTime')), namespaceprefix_ , eol_)) | |
if self.LatestDeliveryDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLatestDeliveryDate>%s</%sLatestDeliveryDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LatestDeliveryDate), input_name='LatestDeliveryDate')), namespaceprefix_ , eol_)) | |
if self.LatestDeliveryTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLatestDeliveryTime>%s</%sLatestDeliveryTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LatestDeliveryTime), input_name='LatestDeliveryTime')), namespaceprefix_ , eol_)) | |
if self.TrackingID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTrackingID>%s</%sTrackingID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TrackingID), input_name='TrackingID')), namespaceprefix_ , eol_)) | |
if self.DeliveryAddress is not None: | |
self.DeliveryAddress.export(outfile, level, namespaceprefix_='tns:', name_='DeliveryAddress', pretty_print=pretty_print) | |
if self.DeliveryLocation is not None: | |
self.DeliveryLocation.export(outfile, level, namespaceprefix_='tns:', name_='DeliveryLocation', pretty_print=pretty_print) | |
if self.RequestedDeliveryPeriod is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRequestedDeliveryPeriod>%s</%sRequestedDeliveryPeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RequestedDeliveryPeriod), input_name='RequestedDeliveryPeriod')), namespaceprefix_ , eol_)) | |
if self.PromisedDeliveryPeriod is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPromisedDeliveryPeriod>%s</%sPromisedDeliveryPeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PromisedDeliveryPeriod), input_name='PromisedDeliveryPeriod')), namespaceprefix_ , eol_)) | |
if self.EstimatedDeliveryPeriod is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sEstimatedDeliveryPeriod>%s</%sEstimatedDeliveryPeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EstimatedDeliveryPeriod), input_name='EstimatedDeliveryPeriod')), namespaceprefix_ , eol_)) | |
if self.DeliveryParty is not None: | |
self.DeliveryParty.export(outfile, level, namespaceprefix_='tns:', name_='DeliveryParty', pretty_print=pretty_print) | |
if self.Despatch is not None: | |
self.Despatch.export(outfile, level, namespaceprefix_='tns:', name_='Despatch', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'Quantity': | |
Quantity_ = child_.text | |
Quantity_ = self.gds_validate_string(Quantity_, node, 'Quantity') | |
self.Quantity = Quantity_ | |
elif nodeName_ == 'MinimumQuantity': | |
MinimumQuantity_ = child_.text | |
MinimumQuantity_ = self.gds_validate_string(MinimumQuantity_, node, 'MinimumQuantity') | |
self.MinimumQuantity = MinimumQuantity_ | |
elif nodeName_ == 'MaximumQuantity': | |
MaximumQuantity_ = child_.text | |
MaximumQuantity_ = self.gds_validate_string(MaximumQuantity_, node, 'MaximumQuantity') | |
self.MaximumQuantity = MaximumQuantity_ | |
elif nodeName_ == 'ActualDeliveryDate': | |
ActualDeliveryDate_ = child_.text | |
ActualDeliveryDate_ = self.gds_validate_string(ActualDeliveryDate_, node, 'ActualDeliveryDate') | |
self.ActualDeliveryDate = ActualDeliveryDate_ | |
elif nodeName_ == 'ActualDeliveryTime': | |
ActualDeliveryTime_ = child_.text | |
ActualDeliveryTime_ = self.gds_validate_string(ActualDeliveryTime_, node, 'ActualDeliveryTime') | |
self.ActualDeliveryTime = ActualDeliveryTime_ | |
elif nodeName_ == 'LatestDeliveryDate': | |
LatestDeliveryDate_ = child_.text | |
LatestDeliveryDate_ = self.gds_validate_string(LatestDeliveryDate_, node, 'LatestDeliveryDate') | |
self.LatestDeliveryDate = LatestDeliveryDate_ | |
elif nodeName_ == 'LatestDeliveryTime': | |
LatestDeliveryTime_ = child_.text | |
LatestDeliveryTime_ = self.gds_validate_string(LatestDeliveryTime_, node, 'LatestDeliveryTime') | |
self.LatestDeliveryTime = LatestDeliveryTime_ | |
elif nodeName_ == 'TrackingID': | |
TrackingID_ = child_.text | |
TrackingID_ = self.gds_validate_string(TrackingID_, node, 'TrackingID') | |
self.TrackingID = TrackingID_ | |
elif nodeName_ == 'DeliveryAddress': | |
obj_ = AddressType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DeliveryAddress = obj_ | |
obj_.original_tagname_ = 'DeliveryAddress' | |
elif nodeName_ == 'DeliveryLocation': | |
obj_ = LocationType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DeliveryLocation = obj_ | |
obj_.original_tagname_ = 'DeliveryLocation' | |
elif nodeName_ == 'RequestedDeliveryPeriod': | |
RequestedDeliveryPeriod_ = child_.text | |
RequestedDeliveryPeriod_ = self.gds_validate_string(RequestedDeliveryPeriod_, node, 'RequestedDeliveryPeriod') | |
self.RequestedDeliveryPeriod = RequestedDeliveryPeriod_ | |
elif nodeName_ == 'PromisedDeliveryPeriod': | |
PromisedDeliveryPeriod_ = child_.text | |
PromisedDeliveryPeriod_ = self.gds_validate_string(PromisedDeliveryPeriod_, node, 'PromisedDeliveryPeriod') | |
self.PromisedDeliveryPeriod = PromisedDeliveryPeriod_ | |
elif nodeName_ == 'EstimatedDeliveryPeriod': | |
EstimatedDeliveryPeriod_ = child_.text | |
EstimatedDeliveryPeriod_ = self.gds_validate_string(EstimatedDeliveryPeriod_, node, 'EstimatedDeliveryPeriod') | |
self.EstimatedDeliveryPeriod = EstimatedDeliveryPeriod_ | |
elif nodeName_ == 'DeliveryParty': | |
obj_ = PartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DeliveryParty = obj_ | |
obj_.original_tagname_ = 'DeliveryParty' | |
elif nodeName_ == 'Despatch': | |
obj_ = DespatchType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Despatch = obj_ | |
obj_.original_tagname_ = 'Despatch' | |
# end class DeliveryType | |
class DespatchType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, RequestedDespatchDate=None, RequestedDespatchTime=None, EstimatedDespatchDate=None, EstimatedDespatchTime=None, ActualDespatchDate=None, ActualDespatchTime=None, DespatchAddress=None, DespatchParty=None, Contact=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.RequestedDespatchDate = RequestedDespatchDate | |
self.RequestedDespatchTime = RequestedDespatchTime | |
self.EstimatedDespatchDate = EstimatedDespatchDate | |
self.EstimatedDespatchTime = EstimatedDespatchTime | |
self.ActualDespatchDate = ActualDespatchDate | |
self.ActualDespatchTime = ActualDespatchTime | |
self.DespatchAddress = DespatchAddress | |
self.DespatchParty = DespatchParty | |
self.Contact = Contact | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, DespatchType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if DespatchType.subclass: | |
return DespatchType.subclass(*args_, **kwargs_) | |
else: | |
return DespatchType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_RequestedDespatchDate(self): | |
return self.RequestedDespatchDate | |
def set_RequestedDespatchDate(self, RequestedDespatchDate): | |
self.RequestedDespatchDate = RequestedDespatchDate | |
def get_RequestedDespatchTime(self): | |
return self.RequestedDespatchTime | |
def set_RequestedDespatchTime(self, RequestedDespatchTime): | |
self.RequestedDespatchTime = RequestedDespatchTime | |
def get_EstimatedDespatchDate(self): | |
return self.EstimatedDespatchDate | |
def set_EstimatedDespatchDate(self, EstimatedDespatchDate): | |
self.EstimatedDespatchDate = EstimatedDespatchDate | |
def get_EstimatedDespatchTime(self): | |
return self.EstimatedDespatchTime | |
def set_EstimatedDespatchTime(self, EstimatedDespatchTime): | |
self.EstimatedDespatchTime = EstimatedDespatchTime | |
def get_ActualDespatchDate(self): | |
return self.ActualDespatchDate | |
def set_ActualDespatchDate(self, ActualDespatchDate): | |
self.ActualDespatchDate = ActualDespatchDate | |
def get_ActualDespatchTime(self): | |
return self.ActualDespatchTime | |
def set_ActualDespatchTime(self, ActualDespatchTime): | |
self.ActualDespatchTime = ActualDespatchTime | |
def get_DespatchAddress(self): | |
return self.DespatchAddress | |
def set_DespatchAddress(self, DespatchAddress): | |
self.DespatchAddress = DespatchAddress | |
def get_DespatchParty(self): | |
return self.DespatchParty | |
def set_DespatchParty(self, DespatchParty): | |
self.DespatchParty = DespatchParty | |
def get_Contact(self): | |
return self.Contact | |
def set_Contact(self, Contact): | |
self.Contact = Contact | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.RequestedDespatchDate is not None or | |
self.RequestedDespatchTime is not None or | |
self.EstimatedDespatchDate is not None or | |
self.EstimatedDespatchTime is not None or | |
self.ActualDespatchDate is not None or | |
self.ActualDespatchTime is not None or | |
self.DespatchAddress is not None or | |
self.DespatchParty is not None or | |
self.Contact is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DespatchType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('DespatchType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DespatchType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DespatchType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='DespatchType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DespatchType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.RequestedDespatchDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRequestedDespatchDate>%s</%sRequestedDespatchDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RequestedDespatchDate), input_name='RequestedDespatchDate')), namespaceprefix_ , eol_)) | |
if self.RequestedDespatchTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sRequestedDespatchTime>%s</%sRequestedDespatchTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RequestedDespatchTime), input_name='RequestedDespatchTime')), namespaceprefix_ , eol_)) | |
if self.EstimatedDespatchDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sEstimatedDespatchDate>%s</%sEstimatedDespatchDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EstimatedDespatchDate), input_name='EstimatedDespatchDate')), namespaceprefix_ , eol_)) | |
if self.EstimatedDespatchTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sEstimatedDespatchTime>%s</%sEstimatedDespatchTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EstimatedDespatchTime), input_name='EstimatedDespatchTime')), namespaceprefix_ , eol_)) | |
if self.ActualDespatchDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sActualDespatchDate>%s</%sActualDespatchDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ActualDespatchDate), input_name='ActualDespatchDate')), namespaceprefix_ , eol_)) | |
if self.ActualDespatchTime is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sActualDespatchTime>%s</%sActualDespatchTime>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ActualDespatchTime), input_name='ActualDespatchTime')), namespaceprefix_ , eol_)) | |
if self.DespatchAddress is not None: | |
self.DespatchAddress.export(outfile, level, namespaceprefix_='tns:', name_='DespatchAddress', pretty_print=pretty_print) | |
if self.DespatchParty is not None: | |
self.DespatchParty.export(outfile, level, namespaceprefix_='tns:', name_='DespatchParty', pretty_print=pretty_print) | |
if self.Contact is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sContact>%s</%sContact>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Contact), input_name='Contact')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'RequestedDespatchDate': | |
RequestedDespatchDate_ = child_.text | |
RequestedDespatchDate_ = self.gds_validate_string(RequestedDespatchDate_, node, 'RequestedDespatchDate') | |
self.RequestedDespatchDate = RequestedDespatchDate_ | |
elif nodeName_ == 'RequestedDespatchTime': | |
RequestedDespatchTime_ = child_.text | |
RequestedDespatchTime_ = self.gds_validate_string(RequestedDespatchTime_, node, 'RequestedDespatchTime') | |
self.RequestedDespatchTime = RequestedDespatchTime_ | |
elif nodeName_ == 'EstimatedDespatchDate': | |
EstimatedDespatchDate_ = child_.text | |
EstimatedDespatchDate_ = self.gds_validate_string(EstimatedDespatchDate_, node, 'EstimatedDespatchDate') | |
self.EstimatedDespatchDate = EstimatedDespatchDate_ | |
elif nodeName_ == 'EstimatedDespatchTime': | |
EstimatedDespatchTime_ = child_.text | |
EstimatedDespatchTime_ = self.gds_validate_string(EstimatedDespatchTime_, node, 'EstimatedDespatchTime') | |
self.EstimatedDespatchTime = EstimatedDespatchTime_ | |
elif nodeName_ == 'ActualDespatchDate': | |
ActualDespatchDate_ = child_.text | |
ActualDespatchDate_ = self.gds_validate_string(ActualDespatchDate_, node, 'ActualDespatchDate') | |
self.ActualDespatchDate = ActualDespatchDate_ | |
elif nodeName_ == 'ActualDespatchTime': | |
ActualDespatchTime_ = child_.text | |
ActualDespatchTime_ = self.gds_validate_string(ActualDespatchTime_, node, 'ActualDespatchTime') | |
self.ActualDespatchTime = ActualDespatchTime_ | |
elif nodeName_ == 'DespatchAddress': | |
obj_ = AddressType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DespatchAddress = obj_ | |
obj_.original_tagname_ = 'DespatchAddress' | |
elif nodeName_ == 'DespatchParty': | |
obj_ = PartyType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DespatchParty = obj_ | |
obj_.original_tagname_ = 'DespatchParty' | |
elif nodeName_ == 'Contact': | |
Contact_ = child_.text | |
Contact_ = self.gds_validate_string(Contact_, node, 'Contact') | |
self.Contact = Contact_ | |
# end class DespatchType | |
class DeliveryTermsType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, SpecialTerms=None, LossRiskResponsibilityCode=None, LossRisk=None, DeliveryLocation=None, AllowanceCharge=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.SpecialTerms = SpecialTerms | |
self.LossRiskResponsibilityCode = LossRiskResponsibilityCode | |
self.LossRisk = LossRisk | |
self.DeliveryLocation = DeliveryLocation | |
self.AllowanceCharge = AllowanceCharge | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, DeliveryTermsType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if DeliveryTermsType.subclass: | |
return DeliveryTermsType.subclass(*args_, **kwargs_) | |
else: | |
return DeliveryTermsType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_SpecialTerms(self): | |
return self.SpecialTerms | |
def set_SpecialTerms(self, SpecialTerms): | |
self.SpecialTerms = SpecialTerms | |
def get_LossRiskResponsibilityCode(self): | |
return self.LossRiskResponsibilityCode | |
def set_LossRiskResponsibilityCode(self, LossRiskResponsibilityCode): | |
self.LossRiskResponsibilityCode = LossRiskResponsibilityCode | |
def get_LossRisk(self): | |
return self.LossRisk | |
def set_LossRisk(self, LossRisk): | |
self.LossRisk = LossRisk | |
def get_DeliveryLocation(self): | |
return self.DeliveryLocation | |
def set_DeliveryLocation(self, DeliveryLocation): | |
self.DeliveryLocation = DeliveryLocation | |
def get_AllowanceCharge(self): | |
return self.AllowanceCharge | |
def set_AllowanceCharge(self, AllowanceCharge): | |
self.AllowanceCharge = AllowanceCharge | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.SpecialTerms is not None or | |
self.LossRiskResponsibilityCode is not None or | |
self.LossRisk is not None or | |
self.DeliveryLocation is not None or | |
self.AllowanceCharge is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DeliveryTermsType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('DeliveryTermsType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DeliveryTermsType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DeliveryTermsType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='DeliveryTermsType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='DeliveryTermsType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.SpecialTerms is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sSpecialTerms>%s</%sSpecialTerms>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SpecialTerms), input_name='SpecialTerms')), namespaceprefix_ , eol_)) | |
if self.LossRiskResponsibilityCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLossRiskResponsibilityCode>%s</%sLossRiskResponsibilityCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LossRiskResponsibilityCode), input_name='LossRiskResponsibilityCode')), namespaceprefix_ , eol_)) | |
if self.LossRisk is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLossRisk>%s</%sLossRisk>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LossRisk), input_name='LossRisk')), namespaceprefix_ , eol_)) | |
if self.DeliveryLocation is not None: | |
self.DeliveryLocation.export(outfile, level, namespaceprefix_='cac:', name_='DeliveryLocation', pretty_print=pretty_print) | |
if self.AllowanceCharge is not None: | |
self.AllowanceCharge.export(outfile, level, namespaceprefix_='cac:', name_='AllowanceCharge', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'SpecialTerms': | |
SpecialTerms_ = child_.text | |
SpecialTerms_ = self.gds_validate_string(SpecialTerms_, node, 'SpecialTerms') | |
self.SpecialTerms = SpecialTerms_ | |
elif nodeName_ == 'LossRiskResponsibilityCode': | |
LossRiskResponsibilityCode_ = child_.text | |
LossRiskResponsibilityCode_ = self.gds_validate_string(LossRiskResponsibilityCode_, node, 'LossRiskResponsibilityCode') | |
self.LossRiskResponsibilityCode = LossRiskResponsibilityCode_ | |
elif nodeName_ == 'LossRisk': | |
LossRisk_ = child_.text | |
LossRisk_ = self.gds_validate_string(LossRisk_, node, 'LossRisk') | |
self.LossRisk = LossRisk_ | |
elif nodeName_ == 'DeliveryLocation': | |
obj_ = LocationType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DeliveryLocation = obj_ | |
obj_.original_tagname_ = 'DeliveryLocation' | |
elif nodeName_ == 'AllowanceCharge': | |
obj_ = AllowanceChargeType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AllowanceCharge = obj_ | |
obj_.original_tagname_ = 'AllowanceCharge' | |
# end class DeliveryTermsType | |
class InvoiceLineType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, ID=None, UUID=None, Note=None, InvoicedQuantity=None, LineExtensionAmount=None, TaxPointDate=None, AccountingCostCode=None, AccountingCost=None, FreeOfChargeIndicator=None, OrderLineReference=None, DespatchLineReference=None, ReceiptLineReference=None, BillingReference=None, DocumentReference=None, PricingReference=None, OriginatorParty=None, Delivery=None, PaymentTerms=None, AllowanceCharge=None, TaxTotal=None, Item=None, Price=None, DeliveryTerms=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.ID = ID | |
self.UUID = UUID | |
self.Note = Note | |
self.InvoicedQuantity = InvoicedQuantity | |
self.LineExtensionAmount = LineExtensionAmount | |
self.TaxPointDate = TaxPointDate | |
self.AccountingCostCode = AccountingCostCode | |
self.AccountingCost = AccountingCost | |
self.FreeOfChargeIndicator = FreeOfChargeIndicator | |
if OrderLineReference is None: | |
self.OrderLineReference = [] | |
else: | |
self.OrderLineReference = OrderLineReference | |
if DespatchLineReference is None: | |
self.DespatchLineReference = [] | |
else: | |
self.DespatchLineReference = DespatchLineReference | |
if ReceiptLineReference is None: | |
self.ReceiptLineReference = [] | |
else: | |
self.ReceiptLineReference = ReceiptLineReference | |
if BillingReference is None: | |
self.BillingReference = [] | |
else: | |
self.BillingReference = BillingReference | |
if DocumentReference is None: | |
self.DocumentReference = [] | |
else: | |
self.DocumentReference = DocumentReference | |
self.PricingReference = PricingReference | |
self.OriginatorParty = OriginatorParty | |
if Delivery is None: | |
self.Delivery = [] | |
else: | |
self.Delivery = Delivery | |
if PaymentTerms is None: | |
self.PaymentTerms = [] | |
else: | |
self.PaymentTerms = PaymentTerms | |
if AllowanceCharge is None: | |
self.AllowanceCharge = [] | |
else: | |
self.AllowanceCharge = AllowanceCharge | |
if TaxTotal is None: | |
self.TaxTotal = [] | |
else: | |
self.TaxTotal = TaxTotal | |
self.Item = Item | |
self.Price = Price | |
self.DeliveryTerms = DeliveryTerms | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, InvoiceLineType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if InvoiceLineType.subclass: | |
return InvoiceLineType.subclass(*args_, **kwargs_) | |
else: | |
return InvoiceLineType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_ID(self): | |
return self.ID | |
def set_ID(self, ID): | |
self.ID = ID | |
def get_UUID(self): | |
return self.UUID | |
def set_UUID(self, UUID): | |
self.UUID = UUID | |
def get_Note(self): | |
return self.Note | |
def set_Note(self, Note): | |
self.Note = Note | |
def get_InvoicedQuantity(self): | |
return self.InvoicedQuantity | |
def set_InvoicedQuantity(self, InvoicedQuantity): | |
self.InvoicedQuantity = InvoicedQuantity | |
def get_LineExtensionAmount(self): | |
return self.LineExtensionAmount | |
def set_LineExtensionAmount(self, LineExtensionAmount): | |
self.LineExtensionAmount = LineExtensionAmount | |
def get_TaxPointDate(self): | |
return self.TaxPointDate | |
def set_TaxPointDate(self, TaxPointDate): | |
self.TaxPointDate = TaxPointDate | |
def get_AccountingCostCode(self): | |
return self.AccountingCostCode | |
def set_AccountingCostCode(self, AccountingCostCode): | |
self.AccountingCostCode = AccountingCostCode | |
def get_AccountingCost(self): | |
return self.AccountingCost | |
def set_AccountingCost(self, AccountingCost): | |
self.AccountingCost = AccountingCost | |
def get_FreeOfChargeIndicator(self): | |
return self.FreeOfChargeIndicator | |
def set_FreeOfChargeIndicator(self, FreeOfChargeIndicator): | |
self.FreeOfChargeIndicator = FreeOfChargeIndicator | |
def get_OrderLineReference(self): | |
return self.OrderLineReference | |
def set_OrderLineReference(self, OrderLineReference): | |
self.OrderLineReference = OrderLineReference | |
def add_OrderLineReference(self, value): | |
self.OrderLineReference.append(value) | |
def add_OrderLineReference(self, value): | |
self.OrderLineReference.append(value) | |
def insert_OrderLineReference_at(self, index, value): | |
self.OrderLineReference.insert(index, value) | |
def replace_OrderLineReference_at(self, index, value): | |
self.OrderLineReference[index] = value | |
def get_DespatchLineReference(self): | |
return self.DespatchLineReference | |
def set_DespatchLineReference(self, DespatchLineReference): | |
self.DespatchLineReference = DespatchLineReference | |
def add_DespatchLineReference(self, value): | |
self.DespatchLineReference.append(value) | |
def add_DespatchLineReference(self, value): | |
self.DespatchLineReference.append(value) | |
def insert_DespatchLineReference_at(self, index, value): | |
self.DespatchLineReference.insert(index, value) | |
def replace_DespatchLineReference_at(self, index, value): | |
self.DespatchLineReference[index] = value | |
def get_ReceiptLineReference(self): | |
return self.ReceiptLineReference | |
def set_ReceiptLineReference(self, ReceiptLineReference): | |
self.ReceiptLineReference = ReceiptLineReference | |
def add_ReceiptLineReference(self, value): | |
self.ReceiptLineReference.append(value) | |
def add_ReceiptLineReference(self, value): | |
self.ReceiptLineReference.append(value) | |
def insert_ReceiptLineReference_at(self, index, value): | |
self.ReceiptLineReference.insert(index, value) | |
def replace_ReceiptLineReference_at(self, index, value): | |
self.ReceiptLineReference[index] = value | |
def get_BillingReference(self): | |
return self.BillingReference | |
def set_BillingReference(self, BillingReference): | |
self.BillingReference = BillingReference | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def add_BillingReference(self, value): | |
self.BillingReference.append(value) | |
def insert_BillingReference_at(self, index, value): | |
self.BillingReference.insert(index, value) | |
def replace_BillingReference_at(self, index, value): | |
self.BillingReference[index] = value | |
def get_DocumentReference(self): | |
return self.DocumentReference | |
def set_DocumentReference(self, DocumentReference): | |
self.DocumentReference = DocumentReference | |
def add_DocumentReference(self, value): | |
self.DocumentReference.append(value) | |
def add_DocumentReference(self, value): | |
self.DocumentReference.append(value) | |
def insert_DocumentReference_at(self, index, value): | |
self.DocumentReference.insert(index, value) | |
def replace_DocumentReference_at(self, index, value): | |
self.DocumentReference[index] = value | |
def get_PricingReference(self): | |
return self.PricingReference | |
def set_PricingReference(self, PricingReference): | |
self.PricingReference = PricingReference | |
def get_OriginatorParty(self): | |
return self.OriginatorParty | |
def set_OriginatorParty(self, OriginatorParty): | |
self.OriginatorParty = OriginatorParty | |
def get_Delivery(self): | |
return self.Delivery | |
def set_Delivery(self, Delivery): | |
self.Delivery = Delivery | |
def add_Delivery(self, value): | |
self.Delivery.append(value) | |
def add_Delivery(self, value): | |
self.Delivery.append(value) | |
def insert_Delivery_at(self, index, value): | |
self.Delivery.insert(index, value) | |
def replace_Delivery_at(self, index, value): | |
self.Delivery[index] = value | |
def get_PaymentTerms(self): | |
return self.PaymentTerms | |
def set_PaymentTerms(self, PaymentTerms): | |
self.PaymentTerms = PaymentTerms | |
def add_PaymentTerms(self, value): | |
self.PaymentTerms.append(value) | |
def add_PaymentTerms(self, value): | |
self.PaymentTerms.append(value) | |
def insert_PaymentTerms_at(self, index, value): | |
self.PaymentTerms.insert(index, value) | |
def replace_PaymentTerms_at(self, index, value): | |
self.PaymentTerms[index] = value | |
def get_AllowanceCharge(self): | |
return self.AllowanceCharge | |
def set_AllowanceCharge(self, AllowanceCharge): | |
self.AllowanceCharge = AllowanceCharge | |
def add_AllowanceCharge(self, value): | |
self.AllowanceCharge.append(value) | |
def add_AllowanceCharge(self, value): | |
self.AllowanceCharge.append(value) | |
def insert_AllowanceCharge_at(self, index, value): | |
self.AllowanceCharge.insert(index, value) | |
def replace_AllowanceCharge_at(self, index, value): | |
self.AllowanceCharge[index] = value | |
def get_TaxTotal(self): | |
return self.TaxTotal | |
def set_TaxTotal(self, TaxTotal): | |
self.TaxTotal = TaxTotal | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def add_TaxTotal(self, value): | |
self.TaxTotal.append(value) | |
def insert_TaxTotal_at(self, index, value): | |
self.TaxTotal.insert(index, value) | |
def replace_TaxTotal_at(self, index, value): | |
self.TaxTotal[index] = value | |
def get_Item(self): | |
return self.Item | |
def set_Item(self, Item): | |
self.Item = Item | |
def get_Price(self): | |
return self.Price | |
def set_Price(self, Price): | |
self.Price = Price | |
def get_DeliveryTerms(self): | |
return self.DeliveryTerms | |
def set_DeliveryTerms(self, DeliveryTerms): | |
self.DeliveryTerms = DeliveryTerms | |
def hasContent_(self): | |
if ( | |
self.ID is not None or | |
self.UUID is not None or | |
self.Note is not None or | |
self.InvoicedQuantity is not None or | |
self.LineExtensionAmount is not None or | |
self.TaxPointDate is not None or | |
self.AccountingCostCode is not None or | |
self.AccountingCost is not None or | |
self.FreeOfChargeIndicator is not None or | |
self.OrderLineReference or | |
self.DespatchLineReference or | |
self.ReceiptLineReference or | |
self.BillingReference or | |
self.DocumentReference or | |
self.PricingReference is not None or | |
self.OriginatorParty is not None or | |
self.Delivery or | |
self.PaymentTerms or | |
self.AllowanceCharge or | |
self.TaxTotal or | |
self.Item is not None or | |
self.Price is not None or | |
self.DeliveryTerms is not None | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='InvoiceLineType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('InvoiceLineType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='InvoiceLineType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='InvoiceLineType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='InvoiceLineType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='InvoiceLineType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.ID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sID>%s</%sID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ID), input_name='ID')), namespaceprefix_ , eol_)) | |
if self.UUID is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sUUID>%s</%sUUID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UUID), input_name='UUID')), namespaceprefix_ , eol_)) | |
if self.Note is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sNote>%s</%sNote>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Note), input_name='Note')), namespaceprefix_ , eol_)) | |
if self.InvoicedQuantity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInvoicedQuantity>%s</%sInvoicedQuantity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InvoicedQuantity), input_name='InvoicedQuantity')), namespaceprefix_ , eol_)) | |
if self.LineExtensionAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sLineExtensionAmount>%s</%sLineExtensionAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.LineExtensionAmount), input_name='LineExtensionAmount')), namespaceprefix_ , eol_)) | |
if self.TaxPointDate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTaxPointDate>%s</%sTaxPointDate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TaxPointDate), input_name='TaxPointDate')), namespaceprefix_ , eol_)) | |
if self.AccountingCostCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCostCode>%s</%sAccountingCostCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCostCode), input_name='AccountingCostCode')), namespaceprefix_ , eol_)) | |
if self.AccountingCost is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAccountingCost>%s</%sAccountingCost>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AccountingCost), input_name='AccountingCost')), namespaceprefix_ , eol_)) | |
if self.FreeOfChargeIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sFreeOfChargeIndicator>%s</%sFreeOfChargeIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FreeOfChargeIndicator), input_name='FreeOfChargeIndicator')), namespaceprefix_ , eol_)) | |
for OrderLineReference_ in self.OrderLineReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOrderLineReference>%s</%sOrderLineReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OrderLineReference_), input_name='OrderLineReference')), namespaceprefix_ , eol_)) | |
for DespatchLineReference_ in self.DespatchLineReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDespatchLineReference>%s</%sDespatchLineReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DespatchLineReference_), input_name='DespatchLineReference')), namespaceprefix_ , eol_)) | |
for ReceiptLineReference_ in self.ReceiptLineReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sReceiptLineReference>%s</%sReceiptLineReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ReceiptLineReference_), input_name='ReceiptLineReference')), namespaceprefix_ , eol_)) | |
for BillingReference_ in self.BillingReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBillingReference>%s</%sBillingReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(BillingReference_), input_name='BillingReference')), namespaceprefix_ , eol_)) | |
for DocumentReference_ in self.DocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDocumentReference>%s</%sDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(DocumentReference_), input_name='DocumentReference')), namespaceprefix_ , eol_)) | |
if self.PricingReference is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPricingReference>%s</%sPricingReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PricingReference), input_name='PricingReference')), namespaceprefix_ , eol_)) | |
if self.OriginatorParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOriginatorParty>%s</%sOriginatorParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.OriginatorParty), input_name='OriginatorParty')), namespaceprefix_ , eol_)) | |
for Delivery_ in self.Delivery: | |
Delivery_.export(outfile, level, namespaceprefix_='cac:', name_='Delivery', pretty_print=pretty_print) | |
for PaymentTerms_ in self.PaymentTerms: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPaymentTerms>%s</%sPaymentTerms>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PaymentTerms_), input_name='PaymentTerms')), namespaceprefix_ , eol_)) | |
for AllowanceCharge_ in self.AllowanceCharge: | |
AllowanceCharge_.export(outfile, level, namespaceprefix_='cac:', name_='AllowanceCharge', pretty_print=pretty_print) | |
for TaxTotal_ in self.TaxTotal: | |
TaxTotal_.export(outfile, level, namespaceprefix_='cac:', name_='TaxTotal', pretty_print=pretty_print) | |
if self.Item is not None: | |
self.Item.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='Item', pretty_print=pretty_print) | |
if self.Price is not None: | |
self.Price.export(outfile, level, namespaceprefix_='tns:', namespacedef_, name_='Price', pretty_print=pretty_print) | |
if self.DeliveryTerms is not None: | |
self.DeliveryTerms.export(outfile, level, namespaceprefix_='cac:', name_='DeliveryTerms', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'ID': | |
ID_ = child_.text | |
ID_ = self.gds_validate_string(ID_, node, 'ID') | |
self.ID = ID_ | |
elif nodeName_ == 'UUID': | |
UUID_ = child_.text | |
UUID_ = self.gds_validate_string(UUID_, node, 'UUID') | |
self.UUID = UUID_ | |
elif nodeName_ == 'Note': | |
Note_ = child_.text | |
Note_ = self.gds_validate_string(Note_, node, 'Note') | |
self.Note = Note_ | |
elif nodeName_ == 'InvoicedQuantity': | |
InvoicedQuantity_ = child_.text | |
InvoicedQuantity_ = self.gds_validate_string(InvoicedQuantity_, node, 'InvoicedQuantity') | |
self.InvoicedQuantity = InvoicedQuantity_ | |
elif nodeName_ == 'LineExtensionAmount': | |
LineExtensionAmount_ = child_.text | |
LineExtensionAmount_ = self.gds_validate_string(LineExtensionAmount_, node, 'LineExtensionAmount') | |
self.LineExtensionAmount = LineExtensionAmount_ | |
elif nodeName_ == 'TaxPointDate': | |
TaxPointDate_ = child_.text | |
TaxPointDate_ = self.gds_validate_string(TaxPointDate_, node, 'TaxPointDate') | |
self.TaxPointDate = TaxPointDate_ | |
elif nodeName_ == 'AccountingCostCode': | |
AccountingCostCode_ = child_.text | |
AccountingCostCode_ = self.gds_validate_string(AccountingCostCode_, node, 'AccountingCostCode') | |
self.AccountingCostCode = AccountingCostCode_ | |
elif nodeName_ == 'AccountingCost': | |
AccountingCost_ = child_.text | |
AccountingCost_ = self.gds_validate_string(AccountingCost_, node, 'AccountingCost') | |
self.AccountingCost = AccountingCost_ | |
elif nodeName_ == 'FreeOfChargeIndicator': | |
FreeOfChargeIndicator_ = child_.text | |
FreeOfChargeIndicator_ = self.gds_validate_string(FreeOfChargeIndicator_, node, 'FreeOfChargeIndicator') | |
self.FreeOfChargeIndicator = FreeOfChargeIndicator_ | |
elif nodeName_ == 'OrderLineReference': | |
OrderLineReference_ = child_.text | |
OrderLineReference_ = self.gds_validate_string(OrderLineReference_, node, 'OrderLineReference') | |
self.OrderLineReference.append(OrderLineReference_) | |
elif nodeName_ == 'DespatchLineReference': | |
DespatchLineReference_ = child_.text | |
DespatchLineReference_ = self.gds_validate_string(DespatchLineReference_, node, 'DespatchLineReference') | |
self.DespatchLineReference.append(DespatchLineReference_) | |
elif nodeName_ == 'ReceiptLineReference': | |
ReceiptLineReference_ = child_.text | |
ReceiptLineReference_ = self.gds_validate_string(ReceiptLineReference_, node, 'ReceiptLineReference') | |
self.ReceiptLineReference.append(ReceiptLineReference_) | |
elif nodeName_ == 'BillingReference': | |
BillingReference_ = child_.text | |
BillingReference_ = self.gds_validate_string(BillingReference_, node, 'BillingReference') | |
self.BillingReference.append(BillingReference_) | |
elif nodeName_ == 'DocumentReference': | |
DocumentReference_ = child_.text | |
DocumentReference_ = self.gds_validate_string(DocumentReference_, node, 'DocumentReference') | |
self.DocumentReference.append(DocumentReference_) | |
elif nodeName_ == 'PricingReference': | |
PricingReference_ = child_.text | |
PricingReference_ = self.gds_validate_string(PricingReference_, node, 'PricingReference') | |
self.PricingReference = PricingReference_ | |
elif nodeName_ == 'OriginatorParty': | |
OriginatorParty_ = child_.text | |
OriginatorParty_ = self.gds_validate_string(OriginatorParty_, node, 'OriginatorParty') | |
self.OriginatorParty = OriginatorParty_ | |
elif nodeName_ == 'Delivery': | |
obj_ = DeliveryType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Delivery.append(obj_) | |
obj_.original_tagname_ = 'Delivery' | |
elif nodeName_ == 'PaymentTerms': | |
PaymentTerms_ = child_.text | |
PaymentTerms_ = self.gds_validate_string(PaymentTerms_, node, 'PaymentTerms') | |
self.PaymentTerms.append(PaymentTerms_) | |
elif nodeName_ == 'AllowanceCharge': | |
obj_ = AllowanceChargeType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AllowanceCharge.append(obj_) | |
obj_.original_tagname_ = 'AllowanceCharge' | |
elif nodeName_ == 'TaxTotal': | |
obj_ = TaxTotalType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.TaxTotal.append(obj_) | |
obj_.original_tagname_ = 'TaxTotal' | |
elif nodeName_ == 'Item': | |
obj_ = ItemType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Item = obj_ | |
obj_.original_tagname_ = 'Item' | |
elif nodeName_ == 'Price': | |
obj_ = PriceType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.Price = obj_ | |
obj_.original_tagname_ = 'Price' | |
elif nodeName_ == 'DeliveryTerms': | |
obj_ = DeliveryTermsType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.DeliveryTerms = obj_ | |
obj_.original_tagname_ = 'DeliveryTerms' | |
# end class InvoiceLineType | |
class ItemType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, Description=None, PackQuantity=None, PackSizeNumeric=None, CatalogueIndicator=None, Name=None, HazardousRiskIndicator=None, AdditionalInformation=None, Keyword=None, BrandName=None, ModelName=None, BuyersItemIdentification=None, SellersItemIdentification=None, ManufacturersItemIdentification=None, StandardItemIdentification=None, CatalogueItemIdentification=None, AdditionalItemIdentification=None, CatalogueDocumentReference=None, ItemSpecificationDocumentReference=None, OriginCountry=None, CommodityClassification=None, TransactionConditions=None, HazardousItem=None, ClassifiedTaxCategory=None, AdditionalItemProperty=None, ManufacturerParty=None, InformationContentProviderParty=None, OriginAddress=None, ItemInstance=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
if Description is None: | |
self.Description = [] | |
else: | |
self.Description = Description | |
self.PackQuantity = PackQuantity | |
self.PackSizeNumeric = PackSizeNumeric | |
self.CatalogueIndicator = CatalogueIndicator | |
self.Name = Name | |
self.HazardousRiskIndicator = HazardousRiskIndicator | |
self.AdditionalInformation = AdditionalInformation | |
if Keyword is None: | |
self.Keyword = [] | |
else: | |
self.Keyword = Keyword | |
if BrandName is None: | |
self.BrandName = [] | |
else: | |
self.BrandName = BrandName | |
if ModelName is None: | |
self.ModelName = [] | |
else: | |
self.ModelName = ModelName | |
self.BuyersItemIdentification = BuyersItemIdentification | |
self.SellersItemIdentification = SellersItemIdentification | |
if ManufacturersItemIdentification is None: | |
self.ManufacturersItemIdentification = [] | |
else: | |
self.ManufacturersItemIdentification = ManufacturersItemIdentification | |
self.StandardItemIdentification = StandardItemIdentification | |
self.CatalogueItemIdentification = CatalogueItemIdentification | |
if AdditionalItemIdentification is None: | |
self.AdditionalItemIdentification = [] | |
else: | |
self.AdditionalItemIdentification = AdditionalItemIdentification | |
self.CatalogueDocumentReference = CatalogueDocumentReference | |
if ItemSpecificationDocumentReference is None: | |
self.ItemSpecificationDocumentReference = [] | |
else: | |
self.ItemSpecificationDocumentReference = ItemSpecificationDocumentReference | |
self.OriginCountry = OriginCountry | |
if CommodityClassification is None: | |
self.CommodityClassification = [] | |
else: | |
self.CommodityClassification = CommodityClassification | |
if TransactionConditions is None: | |
self.TransactionConditions = [] | |
else: | |
self.TransactionConditions = TransactionConditions | |
if HazardousItem is None: | |
self.HazardousItem = [] | |
else: | |
self.HazardousItem = HazardousItem | |
if ClassifiedTaxCategory is None: | |
self.ClassifiedTaxCategory = [] | |
else: | |
self.ClassifiedTaxCategory = ClassifiedTaxCategory | |
if AdditionalItemProperty is None: | |
self.AdditionalItemProperty = [] | |
else: | |
self.AdditionalItemProperty = AdditionalItemProperty | |
if ManufacturerParty is None: | |
self.ManufacturerParty = [] | |
else: | |
self.ManufacturerParty = ManufacturerParty | |
self.InformationContentProviderParty = InformationContentProviderParty | |
if OriginAddress is None: | |
self.OriginAddress = [] | |
else: | |
self.OriginAddress = OriginAddress | |
if ItemInstance is None: | |
self.ItemInstance = [] | |
else: | |
self.ItemInstance = ItemInstance | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, ItemType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if ItemType.subclass: | |
return ItemType.subclass(*args_, **kwargs_) | |
else: | |
return ItemType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_Description(self): | |
return self.Description | |
def set_Description(self, Description): | |
self.Description = Description | |
def add_Description(self, value): | |
self.Description.append(value) | |
def add_Description(self, value): | |
self.Description.append(value) | |
def insert_Description_at(self, index, value): | |
self.Description.insert(index, value) | |
def replace_Description_at(self, index, value): | |
self.Description[index] = value | |
def get_PackQuantity(self): | |
return self.PackQuantity | |
def set_PackQuantity(self, PackQuantity): | |
self.PackQuantity = PackQuantity | |
def get_PackSizeNumeric(self): | |
return self.PackSizeNumeric | |
def set_PackSizeNumeric(self, PackSizeNumeric): | |
self.PackSizeNumeric = PackSizeNumeric | |
def get_CatalogueIndicator(self): | |
return self.CatalogueIndicator | |
def set_CatalogueIndicator(self, CatalogueIndicator): | |
self.CatalogueIndicator = CatalogueIndicator | |
def get_Name(self): | |
return self.Name | |
def set_Name(self, Name): | |
self.Name = Name | |
def get_HazardousRiskIndicator(self): | |
return self.HazardousRiskIndicator | |
def set_HazardousRiskIndicator(self, HazardousRiskIndicator): | |
self.HazardousRiskIndicator = HazardousRiskIndicator | |
def get_AdditionalInformation(self): | |
return self.AdditionalInformation | |
def set_AdditionalInformation(self, AdditionalInformation): | |
self.AdditionalInformation = AdditionalInformation | |
def get_Keyword(self): | |
return self.Keyword | |
def set_Keyword(self, Keyword): | |
self.Keyword = Keyword | |
def add_Keyword(self, value): | |
self.Keyword.append(value) | |
def add_Keyword(self, value): | |
self.Keyword.append(value) | |
def insert_Keyword_at(self, index, value): | |
self.Keyword.insert(index, value) | |
def replace_Keyword_at(self, index, value): | |
self.Keyword[index] = value | |
def get_BrandName(self): | |
return self.BrandName | |
def set_BrandName(self, BrandName): | |
self.BrandName = BrandName | |
def add_BrandName(self, value): | |
self.BrandName.append(value) | |
def add_BrandName(self, value): | |
self.BrandName.append(value) | |
def insert_BrandName_at(self, index, value): | |
self.BrandName.insert(index, value) | |
def replace_BrandName_at(self, index, value): | |
self.BrandName[index] = value | |
def get_ModelName(self): | |
return self.ModelName | |
def set_ModelName(self, ModelName): | |
self.ModelName = ModelName | |
def add_ModelName(self, value): | |
self.ModelName.append(value) | |
def add_ModelName(self, value): | |
self.ModelName.append(value) | |
def insert_ModelName_at(self, index, value): | |
self.ModelName.insert(index, value) | |
def replace_ModelName_at(self, index, value): | |
self.ModelName[index] = value | |
def get_BuyersItemIdentification(self): | |
return self.BuyersItemIdentification | |
def set_BuyersItemIdentification(self, BuyersItemIdentification): | |
self.BuyersItemIdentification = BuyersItemIdentification | |
def get_SellersItemIdentification(self): | |
return self.SellersItemIdentification | |
def set_SellersItemIdentification(self, SellersItemIdentification): | |
self.SellersItemIdentification = SellersItemIdentification | |
def get_ManufacturersItemIdentification(self): | |
return self.ManufacturersItemIdentification | |
def set_ManufacturersItemIdentification(self, ManufacturersItemIdentification): | |
self.ManufacturersItemIdentification = ManufacturersItemIdentification | |
def add_ManufacturersItemIdentification(self, value): | |
self.ManufacturersItemIdentification.append(value) | |
def add_ManufacturersItemIdentification(self, value): | |
self.ManufacturersItemIdentification.append(value) | |
def insert_ManufacturersItemIdentification_at(self, index, value): | |
self.ManufacturersItemIdentification.insert(index, value) | |
def replace_ManufacturersItemIdentification_at(self, index, value): | |
self.ManufacturersItemIdentification[index] = value | |
def get_StandardItemIdentification(self): | |
return self.StandardItemIdentification | |
def set_StandardItemIdentification(self, StandardItemIdentification): | |
self.StandardItemIdentification = StandardItemIdentification | |
def get_CatalogueItemIdentification(self): | |
return self.CatalogueItemIdentification | |
def set_CatalogueItemIdentification(self, CatalogueItemIdentification): | |
self.CatalogueItemIdentification = CatalogueItemIdentification | |
def get_AdditionalItemIdentification(self): | |
return self.AdditionalItemIdentification | |
def set_AdditionalItemIdentification(self, AdditionalItemIdentification): | |
self.AdditionalItemIdentification = AdditionalItemIdentification | |
def add_AdditionalItemIdentification(self, value): | |
self.AdditionalItemIdentification.append(value) | |
def add_AdditionalItemIdentification(self, value): | |
self.AdditionalItemIdentification.append(value) | |
def insert_AdditionalItemIdentification_at(self, index, value): | |
self.AdditionalItemIdentification.insert(index, value) | |
def replace_AdditionalItemIdentification_at(self, index, value): | |
self.AdditionalItemIdentification[index] = value | |
def get_CatalogueDocumentReference(self): | |
return self.CatalogueDocumentReference | |
def set_CatalogueDocumentReference(self, CatalogueDocumentReference): | |
self.CatalogueDocumentReference = CatalogueDocumentReference | |
def get_ItemSpecificationDocumentReference(self): | |
return self.ItemSpecificationDocumentReference | |
def set_ItemSpecificationDocumentReference(self, ItemSpecificationDocumentReference): | |
self.ItemSpecificationDocumentReference = ItemSpecificationDocumentReference | |
def add_ItemSpecificationDocumentReference(self, value): | |
self.ItemSpecificationDocumentReference.append(value) | |
def add_ItemSpecificationDocumentReference(self, value): | |
self.ItemSpecificationDocumentReference.append(value) | |
def insert_ItemSpecificationDocumentReference_at(self, index, value): | |
self.ItemSpecificationDocumentReference.insert(index, value) | |
def replace_ItemSpecificationDocumentReference_at(self, index, value): | |
self.ItemSpecificationDocumentReference[index] = value | |
def get_OriginCountry(self): | |
return self.OriginCountry | |
def set_OriginCountry(self, OriginCountry): | |
self.OriginCountry = OriginCountry | |
def get_CommodityClassification(self): | |
return self.CommodityClassification | |
def set_CommodityClassification(self, CommodityClassification): | |
self.CommodityClassification = CommodityClassification | |
def add_CommodityClassification(self, value): | |
self.CommodityClassification.append(value) | |
def add_CommodityClassification(self, value): | |
self.CommodityClassification.append(value) | |
def insert_CommodityClassification_at(self, index, value): | |
self.CommodityClassification.insert(index, value) | |
def replace_CommodityClassification_at(self, index, value): | |
self.CommodityClassification[index] = value | |
def get_TransactionConditions(self): | |
return self.TransactionConditions | |
def set_TransactionConditions(self, TransactionConditions): | |
self.TransactionConditions = TransactionConditions | |
def add_TransactionConditions(self, value): | |
self.TransactionConditions.append(value) | |
def add_TransactionConditions(self, value): | |
self.TransactionConditions.append(value) | |
def insert_TransactionConditions_at(self, index, value): | |
self.TransactionConditions.insert(index, value) | |
def replace_TransactionConditions_at(self, index, value): | |
self.TransactionConditions[index] = value | |
def get_HazardousItem(self): | |
return self.HazardousItem | |
def set_HazardousItem(self, HazardousItem): | |
self.HazardousItem = HazardousItem | |
def add_HazardousItem(self, value): | |
self.HazardousItem.append(value) | |
def add_HazardousItem(self, value): | |
self.HazardousItem.append(value) | |
def insert_HazardousItem_at(self, index, value): | |
self.HazardousItem.insert(index, value) | |
def replace_HazardousItem_at(self, index, value): | |
self.HazardousItem[index] = value | |
def get_ClassifiedTaxCategory(self): | |
return self.ClassifiedTaxCategory | |
def set_ClassifiedTaxCategory(self, ClassifiedTaxCategory): | |
self.ClassifiedTaxCategory = ClassifiedTaxCategory | |
def add_ClassifiedTaxCategory(self, value): | |
self.ClassifiedTaxCategory.append(value) | |
def add_ClassifiedTaxCategory(self, value): | |
self.ClassifiedTaxCategory.append(value) | |
def insert_ClassifiedTaxCategory_at(self, index, value): | |
self.ClassifiedTaxCategory.insert(index, value) | |
def replace_ClassifiedTaxCategory_at(self, index, value): | |
self.ClassifiedTaxCategory[index] = value | |
def get_AdditionalItemProperty(self): | |
return self.AdditionalItemProperty | |
def set_AdditionalItemProperty(self, AdditionalItemProperty): | |
self.AdditionalItemProperty = AdditionalItemProperty | |
def add_AdditionalItemProperty(self, value): | |
self.AdditionalItemProperty.append(value) | |
def add_AdditionalItemProperty(self, value): | |
self.AdditionalItemProperty.append(value) | |
def insert_AdditionalItemProperty_at(self, index, value): | |
self.AdditionalItemProperty.insert(index, value) | |
def replace_AdditionalItemProperty_at(self, index, value): | |
self.AdditionalItemProperty[index] = value | |
def get_ManufacturerParty(self): | |
return self.ManufacturerParty | |
def set_ManufacturerParty(self, ManufacturerParty): | |
self.ManufacturerParty = ManufacturerParty | |
def add_ManufacturerParty(self, value): | |
self.ManufacturerParty.append(value) | |
def add_ManufacturerParty(self, value): | |
self.ManufacturerParty.append(value) | |
def insert_ManufacturerParty_at(self, index, value): | |
self.ManufacturerParty.insert(index, value) | |
def replace_ManufacturerParty_at(self, index, value): | |
self.ManufacturerParty[index] = value | |
def get_InformationContentProviderParty(self): | |
return self.InformationContentProviderParty | |
def set_InformationContentProviderParty(self, InformationContentProviderParty): | |
self.InformationContentProviderParty = InformationContentProviderParty | |
def get_OriginAddress(self): | |
return self.OriginAddress | |
def set_OriginAddress(self, OriginAddress): | |
self.OriginAddress = OriginAddress | |
def add_OriginAddress(self, value): | |
self.OriginAddress.append(value) | |
def add_OriginAddress(self, value): | |
self.OriginAddress.append(value) | |
def insert_OriginAddress_at(self, index, value): | |
self.OriginAddress.insert(index, value) | |
def replace_OriginAddress_at(self, index, value): | |
self.OriginAddress[index] = value | |
def get_ItemInstance(self): | |
return self.ItemInstance | |
def set_ItemInstance(self, ItemInstance): | |
self.ItemInstance = ItemInstance | |
def add_ItemInstance(self, value): | |
self.ItemInstance.append(value) | |
def add_ItemInstance(self, value): | |
self.ItemInstance.append(value) | |
def insert_ItemInstance_at(self, index, value): | |
self.ItemInstance.insert(index, value) | |
def replace_ItemInstance_at(self, index, value): | |
self.ItemInstance[index] = value | |
def hasContent_(self): | |
if ( | |
self.Description or | |
self.PackQuantity is not None or | |
self.PackSizeNumeric is not None or | |
self.CatalogueIndicator is not None or | |
self.Name is not None or | |
self.HazardousRiskIndicator is not None or | |
self.AdditionalInformation is not None or | |
self.Keyword or | |
self.BrandName or | |
self.ModelName or | |
self.BuyersItemIdentification is not None or | |
self.SellersItemIdentification is not None or | |
self.ManufacturersItemIdentification or | |
self.StandardItemIdentification is not None or | |
self.CatalogueItemIdentification is not None or | |
self.AdditionalItemIdentification or | |
self.CatalogueDocumentReference is not None or | |
self.ItemSpecificationDocumentReference or | |
self.OriginCountry is not None or | |
self.CommodityClassification or | |
self.TransactionConditions or | |
self.HazardousItem or | |
self.ClassifiedTaxCategory or | |
self.AdditionalItemProperty or | |
self.ManufacturerParty or | |
self.InformationContentProviderParty is not None or | |
self.OriginAddress or | |
self.ItemInstance | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='ItemType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('ItemType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='ItemType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='ItemType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='ItemType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='ItemType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
for Description_ in self.Description: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sDescription>%s</%sDescription>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(Description_), input_name='Description')), namespaceprefix_ , eol_)) | |
if self.PackQuantity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPackQuantity>%s</%sPackQuantity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PackQuantity), input_name='PackQuantity')), namespaceprefix_ , eol_)) | |
if self.PackSizeNumeric is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPackSizeNumeric>%s</%sPackSizeNumeric>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PackSizeNumeric), input_name='PackSizeNumeric')), namespaceprefix_ , eol_)) | |
if self.CatalogueIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCatalogueIndicator>%s</%sCatalogueIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CatalogueIndicator), input_name='CatalogueIndicator')), namespaceprefix_ , eol_)) | |
if self.Name is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sName>%s</%sName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Name), input_name='Name')), namespaceprefix_ , eol_)) | |
if self.HazardousRiskIndicator is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sHazardousRiskIndicator>%s</%sHazardousRiskIndicator>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.HazardousRiskIndicator), input_name='HazardousRiskIndicator')), namespaceprefix_ , eol_)) | |
if self.AdditionalInformation is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalInformation>%s</%sAdditionalInformation>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.AdditionalInformation), input_name='AdditionalInformation')), namespaceprefix_ , eol_)) | |
for Keyword_ in self.Keyword: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sKeyword>%s</%sKeyword>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(Keyword_), input_name='Keyword')), namespaceprefix_ , eol_)) | |
for BrandName_ in self.BrandName: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBrandName>%s</%sBrandName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(BrandName_), input_name='BrandName')), namespaceprefix_ , eol_)) | |
for ModelName_ in self.ModelName: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sModelName>%s</%sModelName>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ModelName_), input_name='ModelName')), namespaceprefix_ , eol_)) | |
if self.BuyersItemIdentification is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBuyersItemIdentification>%s</%sBuyersItemIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BuyersItemIdentification), input_name='BuyersItemIdentification')), namespaceprefix_ , eol_)) | |
if self.SellersItemIdentification is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sSellersItemIdentification>%s</%sSellersItemIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SellersItemIdentification), input_name='SellersItemIdentification')), namespaceprefix_ , eol_)) | |
for ManufacturersItemIdentification_ in self.ManufacturersItemIdentification: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sManufacturersItemIdentification>%s</%sManufacturersItemIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ManufacturersItemIdentification_), input_name='ManufacturersItemIdentification')), namespaceprefix_ , eol_)) | |
if self.StandardItemIdentification is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sStandardItemIdentification>%s</%sStandardItemIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.StandardItemIdentification), input_name='StandardItemIdentification')), namespaceprefix_ , eol_)) | |
if self.CatalogueItemIdentification is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCatalogueItemIdentification>%s</%sCatalogueItemIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CatalogueItemIdentification), input_name='CatalogueItemIdentification')), namespaceprefix_ , eol_)) | |
for AdditionalItemIdentification_ in self.AdditionalItemIdentification: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalItemIdentification>%s</%sAdditionalItemIdentification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(AdditionalItemIdentification_), input_name='AdditionalItemIdentification')), namespaceprefix_ , eol_)) | |
if self.CatalogueDocumentReference is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCatalogueDocumentReference>%s</%sCatalogueDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CatalogueDocumentReference), input_name='CatalogueDocumentReference')), namespaceprefix_ , eol_)) | |
for ItemSpecificationDocumentReference_ in self.ItemSpecificationDocumentReference: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sItemSpecificationDocumentReference>%s</%sItemSpecificationDocumentReference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ItemSpecificationDocumentReference_), input_name='ItemSpecificationDocumentReference')), namespaceprefix_ , eol_)) | |
if self.OriginCountry is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOriginCountry>%s</%sOriginCountry>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.OriginCountry), input_name='OriginCountry')), namespaceprefix_ , eol_)) | |
for CommodityClassification_ in self.CommodityClassification: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sCommodityClassification>%s</%sCommodityClassification>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CommodityClassification_), input_name='CommodityClassification')), namespaceprefix_ , eol_)) | |
for TransactionConditions_ in self.TransactionConditions: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sTransactionConditions>%s</%sTransactionConditions>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(TransactionConditions_), input_name='TransactionConditions')), namespaceprefix_ , eol_)) | |
for HazardousItem_ in self.HazardousItem: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sHazardousItem>%s</%sHazardousItem>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(HazardousItem_), input_name='HazardousItem')), namespaceprefix_ , eol_)) | |
for ClassifiedTaxCategory_ in self.ClassifiedTaxCategory: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sClassifiedTaxCategory>%s</%sClassifiedTaxCategory>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ClassifiedTaxCategory_), input_name='ClassifiedTaxCategory')), namespaceprefix_ , eol_)) | |
for AdditionalItemProperty_ in self.AdditionalItemProperty: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sAdditionalItemProperty>%s</%sAdditionalItemProperty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(AdditionalItemProperty_), input_name='AdditionalItemProperty')), namespaceprefix_ , eol_)) | |
for ManufacturerParty_ in self.ManufacturerParty: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sManufacturerParty>%s</%sManufacturerParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ManufacturerParty_), input_name='ManufacturerParty')), namespaceprefix_ , eol_)) | |
if self.InformationContentProviderParty is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sInformationContentProviderParty>%s</%sInformationContentProviderParty>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.InformationContentProviderParty), input_name='InformationContentProviderParty')), namespaceprefix_ , eol_)) | |
for OriginAddress_ in self.OriginAddress: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOriginAddress>%s</%sOriginAddress>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OriginAddress_), input_name='OriginAddress')), namespaceprefix_ , eol_)) | |
for ItemInstance_ in self.ItemInstance: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sItemInstance>%s</%sItemInstance>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ItemInstance_), input_name='ItemInstance')), namespaceprefix_ , eol_)) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'Description': | |
Description_ = child_.text | |
Description_ = self.gds_validate_string(Description_, node, 'Description') | |
self.Description.append(Description_) | |
elif nodeName_ == 'PackQuantity': | |
PackQuantity_ = child_.text | |
PackQuantity_ = self.gds_validate_string(PackQuantity_, node, 'PackQuantity') | |
self.PackQuantity = PackQuantity_ | |
elif nodeName_ == 'PackSizeNumeric': | |
PackSizeNumeric_ = child_.text | |
PackSizeNumeric_ = self.gds_validate_string(PackSizeNumeric_, node, 'PackSizeNumeric') | |
self.PackSizeNumeric = PackSizeNumeric_ | |
elif nodeName_ == 'CatalogueIndicator': | |
CatalogueIndicator_ = child_.text | |
CatalogueIndicator_ = self.gds_validate_string(CatalogueIndicator_, node, 'CatalogueIndicator') | |
self.CatalogueIndicator = CatalogueIndicator_ | |
elif nodeName_ == 'Name': | |
Name_ = child_.text | |
Name_ = self.gds_validate_string(Name_, node, 'Name') | |
self.Name = Name_ | |
elif nodeName_ == 'HazardousRiskIndicator': | |
HazardousRiskIndicator_ = child_.text | |
HazardousRiskIndicator_ = self.gds_validate_string(HazardousRiskIndicator_, node, 'HazardousRiskIndicator') | |
self.HazardousRiskIndicator = HazardousRiskIndicator_ | |
elif nodeName_ == 'AdditionalInformation': | |
AdditionalInformation_ = child_.text | |
AdditionalInformation_ = self.gds_validate_string(AdditionalInformation_, node, 'AdditionalInformation') | |
self.AdditionalInformation = AdditionalInformation_ | |
elif nodeName_ == 'Keyword': | |
Keyword_ = child_.text | |
Keyword_ = self.gds_validate_string(Keyword_, node, 'Keyword') | |
self.Keyword.append(Keyword_) | |
elif nodeName_ == 'BrandName': | |
BrandName_ = child_.text | |
BrandName_ = self.gds_validate_string(BrandName_, node, 'BrandName') | |
self.BrandName.append(BrandName_) | |
elif nodeName_ == 'ModelName': | |
ModelName_ = child_.text | |
ModelName_ = self.gds_validate_string(ModelName_, node, 'ModelName') | |
self.ModelName.append(ModelName_) | |
elif nodeName_ == 'BuyersItemIdentification': | |
BuyersItemIdentification_ = child_.text | |
BuyersItemIdentification_ = self.gds_validate_string(BuyersItemIdentification_, node, 'BuyersItemIdentification') | |
self.BuyersItemIdentification = BuyersItemIdentification_ | |
elif nodeName_ == 'SellersItemIdentification': | |
SellersItemIdentification_ = child_.text | |
SellersItemIdentification_ = self.gds_validate_string(SellersItemIdentification_, node, 'SellersItemIdentification') | |
self.SellersItemIdentification = SellersItemIdentification_ | |
elif nodeName_ == 'ManufacturersItemIdentification': | |
ManufacturersItemIdentification_ = child_.text | |
ManufacturersItemIdentification_ = self.gds_validate_string(ManufacturersItemIdentification_, node, 'ManufacturersItemIdentification') | |
self.ManufacturersItemIdentification.append(ManufacturersItemIdentification_) | |
elif nodeName_ == 'StandardItemIdentification': | |
StandardItemIdentification_ = child_.text | |
StandardItemIdentification_ = self.gds_validate_string(StandardItemIdentification_, node, 'StandardItemIdentification') | |
self.StandardItemIdentification = StandardItemIdentification_ | |
elif nodeName_ == 'CatalogueItemIdentification': | |
CatalogueItemIdentification_ = child_.text | |
CatalogueItemIdentification_ = self.gds_validate_string(CatalogueItemIdentification_, node, 'CatalogueItemIdentification') | |
self.CatalogueItemIdentification = CatalogueItemIdentification_ | |
elif nodeName_ == 'AdditionalItemIdentification': | |
AdditionalItemIdentification_ = child_.text | |
AdditionalItemIdentification_ = self.gds_validate_string(AdditionalItemIdentification_, node, 'AdditionalItemIdentification') | |
self.AdditionalItemIdentification.append(AdditionalItemIdentification_) | |
elif nodeName_ == 'CatalogueDocumentReference': | |
CatalogueDocumentReference_ = child_.text | |
CatalogueDocumentReference_ = self.gds_validate_string(CatalogueDocumentReference_, node, 'CatalogueDocumentReference') | |
self.CatalogueDocumentReference = CatalogueDocumentReference_ | |
elif nodeName_ == 'ItemSpecificationDocumentReference': | |
ItemSpecificationDocumentReference_ = child_.text | |
ItemSpecificationDocumentReference_ = self.gds_validate_string(ItemSpecificationDocumentReference_, node, 'ItemSpecificationDocumentReference') | |
self.ItemSpecificationDocumentReference.append(ItemSpecificationDocumentReference_) | |
elif nodeName_ == 'OriginCountry': | |
OriginCountry_ = child_.text | |
OriginCountry_ = self.gds_validate_string(OriginCountry_, node, 'OriginCountry') | |
self.OriginCountry = OriginCountry_ | |
elif nodeName_ == 'CommodityClassification': | |
CommodityClassification_ = child_.text | |
CommodityClassification_ = self.gds_validate_string(CommodityClassification_, node, 'CommodityClassification') | |
self.CommodityClassification.append(CommodityClassification_) | |
elif nodeName_ == 'TransactionConditions': | |
TransactionConditions_ = child_.text | |
TransactionConditions_ = self.gds_validate_string(TransactionConditions_, node, 'TransactionConditions') | |
self.TransactionConditions.append(TransactionConditions_) | |
elif nodeName_ == 'HazardousItem': | |
HazardousItem_ = child_.text | |
HazardousItem_ = self.gds_validate_string(HazardousItem_, node, 'HazardousItem') | |
self.HazardousItem.append(HazardousItem_) | |
elif nodeName_ == 'ClassifiedTaxCategory': | |
ClassifiedTaxCategory_ = child_.text | |
ClassifiedTaxCategory_ = self.gds_validate_string(ClassifiedTaxCategory_, node, 'ClassifiedTaxCategory') | |
self.ClassifiedTaxCategory.append(ClassifiedTaxCategory_) | |
elif nodeName_ == 'AdditionalItemProperty': | |
AdditionalItemProperty_ = child_.text | |
AdditionalItemProperty_ = self.gds_validate_string(AdditionalItemProperty_, node, 'AdditionalItemProperty') | |
self.AdditionalItemProperty.append(AdditionalItemProperty_) | |
elif nodeName_ == 'ManufacturerParty': | |
ManufacturerParty_ = child_.text | |
ManufacturerParty_ = self.gds_validate_string(ManufacturerParty_, node, 'ManufacturerParty') | |
self.ManufacturerParty.append(ManufacturerParty_) | |
elif nodeName_ == 'InformationContentProviderParty': | |
InformationContentProviderParty_ = child_.text | |
InformationContentProviderParty_ = self.gds_validate_string(InformationContentProviderParty_, node, 'InformationContentProviderParty') | |
self.InformationContentProviderParty = InformationContentProviderParty_ | |
elif nodeName_ == 'OriginAddress': | |
OriginAddress_ = child_.text | |
OriginAddress_ = self.gds_validate_string(OriginAddress_, node, 'OriginAddress') | |
self.OriginAddress.append(OriginAddress_) | |
elif nodeName_ == 'ItemInstance': | |
ItemInstance_ = child_.text | |
ItemInstance_ = self.gds_validate_string(ItemInstance_, node, 'ItemInstance') | |
self.ItemInstance.append(ItemInstance_) | |
# end class ItemType | |
class PriceType(GeneratedsSuper): | |
subclass = None | |
superclass = None | |
def __init__(self, PriceAmount=None, BaseQuantity=None, PriceChangeReason=None, PriceTypeCode=None, PriceType_member=None, OrderableUnitFactorRate=None, ValidityPeriod=None, PriceList=None, AllowanceCharge=None, **kwargs_): | |
self.original_tagname_ = None | |
self.parent_object_ = kwargs_.get('parent_object_') | |
self.PriceAmount = PriceAmount | |
self.BaseQuantity = BaseQuantity | |
if PriceChangeReason is None: | |
self.PriceChangeReason = [] | |
else: | |
self.PriceChangeReason = PriceChangeReason | |
self.PriceTypeCode = PriceTypeCode | |
self.PriceType = PriceType_member | |
self.OrderableUnitFactorRate = OrderableUnitFactorRate | |
if ValidityPeriod is None: | |
self.ValidityPeriod = [] | |
else: | |
self.ValidityPeriod = ValidityPeriod | |
self.PriceList = PriceList | |
if AllowanceCharge is None: | |
self.AllowanceCharge = [] | |
else: | |
self.AllowanceCharge = AllowanceCharge | |
def factory(*args_, **kwargs_): | |
if CurrentSubclassModule_ is not None: | |
subclass = getSubclassFromModule_( | |
CurrentSubclassModule_, PriceType) | |
if subclass is not None: | |
return subclass(*args_, **kwargs_) | |
if PriceType.subclass: | |
return PriceType.subclass(*args_, **kwargs_) | |
else: | |
return PriceType(*args_, **kwargs_) | |
factory = staticmethod(factory) | |
def get_PriceAmount(self): | |
return self.PriceAmount | |
def set_PriceAmount(self, PriceAmount): | |
self.PriceAmount = PriceAmount | |
def get_BaseQuantity(self): | |
return self.BaseQuantity | |
def set_BaseQuantity(self, BaseQuantity): | |
self.BaseQuantity = BaseQuantity | |
def get_PriceChangeReason(self): | |
return self.PriceChangeReason | |
def set_PriceChangeReason(self, PriceChangeReason): | |
self.PriceChangeReason = PriceChangeReason | |
def add_PriceChangeReason(self, value): | |
self.PriceChangeReason.append(value) | |
def add_PriceChangeReason(self, value): | |
self.PriceChangeReason.append(value) | |
def insert_PriceChangeReason_at(self, index, value): | |
self.PriceChangeReason.insert(index, value) | |
def replace_PriceChangeReason_at(self, index, value): | |
self.PriceChangeReason[index] = value | |
def get_PriceTypeCode(self): | |
return self.PriceTypeCode | |
def set_PriceTypeCode(self, PriceTypeCode): | |
self.PriceTypeCode = PriceTypeCode | |
def get_PriceType(self): | |
return self.PriceType | |
def set_PriceType(self, PriceType): | |
self.PriceType = PriceType | |
def get_OrderableUnitFactorRate(self): | |
return self.OrderableUnitFactorRate | |
def set_OrderableUnitFactorRate(self, OrderableUnitFactorRate): | |
self.OrderableUnitFactorRate = OrderableUnitFactorRate | |
def get_ValidityPeriod(self): | |
return self.ValidityPeriod | |
def set_ValidityPeriod(self, ValidityPeriod): | |
self.ValidityPeriod = ValidityPeriod | |
def add_ValidityPeriod(self, value): | |
self.ValidityPeriod.append(value) | |
def add_ValidityPeriod(self, value): | |
self.ValidityPeriod.append(value) | |
def insert_ValidityPeriod_at(self, index, value): | |
self.ValidityPeriod.insert(index, value) | |
def replace_ValidityPeriod_at(self, index, value): | |
self.ValidityPeriod[index] = value | |
def get_PriceList(self): | |
return self.PriceList | |
def set_PriceList(self, PriceList): | |
self.PriceList = PriceList | |
def get_AllowanceCharge(self): | |
return self.AllowanceCharge | |
def set_AllowanceCharge(self, AllowanceCharge): | |
self.AllowanceCharge = AllowanceCharge | |
def add_AllowanceCharge(self, value): | |
self.AllowanceCharge.append(value) | |
def add_AllowanceCharge(self, value): | |
self.AllowanceCharge.append(value) | |
def insert_AllowanceCharge_at(self, index, value): | |
self.AllowanceCharge.insert(index, value) | |
def replace_AllowanceCharge_at(self, index, value): | |
self.AllowanceCharge[index] = value | |
def hasContent_(self): | |
if ( | |
self.PriceAmount is not None or | |
self.BaseQuantity is not None or | |
self.PriceChangeReason or | |
self.PriceTypeCode is not None or | |
self.PriceType is not None or | |
self.OrderableUnitFactorRate is not None or | |
self.ValidityPeriod or | |
self.PriceList is not None or | |
self.AllowanceCharge | |
): | |
return True | |
else: | |
return False | |
def export(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PriceType', pretty_print=True): | |
imported_ns_def_ = GenerateDSNamespaceDefs_.get('PriceType') | |
if imported_ns_def_ is not None: | |
namespacedef_ = imported_ns_def_ | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.original_tagname_ is not None: | |
name_ = self.original_tagname_ | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) | |
already_processed = set() | |
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PriceType') | |
if self.hasContent_(): | |
outfile.write('>%s' % (eol_, )) | |
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PriceType', pretty_print=pretty_print) | |
showIndent(outfile, level, pretty_print) | |
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) | |
else: | |
outfile.write('/>%s' % (eol_, )) | |
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tns:', name_='PriceType'): | |
pass | |
def exportChildren(self, outfile, level, namespaceprefix_='tns:', namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" ', name_='PriceType', fromsubclass_=False, pretty_print=True): | |
if pretty_print: | |
eol_ = '\n' | |
else: | |
eol_ = '' | |
if self.PriceAmount is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPriceAmount>%s</%sPriceAmount>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PriceAmount), input_name='PriceAmount')), namespaceprefix_ , eol_)) | |
if self.BaseQuantity is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sBaseQuantity>%s</%sBaseQuantity>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.BaseQuantity), input_name='BaseQuantity')), namespaceprefix_ , eol_)) | |
for PriceChangeReason_ in self.PriceChangeReason: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPriceChangeReason>%s</%sPriceChangeReason>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(PriceChangeReason_), input_name='PriceChangeReason')), namespaceprefix_ , eol_)) | |
if self.PriceTypeCode is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPriceTypeCode>%s</%sPriceTypeCode>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PriceTypeCode), input_name='PriceTypeCode')), namespaceprefix_ , eol_)) | |
if self.PriceType is not None: | |
self.PriceType.export(outfile, level, namespaceprefix_='cbc:', name_='PriceType', pretty_print=pretty_print) | |
if self.OrderableUnitFactorRate is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sOrderableUnitFactorRate>%s</%sOrderableUnitFactorRate>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.OrderableUnitFactorRate), input_name='OrderableUnitFactorRate')), namespaceprefix_ , eol_)) | |
for ValidityPeriod_ in self.ValidityPeriod: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sValidityPeriod>%s</%sValidityPeriod>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(ValidityPeriod_), input_name='ValidityPeriod')), namespaceprefix_ , eol_)) | |
if self.PriceList is not None: | |
showIndent(outfile, level, pretty_print) | |
outfile.write('<%sPriceList>%s</%sPriceList>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PriceList), input_name='PriceList')), namespaceprefix_ , eol_)) | |
for AllowanceCharge_ in self.AllowanceCharge: | |
AllowanceCharge_.export(outfile, level, namespaceprefix_='cac:', name_='AllowanceCharge', pretty_print=pretty_print) | |
def build(self, node): | |
already_processed = set() | |
self.buildAttributes(node, node.attrib, already_processed) | |
for child in node: | |
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] | |
self.buildChildren(child, node, nodeName_) | |
return self | |
def buildAttributes(self, node, attrs, already_processed): | |
pass | |
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): | |
if nodeName_ == 'PriceAmount': | |
PriceAmount_ = child_.text | |
PriceAmount_ = self.gds_validate_string(PriceAmount_, node, 'PriceAmount') | |
self.PriceAmount = PriceAmount_ | |
elif nodeName_ == 'BaseQuantity': | |
BaseQuantity_ = child_.text | |
BaseQuantity_ = self.gds_validate_string(BaseQuantity_, node, 'BaseQuantity') | |
self.BaseQuantity = BaseQuantity_ | |
elif nodeName_ == 'PriceChangeReason': | |
PriceChangeReason_ = child_.text | |
PriceChangeReason_ = self.gds_validate_string(PriceChangeReason_, node, 'PriceChangeReason') | |
self.PriceChangeReason.append(PriceChangeReason_) | |
elif nodeName_ == 'PriceTypeCode': | |
PriceTypeCode_ = child_.text | |
PriceTypeCode_ = self.gds_validate_string(PriceTypeCode_, node, 'PriceTypeCode') | |
self.PriceTypeCode = PriceTypeCode_ | |
elif nodeName_ == 'PriceType': | |
obj_ = PriceType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.PriceType = obj_ | |
obj_.original_tagname_ = 'PriceType' | |
elif nodeName_ == 'OrderableUnitFactorRate': | |
OrderableUnitFactorRate_ = child_.text | |
OrderableUnitFactorRate_ = self.gds_validate_string(OrderableUnitFactorRate_, node, 'OrderableUnitFactorRate') | |
self.OrderableUnitFactorRate = OrderableUnitFactorRate_ | |
elif nodeName_ == 'ValidityPeriod': | |
ValidityPeriod_ = child_.text | |
ValidityPeriod_ = self.gds_validate_string(ValidityPeriod_, node, 'ValidityPeriod') | |
self.ValidityPeriod.append(ValidityPeriod_) | |
elif nodeName_ == 'PriceList': | |
PriceList_ = child_.text | |
PriceList_ = self.gds_validate_string(PriceList_, node, 'PriceList') | |
self.PriceList = PriceList_ | |
elif nodeName_ == 'AllowanceCharge': | |
obj_ = AllowanceChargeType.factory(parent_object_=self) | |
obj_.build(child_) | |
self.AllowanceCharge.append(obj_) | |
obj_.original_tagname_ = 'AllowanceCharge' | |
# end class PriceType | |
GDSClassesMapping = { | |
'AccountingCustomerParty': CustomerPartyType, | |
'AccountingSupplierParty': SupplierPartyType, | |
'Address': AddressType, | |
'AllowanceCharge': AllowanceChargeType, | |
'CreditNote': CreditNoteType, | |
'DebitNote': DebitNoteType, | |
'Delivery': DeliveryType, | |
'DeliveryAddress': AddressType, | |
'DeliveryLocation': LocationType, | |
'DeliveryParty': PartyType, | |
'DeliveryTerms': DeliveryTermsType, | |
'Despatch': DespatchType, | |
'DespatchAddress': AddressType, | |
'DespatchParty': PartyType, | |
'Invoice': InvoiceType, | |
'InvoiceLine': InvoiceLineType, | |
'Item': ItemType, | |
'LegalMonetaryTotal': MonetaryTotalType, | |
'Party': PartyType, | |
'PartyLegalEntity': PartyLegalEntityType, | |
'PartyTaxScheme': PartyTaxSchemeType, | |
'Person': PersonType, | |
'PhysicalLocation': LocationType, | |
'PrepaidPayment': PaymentType, | |
'Price': PriceType, | |
'TaxSubtotal': TaxSubtotalType, | |
'TaxTotal': TaxTotalType, | |
} | |
USAGE_TEXT = """ | |
Usage: python <Parser>.py [ -s ] <in_xml_file> | |
""" | |
def usage(): | |
print(USAGE_TEXT) | |
sys.exit(1) | |
def get_root_tag(node): | |
tag = Tag_pattern_.match(node.tag).groups()[-1] | |
rootClass = GDSClassesMapping.get(tag) | |
if rootClass is None: | |
rootClass = globals().get(tag) | |
return tag, rootClass | |
def parse(inFileName, silence=False): | |
parser = None | |
doc = parsexml_(inFileName, parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
if not silence: | |
sys.stdout.write('<?xml version="1.0" ?>\n') | |
rootObj.export( | |
sys.stdout, 0, name_=rootTag, | |
namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1"', | |
pretty_print=True) | |
return rootObj | |
def parseEtree(inFileName, silence=False): | |
parser = None | |
doc = parsexml_(inFileName, parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
mapping = {} | |
rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping) | |
reverse_mapping = rootObj.gds_reverse_node_mapping(mapping) | |
if not silence: | |
content = etree_.tostring( | |
rootElement, pretty_print=True, | |
xml_declaration=True, encoding="utf-8") | |
sys.stdout.write(content) | |
sys.stdout.write('\n') | |
return rootObj, rootElement, mapping, reverse_mapping | |
def parseString(inString, silence=False): | |
'''Parse a string, create the object tree, and export it. | |
Arguments: | |
- inString -- A string. This XML fragment should not start | |
with an XML declaration containing an encoding. | |
- silence -- A boolean. If False, export the object. | |
Returns -- The root object in the tree. | |
''' | |
parser = None | |
rootNode= parsexmlstring_(inString, parser) | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
if not silence: | |
sys.stdout.write('<?xml version="1.0" ?>\n') | |
rootObj.export( | |
sys.stdout, 0, name_=rootTag, | |
namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1"') | |
return rootObj | |
def parseLiteral(inFileName, silence=False): | |
parser = None | |
doc = parsexml_(inFileName, parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
if not silence: | |
sys.stdout.write('#from invoice import *\n\n') | |
sys.stdout.write('import invoice as model_\n\n') | |
sys.stdout.write('rootObj = model_.rootClass(\n') | |
rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) | |
sys.stdout.write(')\n') | |
return rootObj | |
def main(): | |
args = sys.argv[1:] | |
if len(args) == 1: | |
parse(args[0]) | |
else: | |
usage() | |
if __name__ == '__main__': | |
#import pdb; pdb.set_trace() | |
main() | |
__all__ = [ | |
"AddressType", | |
"AllowanceChargeType", | |
"CreditNoteType", | |
"CustomerPartyType", | |
"DebitNoteType", | |
"DeliveryTermsType", | |
"DeliveryType", | |
"DespatchType", | |
"InvoiceLineType", | |
"InvoiceType", | |
"ItemType", | |
"LocationType", | |
"MonetaryTotalType", | |
"PartyLegalEntityType", | |
"PartyTaxSchemeType", | |
"PartyType", | |
"PaymentType", | |
"PersonType", | |
"PriceType", | |
"SupplierPartyType", | |
"TaxSubtotalType", | |
"TaxTotalType" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Generated Sun Dec 16 19:02:41 2018 by generateDS.py version 2.30.8. | |
# Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] | |
# | |
# Command line options: | |
# ('-o', 'invoice.py') | |
# ('-s', 'invoicesubs.py') | |
# ('--no-collect-includes', '') | |
# | |
# Command line arguments: | |
# ../odoo/facturark/facturark/XSD/DIAN/DIAN_UBL.xsd | |
# | |
# Command line: | |
# generateDS-2.30.8/generateDS.py -o "invoice.py" -s "invoicesubs.py" --no-collect-includes ../odoo/facturark/facturark/XSD/DIAN/DIAN_UBL.xsd | |
# | |
# Current working directory (os.getcwd()): | |
# generateDS | |
# | |
import sys | |
from lxml import etree as etree_ | |
import ??? as supermod | |
def parsexml_(infile, parser=None, **kwargs): | |
if parser is None: | |
# Use the lxml ElementTree compatible parser so that, e.g., | |
# we ignore comments. | |
parser = etree_.ETCompatXMLParser() | |
doc = etree_.parse(infile, parser=parser, **kwargs) | |
return doc | |
# | |
# Globals | |
# | |
ExternalEncoding = '' | |
# | |
# Data representation classes | |
# | |
class InvoiceTypeSub(supermod.InvoiceType): | |
def __init__(self, UBLExtensions=None, UBLVersionID=None, CustomizationID=None, ProfileID=None, ID=None, UUID=None, IssueDate=None, IssueTime=None, InvoiceTypeCode=None, Note=None, DocumentCurrencyCode=None, AccountingCostCode=None, AccountingCost=None, LineCountNumeric=None, InvoicePeriod=None, OrderReference=None, BillingReference=None, DespatchDocumentReference=None, ReceiptDocumentReference=None, OriginatorDocumentReference=None, ContractDocumentReference=None, AdditionalDocumentReference=None, AccountingSupplierParty=None, AccountingCustomerParty=None, PayeeParty=None, BuyerCustomerParty=None, SellerSupplierParty=None, TaxRepresentativeParty=None, Delivery=None, DeliveryTerms=None, PaymentMeans=None, PaymentTerms=None, PrepaidPayment=None, AllowanceCharge=None, PaymentExchangeRate=None, PaymentAlternativeExchangeRate=None, TaxTotal=None, LegalMonetaryTotal=None, InvoiceLine=None, **kwargs_): | |
super(InvoiceTypeSub, self).__init__(UBLExtensions, UBLVersionID, CustomizationID, ProfileID, ID, UUID, IssueDate, IssueTime, InvoiceTypeCode, Note, DocumentCurrencyCode, AccountingCostCode, AccountingCost, LineCountNumeric, InvoicePeriod, OrderReference, BillingReference, DespatchDocumentReference, ReceiptDocumentReference, OriginatorDocumentReference, ContractDocumentReference, AdditionalDocumentReference, AccountingSupplierParty, AccountingCustomerParty, PayeeParty, BuyerCustomerParty, SellerSupplierParty, TaxRepresentativeParty, Delivery, DeliveryTerms, PaymentMeans, PaymentTerms, PrepaidPayment, AllowanceCharge, PaymentExchangeRate, PaymentAlternativeExchangeRate, TaxTotal, LegalMonetaryTotal, InvoiceLine, **kwargs_) | |
supermod.InvoiceType.subclass = InvoiceTypeSub | |
# end class InvoiceTypeSub | |
class CreditNoteTypeSub(supermod.CreditNoteType): | |
def __init__(self, UBLExtensions=None, UBLVersionID=None, CustomizationID=None, ProfileID=None, ID=None, UUID=None, IssueDate=None, IssueTime=None, Note=None, DocumentCurrencyCode=None, AccountingCostCode=None, AccountingCost=None, LineCountNumeric=None, InvoicePeriod=None, DiscrepancyResponse=None, OrderReference=None, BillingReference=None, DespatchDocumentReference=None, ReceiptDocumentReference=None, ContractDocumentReference=None, AdditionalDocumentReference=None, AccountingSupplierParty=None, AccountingCustomerParty=None, PayeeParty=None, TaxRepresentativeParty=None, TaxTotal=None, LegalMonetaryTotal=None, CreditNoteLine=None, **kwargs_): | |
super(CreditNoteTypeSub, self).__init__(UBLExtensions, UBLVersionID, CustomizationID, ProfileID, ID, UUID, IssueDate, IssueTime, Note, DocumentCurrencyCode, AccountingCostCode, AccountingCost, LineCountNumeric, InvoicePeriod, DiscrepancyResponse, OrderReference, BillingReference, DespatchDocumentReference, ReceiptDocumentReference, ContractDocumentReference, AdditionalDocumentReference, AccountingSupplierParty, AccountingCustomerParty, PayeeParty, TaxRepresentativeParty, TaxTotal, LegalMonetaryTotal, CreditNoteLine, **kwargs_) | |
supermod.CreditNoteType.subclass = CreditNoteTypeSub | |
# end class CreditNoteTypeSub | |
class DebitNoteTypeSub(supermod.DebitNoteType): | |
def __init__(self, UBLExtensions=None, UBLVersionID=None, CustomizationID=None, ProfileID=None, ID=None, UUID=None, IssueDate=None, IssueTime=None, Note=None, DocumentCurrencyCode=None, AccountingCostCode=None, AccountingCost=None, LineCountNumeric=None, InvoicePeriod=None, DiscrepancyResponse=None, OrderReference=None, BillingReference=None, DespatchDocumentReference=None, ReceiptDocumentReference=None, ContractDocumentReference=None, AdditionalDocumentReference=None, AccountingSupplierParty=None, AccountingCustomerParty=None, PayeeParty=None, TaxRepresentativeParty=None, PrepaidPayment=None, PaymentExchangeRate=None, PaymentAlternativeExchangeRate=None, TaxTotal=None, LegalMonetaryTotal=None, DebitNoteLine=None, **kwargs_): | |
super(DebitNoteTypeSub, self).__init__(UBLExtensions, UBLVersionID, CustomizationID, ProfileID, ID, UUID, IssueDate, IssueTime, Note, DocumentCurrencyCode, AccountingCostCode, AccountingCost, LineCountNumeric, InvoicePeriod, DiscrepancyResponse, OrderReference, BillingReference, DespatchDocumentReference, ReceiptDocumentReference, ContractDocumentReference, AdditionalDocumentReference, AccountingSupplierParty, AccountingCustomerParty, PayeeParty, TaxRepresentativeParty, PrepaidPayment, PaymentExchangeRate, PaymentAlternativeExchangeRate, TaxTotal, LegalMonetaryTotal, DebitNoteLine, **kwargs_) | |
supermod.DebitNoteType.subclass = DebitNoteTypeSub | |
# end class DebitNoteTypeSub | |
class SupplierPartyTypeSub(supermod.SupplierPartyType): | |
def __init__(self, CustomerAssignedAccountID=None, AdditionalAccountID=None, DataSendingCapability=None, Party=None, DespatchContact=None, AccountingContact=None, SellerContact=None, **kwargs_): | |
super(SupplierPartyTypeSub, self).__init__(CustomerAssignedAccountID, AdditionalAccountID, DataSendingCapability, Party, DespatchContact, AccountingContact, SellerContact, **kwargs_) | |
supermod.SupplierPartyType.subclass = SupplierPartyTypeSub | |
# end class SupplierPartyTypeSub | |
class CustomerPartyTypeSub(supermod.CustomerPartyType): | |
def __init__(self, CustomerAssignedAccountID=None, SupplierAssignedAccountID=None, AdditionalAccountID=None, Party=None, DeliveryContact=None, AccountingContact=None, BuyerContact=None, **kwargs_): | |
super(CustomerPartyTypeSub, self).__init__(CustomerAssignedAccountID, SupplierAssignedAccountID, AdditionalAccountID, Party, DeliveryContact, AccountingContact, BuyerContact, **kwargs_) | |
supermod.CustomerPartyType.subclass = CustomerPartyTypeSub | |
# end class CustomerPartyTypeSub | |
class PartyTypeSub(supermod.PartyType): | |
def __init__(self, MarkCareIndicator=None, MarkAttentionIndicator=None, WebsiteURI=None, LogoReferenceID=None, EndpointID=None, PartyIdentification=None, PartyName=None, Language=None, PostalAddress=None, PhysicalLocation=None, PartyTaxScheme=None, PartyLegalEntity=None, Contact=None, Person=None, AgentParty=None, **kwargs_): | |
super(PartyTypeSub, self).__init__(MarkCareIndicator, MarkAttentionIndicator, WebsiteURI, LogoReferenceID, EndpointID, PartyIdentification, PartyName, Language, PostalAddress, PhysicalLocation, PartyTaxScheme, PartyLegalEntity, Contact, Person, AgentParty, **kwargs_) | |
supermod.PartyType.subclass = PartyTypeSub | |
# end class PartyTypeSub | |
class LocationTypeSub(supermod.LocationType): | |
def __init__(self, ID=None, Description=None, Conditions=None, CountrySubentity=None, CountrySubentityCode=None, ValidityPeriod=None, Address=None, **kwargs_): | |
super(LocationTypeSub, self).__init__(ID, Description, Conditions, CountrySubentity, CountrySubentityCode, ValidityPeriod, Address, **kwargs_) | |
supermod.LocationType.subclass = LocationTypeSub | |
# end class LocationTypeSub | |
class AddressTypeSub(supermod.AddressType): | |
def __init__(self, ID=None, AddressTypeCode=None, AddressFormatCode=None, Postbox=None, Floor=None, Room=None, StreetName=None, AdditionalStreetName=None, BlockName=None, BuildingName=None, BuildingNumber=None, InhouseMail=None, Department=None, MarkAttention=None, MarkCare=None, PlotIdentification=None, CitySubdivisionName=None, CityName=None, PostalZone=None, CountrySubentity=None, CountrySubentityCode=None, Region=None, District=None, TimezoneOffset=None, AddressLine=None, Country=None, LocationCoordinate=None, **kwargs_): | |
super(AddressTypeSub, self).__init__(ID, AddressTypeCode, AddressFormatCode, Postbox, Floor, Room, StreetName, AdditionalStreetName, BlockName, BuildingName, BuildingNumber, InhouseMail, Department, MarkAttention, MarkCare, PlotIdentification, CitySubdivisionName, CityName, PostalZone, CountrySubentity, CountrySubentityCode, Region, District, TimezoneOffset, AddressLine, Country, LocationCoordinate, **kwargs_) | |
supermod.AddressType.subclass = AddressTypeSub | |
# end class AddressTypeSub | |
class PartyTaxSchemeTypeSub(supermod.PartyTaxSchemeType): | |
def __init__(self, RegistrationName=None, CompanyID=None, TaxLevelCode=None, ExemptionReasonCode=None, ExemptionReason=None, RegistrationAddress=None, TaxScheme=None, **kwargs_): | |
super(PartyTaxSchemeTypeSub, self).__init__(RegistrationName, CompanyID, TaxLevelCode, ExemptionReasonCode, ExemptionReason, RegistrationAddress, TaxScheme, **kwargs_) | |
supermod.PartyTaxSchemeType.subclass = PartyTaxSchemeTypeSub | |
# end class PartyTaxSchemeTypeSub | |
class PartyLegalEntityTypeSub(supermod.PartyLegalEntityType): | |
def __init__(self, RegistrationName=None, CompanyID=None, RegistrationAddress=None, CorporateRegistrationScheme=None, **kwargs_): | |
super(PartyLegalEntityTypeSub, self).__init__(RegistrationName, CompanyID, RegistrationAddress, CorporateRegistrationScheme, **kwargs_) | |
supermod.PartyLegalEntityType.subclass = PartyLegalEntityTypeSub | |
# end class PartyLegalEntityTypeSub | |
class PersonTypeSub(supermod.PersonType): | |
def __init__(self, FirstName=None, FamilyName=None, Title=None, MiddleName=None, NameSuffix=None, JobTitle=None, OrganizationDepartment=None, **kwargs_): | |
super(PersonTypeSub, self).__init__(FirstName, FamilyName, Title, MiddleName, NameSuffix, JobTitle, OrganizationDepartment, **kwargs_) | |
supermod.PersonType.subclass = PersonTypeSub | |
# end class PersonTypeSub | |
class AllowanceChargeTypeSub(supermod.AllowanceChargeType): | |
def __init__(self, ID=None, ChargeIndicator=None, AllowanceChargeReasonCode=None, AllowanceChargeReason=None, MultiplierFactorNumeric=None, PrepaidIndicator=None, SequenceNumeric=None, Amount=None, BaseAmount=None, AccountingCostCode=None, AccountingCost=None, TaxCategory=None, TaxTotal=None, PaymentMeans=None, **kwargs_): | |
super(AllowanceChargeTypeSub, self).__init__(ID, ChargeIndicator, AllowanceChargeReasonCode, AllowanceChargeReason, MultiplierFactorNumeric, PrepaidIndicator, SequenceNumeric, Amount, BaseAmount, AccountingCostCode, AccountingCost, TaxCategory, TaxTotal, PaymentMeans, **kwargs_) | |
supermod.AllowanceChargeType.subclass = AllowanceChargeTypeSub | |
# end class AllowanceChargeTypeSub | |
class PaymentTypeSub(supermod.PaymentType): | |
def __init__(self, ID=None, PaidAmount=None, ReceivedDate=None, PaidDate=None, PaidTime=None, InstructionID=None, **kwargs_): | |
super(PaymentTypeSub, self).__init__(ID, PaidAmount, ReceivedDate, PaidDate, PaidTime, InstructionID, **kwargs_) | |
supermod.PaymentType.subclass = PaymentTypeSub | |
# end class PaymentTypeSub | |
class TaxTotalTypeSub(supermod.TaxTotalType): | |
def __init__(self, TaxAmount=None, RoundingAmount=None, TaxEvidenceIndicator=None, TaxSubtotal=None, **kwargs_): | |
super(TaxTotalTypeSub, self).__init__(TaxAmount, RoundingAmount, TaxEvidenceIndicator, TaxSubtotal, **kwargs_) | |
supermod.TaxTotalType.subclass = TaxTotalTypeSub | |
# end class TaxTotalTypeSub | |
class TaxSubtotalTypeSub(supermod.TaxSubtotalType): | |
def __init__(self, TaxableAmount=None, TaxAmount=None, CalculationSequenceNumeric=None, TransactionCurrencyTaxAmount=None, Percent=None, BaseUnitMeasure=None, PerUnitAmount=None, TierRange=None, TierRatePercent=None, TaxCategory=None, **kwargs_): | |
super(TaxSubtotalTypeSub, self).__init__(TaxableAmount, TaxAmount, CalculationSequenceNumeric, TransactionCurrencyTaxAmount, Percent, BaseUnitMeasure, PerUnitAmount, TierRange, TierRatePercent, TaxCategory, **kwargs_) | |
supermod.TaxSubtotalType.subclass = TaxSubtotalTypeSub | |
# end class TaxSubtotalTypeSub | |
class MonetaryTotalTypeSub(supermod.MonetaryTotalType): | |
def __init__(self, LineExtensionAmount=None, TaxExclusiveAmount=None, TaxInclusiveAmount=None, AllowanceTotalAmount=None, ChargeTotalAmount=None, PrepaidAmount=None, PayableRoundingAmount=None, PayableAmount=None, **kwargs_): | |
super(MonetaryTotalTypeSub, self).__init__(LineExtensionAmount, TaxExclusiveAmount, TaxInclusiveAmount, AllowanceTotalAmount, ChargeTotalAmount, PrepaidAmount, PayableRoundingAmount, PayableAmount, **kwargs_) | |
supermod.MonetaryTotalType.subclass = MonetaryTotalTypeSub | |
# end class MonetaryTotalTypeSub | |
class DeliveryTypeSub(supermod.DeliveryType): | |
def __init__(self, ID=None, Quantity=None, MinimumQuantity=None, MaximumQuantity=None, ActualDeliveryDate=None, ActualDeliveryTime=None, LatestDeliveryDate=None, LatestDeliveryTime=None, TrackingID=None, DeliveryAddress=None, DeliveryLocation=None, RequestedDeliveryPeriod=None, PromisedDeliveryPeriod=None, EstimatedDeliveryPeriod=None, DeliveryParty=None, Despatch=None, **kwargs_): | |
super(DeliveryTypeSub, self).__init__(ID, Quantity, MinimumQuantity, MaximumQuantity, ActualDeliveryDate, ActualDeliveryTime, LatestDeliveryDate, LatestDeliveryTime, TrackingID, DeliveryAddress, DeliveryLocation, RequestedDeliveryPeriod, PromisedDeliveryPeriod, EstimatedDeliveryPeriod, DeliveryParty, Despatch, **kwargs_) | |
supermod.DeliveryType.subclass = DeliveryTypeSub | |
# end class DeliveryTypeSub | |
class DespatchTypeSub(supermod.DespatchType): | |
def __init__(self, ID=None, RequestedDespatchDate=None, RequestedDespatchTime=None, EstimatedDespatchDate=None, EstimatedDespatchTime=None, ActualDespatchDate=None, ActualDespatchTime=None, DespatchAddress=None, DespatchParty=None, Contact=None, **kwargs_): | |
super(DespatchTypeSub, self).__init__(ID, RequestedDespatchDate, RequestedDespatchTime, EstimatedDespatchDate, EstimatedDespatchTime, ActualDespatchDate, ActualDespatchTime, DespatchAddress, DespatchParty, Contact, **kwargs_) | |
supermod.DespatchType.subclass = DespatchTypeSub | |
# end class DespatchTypeSub | |
class DeliveryTermsTypeSub(supermod.DeliveryTermsType): | |
def __init__(self, ID=None, SpecialTerms=None, LossRiskResponsibilityCode=None, LossRisk=None, DeliveryLocation=None, AllowanceCharge=None, **kwargs_): | |
super(DeliveryTermsTypeSub, self).__init__(ID, SpecialTerms, LossRiskResponsibilityCode, LossRisk, DeliveryLocation, AllowanceCharge, **kwargs_) | |
supermod.DeliveryTermsType.subclass = DeliveryTermsTypeSub | |
# end class DeliveryTermsTypeSub | |
class InvoiceLineTypeSub(supermod.InvoiceLineType): | |
def __init__(self, ID=None, UUID=None, Note=None, InvoicedQuantity=None, LineExtensionAmount=None, TaxPointDate=None, AccountingCostCode=None, AccountingCost=None, FreeOfChargeIndicator=None, OrderLineReference=None, DespatchLineReference=None, ReceiptLineReference=None, BillingReference=None, DocumentReference=None, PricingReference=None, OriginatorParty=None, Delivery=None, PaymentTerms=None, AllowanceCharge=None, TaxTotal=None, Item=None, Price=None, DeliveryTerms=None, **kwargs_): | |
super(InvoiceLineTypeSub, self).__init__(ID, UUID, Note, InvoicedQuantity, LineExtensionAmount, TaxPointDate, AccountingCostCode, AccountingCost, FreeOfChargeIndicator, OrderLineReference, DespatchLineReference, ReceiptLineReference, BillingReference, DocumentReference, PricingReference, OriginatorParty, Delivery, PaymentTerms, AllowanceCharge, TaxTotal, Item, Price, DeliveryTerms, **kwargs_) | |
supermod.InvoiceLineType.subclass = InvoiceLineTypeSub | |
# end class InvoiceLineTypeSub | |
class ItemTypeSub(supermod.ItemType): | |
def __init__(self, Description=None, PackQuantity=None, PackSizeNumeric=None, CatalogueIndicator=None, Name=None, HazardousRiskIndicator=None, AdditionalInformation=None, Keyword=None, BrandName=None, ModelName=None, BuyersItemIdentification=None, SellersItemIdentification=None, ManufacturersItemIdentification=None, StandardItemIdentification=None, CatalogueItemIdentification=None, AdditionalItemIdentification=None, CatalogueDocumentReference=None, ItemSpecificationDocumentReference=None, OriginCountry=None, CommodityClassification=None, TransactionConditions=None, HazardousItem=None, ClassifiedTaxCategory=None, AdditionalItemProperty=None, ManufacturerParty=None, InformationContentProviderParty=None, OriginAddress=None, ItemInstance=None, **kwargs_): | |
super(ItemTypeSub, self).__init__(Description, PackQuantity, PackSizeNumeric, CatalogueIndicator, Name, HazardousRiskIndicator, AdditionalInformation, Keyword, BrandName, ModelName, BuyersItemIdentification, SellersItemIdentification, ManufacturersItemIdentification, StandardItemIdentification, CatalogueItemIdentification, AdditionalItemIdentification, CatalogueDocumentReference, ItemSpecificationDocumentReference, OriginCountry, CommodityClassification, TransactionConditions, HazardousItem, ClassifiedTaxCategory, AdditionalItemProperty, ManufacturerParty, InformationContentProviderParty, OriginAddress, ItemInstance, **kwargs_) | |
supermod.ItemType.subclass = ItemTypeSub | |
# end class ItemTypeSub | |
class PriceTypeSub(supermod.PriceType): | |
def __init__(self, PriceAmount=None, BaseQuantity=None, PriceChangeReason=None, PriceTypeCode=None, PriceType_member=None, OrderableUnitFactorRate=None, ValidityPeriod=None, PriceList=None, AllowanceCharge=None, **kwargs_): | |
super(PriceTypeSub, self).__init__(PriceAmount, BaseQuantity, PriceChangeReason, PriceTypeCode, PriceType_member, OrderableUnitFactorRate, ValidityPeriod, PriceList, AllowanceCharge, **kwargs_) | |
supermod.PriceType.subclass = PriceTypeSub | |
# end class PriceTypeSub | |
def get_root_tag(node): | |
tag = supermod.Tag_pattern_.match(node.tag).groups()[-1] | |
rootClass = None | |
rootClass = supermod.GDSClassesMapping.get(tag) | |
if rootClass is None and hasattr(supermod, tag): | |
rootClass = getattr(supermod, tag) | |
return tag, rootClass | |
def parse(inFilename, silence=False): | |
parser = None | |
doc = parsexml_(inFilename, parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = supermod.InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
if not silence: | |
sys.stdout.write('<?xml version="1.0" ?>\n') | |
rootObj.export( | |
sys.stdout, 0, name_=rootTag, | |
namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1"', | |
pretty_print=True) | |
return rootObj | |
def parseEtree(inFilename, silence=False): | |
parser = None | |
doc = parsexml_(inFilename, parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = supermod.InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
mapping = {} | |
rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping) | |
reverse_mapping = rootObj.gds_reverse_node_mapping(mapping) | |
if not silence: | |
content = etree_.tostring( | |
rootElement, pretty_print=True, | |
xml_declaration=True, encoding="utf-8") | |
sys.stdout.write(content) | |
sys.stdout.write('\n') | |
return rootObj, rootElement, mapping, reverse_mapping | |
def parseString(inString, silence=False): | |
if sys.version_info.major == 2: | |
from StringIO import StringIO | |
else: | |
from io import BytesIO as StringIO | |
parser = None | |
doc = parsexml_(StringIO(inString), parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = supermod.InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
if not silence: | |
sys.stdout.write('<?xml version="1.0" ?>\n') | |
rootObj.export( | |
sys.stdout, 0, name_=rootTag, | |
namespacedef_='xmlns:tns="http://www.dian.gov.co/contratos/facturaelectronica/v1"') | |
return rootObj | |
def parseLiteral(inFilename, silence=False): | |
parser = None | |
doc = parsexml_(inFilename, parser) | |
rootNode = doc.getroot() | |
rootTag, rootClass = get_root_tag(rootNode) | |
if rootClass is None: | |
rootTag = 'InvoiceType' | |
rootClass = supermod.InvoiceType | |
rootObj = rootClass.factory() | |
rootObj.build(rootNode) | |
# Enable Python to collect the space used by the DOM. | |
doc = None | |
if not silence: | |
sys.stdout.write('#from ??? import *\n\n') | |
sys.stdout.write('import ??? as model_\n\n') | |
sys.stdout.write('rootObj = model_.rootClass(\n') | |
rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) | |
sys.stdout.write(')\n') | |
return rootObj | |
USAGE_TEXT = """ | |
Usage: python ???.py <infilename> | |
""" | |
def usage(): | |
print(USAGE_TEXT) | |
sys.exit(1) | |
def main(): | |
args = sys.argv[1:] | |
if len(args) != 1: | |
usage() | |
infilename = args[0] | |
parse(infilename) | |
if __name__ == '__main__': | |
#import pdb; pdb.set_trace() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment