Exemplo n.º 1
0
        public override void Gravar()
        {
            try
            {
                Validar();

                duplicata = new TB_FIN_DUPLICATA();

                duplicata.ID_DUPLICATA         = teIdentificador.Text.ToInt32().Padrao();
                duplicata.ID_DOCUMENTO         = teNrDocumento.Text.Padrao();
                duplicata.DT_EMISSAO           = Convert.ToDateTime(deEmissao.Text);
                duplicata.TP                   = rbPagar.Checked ? "P" : "R";
                duplicata.ID_EMPRESA           = beEmpresa.Text.ToInt32().Padrao();
                duplicata.ID_CLIFOR            = beClifor.Text.ToInt32().Padrao();
                duplicata.ID_CENTROCUSTO       = beCCusto.Text.ToInt32().Padrao();
                duplicata.ID_CONDICAOPAGAMENTO = beCondicao.Text.ToInt32().Padrao();
                duplicata.QT_PARCELAS          = seQtdParcelas.Value;
                duplicata.VL                   = seValor.Value;

                var posicaoTransacao = 0;
                new QDuplicata().Gravar(duplicata, 0m, 0m, null, ref posicaoTransacao);

                base.Gravar();
            }
            catch (Exception excessao)
            {
                excessao.Validar();
            }
        }
Exemplo n.º 2
0
        public void Deletar(TB_FIN_DUPLICATA duplicata, ref int posicaoTransacao)
        {
            try
            {
                Conexao.Iniciar(ref posicaoTransacao);

                var parcelas = (from i in Conexao.BancoDados.TB_FIN_PARCELAs
                                where i.ID_DUPLICATA == duplicata.ID_DUPLICATA
                                select i).ToList();

                for (int i = 0; i < parcelas.Count(); i++)
                {
                    Conexao.BancoDados.TB_FIN_PARCELAs.DeleteOnSubmit(parcelas[i]);
                    Conexao.Enviar();
                }

                var existente = Conexao.BancoDados.TB_FIN_DUPLICATAs.FirstOrDefault(a => a.ID_DUPLICATA == duplicata.ID_DUPLICATA);
                if (existente != null)
                {
                    Conexao.BancoDados.TB_FIN_DUPLICATAs.DeleteOnSubmit(existente);
                }

                Conexao.Enviar();

                Conexao.Finalizar(ref posicaoTransacao);
            }
            catch (Exception excessao)
            {
                Conexao.Voltar(ref posicaoTransacao);
                throw excessao;
            }
        }
Exemplo n.º 3
0
        public void Deletar(TB_FIN_DUPLICATA duplicata)
        {
            try
            {
                Iniciar();

                var parcelas = (from i in BancoDados.TB_FIN_PARCELAs
                                where i.ID_DUPLICATA == duplicata.ID_DUPLICATA
                                select i).ToList();

                for (int i = 0; i < parcelas.Count(); i++)
                {
                    BancoDados.TB_FIN_PARCELAs.DeleteOnSubmit(parcelas[i]);
                    Enviar();
                }

                var existente = BancoDados.TB_FIN_DUPLICATAs.FirstOrDefault(a => a.ID_DUPLICATA == duplicata.ID_DUPLICATA);
                if (existente != null)
                {
                    BancoDados.TB_FIN_DUPLICATAs.DeleteOnSubmit(existente);
                }

                Enviar();

                Finalizar();
            }
            catch (Exception excessao)
            {
                Voltar();
                throw excessao;
            }
        }
