Skip to content

Commit 018042e

Browse files
authored
Merge pull request #345 from Camparinni/main
Ajustes conforme atualização do provedor de NfeCidades.
2 parents 48d03c3 + f9ded4f commit 018042e

4 files changed

Lines changed: 96 additions & 2 deletions

File tree

src/OpenAC.Net.NFSe/Nota/DadosServico.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,9 @@ internal DadosServico()
9797

9898
public DeducoesCollection Deducoes { get; }
9999

100+
public string CodigoIndicadorOperacao { get; set; }
101+
102+
public string CodigoClassificacaoTributaria { get; set; }
103+
100104
#endregion Propriedades
101105
}

src/OpenAC.Net.NFSe/Nota/ValoresServico.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ internal ValoresServico()
108108
public decimal AliquotaCargaTributaria { get; set; }
109109

110110
public string FonteCargaTributaria { get; set; }
111-
111+
112112
public InfoIBSCBS? IBSCBS { get; set; }
113113

114+
public string CstPisCofins { get; set; }
115+
116+
public string TipoRetencaoPisCofins { get; set; }
117+
114118
#endregion Propriedades
115119
}

src/OpenAC.Net.NFSe/Providers/NFeCidades/ProviderNFeCidades.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,36 @@ protected override XElement WriteServicosRps(NotaServico nota)
133133
servico.AddChild(AddTag(TipoCampo.Str, "", "MunicipioPrestacao", 1, 20, Ocorrencia.Obrigatoria, nota.Servico.CodigoMunicipio));
134134
servico.AddChild(AddTag(TipoCampo.Int, "", "PaisPrestacao", 4, 4, Ocorrencia.MaiorQueZero, nota.Servico.CodigoPais));
135135
servico.AddChild(AddTag(TipoCampo.Str, "", "CodigoNBS", 1, 5, Ocorrencia.Obrigatoria, nota.Servico.CodigoNbs));
136+
servico.AddChild(AddTag(TipoCampo.Str, "", "CIndOp", 6, 6, Ocorrencia.NaoObrigatoria, nota.Servico.CodigoIndicadorOperacao));
137+
servico.AddChild(AddTag(TipoCampo.Str, "", "CClassTribReg", 6, 6, Ocorrencia.NaoObrigatoria, nota.Servico.CodigoClassificacaoTributaria));
136138

137139
return servico;
138140
}
141+
142+
protected override XElement WriteValoresRps(NotaServico nota)
143+
{
144+
var valores = new XElement("Valores");
145+
146+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorServicos", 1, 15, Ocorrencia.Obrigatoria, nota.Servico.Valores.ValorServicos));
147+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorDeducoes", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorDeducoes));
148+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorPis", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorPis));
149+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorCofins", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorCofins));
150+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorInss", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorInss));
151+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorIr", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorIr));
152+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorCsll", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorCsll));
153+
valores.AddChild(AddTag(TipoCampo.De2, "", "OutrasRetencoes", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.OutrasRetencoes));
154+
valores.AddChild(AddTag(TipoCampo.De2, "", "ValorIss", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.ValorIss));
155+
if (Municipio.Provedor == NFSeProvider.Fiorilli)
156+
valores.AddChild(AddTag(TipoCampo.De4, "", "Aliquota", 1, 6, Ocorrencia.Obrigatoria, nota.Servico.Valores.Aliquota));
157+
else
158+
valores.AddChild(AddTag(TipoCampo.De4, "", "Aliquota", 1, 6, Ocorrencia.MaiorQueZero, nota.Servico.Valores.Aliquota));
159+
valores.AddChild(AddTag(TipoCampo.De2, "", "DescontoIncondicionado", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.DescontoIncondicionado));
160+
valores.AddChild(AddTag(TipoCampo.De2, "", "DescontoCondicionado", 1, 15, Ocorrencia.MaiorQueZero, nota.Servico.Valores.DescontoCondicionado));
161+
valores.AddChild(AddTag(TipoCampo.Str, "", "CST", 2, 2, Ocorrencia.NaoObrigatoria, nota.Servico.Valores.CstPisCofins));
162+
valores.AddChild(AddTag(TipoCampo.Str, "", "TpRetPisCofins", 1, 1, Ocorrencia.NaoObrigatoria, nota.Servico.Valores.TipoRetencaoPisCofins));
163+
164+
return valores;
165+
}
139166

