public string IncluirTipoRecebimento() { DataTable dt = new DataTable(); ItemTipoRecebimentoVendaBO itemTipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO(); dt = itemTipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(numeroVenda); sb2 = new StringBuilder(); foreach (DataRow row in dt.Rows) { if (row["formaRecebimento"].ToString().StartsWith("01")) { frmPgtoDinheiro = true; sb2.AppendLine(row["formaRecebimento"].ToString() + " " + Convert.ToDecimal(row["vlrPago"]).ToString("C").Substring(3)); } if (row["formaRecebimento"].ToString().StartsWith("02")) { frmPgtoCD = true; sb2.AppendLine(row["formaRecebimento"].ToString() + " " + Convert.ToDecimal(row["vlrPago"]).ToString("C").Substring(3)); } if (row["formaRecebimento"].ToString().StartsWith("03")) { frmPgtoCC = true; sb2.AppendLine(row["formaRecebimento"].ToString() + " " + Convert.ToDecimal(row["vlrPago"]).ToString("C").Substring(3)); } } return(sb2.ToString()); }
public void CalcularComposicaoVenda(int numeroVenda) { DataTable dt = new DataTable(); ItemTipoRecebimentoVendaBO itemTipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO(); dt = itemTipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(numeroVenda); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { if (row["formaRecebimento"].ToString().StartsWith("01 - Dinheiro")) { totalVendasRealizadasDinheiro += Convert.ToDecimal(row["vlrPago"]); } else { totalVendasRealizadasCartao += Convert.ToDecimal(row["vlrPago"]); } } txtTotalVendasRealizadasEmDinheiro.Text = string.Format("{0:C2}", totalVendasRealizadasDinheiro); txtTotalVendasRealizadasEmCartoes.Text = string.Format("{0:C2}", totalVendasRealizadasCartao); txtTotalVendasRealizadasEmCheque.Text = Convert.ToDecimal("0.00").ToString("C"); txtTotalVendasRealizadasEmBancos.Text = Convert.ToDecimal("0.00").ToString("C"); } }
private string IncluirPagandoDinheiro() { DataTable dt = new DataTable(); ItemTipoRecebimentoVendaBO itemTipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO(); dt = itemTipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(numeroVenda); foreach (DataRow row in dt.Rows) { if (row["formaRecebimento"].ToString().StartsWith("02")) { frmPgtoCD = true; } else if (row["formaRecebimento"].ToString().StartsWith("03")) { frmPgtoCC = true; } else { frmPgtoDinheiro = true; } } if ((frmPgtoDinheiro == true) && (frmPgtoCC == false) && (frmPgtoCD == false)) { return("PAGANDO........:R$" + " - " + pagando.ToString("N2")); } else { return(string.Empty); } }
public void CalculaSaldoEmDinheiro(DateTime dataInicio, DateTime dataFim) { //Pega vendas em dinheiro DataSet ds = new DataSet(); RealizarVendasBO realizaVendasBO = new RealizarVendasBO(); int vendaID; ds = realizaVendasBO.Vendas(dataInicio, dataFim); if (ds != null) { foreach (DataRow row in ds.Tables[0].Rows) { vendaID = Convert.ToInt32(row["NumeroVenda"].ToString()); ItemTipoRecebimentoVendaBO tipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO(); DataTable dt = new DataTable(); dt = tipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(vendaID); if (dt != null) { foreach (DataRow rowDt in dt.Rows) { if (rowDt["formaRecebimento"].ToString().StartsWith("01 - Dinheiro")) { saldoCaixa += Convert.ToDecimal(rowDt["vlrPago"].ToString()); } } } } } //Pega recebimento em dinheiro }
public void CarregaItensTipoRecebimento(int codigo) { int countRow = 0; DataTable dt = new DataTable(); ItemTipoRecebimentoVendaBO itemTipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO(); dt = itemTipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(codigo); listItenFormaRecebimento.Items.Clear(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { //Adiciona os itens do list view listItenFormaRecebimento.Items.Add(row["formaRecebimento"].ToString()); listItenFormaRecebimento.Items[countRow].SubItems.Add(Convert.ToDecimal(row["vlrPago"]).ToString("C")); countRow++; } countRow = 0; } }
public void CarregaItensTipoRecebimento(string tipo, int codigo) { DataTable dt = new DataTable(); ItemContaReceberFormaRecebimentoBO itemFormaRecebimentoBO = new ItemContaReceberFormaRecebimentoBO(); ItemTipoRecebimentoVendaBO itemTipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO(); if (tipo.StartsWith("contaRecebida")) { dt = itemFormaRecebimentoBO.CriaDataTableSelecionaItemContasReceberFormaRecebimenoto(codigo); } else { dt = itemTipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(codigo); } if (dt.Rows.Count > 0) { listItenFormaRecebimento.Items.Clear(); foreach (DataRow row in dt.Rows) { //Adiciona os itens do list view listItenFormaRecebimento.Items.Add(row["formaRecebimento"].ToString()); listItenFormaRecebimento.Items[countRow].SubItems.Add(Convert.ToDecimal(row["vlrPago"]).ToString("C")); countRow++; totalRecebimento += Convert.ToDecimal(row["vlrPago"]); } countRow = 0; txtTotal.Text = totalRecebimento.ToString("C"); } else { listItenFormaRecebimento.Items.Add("Crédiario Loja"); } }
private void EstornarSaldoCaixaEmpresa() { //Atualiza saldo conta corrente caixa empresa //Altera a saldo conta corrente ItemTipoRecebimentoVenda itemTipoRecVenda = new ItemTipoRecebimentoVenda(); ItemTipoRecebimentoVendaBO itemTipoRecVendaBO = new ItemTipoRecebimentoVendaBO(); DataTable dtItensTipoRecVenda = itemTipoRecVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(vendaID); foreach (DataRow itemTipRV in dtItensTipoRecVenda.Rows) { Banco banco = new Banco(); BancoBO bancoBO = new BancoBO(); ContaCorrente contaCorrente = new ContaCorrente(); ContaCorrenteBO contaCorrenteBO = new ContaCorrenteBO(); if (itemTipRV["formaRecebimento"].ToString().Equals("01 - Dinheiro")) { //VERIFICA SE EXISTE BANCO CAIXA EMPRESA banco = bancoBO.SelecionaBancoCaixaEmpresa(); if (banco != null) { //VERIFICA SE EXISTE CONTA CORRENTE RELACIONADA AO BANCO contaCorrente = contaCorrenteBO.SelecionarContaCorrenteBancoID(banco.BancoID); if (contaCorrente != null) { //ATUALIZA O SALDO PERTINENTE A CONTA CORRENTE DE ACORDO COM O BANCO CAIXA EMPRESA contaCorrenteBO.AtualizarSaldoDespesa(contaCorrente.ContaID, itemTipRV["vlrPago"].ToString()); } } } } }