<?xml version="1.0" encoding="utf-8"?>
<!--
        
        ** OAGIS® Revision: 9.1  **
        ** Date: 11 May 2007 **
        ** Copyright 1997-2007, All Rights Reserved **
        
        This is an OAGIS® BOD XML Schema (XSD) Definition.
        
       License information for this file is provided in the file **OAGi License Agreement.txt** that is provided with this download package.
        
        For support, more information, or to report implementation bugs, please contact the Open Applications Group at xml@openapplications.org.
        
        XML Schema 
        
-->
 
<!--
© Copyright 2007 Infor Global Solutions Technology GmbH and/or its affiliates and subsidiaries. All rights reserved. The 
word and design marks set forth herein are trademarks and/or registered trademarks of Infor Global Solutions 
Technology GmbH and/or its affiliates and subsidiaries. All rights reserved. All other trademarks listed herein 
are the property of their respective owners.
 
-->
 
<!--    *****     Update Log     *****
 
Date           By      Note 
10 Apr 2008    JB      Added correct Copyright and update comments to schema.
27 Jan 2009    PO      Make RequestedDeliveryDate on the line optional.
08 Sep 2009    JB      Added PricingAmount to the Line.
08 Oct 2012    NO      Added OrderLineTypeCode and OrderLineCategoryCode CodeTypes (BOD-2014)
28 May 2013    Ajay    Added CreditPersonReference (BOD 1767)
25 Sep 2014	   LA		e-invoice enhancements BOD-2678 - DebtorParty, CreditorParty, StructuredCreditorReference
						Classification, BillingTimePeriod, Correction added to InvoiceHeaderType
08 Oct 2014	   PJ	   Added BillingPersonReference in InvoceHeader(BOD-2366)	
10 Oct 2014	   LA		MinimumPaymentAmount - BOD-2678
14 Apr 2014	   LA		Added subunitRoundingAmount and PreSubunitRoundedTotalAmount  BOD-2864
24 APr 2015    LA       Added PaymentMethodCode, PaymentChannelCode, TaxPointDate, TaxRepresentativeParty to header BOD-2863
28 Apr 2015    LA       Added NatureOfTransaction to InvoiceLineType, BOD-2020
14 May 2015    LA       Added AlternateCost, REbate, PriceOverrideIndicator, RushIndicator to InvoiceLineType, BOD-2813
6 Jul 2015     LA       Added ProjectContractReference to InvoiceHeaderType BOD-2599
15 Jul 2015    LA       Added BillFromParty to InvoiceHeaderType (BOD-2547)\
20 Oct 2015    LA       Validation added to InvoiceHeaderType, BOD-2990
16 Mar 2016    LA       ProtocolNumberText added to InvoiceHeader, BOD-3091
17 Jan 2017    LA       Corrected line number details, BOD-3251
                        New elements CorrectedLineIndicator and LinkedLineNumber added
        *****     Update End     *****
 
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns="http://schema.infor.com/InforOAGIS/2"
	targetNamespace="http://schema.infor.com/InforOAGIS/2" elementFormDefault="qualified">
	<xsd:include schemaLocation="../Components/Operational/OrderManagementComponents.xsd"/>


	<xsd:element name="Invoice" type="InvoiceType">
		<xsd:annotation>
			<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">The Invoice is used to invoice a customer for goods/services the have been provided.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="InvoiceHeader" type="InvoiceHeaderType">
		<xsd:annotation>
			<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">Information that applies to the entire invoice document. The Header supports summary amounts for line items, charges, taxes and allowances.

It also supports itemizing Header level charges, taxes and allowances for use in credit or debit invoices. In this case Line items are not needed. 