140167
protected override void PrepararEnviar(RetornoEnviar retornoWebservice, NotaServicoCollection notas)
141168
{

src/OpenAC.Net.NFSe/Schemas/NFeCidades/2.01/nfse.xsd

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,31 @@
286286
<xsd:pattern value="1|2|3|4|5" />
287287
</xsd:restriction>
288288
</xsd:simpleType>
289+
<xsd:simpleType name="tsCodJustCanc">
290+
<xsd:annotation>
291+
<xsd:documentation>
292+
Código de justificativa de cancelamento:
293+
1 - Erro na Emissão;
294+
2 - Serviço não Prestado;
295+
9 - Outros;
296+
</xsd:documentation>
297+
</xsd:annotation>
298+
<xsd:restriction base="xsd:string">
299+
<xsd:whiteSpace value="preserve"/>
300+
<xsd:enumeration value="1"/>
301+
<xsd:enumeration value="2"/>
302+
<xsd:enumeration value="9"/>
303+
</xsd:restriction>
304+
</xsd:simpleType>
305+
<xsd:simpleType name="tsMotivo">
306+
<xsd:annotation>
307+
<xsd:documentation>Descrição do motivo da substituição da NFS-e</xsd:documentation>
308+
</xsd:annotation>
309+
<xsd:restriction base="tsString">
310+
<xsd:minLength value="15"/>
311+
<xsd:maxLength value="255"/>
312+
</xsd:restriction>
313+
</xsd:simpleType>
289314
<xsd:simpleType name="tsIdTag">
290315
<xsd:restriction base="xsd:string">
291316
<xsd:maxLength value="255" />
@@ -512,6 +537,29 @@
512537
<xsd:enumeration value="09"/>
513538
</xsd:restriction>
514539
</xsd:simpleType>
540+
<xsd:simpleType name="tsTipoRetPISCofins">
541+
<xsd:annotation>
542+
<xsd:documentation>
543+
Tipo de retencao do Pis/Cofins:
544+
1 - Retido;
545+
2 - Não Retido;
546+
</xsd:documentation>
547+
</xsd:annotation>
548+
<xsd:restriction base="xsd:string">
549+
<xsd:whiteSpace value="preserve"/>
550+
<xsd:enumeration value="1"/>
551+
<xsd:enumeration value="2"/>
552+
</xsd:restriction>
553+
</xsd:simpleType>
554+
<xsd:simpleType name="tsString">
555+
<xsd:annotation>
556+
<xsd:documentation>Tipo string genérico</xsd:documentation>
557+
</xsd:annotation>
558+
<xsd:restriction base="xsd:string">
559+
<xsd:whiteSpace value="preserve"/>
560+
<xsd:pattern value="[!-ÿ]{1}[ -ÿ]{0,}[!-ÿ]{1}|[!-ÿ]{1}"/>
561+
</xsd:restriction>
562+
</xsd:simpleType>
515563

516564
<!-- definition of complex elements -->
517565
<xsd:complexType name="tcCpfCnpj">
@@ -680,6 +728,7 @@
680728
minOccurs="0" maxOccurs="1" />
681729
<xsd:element name="CST" type="tsTipoCST"
682730
minOccurs="0" maxOccurs="1" />
731+
<xsd:element name="TpRetPisCofins" type="tsTipoRetPISCofins" minOccurs="0"/>
683732
</xsd:sequence>
684733
</xsd:complexType>
685734

@@ -727,7 +776,7 @@
727776
<xsd:element name="PaisPrestacao" type="tsCodigoPaisBacen"
728777
minOccurs="0" maxOccurs="1" />
729778
<xsd:element name="CodigoNBS" type="tsCodNBS"
730-
minOccurs="1" maxOccurs="1">
779+
minOccurs="0" maxOccurs="1">
731780
<xsd:annotation>
732781
<xsd:documentation>Código NBS (Nomenclatura Brasileira de Serviços, Intangíveis e outras Operações que produzam Variações no Patrimônio) correspondente ao serviço prestado</xsd:documentation>
733782
</xsd:annotation>
@@ -986,6 +1035,16 @@
9861035
minOccurs="1" maxOccurs="1" />
9871036
<xsd:element name="CodigoCancelamento" type="tsCodigoCancelamentoNfse"
9881037
minOccurs="0" maxOccurs="1" />
1038+
<xsd:element name="CMotivo" type="tsCodJustCanc">
1039+
<xsd:annotation>
1040+
<xsd:documentation>Código de justificativa de cancelamento</xsd:documentation>
1041+
</xsd:annotation>
1042+
</xsd:element>
1043+
<xsd:element name="XMotivo" type="tsMotivo">
1044+
<xsd:annotation>
1045+
<xsd:documentation>Descrição para explicitar o motivo do cancelamento</xsd:documentation>
1046+
</xsd:annotation>
1047+
</xsd:element>
9891048
</xsd:sequence>
9901049
<xsd:attribute name="Id" type="tsIdTag" />
9911050
</xsd:complexType>

0 commit comments

Comments
 (0)