<!ELEMENT root (salesinvoice)>
<!ELEMENT salesinvoice (salesinvoicenumber?, salesinvoicedate, salesinvoiceeventdate?, salesinvoiceduedate?, salesinvoicevaluedate?, salesinvoicedeliverydate?, salesinvoicedeliverytocustomerdate?, salesinvoicewaybillidentifier?, salesinvoicereferencenumber?, salesinvoiceamount, selleridentifier?, sellername?, invoicetype?, salesinvoicestatus, salesinvoicefreetextbeforelines?, salesinvoicefreetextafterlines?, salesinvoiceourreference?, salesinvoiceyourreference?, salesinvoiceprivatecomment?, invoicingcustomeridentifier, invoicingcustomername?, invoicingcustomernameextension?, invoicingcustomeraddressline?, invoicingcustomeradditionaladdressline?, invoicingcustomerpostnumber?, invoicingcustomertown?, invoicingcustomercountrycode?, officeidentifier?, deliveryoffice?, deliveryaddressname?, deliveryaddressnameextension?, deliveryaddressline?, deliveryaddresspostnumber?, deliveryaddresstown?, deliveryaddresscountrycode?, deliverymethod?, deliveryterm?, salesinvoicetaxhandlingtype?, paymenttermnetdays?, paymenttermcashdiscountdays?, paymenttermcashdiscount?, paymentterm?, expectpartialpayments?, trydirectdebitlink?, overridevouchersalesreceivablesaccountnumber?, invoicesubjecttype?, salesinvoiceagreementidentifier?, printchannelformat?, secondname?, overriderateofoverdue?, ordernumber?, proposedaccount?, accountdimensiontext?, collectioncost?, isthirdpartysales?, salesinvoicetaxhandlingclause?, denyinvoicecollection?, invoicelines, invoicevoucherlines?, accrualrule?, salesinvoiceattachments?, customtags?)>
<!ELEMENT invoicelines (invoiceline+)>
<!ELEMENT invoiceline (salesinvoiceproductline?|salesinvoicecommentline?|salesinvoicesubline?)>
<!ELEMENT salesinvoiceproductline (productidentifier, productname, productunitprice, productunitpurchaseprice?, productvatpercentage, salesinvoiceproductlinequantity, salesinvoiceproductlinediscountpercentage?, salesinvoiceproductlinefreetext?, salesinvoiceproductlinevatsum?, salesinvoiceproductlinesum?, salesinvoiceproductlineinventoryid?, accountingaccountsuggestion?, skipaccrual?, dimension*, provisionpercentage?, accrualrule?, productunitname?, deliverydate?, ordernumber?, deliveryidentifier?, proposedaccount?, accountdimensiontext?)>
<!ELEMENT salesinvoicecommentline (comment)>
<!ELEMENT salesinvoicesubline (sublinearticleidentifier?, sublinearticlename, sublinedescription?, sublineunitcode?, sublineunitprice?, sublinedeliveredquantity?, sublinediscountpercent?, sublinevatpercent?, sublinesum?, sublinevatsum?)>
<!ELEMENT invoicevoucherlines (calculationmode?, voucherline+)>
<!ELEMENT voucherline (linesum, description?, accountnumber, vatpercent, skipaccrual?, accountdimension?, dimension*)>
<!ELEMENT dimension (dimensionname, dimensionitem?, dimensionitemcode?, dimensionitemname?, metadata*)>
<!ELEMENT metadata (data)>
<!ELEMENT salesinvoiceattachments (salesinvoiceattachment+)>
<!ELEMENT salesinvoiceattachment (mimetype, attachmentdescription, filename, documentdata, printbydefault?)>
<!ELEMENT customtags (tag*)>
<!ELEMENT tag (tagname, tagvalue)>