The summary amounts in the Header include the Line level amounts and Header level amounts.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="InvoiceLine" type="InvoiceLineType">
		<xsd:annotation>
			<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">In general an Invoice Line can be aligned with Order Lines. The ItemQuantity and Price are used to compute the Total. The Total is a sum of the Total and any Charges, Taxes or Allowances.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:complexType name="InvoiceType">
		<xsd:sequence>
			<xsd:element ref="InvoiceHeader" minOccurs="0"/>
			<xsd:element ref="InvoiceLine" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="type" type="NormalizedStringType"/>
	</xsd:complexType>
	<xsd:complexType name="InvoiceHeaderType">
		<xsd:annotation>
			<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">The InvoiceHeader type supports summary amounts for line items, charges and allowances.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="HeaderType">
				<xsd:sequence>
					<xsd:element ref="ExtendedAmount" minOccurs="0"/>
					<xsd:element ref="ExtendedBaseAmount" minOccurs="0"/>
					<xsd:element ref="ExtendedReportAmount" minOccurs="0"/>
					<xsd:element ref="PreSubunitRoundedTotalAmount" minOccurs="0"/>
					<xsd:element ref="SubunitRoundingAmount" minOccurs="0"/>
					<xsd:element ref="TotalAmount" minOccurs="0"/>
					<xsd:element ref="TotalBaseAmount" minOccurs="0"/>
					<xsd:element ref="TotalReportAmount" minOccurs="0"/>
					<xsd:element ref="PrePayment" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="MinimumDueAmount" minOccurs="0"/>
					<xsd:element ref="MinimumDueBaseAmount" minOccurs="0"/>
					<xsd:element ref="MinimumDueReportAmount" minOccurs="0"/>
					<xsd:element ref="SupplierParty" minOccurs="0"/>
					<xsd:element ref="CustomerParty" minOccurs="0"/>
					<xsd:element ref="RemitToParty" minOccurs="0"/>
					<xsd:element ref="CreditorParty" minOccurs="0"/>
					<xsd:element ref="DebtorParty" minOccurs="0"/>
					<xsd:element ref="Party" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="StructuredCreditorReference" minOccurs="0"/>
					<xsd:element ref="ReasonCode" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">A code for the invoice.Example: Special allowance for preferred customers.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="PurchaseOrderReference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="ContractReference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="ProjectContractReference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="BillingTimePeriod" minOccurs="0"/>
					<xsd:element ref="PaymentTerm" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="PaymentMethodCode" minOccurs="0"/>
					<xsd:element ref="PaymentChannelCode" minOccurs="0"/>
					<xsd:element ref="TaxPointDate" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>
								Specifies the tax point date; the date on which a taxable person should account for tax
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="Tax" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="Charge" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="Allowance" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="UserArea" minOccurs="0"/>
					<xsd:element ref="Status"/>
					<xsd:element ref="Validation" minOccurs="0"/>
					<xsd:element ref="ChargeIndicator" minOccurs="0" maxOccurs="1"/>
					<xsd:element ref="CurrencyExchangeRate" minOccurs="0"/>
					<xsd:element ref="BaseCurrencyAmount" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="SelfBillingIndicator" minOccurs="0"/>
					<xsd:element ref="ShipToParty" minOccurs="0"/>
					<xsd:element ref="BillToParty" minOccurs="0"/>
					<xsd:element ref="BillFromParty" minOccurs="0"/>
					<xsd:element ref="PayFromParty" minOccurs="0"/>
					<xsd:element ref="ShipFromParty" minOccurs="0"/>
					<xsd:element ref="TaxRepresentativeParty" minOccurs="0"/>
					<xsd:element ref="ExtendedPretaxAmount" minOccurs="0"/>
					<xsd:element ref="ExtendedPretaxBaseAmount" minOccurs="0"/>
					<xsd:element ref="ExtendedPretaxReportAmount" minOccurs="0"/>
					<xsd:element ref="SubTotalAmount" minOccurs="0"/>
					<xsd:element ref="SubTotalBaseAmount" minOccurs="0"/>
					<xsd:element ref="SubTotalReportAmount" minOccurs="0"/>
					<xsd:element ref="Classification" minOccurs="0"/>
					<xsd:element ref="Distribution" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="NatureOfTransaction" minOccurs="0"/>
					<xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="SalesPersonReference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="CreditPersonReference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="BillingPersonReference" minOccurs="0"/>
					<xsd:element ref="Correction" minOccurs="0"/>
					<xsd:element ref="ProtocolNumberText" minOccurs="0"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="InvoiceLineType">
		<xsd:annotation>
			<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">The InvoiceLine type supports order line invoicing.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="InvoiceLineBaseType">
				<xsd:sequence>
					<xsd:element ref="InvoiceSubLine" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="UserArea" minOccurs="0"/>
					<xsd:element ref="RequestedDeliveryDate" minOccurs="0"/>
					<xsd:element ref="SupplierParty" minOccurs="0"/>
					<xsd:element ref="CustomerParty" minOccurs="0"/>
					<xsd:element ref="SalesOrderReference" minOccurs="0"/>
					<xsd:element ref="ExtendedCost" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>
								Cost of goods sold for the line
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="AlternateCost" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>
								A Cost that is used for alternate Margin calculations. 
								Example for this use case may be SalesMargin or StandardMargin. 
								Other AlternateCost uses may be a Cost used for later reporting or comparison purposes. 
								AlternateCost@type for such uses may include Actual, FIFO, Customer, and others. 
								Other use cases: A Basis Cost which might have been used for Commission or Rebate calculations.  
								AlternateCost@type for such cases could be CommissionBasis or SupplierRebateBasis.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="Rebate" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>
								To specify vendor rebates that could be claimed and customer rebates
								that need to be given for the invoice line
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="BaseCurrencyAmount" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="ShipToParty" minOccurs="0"/>
					<xsd:element ref="BillToParty" minOccurs="0"/>
					<xsd:element ref="PayFromParty" minOccurs="0"/>
					<xsd:element ref="ShipFromParty" minOccurs="0"/>
					<xsd:element ref="RemitToParty" minOccurs="0"/>
					<xsd:element ref="PricingAmount" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Pricing amount for the current line.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="PricingBaseAmount" minOccurs="0"/>
					<xsd:element ref="PricingReportAmount" minOccurs="0"/>
					<xsd:element ref="PriceOverrideIndicator" minOccurs="0"/>
					<xsd:element ref="RushIndicator" minOccurs="0"/>
					<xsd:element ref="Reference" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="OrderLineTypeCode" minOccurs="0"/>
					<xsd:element ref="OrderLineCategoryCode" minOccurs="0"/>
					<xsd:element ref="NatureOfTransaction" minOccurs="0"/>
					<xsd:element ref="Distribution" minOccurs="0" maxOccurs="unbounded"/>
					<xsd:element ref="CorrectedLineIndicator" minOccurs="0"/>
					<xsd:element ref="LinkedLineNumber" minOccurs="0"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="BillingPersonReference" type="PersonReferenceType"/>


</xsd:schema>
