From c603e8f6f1b5dd91c4f58cbb51159e79605bb396 Mon Sep 17 00:00:00 2001 From: marinaGD Date: Tue, 11 Dec 2018 13:44:34 -0200 Subject: [PATCH 1/2] add fgts missing fields --- br_payment_cnab/models/payment_information.py | 4 ++++ br_payment_cnab/serialize/cnab240.py | 7 ++++++- br_payment_cnab_voucher/models/account_voucher.py | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/br_payment_cnab/models/payment_information.py b/br_payment_cnab/models/payment_information.py index 6fe8e628c..61925538c 100644 --- a/br_payment_cnab/models/payment_information.py +++ b/br_payment_cnab/models/payment_information.py @@ -155,6 +155,10 @@ def name_get(self): identificacao_fgts = fields.Integer('Número de Identificação do FGTS') + conec_social_dv_fgts = fields.Integer("DV do conectividade Social") + + conec_social_fgts = fields.Integer("Lacre do conectividade social") + tax_identification = fields.Selection( [('16', 'DARF Normal'), ('18', 'DARF Simples'), diff --git a/br_payment_cnab/serialize/cnab240.py b/br_payment_cnab/serialize/cnab240.py index 09e61824b..94b19fbc1 100644 --- a/br_payment_cnab/serialize/cnab240.py +++ b/br_payment_cnab/serialize/cnab240.py @@ -81,7 +81,12 @@ def _get_header_arq(self): def _get_segmento(self, line, lot_sequency, num_lot, nome_segmento): information_id = line.payment_information_id segmento = { + "cedente_inscricao_numero": self._string_to_num( + self._order.company_id.cnpj_cpf), "identificador_fgts": information_id.identificacao_fgts, + "lacre_conectividade_social": information_id.conec_social_fgts, + "lacre_conectividade_social_dv": + information_id.conec_social_dv_fgts, "controle_lote": num_lot, "sequencial_registro_lote": lot_sequency, "tipo_movimento": information_id.mov_type, @@ -191,7 +196,7 @@ def _get_header_lot(self, line, num_lot, lot): information_id = line.payment_information_id bank = self._order.src_bank_account_id header_lot = { - 'forma_lancamento': lot, + "forma_lancamento": lot, "controle_lote": num_lot, "tipo_servico": int(information_id.service_type), "cedente_inscricao_tipo": 2, diff --git a/br_payment_cnab_voucher/models/account_voucher.py b/br_payment_cnab_voucher/models/account_voucher.py index 4bb691388..7281b072d 100644 --- a/br_payment_cnab_voucher/models/account_voucher.py +++ b/br_payment_cnab_voucher/models/account_voucher.py @@ -131,6 +131,8 @@ def _prepare_payment_order_vals(self): 'invoice_date': self.date, 'barcode': self.barcode, 'linha_digitavel': self.linha_digitavel, + 'conec_social_fgts': self.conec_social_fgts, + 'conec_social_dv_fgts': self.conec_social_dv_fgts, # TODO Ajustar o valor de multa e de juros # 'fine_value': self.fine_value, # 'interest_value': self.interest_value, From 2d025a2c09458c2b4dbc8864889b7dbc9042d008 Mon Sep 17 00:00:00 2001 From: marinaGD Date: Tue, 11 Dec 2018 13:46:47 -0200 Subject: [PATCH 2/2] fix value of ticket in tests --- br_payment_cnab_voucher/tests/test_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br_payment_cnab_voucher/tests/test_voucher.py b/br_payment_cnab_voucher/tests/test_voucher.py index de5bf421c..d8bac625f 100644 --- a/br_payment_cnab_voucher/tests/test_voucher.py +++ b/br_payment_cnab_voucher/tests/test_voucher.py @@ -175,7 +175,7 @@ def test_boletos_titulos(self): 'linha': '858700000049 800001791819 107622050820 415823300017', }, '237': { - 'valor': '2546.06', + 'valor': '2546.05', 'linha': '858000000259 460503281831 240720183202 339122710600' }, '341': {