<?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
06/17/10      NIO     Replaced SoldToParty with a new EmployerReference as requested in JIRA BOD-1369
06/29/10      NIO     Added QualityTestReference and AssignedToPerson for JIRA BOD-1369
24 Dec 2015	  LA	  UserArea added to header and line, BOD-3123
4  Aug 2016   LA      BlendingSpecIndicator and CopyResultsIndicator added, BOD-3216
18 Aug 2016   LA      RetestTransferReceiptIndicator added to header, BOD-3218
5 May 2017    LA      GrowerAgreementIndicator added, BOD-3311
        *****     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"
	attributeFormDefault="unqualified">

	<xsd:include schemaLocation="../Components/Operational/QualityComponents.xsd"/>

	<xsd:element name="QualitySpecification" type="QualitySpecificationType">
		<xsd:annotation>
			<xsd:documentation source="http://schema.infor.com/InforOAGIS/2">Identifies the RemitTo
				Party Master records.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:complexType name="QualitySpecificationType">
		<xsd:sequence>
			<xsd:element ref="QualitySpecificationHeader" minOccurs="0"/>
			<xsd:element ref="QualitySpecificationLine" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="QualitySpecificationHeaderType">
		<xsd:sequence>
			<xsd:element ref="SpecificationID" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="DisplayID" minOccurs="0"/>
			<xsd:element ref="LastModificationDateTime" minOccurs="0"/>
			<xsd:element ref="LastModificationPerson" minOccurs="0"/>
			<xsd:element ref="DocumentDateTime" minOccurs="0"/>
			<xsd:group ref="FreeFormTextGroup"/>
			<xsd:element ref="Status" minOccurs="0"/>
			<xsd:element ref="EffectiveTimePeriod" minOccurs="0"/>
			<xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:choice>
				<xsd:element ref="Item" minOccurs="0"/>
				<xsd:element ref="QualityGroup" minOccurs="0"/>
			</xsd:choice>
			<xsd:element ref="CustomSpecificationIndicator" minOccurs="0"/>
			<xsd:element ref="ValidUses" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="AutoAttachIndicator" minOccurs="0"/>
			<xsd:element ref="ProcessBlockingMethodCode" minOccurs="0"/>
			<xsd:element ref="RetestIndicator" minOccurs="0"/>
			<xsd:element ref="ReclassifyIndicator" minOccurs="0"/>
			<xsd:element ref="BlendingSpecIndicator" minOccurs="0"/>
			<xsd:element ref="GrowerAgreementIndicator" minOccurs="0"/>
			<xsd:element ref="RetestTransferReceiptIndicator" minOccurs="0"/>
			<xsd:element ref="LabManagerPerson" minOccurs="0"/>
			<xsd:element ref="CopiesNumber" minOccurs="0"/>
			<xsd:element ref="UserArea" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="QualitySpecificationHeader" type="QualitySpecificationHeaderType"/>

	<xsd:complexType name="QualitySpecificationLineType">
		<xsd:complexContent>
			<xsd:extension base="StatusEnabledLineType">
				<xsd:sequence>
					<xsd:element ref="QualityTest" minOccurs="0"/>
					<xsd:element ref="IncludeTestInRequestIndicator" minOccurs="0"/>
					<xsd:element ref="PrintTestOnCOAIndicator" minOccurs="0"/>
					<xsd:element ref="PrintTestOnSpecIndicator" minOccurs="0"/>
					<xsd:element ref="SingleUseSampleIndicator" minOccurs="0"/>
					<xsd:element ref="CopyResultsIndicator" minOccurs="0"/>
					<xsd:element ref="UserArea" minOccurs="0"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="QualitySpecificationLine" type="QualitySpecificationLineType"/>

	<xsd:complexType name="ValidUsesType">
		<xsd:sequence>
			<xsd:element ref="CustomerParty" minOccurs="0"/>
			<xsd:element ref="ShipToParty" minOccurs="0"/>
			<xsd:element ref="SupplierParty" minOccurs="0"/>
			<xsd:element ref="ShipFromParty" minOccurs="0"/>
			<xsd:element ref="ToWarehouse" minOccurs="0"/>
			<xsd:element ref="FromWarehouse" minOccurs="0"/>
			<xsd:element ref="Location" minOccurs="0"/>
			<xsd:element ref="CountryAndPercent" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="ValidUses" type="ValidUsesType"/>
	
	<xsd:element name="IncludeTestInRequestIndicator" type="IndicatorType"/>
	<xsd:element name="PrintTestOnCOAIndicator" type="IndicatorType"/>
	<xsd:element name="PrintTestOnSpecIndicator" type="IndicatorType"/>
	<xsd:element name="SingleUseSampleIndicator" type="IndicatorType"/>
	
	<xsd:element name="ToWarehouse" type="LocationType"/>
	<xsd:element name="FromWarehouse" type="LocationType"/>
	
	<xsd:element name="BlendingSpecIndicator" type="IndicatorType">
		<xsd:annotation>
			<xsd:documentation>
				Indicates whether the specification must be used when a blending transaction 
				occurs. 
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:element name="CopyResultsIndicator" type="IndicatorType">
		<xsd:annotation>
			<xsd:documentation>
				Specifies whether the results have to be copied in the receiving warehouse
				in case of transfer orders. This would generally happen when the element 
				RetestTransferReceiptIndicator is also set to true at the header level. 
				When RetestTransferReceiptIndicator is set to true, and CopyResultsIndicator is set to true, it
				would imply that the results are copied in the receiving warehouse.
				When RetestTransferReceiptIndicator is set to true, and CopyResultsIndicator is set to false, 
				the tests are done again (results are not copied).
				Any other combination of options are not valid set up scenarios. The parameters
				must be set up appropriately depending on the need. 
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:element name="GrowerAgreementIndicator" type="IndicatorType">
		<xsd:annotation>
			<xsd:documentation>
				TSpecifies that this is part of a grower agreement where the 
				quality spec for the grower is defined by this Specification.
				Grower agreement is where a manufacturer has a contract with a grower 
				which defines what to grow, where, and what quality to deliver it with  
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
</xsd:schema>