Exemplo n.º 4
0
        public void Gravar(TB_FIN_DUPLICATA duplicata, decimal valorDesconto, decimal valorJuros, int?formaPagamento, ref int posicaoTransacao)
        {
            try
            {
                Conexao.Iniciar(ref posicaoTransacao);

                if (duplicata.ID_DUPLICATA.ToString().Length > 0)
                {
                    Deletar(duplicata, ref posicaoTransacao);
                }

                duplicata.ID_DUPLICATA = duplicata.ID_DUPLICATA.TemValor() ? duplicata.ID_DUPLICATA : ((Conexao.BancoDados.TB_FIN_DUPLICATAs.Any() ? Conexao.BancoDados.TB_FIN_DUPLICATAs.Max(a => a.ID_DUPLICATA) : 0) + 1);

                if (!duplicata.ID_CONDICAOPAGAMENTO.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("informar a condição de pagamento"));
                }

                Conexao.BancoDados.TB_FIN_DUPLICATAs.InsertOnSubmit(duplicata);
                Conexao.Enviar();

                duplicata.TB_FIN_PARCELAs = new System.Data.Linq.EntitySet <TB_FIN_PARCELA>();

                var condicaoPagamento = new QCondicaoPagamento().Buscar(duplicata.ID_CONDICAOPAGAMENTO.Padrao()).FirstOrDefault();

                for (var i = 0; i < (duplicata.QT_PARCELAS ?? 1); i++)
                {
                    var data = condicaoPagamento.QT_DIASDESDOBRO.Padrao() == 0 ? Conexao.Data : Conexao.Data.AddDays(Convert.ToDouble(condicaoPagamento.QT_DIASDESDOBRO.Padrao()) * (i + 1));

                    var parcela = new TB_FIN_PARCELA
                    {
                        ID_PARCELA    = i + 1,
                        ID_DUPLICATA  = duplicata.ID_DUPLICATA,
                        ID_EMPRESA    = duplicata.ID_EMPRESA,
                        VL            = duplicata.VL / duplicata.QT_PARCELAS,
                        DT_VENCIMENTO = data,
                        DT_PAGAMENTO  = data == Conexao.Data ? Conexao.DataHora : (DateTime?)null
                    };

                    Conexao.BancoDados.TB_FIN_PARCELAs.InsertOnSubmit(parcela);

                    Conexao.Enviar();

                    if (parcela.DT_VENCIMENTO == Conexao.Data)
                    {
                        new QLiquidacao().Gravar(parcela, valorDesconto, valorJuros, formaPagamento, ref posicaoTransacao);
                    }

                    Conexao.Enviar();
                }

                Conexao.Finalizar(ref posicaoTransacao);
            }
            catch (Exception excessao)
            {
                Conexao.Voltar(ref posicaoTransacao);
                throw excessao;
            }
        }
Exemplo n.º 5
0
        public FContas_Cadastro()
        {
            InitializeComponent();
            this.Shown += delegate
            {
                try
                {
                    if (Modo == Modo.Cadastrar)
                    {
                        duplicata = new TB_FIN_DUPLICATA();
                    }
                    else if (Modo == Modo.Alterar)
                    {
                        if (duplicata == null)
                        {
                            Excessoes.Alterar();
                        }

                        if (new QLiquidacao().Buscar(0, duplicata.ID_DUPLICATA).Count() > 0)
                        {
                            lcGeral.Enabled = false;
                        }

                        teIdentificador.Text = duplicata.ID_DUPLICATA.ToString();
                        teNrDocumento.Text   = duplicata.ID_DOCUMENTO;
                        deEmissao.Text       = duplicata.DT_EMISSAO.ToString();
                        rbPagar.Checked      = duplicata.TP == "P";
                        rbReceber.Checked    = duplicata.TP == "R";
                        beEmpresa.Text       = duplicata.ID_EMPRESA.ToString();
                        beEmpresa_Leave(null, null);
                        beClifor.Text = duplicata.ID_CLIFOR.ToString();
                        beClifor_Leave(null, null);
                        beCCusto.Text = duplicata.ID_CENTROCUSTO.ToString();
                        beCCusto_Leave(null, null);
                        beCondicao.Text = duplicata.ID_CONDICAOPAGAMENTO.ToString();
                        beCondicao_Leave(null, null);
                        seQtdParcelas.Value = duplicata.QT_PARCELAS ?? 0m;
                        seValor.Value       = duplicata.VL ?? 0m;
                    }
                }
                catch (Exception excessao)
                {
                    excessao.Validar();
                }
            };
        }
