﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="https://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="DTAS">
		<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="PeriodicidadeDTAS" />
							<!-- Consultar tabela de Periodicidade "Periodicidade.xml" -->
							<xs:element name="Periodo" type="StringNum3" />
							<!-- Consultar tabela de Periodos "Periodo.xml" -->
							<xs:element name="PlanoContasLocal" type="ValoresParaPlanoContasLocal" />
						</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="MacroRubricaDTAS" />
										<!-- Consultar tabela de Rubricas "RubricasDTAS.xml" -->
										<xs:element name="TotalDividaVincendaCurtoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalDividaVincendaMedioLongoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaMenor90Dias" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaDe90a180Dias" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaDe180a365Dias" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaMaior365Dias" type="DecimalS3CP" />
										<xs:element name="TotalExcecoes" type="DecimalS3CP" />
										<xs:element name="TotalPagamentosEmAtraso" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesaCurtoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesaMedioLongoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalGeralDividaPorNaturezaDespesa" 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="RubricaAgregadoraDTAS" />
										<!-- Consultar tabela de Rubricas "RubricasDTAS.xml" -->
										<xs:element name="MacroRubrica" type="MacroRubricaDTAS" />
										<!-- Consultar tabela de Rubricas "RubricasDTAS.xml" -->
										<xs:element name="TotalDividaVincendaCurtoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalDividaVincendaMedioLongoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaMenor90Dias" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaDe90a180Dias" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaDe180a365Dias" type="DecimalS3CP" />
										<xs:element name="TotalIntervalosAntiguidadeDividaVencidaMaior365Dias" type="DecimalS3CP" />
										<xs:element name="TotalExcecoes" type="DecimalS3CP" />
										<xs:element name="TotalPagamentosEmAtraso" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesaCurtoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesaMedioLongoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalGeralDividaPorNaturezaDespesa" 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="RubricaDTAS" />
										<xs:element name="RubricaAgregadora" type="RubricaAgregadoraDTAS" />
										<xs:element name="MacroRubrica" type="MacroRubricaDTAS" />
										<xs:element name="DividaVincendaCurtoPrazo" type="DecimalS3CP" />
										<xs:element name="DividaVincendaMedioLongoPrazo" type="DecimalS3CP" />
										<xs:element name="IntervalosAntiguidadeDividaVencidaMenor90Dias" type="DecimalS3CP" />
										<xs:element name="IntervalosAntiguidadeDividaVencidaDe90a180Dias" type="DecimalS3CP" />
										<xs:element name="IntervalosAntiguidadeDividaVencidaDe180a365Dias" type="DecimalS3CP" />
										<xs:element name="IntervalosAntiguidadeDividaVencidaMaior365Dias" type="DecimalS3CP" />
										<xs:element name="Excecoes" type="DecimalS3CP" />
										<xs:element name="PagamentosEmAtraso" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesaCurtoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesaMedioLongoPrazo" type="DecimalS3CP" />
										<xs:element name="TotalDividaPorNaturezaDespesa" type="DecimalS3CP" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>