<?xml version="1.0" encoding="iso-8859-15"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  
  <xs:include schemaLocation="Generic.xsd" />
  
  <xs:element name="scheda">
   <xs:complexType>
      <xs:sequence>
		<xs:element name="Settings">
          <xs:complexType>
            <xs:sequence>
				<xs:element name="version">
					<xs:simpleType>
						<xs:restriction base="Versione" /> 
					</xs:simpleType>
				</xs:element>
				<xs:element name="codfiscamm">
					<xs:simpleType>
						<xs:restriction base="PIva" />
					</xs:simpleType>
				</xs:element>
				<xs:element name="cua">
					<xs:simpleType>
						<xs:restriction base="Cua" /> 
					</xs:simpleType>
				</xs:element>
				<xs:element name="tiposcheda" type="xs:string" fixed="SAL" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Stato_avanzamento_lavori">
          <xs:complexType>
            <xs:sequence>
				<xs:element name="gg_causa_maggiore" type="xs:int" nillable="true" />
				<xs:element name="gg_indisp_luoghi" type="xs:int" nillable="true" />
				<xs:element name="gg_varianti" type="xs:int" nillable="true" />
				<xs:element name="gg_interferenze_cantieri" type="xs:int" nillable="true" />
				<xs:element name="gg_interv_aut_giudiziaria" type="xs:int" nillable="true" />
				<xs:element name="altro_specificare" type="myString" />
				<xs:element name="gg_altro" type="xs:int" nillable="true" />
				<xs:element name="data_ripresa" type="myDate" nillable="true" />
				<xs:element name="data_nuovo_termine_esec" type="myDate" nillable="true" />
				<xs:element name="in_atto_sosp" type="SiNo" />
	            
				<xs:element name="subappalti">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="subappalto" minOccurs="0" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="persona_giuridica" type="PeGi" />
										<xs:element name="descrizione" type="myString" />
										<xs:element name="importo" type="myDecimal" />
										<xs:element name="categoria" type="CAT" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
	            
				<xs:element name="cod_inps_agg" type="myString" />
				<xs:element name="cod_inail_agg" type="myString" />
				<xs:element name="cod_cassa_edile_agg" type="myString" />
				<xs:element name="cod_inps_mand" type="myString" />
				<xs:element name="cod_inail_mand" type="myString" />
				<xs:element name="cod_cassa_edile_mand" type="myString" />
	            
				<xs:element name="imprese_esecutrici">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="impresa" minOccurs="0" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="persona_giuridica" type="PeGi" />
										<xs:element name="cod_inps" type="myString" />
										<xs:element name="cod_inail" type="myString" />
										<xs:element name="cod_cassa_edile" type="myString" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
	            
				<xs:element name="id_corrispettivo">
					<xs:simpleType>
						<xs:restriction base="xs:int">
							<xs:pattern value="1|2|3" />
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="data_sal" type="myDate" nillable="true" />
				<xs:element name="data_cert_pagamento" type="myDate" nillable="true" />
				<xs:element name="sal_num" type="myString" />
				<xs:element name="imp_cert_pagamento" type="myDecimal" nillable="true" />
				<xs:element name="mandato_prec_pagam_sal" type="xs:int" nillable="true" />
				<xs:element name="data_prec_pagam_sal" type="myDate" nillable="true" />
				<xs:element name="imp_prec_pagam_sal" type="myDecimal" nillable="true" />
				<xs:element name="imp_interessi_moratori_sal" type="myDecimal" nillable="true" />
				<xs:element name="accordi_bonari" type="SiNo" />
				<xs:element name="data_accordo" type="myDate" nillable="true" />
				<xs:element name="imp_oneri_accordo" type="myDecimal" nillable="true" />
				<xs:element name="imp_interessi_moratori" type="myDecimal" nillable="true" />
				<xs:element name="proroghe" type="SiNo" />
				<xs:element name="data_proroghe" type="myDate" nillable="true" />
				<xs:element name="gg_maggior_term_esec_lav" type="xs:int" nillable="true" />
           </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
