﻿<?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="PI">
		<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="PeriodicidadePI" />
							<!-- 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="ModeloJustoValor">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="PropriedadesInvestimento">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Resumo">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ID_Resumo" type="InteiroMaiorQueZero" />
													<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
													<xs:element name="TotalQuantiaEscrituradaInicial" type="DecimalS3CP" />
													<xs:element name="TotalAdicoes" type="DecimalS3CP" />
													<xs:element name="TotalTransferenciasInternasEntidade" type="DecimalS3CP" />
													<xs:element name="TotalGanhosJustoValor" type="DecimalS3CP" />
													<xs:element name="TotalPerdasJustoValor" type="DecimalS3CP" />
													<xs:element name="TotalDiferencasCambiais" type="DecimalS3CP" />
													<xs:element name="TotalDiminuicoes" type="DecimalS3CP" />
													<xs:element name="TotalQuantiaEscrituradaFinal" type="DecimalS3CP" />
													<xs:element name="TotalGastosPeriodo" type="DecimalS3CP" />
													<xs:element name="TotalRendimentosPeriodoRendas" type="DecimalS3CP" />
													<xs:element name="TotalRendimentosPeriodoOutros" type="DecimalS3CP" />                          
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="Registos">
											<xs:complexType>
												<xs:sequence>
													<xs:element maxOccurs="unbounded" name="Registo">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
																<xs:element name="Rubrica" type="RubricaPI" />
																<!--Consultar tabela de rubricas "RubricasPI.xml" -->
																<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
																<xs:element name="QuantiaEscrituradaInicial" type="DecimalS3CP" />
																<xs:element name="Adicoes" type="DecimalS3CP" />
																<xs:element name="TransferenciasInternasEntidade" type="DecimalS3CP" />
																<xs:element name="GanhosJustoValor" type="DecimalS3CP" />
																<xs:element name="PerdasJustoValor" type="DecimalS3CP" />
																<xs:element name="DiferencasCambiais" type="DecimalS3CP" />
																<xs:element name="Diminuicoes" type="DecimalS3CP" />
																<xs:element name="QuantiaEscrituradaFinal" type="DecimalS3CP" />
																<xs:element name="GastosPeriodo" type="DecimalS3CP" />
																<xs:element name="RendimentosPeriodoRendas" type="DecimalS3CP" />
																<xs:element name="RendimentosPeriodoOutros" type="DecimalS3CP" />                                  
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="PropriedadesInvestimentoDesagregacaoAdicoes">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Resumo">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ID_Resumo" type="InteiroMaiorQueZero" />
													<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
													<!--Consultar tabela de rubricas "RubricasPI.xml" -->
													<xs:element name="TotalInternas" type="DecimalS3CP" />
													<xs:element name="TotalCompra" type="DecimalS3CP" />
													<xs:element name="TotalCessao" type="DecimalS3CP" />
													<xs:element name="TotalTransferenciaTroca" type="DecimalS3CP" />
													<xs:element name="TotalDoacaoHerancaLegadoOuPerdidoFavorEstado" type="DecimalS3CP" />
													<xs:element name="TotalDacaoPagamento" type="DecimalS3CP" />
													<xs:element name="TotalLocacaoFinanceira" type="DecimalS3CP" />
													<xs:element name="TotalFusaoCisaoReestruturacao" type="DecimalS3CP" />
													<xs:element name="TotalOutras" type="DecimalS3CP" />
													<xs:element name="TotalGeral" type="DecimalS3CP" />
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="Registos">
											<xs:complexType>
												<xs:sequence>
													<xs:element maxOccurs="unbounded" name="Registo">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
																<xs:element name="Rubrica" type="RubricaPI" />
																<!--Consultar tabela de rubricas "RubricasPI.xml" -->
																<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
																<xs:element name="Internas" type="DecimalS3CP" />
																<xs:element name="Compra" type="DecimalS3CP" />
																<xs:element name="Cessao" type="DecimalS3CP" />
																<xs:element name="TransferenciaTroca" type="DecimalS3CP" />
																<xs:element name="DoacaoHerancaLegadoOuPerdidoFavorEstado" type="DecimalS3CP" />
																<xs:element name="DacaoPagamento" type="DecimalS3CP" />
																<xs:element name="LocacaoFinanceira" type="DecimalS3CP" />
																<xs:element name="FusaoCisaoReestruturacao" type="DecimalS3CP" />
																<xs:element name="Outras" type="DecimalS3CP" />
																<xs:element name="Total" type="DecimalS3CP" />
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="PropriedadesInvestimentoDesagregacaoDiminuicoes">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Resumo">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ID_Resumo" type="InteiroMaiorQueZero" />
													<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
													<!--Consultar tabela de rubricas "RubricasPI.xml" -->
													<xs:element name="TotalAlienacaoTituloOneroso" type="DecimalS3CP" />
													<xs:element name="TotalTransferenciaTroca" type="DecimalS3CP" />
													<xs:element name="TotalFusaoCisaoReestruturacao" type="DecimalS3CP" />
													<xs:element name="TotalOutras" type="DecimalS3CP" />
													<xs:element name="TotalGeral" type="DecimalS3CP" />
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="Registos">
											<xs:complexType>
												<xs:sequence>
													<xs:element maxOccurs="unbounded" name="Registo">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
																<xs:element name="Rubrica" type="RubricaPI" />
																<!--Consultar tabela de rubricas "RubricasPI.xml" -->
																<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
																<xs:element name="AlienacaoTituloOneroso" type="DecimalS3CP" />
																<xs:element name="TransferenciaTroca" type="DecimalS3CP" />
																<xs:element name="FusaoCisaoReestruturacao" type="DecimalS3CP" />
																<xs:element name="Outras" type="DecimalS3CP" />
																<xs:element name="Total" type="DecimalS3CP" />
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="ModeloCusto">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="PropriedadesInvestimento">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Resumo">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ID_Resumo" type="InteiroMaiorQueZero" />
													<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
													<!--Consultar tabela de rubricas "RubricasPI.xml" -->
													<xs:element name="TotalQuantiaEscrituradaInicial" type="DecimalS3CP" />
													<xs:element name="TotalAdicoes" type="DecimalS3CP" />
													<xs:element name="TotalTransferenciasInternasEntidade" type="DecimalS3CP" />
													<xs:element name="TotalDepreciacoesPeriodo" type="DecimalS3CP" />
													<xs:element name="TotalPerdasImparidade" type="DecimalS3CP" />
													<xs:element name="TotalReversoesPerdasImparidade" type="DecimalS3CP" />
													<xs:element name="TotalDiferencasCambiais" type="DecimalS3CP" />
													<xs:element name="TotalDiminuicoes" type="DecimalS3CP" />
													<xs:element name="TotalQuantiaEscrituradaFinal" type="DecimalS3CP" />
													<xs:element name="TotalGastosPeriodo" type="DecimalS3CP" />
													<xs:element name="TotalRendimentosPeriodoRendas" type="DecimalS3CP" />
													<xs:element name="TotalRendimentosPeriodoOutros" type="DecimalS3CP" />                            
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="Registos">
											<xs:complexType>
												<xs:sequence>
													<xs:element maxOccurs="unbounded" name="Registo">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
																<xs:element name="Rubrica" type="RubricaPI" />
																<!--Consultar tabela de rubricas "RubricasPI.xml" -->
																<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
																<xs:element name="QuantiaEscrituradaInicial" type="DecimalS3CP" />
																<xs:element name="Adicoes" type="DecimalS3CP" />
																<xs:element name="TransferenciasInternasEntidade" type="DecimalS3CP" />
																<xs:element name="DepreciacoesPeriodo" type="DecimalS3CP" />
																<xs:element name="PerdasImparidade" type="DecimalS3CP" />
																<xs:element name="ReversoesPerdasImparidade" type="DecimalS3CP" />
																<xs:element name="DiferencasCambiais" type="DecimalS3CP" />
																<xs:element name="Diminuicoes" type="DecimalS3CP" />
																<xs:element name="QuantiaEscrituradaFinal" type="DecimalS3CP" />
																<xs:element name="GastosPeriodo" type="DecimalS3CP" />
																<xs:element name="RendimentosPeriodoRendas" type="DecimalS3CP" />
																<xs:element name="RendimentosPeriodoOutros" type="DecimalS3CP" />                                  
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="PropriedadesInvestimentoDesagregacaoAdicoes">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Resumo">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ID_Resumo" type="InteiroMaiorQueZero" />
													<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
													<!--Consultar tabela de rubricas "RubricasPI.xml" -->
													<xs:element name="TotalInternas" type="DecimalS3CP" />
													<xs:element name="TotalCompra" type="DecimalS3CP" />
													<xs:element name="TotalCessao" type="DecimalS3CP" />
													<xs:element name="TotalTransferenciaTroca" type="DecimalS3CP" />
													<xs:element name="TotalDoacaoHerancaLegadoOuPerdidoFavorEstado" type="DecimalS3CP" />
													<xs:element name="TotalDacaoPagamento" type="DecimalS3CP" />
													<xs:element name="TotalLocacaoFinanceira" type="DecimalS3CP" />
													<xs:element name="TotalFusaoCisaoReestruturacao" type="DecimalS3CP" />
													<xs:element name="TotalOutras" type="DecimalS3CP" />
													<xs:element name="TotalGeral" type="DecimalS3CP" />
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="Registos">
											<xs:complexType>
												<xs:sequence>
													<xs:element maxOccurs="unbounded" name="Registo">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
																<xs:element name="Rubrica" type="RubricaPI" />
																<!--Consultar tabela de rubricas "RubricasPI.xml" -->
																<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
																<xs:element name="Internas" type="DecimalS3CP" />
																<xs:element name="Compra" type="DecimalS3CP" />
																<xs:element name="Cessao" type="DecimalS3CP" />
																<xs:element name="TransferenciaTroca" type="DecimalS3CP" />
																<xs:element name="DoacaoHerancaLegadoOuPerdidoFavorEstado" type="DecimalS3CP" />
																<xs:element name="DacaoPagamento" type="DecimalS3CP" />
																<xs:element name="LocacaoFinanceira" type="DecimalS3CP" />
																<xs:element name="FusaoCisaoReestruturacao" type="DecimalS3CP" />
																<xs:element name="Outras" type="DecimalS3CP" />
																<xs:element name="Total" type="DecimalS3CP" />
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="PropriedadesInvestimentoDesagregacaoDiminuicoes">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Resumo">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ID_Resumo" type="InteiroMaiorQueZero" />
													<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
													<!--Consultar tabela de rubricas "RubricasPI.xml" -->
													<xs:element name="TotalAlienacaoTituloOneroso" type="DecimalS3CP" />
													<xs:element name="TotalTransferenciaTroca" type="DecimalS3CP" />
													<xs:element name="TotalFusaoCisaoReestruturacao" type="DecimalS3CP" />
													<xs:element name="TotalOutras" type="DecimalS3CP" />
													<xs:element name="TotalGeral" type="DecimalS3CP" />
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="Registos">
											<xs:complexType>
												<xs:sequence>
													<xs:element maxOccurs="unbounded" name="Registo">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="ID_Registo" type="InteiroMaiorQueZero" />
																<xs:element name="Rubrica" type="RubricaPI" />
																<!--Consultar tabela de rubricas "RubricasPI.xml" -->
																<xs:element name="RubricaAgregadora" type="RubricaAgregadoraPI" />
																<xs:element name="AlienacaoTituloOneroso" type="DecimalS3CP" />
																<xs:element name="TransferenciaTroca" type="DecimalS3CP" />
																<xs:element name="FusaoCisaoReestruturacao" type="DecimalS3CP" />
																<xs:element name="Outras" type="DecimalS3CP" />
																<xs:element name="Total" type="DecimalS3CP" />
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>