Exemplo n.º 1
0
        public void EstornaRecebimento()
        {
            ItemContaReceberFormaRecebimento   itemContaReceberFR   = new ItemContaReceberFormaRecebimento();
            ItemContaReceberFormaRecebimentoBO itemContaReceberFRBO = new ItemContaReceberFormaRecebimentoBO();

            ItemContaReceber   itemContaReceber   = new ItemContaReceber();
            ItemContaReceberBO itemContaReceberBo = new ItemContaReceberBO();

            ContasReceber   contaReceber   = new ContasReceber();
            ContasReceberBO contaReceberBO = new ContasReceberBO();

            itemContaReceberFR = itemContaReceberFRBO.SelecionarItemFormaRecebimentoId(itemContaReceberID);
            itemContaReceber   = itemContaReceberBo.SelecionarItemContaReceberID(itemContaReceberFR._ItenContaReceber._ItemContaReceberID);

            decimal vlrPago  = itemContaReceberFR._VlrPago;
            decimal vlrAbert = itemContaReceber.ValorAberto;

            itemContaReceberBo.EstornarRecebimento(itemContaReceber._ItemContaReceberID, vlrPago, vlrAbert, "Prevista");

            itemContaReceberFRBO.ExcluirItemFormaRecebimentoContaReceberId(itemContaReceberFR._ItemContaReceberFRID);

            MessageBox.Show("Recebimento estornado com sucesso", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);

            CarregaItemContasRecebidasFormaRecebimento();
        }