<!ELEMENT accrualrule (startmonth, startyear, endmonth?, endyear?, divisioncurvename?)>
<!ELEMENT startmonth (#PCDATA)>
<!ELEMENT startyear (#PCDATA)>
<!ELEMENT endmonth (#PCDATA)>
<!ELEMENT endyear (#PCDATA)>
<!ELEMENT divisioncurvename (#PCDATA)>

<!ELEMENT salesinvoicenumber (#PCDATA)>
<!ELEMENT salesinvoicedate (#PCDATA)>
	<!ATTLIST salesinvoicedate format CDATA "ansi">
<!ELEMENT salesinvoiceeventdate (#PCDATA)>
    <!ATTLIST salesinvoiceeventdate format CDATA "ansi">
<!ELEMENT salesinvoiceduedate (#PCDATA)>
	<!ATTLIST salesinvoiceduedate format CDATA "ansi">
<!ELEMENT salesinvoicevaluedate (#PCDATA)>
  <!ATTLIST salesinvoicevaluedate format CDATA "ansi">
<!ELEMENT salesinvoicedeliverydate (#PCDATA)>
  <!ATTLIST salesinvoicedeliverydate format CDATA "ansi">
<!ELEMENT salesinvoicedeliverytocustomerdate (#PCDATA)>
  <!ATTLIST salesinvoicedeliverytocustomerdate format CDATA "ansi">
  <!ATTLIST salesinvoicedeliverytocustomerdate type (date|weeknumber) #REQUIRED>
<!ELEMENT salesinvoicewaybillidentifier (#PCDATA)>
<!ELEMENT salesinvoicereferencenumber (#PCDATA)>
<!ELEMENT salesinvoiceamount (#PCDATA)>
  <!ATTLIST salesinvoiceamount iso4217currencycode CDATA #IMPLIED>
  <!ATTLIST salesinvoiceamount currencyrate CDATA #IMPLIED>
  <!ATTLIST salesinvoiceamount pricetype (netvisor|customer) #IMPLIED>
<!ELEMENT selleridentifier (#PCDATA)>
	<!ATTLIST selleridentifier type (netvisor|customer) #IMPLIED>
<!ELEMENT sellername (#PCDATA)>
<!ELEMENT invoicetype (#PCDATA)>
<!ELEMENT salesinvoicestatus (#PCDATA)>	
	<!ATTLIST salesinvoicestatus type CDATA "netvisor">
<!ELEMENT salesinvoicefreetextbeforelines (#PCDATA)>
<!ELEMENT salesinvoicefreetextafterlines (#PCDATA)>
<!ELEMENT salesinvoiceourreference (#PCDATA)>
<!ELEMENT salesinvoiceyourreference (#PCDATA)>
<!ELEMENT salesinvoiceprivatecomment (#PCDATA)>
<!ELEMENT invoicingcustomeridentifier (#PCDATA)>
	<!ATTLIST invoicingcustomeridentifier type (netvisor|customer|organizationunitnumber) #REQUIRED>
    <!ATTLIST invoicingcustomeridentifier contactpersonid CDATA #IMPLIED>
<!ELEMENT invoicingcustomername (#PCDATA)>
<!ELEMENT invoicingcustomernameextension (#PCDATA)>
<!ELEMENT invoicingcustomeraddressline (#PCDATA)>
<!ELEMENT invoicingcustomeradditionaladdressline (#PCDATA)>
<!ELEMENT invoicingcustomerpostnumber (#PCDATA)>
<!ELEMENT invoicingcustomertown (#PCDATA)>
<!ELEMENT invoicingcustomercountrycode (#PCDATA)>
	<!ATTLIST invoicingcustomercountrycode type CDATA "ISO-xxx">
<!ELEMENT expectpartialpayments (#PCDATA)>
<!ELEMENT trydirectdebitlink (#PCDATA)>
    <!ATTLIST trydirectdebitlink mode (ignore_error|fail_on_error) #REQUIRED>
<!ELEMENT overridevouchersalesreceivablesaccountnumber (#PCDATA)>
<!ELEMENT invoicesubjecttype (#PCDATA)>
<!ELEMENT salesinvoiceagreementidentifier (#PCDATA)>
<!ELEMENT salesinvoicetaxhandlingtype (#PCDATA)>
<!ELEMENT printchannelformat (#PCDATA)>
    <!ATTLIST printchannelformat type (netvisor|customer) #REQUIRED>
<!ELEMENT secondname (#PCDATA)>
    <!ATTLIST secondname type (netvisor|customer) #REQUIRED>
<!ELEMENT overriderateofoverdue (#PCDATA)>
<!ELEMENT officeidentifier (#PCDATA)>
    <!ATTLIST officeidentifier type (automatic) #IMPLIED>
<!ELEMENT deliveryoffice (#PCDATA)>
    <!ATTLIST deliveryoffice type (netvisor|customer) #REQUIRED>
<!ELEMENT deliveryaddressname (#PCDATA)>
<!ELEMENT deliveryaddressnameextension (#PCDATA)>
<!ELEMENT deliveryaddressline (#PCDATA)>
<!ELEMENT deliveryaddresspostnumber (#PCDATA)>
<!ELEMENT deliveryaddresstown (#PCDATA)>
<!ELEMENT deliveryaddresscountrycode (#PCDATA)>
	<!ATTLIST deliveryaddresscountrycode type CDATA "ISO-xxx">
<!ELEMENT deliverymethod (#PCDATA)>
<!ELEMENT deliveryterm (#PCDATA)>
<!ELEMENT pricetype (#PCDATA)>
<!ELEMENT ordernumber (#PCDATA)>
<!ELEMENT deliveryidentifier (#PCDATA)>
<!ELEMENT collectioncost (#PCDATA)>
<!ELEMENT isthirdpartysales (#PCDATA)>
<!ELEMENT salesinvoicetaxhandlingclause (#PCDATA)>
<!ELEMENT denyinvoicecollection (#PCDATA)>

<!ELEMENT productidentifier (#PCDATA)>
	<!ATTLIST productidentifier type (netvisor|customer|primaryeancode|secondaryeancode|temporary) #REQUIRED>
<!ELEMENT productname (#PCDATA)>
<!ELEMENT productunitprice (#PCDATA)>
	<!ATTLIST productunitprice type (net|gross|netvisor) #REQUIRED>
<!ELEMENT productunitpurchaseprice (#PCDATA)>
  <!ATTLIST productunitpurchaseprice type (net) #REQUIRED>
<!ELEMENT productvatpercentage (#PCDATA)>
	<!ATTLIST productvatpercentage vatcode (NONE|KOOS|EUOS|EUUO|EUPO|100|KOMY|EUMY|EUUM|EUPM312|EUPM309|MUUL|EVTO|EVPO|EVKV|KAVE|RAMY|RAOS|EVRO|MAAL|EVMA|KOMY0) #IMPLIED>
<!ELEMENT salesinvoiceproductlinequantity (#PCDATA)>
<!ELEMENT salesinvoiceproductlinediscountpercentage (#PCDATA)>
    <!ATTLIST salesinvoiceproductlinediscountpercentage type (netvisor) #IMPLIED>
<!ELEMENT salesinvoiceproductlinefreetext (#PCDATA)>
<!ELEMENT salesinvoiceproductlinevatsum (#PCDATA)>
<!ELEMENT salesinvoiceproductlinesum (#PCDATA)>
<!ELEMENT salesinvoiceproductlineinventoryid (#PCDATA)>
<!ELEMENT accountingaccountsuggestion (#PCDATA)>
<!ELEMENT skipaccrual (#PCDATA)>

<!ELEMENT paymenttermnetdays (#PCDATA)>
<!ELEMENT paymenttermcashdiscountdays (#PCDATA)>
<!ELEMENT paymenttermcashdiscount (#PCDATA)>
	<!ATTLIST paymenttermcashdiscount type (percentage|sum) #REQUIRED>
<!ELEMENT paymentterm (#PCDATA)>
    <!ATTLIST paymentterm type (netvisor|customerdefault|companydefault|default) #REQUIRED>
<!ELEMENT comment (#PCDATA)>

<!ELEMENT sublinearticleidentifier (#PCDATA)>
<!ELEMENT sublinearticlename (#PCDATA)>
<!ELEMENT sublinedescription (#PCDATA)>
<!ELEMENT sublineunitcode (#PCDATA)>
<!ELEMENT sublineunitprice (#PCDATA)>
<!ELEMENT sublinedeliveredquantity (#PCDATA)>
<!ELEMENT sublinediscountpercent (#PCDATA)>
<!ELEMENT sublinevatpercent (#PCDATA)>
<!ELEMENT sublinesum (#PCDATA)>
<!ELEMENT sublinevatsum (#PCDATA)>

<!ELEMENT calculationmode (#PCDATA)>

<!ELEMENT linesum (#PCDATA)>
	<!ATTLIST linesum type (net|gross) #REQUIRED>
<!ELEMENT description (#PCDATA)>
<!ELEMENT accountnumber (#PCDATA)>
<!ELEMENT vatpercent (#PCDATA)>
	<!ATTLIST vatpercent vatcode (NONE|KOOS|EUOS|EUUO|EUPO|100|KOMY|EUMY|EUUM|EUPM312|EUPM309|MUUL|EVTO|EVPO|EVKV|KAVE|RAMY|RAOS|EVRO|MAAL|EVMA|KOMY0) #REQUIRED>

<!ELEMENT accountdimension (#PCDATA)>
<!ATTLIST accountdimension type (netvisorkey|name) #IMPLIED>

<!ELEMENT dimensionname (#PCDATA)>
<!ELEMENT dimensionitem (#PCDATA)>
  <!ATTLIST dimensionitem integrationdimensiondetailguid CDATA #IMPLIED>
<!ELEMENT dimensionitemcode (#PCDATA)>
<!ELEMENT dimensionitemname (#PCDATA)>

<!ELEMENT mimetype (#PCDATA)>
<!ELEMENT attachmentdescription (#PCDATA)>
<!ELEMENT filename (#PCDATA)>
<!ELEMENT documentdata (#PCDATA)>
  <!ATTLIST documentdata type (finvoice|pdf) #IMPLIED>
<!ELEMENT printbydefault (#PCDATA)>

<!ELEMENT tagname (#PCDATA)>
<!ELEMENT tagvalue (#PCDATA)>
	<!ATTLIST tagvalue datatype (date|text|float|enum) #REQUIRED>
<!ELEMENT data (#PCDATA)>

<!ELEMENT provisionpercentage (#PCDATA)>
<!ELEMENT productunitname (#PCDATA)>
<!ELEMENT deliverydate (#PCDATA)>
  <!ATTLIST deliverydate format CDATA "ansi">
<!ELEMENT proposedaccount (#PCDATA)>
    <!ATTLIST proposedaccount type (netvisor|customer) #REQUIRED>
<!ELEMENT accountdimensiontext (#PCDATA)>