Exemplo n.º 6
0
        public void Gravar(TB_FAT_NOTA nota, int?formaPagamento, ref int posicaoTransacao)
        {
            try
            {
                Conexao.Iniciar(ref posicaoTransacao);

                var itens      = nota.TB_FAT_NOTA_ITEMs;
                var itensNovos = new List <TB_FAT_NOTA_ITEM>();

                nota = new TB_FAT_NOTA
                {
                    ID_NOTA                    = nota.ID_NOTA,
                    ID_EMPRESA                 = nota.ID_EMPRESA,
                    ID_NOTA_REFERENCIA         = nota.ID_NOTA_REFERENCIA,
                    ID_CONFIGURACAO_FISCAL     = nota.ID_CONFIGURACAO_FISCAL,
                    ID_CONFIGURACAO_FINANCEIRO = nota.ID_CONFIGURACAO_FINANCEIRO,
                    ID_USUARIO                 = nota.ID_USUARIO,
                    ID_CLIFOR                  = nota.ID_CLIFOR,
                    ID_TRANSPORTADORA          = nota.ID_TRANSPORTADORA,
                    ID_VEICULO                 = nota.ID_VEICULO,
                    ID_MOEDA                   = nota.ID_MOEDA,
                    TP_MOVIMENTO               = nota.TP_MOVIMENTO,
                    TP_NOTA                    = nota.TP_NOTA,
                    DT_ENTRADASAIDA            = nota.DT_ENTRADASAIDA,
                    DT_EMISSAO                 = Conexao.DataHora
                };

                if (!nota.ID_EMPRESA.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("empresa da nota"));
                }

                if (!nota.ID_CLIFOR.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("clifor da nota"));
                }

                nota.TP_MOVIMENTO.Validar(true, 1);

                if (!(nota.TP_MOVIMENTO == "E" | nota.TP_MOVIMENTO == "S"))
                {
                    throw new SYSException(Mensagens.Necessario("o tipo do movimento da nota"));
                }

                if (nota.TP_MOVIMENTO == "E" && !nota.ID_NOTA_REFERENCIA.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("o identificador da nota de referência"));
                }

                if (nota.TP_MOVIMENTO == "E" && !nota.DT_ENTRADASAIDA.DataValida())
                {
                    throw new SYSException(Mensagens.Necessario("a data de entrada da nota"));
                }

                if (!nota.ID_CONFIGURACAO_FISCAL.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("o identificador da configuração fiscal"));
                }

                if (!nota.ID_CONFIGURACAO_FINANCEIRO.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("o identificador da configuração financeiro"));
                }

                if (!nota.ID_USUARIO.TemValor())
                {
                    nota.ID_USUARIO = Parametros.ID_Usuario;
                }

                if (!nota.ID_MOEDA.TemValor())
                {
                    nota.ID_MOEDA = Parametros.ID_MoedaPadrao;
                }

                if (itens == null || !itens.Count.TemValor())
                {
                    throw new SYSException(Mensagens.Necessario("os itens da nota"));
                }

                nota.ID_NOTA = (Conexao.BancoDados.TB_FAT_NOTAs.Where(a => a.ID_EMPRESA == nota.ID_EMPRESA).Any() ? Conexao.BancoDados.TB_FAT_NOTAs.Where(a => a.ID_EMPRESA == nota.ID_EMPRESA).Max(a => a.ID_NOTA) : 0) + 1;

                Conexao.BancoDados.TB_FAT_NOTAs.InsertOnSubmit(nota);
                Conexao.Enviar();

                // Itens da nota
                foreach (var item in itens)
                {
                    var novoItem = new TB_FAT_NOTA_ITEM
                    {
                        ID_NOTA             = nota.ID_NOTA,
                        ID_EMPRESA          = nota.ID_EMPRESA,
                        ID_ITEM             = item.ID_ITEM,
                        ID_PRODUTO          = item.ID_PRODUTO,
                        QT                  = item.QT,
                        VL_UNITARIO         = item.VL_UNITARIO,
                        VL_FRETE            = item.VL_FRETE,
                        VL_SEGURO           = item.VL_SEGURO,
                        VL_DESCONTO         = item.VL_DESCONTO,
                        VL_ACRESCIMO        = item.VL_ACRESCIMO,
                        VL_SUBTOTAL         = (item.VL_UNITARIO.Padrao() * item.QT.Padrao()) + item.VL_FRETE.Padrao() + item.VL_SEGURO.Padrao() + item.VL_ACRESCIMO.Padrao() - item.VL_DESCONTO.Padrao(),
                        ST_COMPOE           = item.ST_COMPOE,
                        DS_OBSERVACAO       = item.DS_OBSERVACAO,
                        DS_OBSERVACAOFISCAL = item.DS_OBSERVACAOFISCAL
                    };

                    if (!novoItem.ID_PRODUTO.TemValor())
                    {
                        throw new SYSException(Mensagens.Necessario("o produto do item"));
                    }

                    novoItem.VL_DESCONTO.Validar();
                    novoItem.QT.Validar();
                    novoItem.VL_UNITARIO.Validar();

                    if (!novoItem.VL_UNITARIO.TemValor() && !novoItem.QT.TemValor())
                    {
                        throw new SYSException(Mensagens.Necessario("valor e/ou quantidade do item"));
                    }

                    novoItem.ID_ITEM = (Conexao.BancoDados.TB_FAT_NOTA_ITEMs.Where(a => a.ID_EMPRESA == nota.ID_EMPRESA && a.ID_NOTA == a.ID_NOTA).Any() ? Conexao.BancoDados.TB_FAT_NOTA_ITEMs.Where(a => a.ID_EMPRESA == nota.ID_EMPRESA && a.ID_NOTA == a.ID_NOTA).Max(a => a.ID_ITEM) : 0) + 1;


                    var novoItemTributos = novoItem.TB_FAT_NOTA_ITEM_TRIBUTOs;

                    Conexao.BancoDados.TB_FAT_NOTA_ITEMs.InsertOnSubmit(novoItem);
                    Conexao.Enviar();

                    itensNovos.Add(novoItem);

                    // Remove o item do estoque
                    new QEstoque().Gravar(new TB_EST_ESTOQUE
                    {
                        DT         = Conexao.DataHora,
                        ID_EMPRESA = nota.ID_EMPRESA,
                        ID_PRODUTO = novoItem.ID_PRODUTO.Padrao(),
                        QT         = item.QT.Padrao() * -1 // Saída
                    }, ref posicaoTransacao);

                    // tributos do item
                    if (novoItemTributos == null || !novoItemTributos.Count.TemValor())
                    {
                        var tributos = Conexao.BancoDados.TB_EST_PRODUTO_TRIBUTOs.Where(a => a.ID_PRODUTO == novoItem.ID_PRODUTO).Select(a => a.TB_FIS_TRIBUTO).ToList();

                        if (tributos == null || !tributos.Count.TemValor())
                        {
                            tributos = Conexao.BancoDados.TB_EST_GRUPO_TRIBUTOs.Where(a => a.ID_GRUPO == novoItem.TB_EST_PRODUTO.ID_GRUPO).Select(a => a.TB_FIS_TRIBUTO).ToList();
                        }

                        if (tributos != null && tributos.Count.TemValor())
                        {
                            novoItemTributos = tributos.Select(a => new TB_FAT_NOTA_ITEM_TRIBUTO
                            {
                                ID_EMPRESA = nota.ID_EMPRESA,
                                ID_NOTA    = nota.ID_NOTA,
                                ID_ITEM    = item.ID_ITEM,
                                ID_TRIBUTO = a.ID_TRIBUTO
                            }).ToEntitySet();
                        }
                    }

                    if (novoItemTributos == null || !novoItemTributos.Count.TemValor())
                    {
                        throw new SYSException(Mensagens.Necessario("os tributos do item"));
                    }

                    foreach (var tributo in novoItemTributos)
                    {
                        tributo.ID_EMPRESA = nota.ID_EMPRESA;
                        tributo.ID_NOTA    = nota.ID_NOTA;
                        tributo.ID_ITEM    = novoItem.ID_ITEM;

                        if (!tributo.ID_TRIBUTO.TemValor())
                        {
                            throw new SYSException(Mensagens.Necessario("o tributo do item"));
                        }

                        tributo.VL_BASECALCULO = novoItem.VL_SUBTOTAL.Validar();

                        if (nota.TB_CON_EMPRESA.TB_REL_CLIFOR.TB_REL_CLIFOR_X_ENDERECOs == null || nota.TB_CON_EMPRESA.TB_REL_CLIFOR.TB_REL_CLIFOR_X_ENDERECOs.Count == 0)
                        {
                            throw new SYSException(Mensagens.Necessario("os endereços da empresa"));
                        }

                        var enderecoEmpresa = nota.TB_CON_EMPRESA.TB_REL_CLIFOR.TB_REL_CLIFOR_X_ENDERECOs.FirstOrDefault().TB_REL_ENDERECO;
                        var enderecoCliente = nota.TB_REL_CLIFOR.TB_REL_CLIFOR_X_ENDERECOs.FirstOrDefault().TB_REL_ENDERECO;
                        //var produto = new Cadastros.Estoque.QProduto().Buscar(item.ID_PRODUTO.Padrao()).FirstOrDefault();

                        //tributo.PC_ALIQUOTA = enderecoEmpresa.ID_CIDADE == enderecoCliente.ID_CIDADE ? produto.PC_ALIQUOTA_MUNICIPAL.Padrao() :
                        //                     (enderecoEmpresa.ID_UF == enderecoCliente.ID_UF ? produto.PC_ALIQUOTA_ESTADUAL.Padrao() :
                        //                    ((enderecoEmpresa.ID_PAIS == enderecoCliente.ID_PAIS ? produto.PC_ALIQUOTA_FEDERAL.Padrao() : produto.PC_ALIQUOTA_INTERNACIONAL.Padrao())));

                        //tributo.VL = (tributo.VL_BASECALC.Padrao() / 100) * tributo.PC_ALIQUOTA.Padrao();

                        Conexao.BancoDados.TB_FAT_NOTA_ITEM_TRIBUTOs.InsertOnSubmit(tributo);
                        Conexao.Enviar();
                    }
                }

                Conexao.Enviar();

                var configuracaoFinanceiro = Conexao.BancoDados.TB_FIN_CONFIGURACAOs.FirstOrDefault(a => a.ID_CONFIGURACAO_FINANCEIRO == nota.ID_CONFIGURACAO_FINANCEIRO);

                var duplicata = new TB_FIN_DUPLICATA
                {
                    ID_EMPRESA           = nota.ID_EMPRESA,
                    ID_CLIFOR            = nota.ID_CLIFOR.Padrao(),
                    ID_MOEDA             = nota.ID_MOEDA.Padrao(),
                    ID_CENTROCUSTO       = configuracaoFinanceiro.ID_CENTROCUSTO,
                    ID_CONDICAOPAGAMENTO = configuracaoFinanceiro.ID_CONDICAOPAGAMENTO,
                    ID_DOCUMENTO         = nota.ID_NOTA.ToString().Validar(true, 16),
                    VL          = itensNovos.Sum(a => a.VL_SUBTOTAL.Padrao()),
                    QT_PARCELAS = configuracaoFinanceiro.QT_PARCELAS,
                    DT_EMISSAO  = Conexao.DataHora,
                    TP          = nota.TP_MOVIMENTO == "E" ? "P" : "R"
                };

                new QDuplicata().Gravar(duplicata, itensNovos.Sum(a => a.VL_DESCONTO.Padrao()), 0m, formaPagamento, ref posicaoTransacao);

                Conexao.BancoDados.TB_FIN_DUPLICATA_X_NOTAs.InsertOnSubmit(new TB_FIN_DUPLICATA_X_NOTA
                {
                    ID_DUPLICATA = duplicata.ID_DUPLICATA,
                    ID_NOTA      = nota.ID_NOTA,
                    ID_EMPRESA   = nota.ID_EMPRESA
                });

                var documento = new TB_FIS_DOCUMENTO {
                    ID_EMPRESA = nota.ID_EMPRESA
                };
                new QDocumento().Gravar(documento, ref posicaoTransacao);

                Conexao.BancoDados.TB_FAT_NOTA_X_DOCUMENTOs.InsertOnSubmit(new TB_FAT_NOTA_X_DOCUMENTO
                {
                    ID_NOTA      = nota.ID_NOTA,
                    ID_EMPRESA   = nota.ID_EMPRESA,
                    ID_DOCUMENTO = documento.ID_DOCUMENTO
                });

                Conexao.Enviar();

                ID_NOTA = nota.ID_NOTA;

                Conexao.BancoDados.TB_FAT_NOTA_X_CPFs.InsertOnSubmit(new TB_FAT_NOTA_X_CPF
                {
                    ID_EMPRESA = nota.ID_EMPRESA,
                    ID_NOTA    = nota.ID_NOTA,
                    CPF        = new QClifor().Buscar(nota.ID_CLIFOR ?? 0).ToList()[0].CPF
                });

                Conexao.Enviar();

                Conexao.Finalizar(ref posicaoTransacao);
            }
            catch (Exception excessao)
            {
                Conexao.Voltar(ref posicaoTransacao);
                throw excessao;
            }
        }
