|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -from pynfe.entidades import NotaFiscal, Manifesto |
| 2 | +import base64 |
| 3 | +import hashlib |
| 4 | +import re |
| 5 | +from datetime import datetime |
| 6 | + |
| 7 | +from pynfe.entidades import Manifesto, NotaFiscal |
3 | 8 | from pynfe.utils import ( |
4 | 9 | etree, |
5 | | - so_numeros, |
| 10 | + obter_codigo_por_municipio, |
6 | 11 | obter_municipio_por_codigo, |
7 | 12 | obter_pais_por_codigo, |
8 | | - obter_codigo_por_municipio, |
| 13 | + so_numeros, |
9 | 14 | ) |
10 | 15 | from pynfe.utils.flags import ( |
11 | 16 | CODIGOS_ESTADOS, |
12 | | - VERSAO_PADRAO, |
13 | | - VERSAO_MDFE, |
14 | | - NAMESPACE_NFE, |
15 | 17 | NAMESPACE_MDFE, |
| 18 | + NAMESPACE_NFE, |
16 | 19 | NAMESPACE_SIG, |
| 20 | + VERSAO_MDFE, |
| 21 | + VERSAO_PADRAO, |
17 | 22 | VERSAO_QRCODE, |
18 | 23 | ) |
19 | | -from pynfe.utils.webservices import NFCE, MDFE |
20 | | -import base64 |
21 | | -import hashlib |
22 | | -from datetime import datetime |
23 | | -import re |
| 24 | +from pynfe.utils.webservices import MDFE, NFCE |
24 | 25 |
|
25 | 26 |
|
26 | 27 | class Serializacao(object): |
@@ -697,6 +698,21 @@ def _serializar_imposto_icms( |
697 | 698 | etree.SubElement(icms_item, "vFCPSTRet").text = "{:.2f}".format( |
698 | 699 | produto_servico.fcp_st_valor or 0 |
699 | 700 | ) |
| 701 | + |
| 702 | + # 61=Tributação monofásica sobre combustíveis cobrada anteriormente |
| 703 | + elif produto_servico.icms_modalidade == "61": |
| 704 | + icms_item = etree.SubElement(icms, "ICMS" + produto_servico.icms_modalidade) |
| 705 | + etree.SubElement(icms_item, "orig").text = str(produto_servico.icms_origem) |
| 706 | + etree.SubElement(icms_item, "CST").text = "61" |
| 707 | + etree.SubElement(icms_item, "qBCMonoRet").text = "{:.2f}".format( |
| 708 | + produto_servico.icms_q_bc_mono_ret or 0 |
| 709 | + ) |
| 710 | + etree.SubElement(icms_item, "adRemICMSRet").text = "{:.2f}".format( |
| 711 | + produto_servico.icms_ad_rem_icms_ret or 0 |
| 712 | + ) |
| 713 | + etree.SubElement(icms_item, "vICMSMonoRet").text = "{:.2f}".format( |
| 714 | + produto_servico.icms_v_icms_mono_ret or 0 |
| 715 | + ) |
700 | 716 |
|
701 | 717 | # 70=Com redução da BC e cobrança do ICMS por substituição tributária |
702 | 718 | elif produto_servico.icms_modalidade == "70": |
@@ -1494,6 +1510,14 @@ def _serializar_nota_fiscal( |
1494 | 1510 | etree.SubElement(icms_total, "vICMSUFRemet").text = "{:.2f}".format( |
1495 | 1511 | nota_fiscal.totais_icms_remetente |
1496 | 1512 | ) |
| 1513 | + if nota_fiscal.totais_icms_q_bc_mono_ret: |
| 1514 | + etree.SubElement(icms_total, "qBCMonoRet").text = "{:.2f}".format( |
| 1515 | + nota_fiscal.totais_icms_q_bc_mono_ret |
| 1516 | + ) |
| 1517 | + if nota_fiscal.totais_icms_v_icms_mono_ret: |
| 1518 | + etree.SubElement(icms_total, "vICMSMonoRet").text = "{:.2f}".format( |
| 1519 | + nota_fiscal.totais_icms_v_icms_mono_ret |
| 1520 | + ) |
1497 | 1521 | etree.SubElement(icms_total, "vFCP").text = "{:.2f}".format( |
1498 | 1522 | nota_fiscal.totais_fcp |
1499 | 1523 | ) |
|
0 commit comments