<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:include schemaLocation="TiposDadosS3CP.XSD"/>
	<xs:include schemaLocation="TiposDadosRubricas.XSD"/>
	<!--
Proprietário: UNILEO
Projeto: S3CP
Versão: 1.4
Data da versão:2018/12/01
Observações:  
--> 
	<xs:element name="BLC">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Cabecalho">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Entidade" type="StringNIF" />
							<!--Neste campo deverá constar o NIF da Entidade. -->
							<xs:element name="Data" type="DataHora" />
							<!--A data tem o seguinte formato AAAA-MM-DDThh:mm:ss-->
							<xs:element name="Ano" type="Ano" />
							<!--valor inteiro maior que 2010-->
							<xs:element name="Periodicidade" type="PeriodicidadeBLC" />
							<!-- Consultar tabela de Periodicidade "Periodicidade.xml" -->
							<xs:element name="Periodo" type="StringNum3" />
							<!-- Consultar tabela de Periodos "Periodo.xml" -->
							<xs:element name="PlanoContasLocal" type="xs:string" />
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="Resumo">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="ResumoMacroRubrica" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="ID_ResumoMacroRubrica" type="InteiroMaiorQueZero" />
										<xs:element name="MacroRubrica" type="MacroRubricaBLC" />
										<!-- Consultar tabela de Rubricas "RubricasBLC.xml" -->
										<xs:element name="Notas" minOccurs ="0" type="xs:string" />
										<xs:element name="TotalAnoCorrente" type="DecimalS3CP" />
										<xs:element name="TotalAnoAnterior" type="DecimalS3CP" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="ResumoRubricaAgregadora" maxOccurs="unbounded" >
								<xs:complexType>
									<xs:sequence>
										<xs:element name="ID_ResumoRubricaAgregadora" type="InteiroMaiorQueZero" />
										<xs:element name="RubricaAgregadora" type="RubricaAgregadoraBLC" />
										<!-- Consultar tabela de Rubricas "RubricasBLC.xml" -->
										<xs:element name="MacroRubrica" type="MacroRubricaBLC" />
										<!-- Consultar tabela de Rubricas "RubricasBLC.xml" -->
										<xs:element name="Notas" minOccurs ="0" type="xs:string" />
										<xs:element name="TotalAnoCorrente" type="DecimalS3CP" />
										<xs:element name="TotalAnoAnterior" type="DecimalS3CP" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>   
					</xs:complexType>
				</xs:element>
				<xs:element name="Registos">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Registo" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
										<xs:element name="Rubrica" type="RubricaBLC" />
										<!-- Consultar tabela de Rubricas "RubricasBLC.xml" -->
										<xs:element name="RubricaAgregadora" type="RubricaAgregadoraBLC" />
										<!-- Consultar tabela de Rubricas "RubricasBLC.xml" -->
										<xs:element name="MacroRubrica" type="MacroRubricaBLC" />
										<!-- Consultar tabela de Rubricas "RubricasBLC.xml" -->
										<xs:element name="Notas"  minOccurs ="0"  type="xs:string" />
										<xs:element name="ValorAnoCorrente" type="DecimalS3CP" />
										<xs:element name="ValorAnoAnterior" type="DecimalS3CP" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>