@ -359,6 +359,50 @@ class SerializacaoXML(Serializacao):
etree . SubElement ( icms_item , ' vBCFCP ' ) . text = ' {:.2f} ' . format ( produto_servico . fcp_base_calculo or 0 ) # Base de calculo FCP
etree . SubElement ( icms_item , ' vBCFCP ' ) . text = ' {:.2f} ' . format ( produto_servico . fcp_base_calculo or 0 ) # Base de calculo FCP
etree . SubElement ( icms_item , ' pFCP ' ) . text = ' {:.2f} ' . format ( produto_servico . fcp_percentual or 0 ) # Percentual FCP
etree . SubElement ( icms_item , ' pFCP ' ) . text = ' {:.2f} ' . format ( produto_servico . fcp_percentual or 0 ) # Percentual FCP
etree . SubElement ( icms_item , ' vFCP ' ) . text = ' {:.2f} ' . format ( produto_servico . fcp_valor or 0 ) # Valor Fundo Combate a Pobreza
etree . SubElement ( icms_item , ' vFCP ' ) . text = ' {:.2f} ' . format ( produto_servico . fcp_valor or 0 ) # Valor Fundo Combate a Pobreza
# 30=Isenta / não tributada e com cobrança do ICMS por substituição tributária
elif produto_servico . icms_modalidade == ' 30 ' :
etree . SubElement ( icms_item , ' modBCST ' ) . text = str ( produto_servico . icms_st_modalidade_determinacao_bc )
etree . SubElement ( icms_item , ' pMVAST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_percentual_adicional or 0 ) # Percentual da margem de valor Adicionado do ICMS ST
etree . SubElement ( icms_item , ' pRedBCST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_percentual_reducao_bc or 0 ) # APercentual da Redução de BC do ICMS ST
etree . SubElement ( icms_item , ' vBCST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_valor_base_calculo or 0 )
etree . SubElement ( icms_item , ' pICMSST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_aliquota or 0 )
etree . SubElement ( icms_item , ' vICMSST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_valor or 0 )
if produto_servico . icms_desonerado > 0 :
etree . SubElement ( icms_item , ' vICMSDeson ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_desonerado or 0 ) # Valor do ICMS Desonerado
etree . SubElement ( icms_item , ' motDesICMS ' ) . text = str ( produto_servico . icms_motivo_desoneracao )
# 70=Com redução da BC e cobrança do ICMS por substituição tributária
elif produto_servico . icms_modalidade == ' 70 ' :
etree . SubElement ( icms_item , ' modBC ' ) . text = str ( produto_servico . icms_modalidade_determinacao_bc )
etree . SubElement ( icms_item , ' pRedBC ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_percentual_reducao_bc or 0 ) # Percentual da Redução de BC
etree . SubElement ( icms_item , ' vBC ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_valor_base_calculo or 0 ) # Valor da BC do ICMS
etree . SubElement ( icms_item , ' pICMS ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_aliquota or 0 ) # Alíquota do imposto
etree . SubElement ( icms_item , ' vICMS ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_valor or 0 ) # Valor do ICMS
etree . SubElement ( icms_item , ' modBCST ' ) . text = str ( produto_servico . icms_st_modalidade_determinacao_bc )
etree . SubElement ( icms_item , ' pMVAST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_percentual_adicional or 0 ) # Percentual da margem de valor Adicionado do ICMS ST
etree . SubElement ( icms_item , ' pRedBCST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_percentual_reducao_bc or 0 ) # APercentual da Redução de BC do ICMS ST
etree . SubElement ( icms_item , ' vBCST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_valor_base_calculo or 0 )
etree . SubElement ( icms_item , ' pICMSST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_aliquota or 0 )
etree . SubElement ( icms_item , ' vICMSST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_valor or 0 )
if produto_servico . icms_desonerado > 0 :
etree . SubElement ( icms_item , ' vICMSDeson ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_desonerado or 0 ) # Valor do ICMS Desonerado
etree . SubElement ( icms_item , ' motDesICMS ' ) . text = str ( produto_servico . icms_motivo_desoneracao )
# 90=Outras
elif produto_servico . icms_modalidade == ' 90 ' :
etree . SubElement ( icms_item , ' vBC ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_valor_base_calculo or 0 ) # Valor da BC do ICMS
etree . SubElement ( icms_item , ' pRedBC ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_percentual_reducao_bc or 0 ) # Percentual da Redução de BC
etree . SubElement ( icms_item , ' pICMS ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_aliquota or 0 ) # Alíquota do imposto
etree . SubElement ( icms_item , ' vICMS ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_valor or 0 ) # Valor do ICMS
if ( produto_servico . icms_st_valor_base_calculo > 0 ) and ( produto_servico . icms_st_valor > 0 ) :
etree . SubElement ( icms_item , ' modBCST ' ) . text = str ( produto_servico . icms_st_modalidade_determinacao_bc )
etree . SubElement ( icms_item , ' pMVAST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_percentual_adicional or 0 ) # Percentual da margem de valor Adicionado do ICMS ST
etree . SubElement ( icms_item , ' pRedBCST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_percentual_reducao_bc or 0 ) # APercentual da Redução de BC do ICMS ST
etree . SubElement ( icms_item , ' vBCST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_valor_base_calculo or 0 )
etree . SubElement ( icms_item , ' pICMSST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_aliquota or 0 )
etree . SubElement ( icms_item , ' vICMSST ' ) . text = ' {:.2f} ' . format ( produto_servico . icms_st_valor or 0 )
# Impostos não implementados
# Impostos não implementados
else :
else :
raise NotImplementedError
raise NotImplementedError