Exemplo n.º 7
0
        public void Gravar(TB_FIN_DUPLICATA duplicata)
        {
            try
            {
                Iniciar();

                var existente = BancoDados.TB_FIN_DUPLICATAs.FirstOrDefault(a => a.ID_DUPLICATA == duplicata.ID_DUPLICATA);

                #region Inserção

                if (existente == null)
                {
                    duplicata.ID_DUPLICATA = (BancoDados.TB_FIN_DUPLICATAs.Any() ? BancoDados.TB_FIN_DUPLICATAs.Max(a => a.ID_DUPLICATA) : 0) + 1;
                    BancoDados.TB_FIN_DUPLICATAs.InsertOnSubmit(duplicata);

                    _ID_Duplicata = duplicata.ID_DUPLICATA;

                    for (int i = 0; i < duplicata.TB_FIN_PARCELAs.Count; i++)
                    {
                        duplicata.TB_FIN_PARCELAs[i].ID_PARCELA    = (BancoDados.TB_FIN_PARCELAs.Any() ? BancoDados.TB_COM_PEDIDO_ITEMs.Max(a => a.ID_ITEM) : 0) + 1;
                        duplicata.TB_FIN_PARCELAs[i].ID_DUPLICATA  = duplicata.ID_DUPLICATA;
                        duplicata.TB_FIN_PARCELAs[i].VL            = duplicata.VL / duplicata.QT_PARCELAS;
                        duplicata.TB_FIN_PARCELAs[i].DT_VENCIMENTO = duplicata.TB_FIN_CONDICAOPAGAMENTO.QT_DIASDESDOBRO == 1 ? DataHora : DataHora.AddDays(Convert.ToDouble(duplicata.TB_FIN_CONDICAOPAGAMENTO.QT_DIASDESDOBRO) * i);
                        BancoDados.TB_FIN_PARCELAs.InsertOnSubmit(duplicata.TB_FIN_PARCELAs[i]);
                        _ID_Parcela = duplicata.TB_FIN_PARCELAs[i].ID_PARCELA;
                    }
                }

                #endregion

                #region Atualização

                else
                {
                    existente.ID_EMPRESA           = duplicata.ID_EMPRESA;
                    existente.ID_CLIFOR            = duplicata.ID_CLIFOR;
                    existente.ID_CONDICAOPAGAMENTO = duplicata.ID_CONDICAOPAGAMENTO;
                    existente.ID_CENTROCUSTO       = duplicata.ID_CENTROCUSTO;
                    existente.ID_DOCUMENTO         = duplicata.ID_DOCUMENTO;
                    existente.QT_PARCELAS          = duplicata.QT_PARCELAS;
                    existente.VL         = duplicata.VL;
                    existente.DT_EMISSAO = duplicata.DT_EMISSAO;
                    existente.TP         = duplicata.TP;

                    Enviar();

                    for (int i = 0; i < duplicata.TB_FIN_PARCELAs.Count; i++)
                    {
                        duplicata.TB_FIN_PARCELAs[i].ID_PARCELA    = duplicata.TB_FIN_PARCELAs[i].ID_PARCELA;
                        duplicata.TB_FIN_PARCELAs[i].ID_DUPLICATA  = duplicata.ID_DUPLICATA;
                        duplicata.TB_FIN_PARCELAs[i].VL            = duplicata.VL / duplicata.QT_PARCELAS;
                        duplicata.TB_FIN_PARCELAs[i].DT_VENCIMENTO = duplicata.TB_FIN_CONDICAOPAGAMENTO.QT_DIASDESDOBRO == 1 ? DataHora : DataHora.AddDays(Convert.ToDouble(duplicata.TB_FIN_CONDICAOPAGAMENTO.QT_DIASDESDOBRO) * i);
                        BancoDados.TB_FIN_PARCELAs.InsertOnSubmit(duplicata.TB_FIN_PARCELAs[i]);
                        _ID_Parcela = duplicata.TB_FIN_PARCELAs[i].ID_PARCELA;
                    }
                }


                #endregion

                Enviar();

                Finalizar();
            }
            catch (Exception excessao)
            {
                Voltar();
                throw excessao;
            }
        }