예제 #1
0
 public TRegistro_Inventario_Item_X_Saldo()
 {
     this.Id_inventario  = 0;
     this.Cd_empresa     = string.Empty;
     this.Cd_produto     = string.Empty;
     this.Ds_produto     = string.Empty;
     this.Cd_unidade     = string.Empty;
     this.Ds_unidade     = string.Empty;
     this.Sigla_unidade  = string.Empty;
     this.Cd_local       = string.Empty;
     this.Ds_local       = string.Empty;
     this.Qtd_contada    = decimal.Zero;
     this.Qtd_saldo      = decimal.Zero;
     this.Qtd_saldoatual = decimal.Zero;
     this.vl_unitario    = decimal.Zero;
     this.vl_medio       = decimal.Zero;
     this.lEstoque       = new TList_RegLanEstoque();
 }
예제 #2
0
 public TRegistro_TransfLocal()
 {
     this.Id_transf         = null;
     this.Ds_transf         = string.Empty;
     this.dt_lancto         = DateTime.Now;
     this.dt_lanctostr      = DateTime.Now.ToString("dd/MM/yyyy");
     this.Cd_produto        = string.Empty;
     this.Ds_produto        = string.Empty;
     this.Sigla_unidade     = string.Empty;
     this.Quantidade        = decimal.Zero;
     this.Cd_localorigem    = string.Empty;
     this.Ds_localorigem    = string.Empty;
     this.Cd_localdestino   = string.Empty;
     this.Ds_localdestino   = string.Empty;
     this.Cd_empresaorigem  = string.Empty;
     this.Nm_empresaorigem  = string.Empty;
     this.Cd_empresadestino = string.Empty;
     this.Nm_empresadestino = string.Empty;
     this.Ds_observacao     = string.Empty;
     this.lEstTransf        = new TList_RegLanEstoque();
 }
예제 #3
0
 public TRegistro_Lan_Provisao_Estoque()
 {
     this.Id_provisao           = null;
     this.Ds_provisao           = string.Empty;
     this.dt_lancto             = DateTime.Now;
     this.dt_lanctostr          = DateTime.Now.ToString("dd/MM/yyyy");
     this.Login                 = Utils.Parametros.pubLogin.ToString();
     this.Cd_empresa_prov       = string.Empty;
     this.Nm_empresa_prov       = string.Empty;
     this.Cd_produto_prov       = string.Empty;
     this.Ds_produto_prov       = string.Empty;
     this.Sigla_unidade         = string.Empty;
     this.Id_lanctoestoque_prov = null;
     this.Cd_local              = string.Empty;
     this.Ds_local              = string.Empty;
     this.Quantidade            = decimal.Zero;
     this.Vl_unitario           = decimal.Zero;
     this.Lan_Estoque           = new TList_RegLanEstoque();
     this.Tot_Entrada           = decimal.Zero;
     this.Tot_Saida             = decimal.Zero;
     this.VL_Medio              = decimal.Zero;
     this.Saldo_Provisao        = decimal.Zero;
 }
예제 #4
0
        private void bb_incluir_Click(object sender, EventArgs e)
        {
            if (cd_empresa.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("Obrigatorio informar empresa.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                cd_empresa.Focus();
                return;
            }
            if (dt_inicial.Text.Trim().Equals(string.Empty) ||
                dt_inicial.Text.Trim().Equals("/  /"))
            {
                MessageBox.Show("Obrigatorio informar data inicial.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                dt_inicial.Focus();
                return;
            }
            if (dt_final.Text.Trim().Equals(string.Empty) ||
                dt_final.Text.Trim().Equals("/  /"))
            {
                MessageBox.Show("Obrigatorio informar data final.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                dt_final.Focus();
                return;
            }
            //Buscar lista de itens movimentados dentro do periodo
            TList_RegLanEstoque lEstoque = TCN_LanEstoque.Busca(cd_empresa.Text,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                string.Empty,
                                                                dt_inicial.Text,
                                                                dt_final.Text,
                                                                "A",
                                                                string.Empty,
                                                                string.Empty,
                                                                false,
                                                                false,
                                                                false,
                                                                false,
                                                                false,
                                                                false,
                                                                0,
                                                                string.Empty,
                                                                "c.cd_grupo, a.cd_produto");

            foreach (TRegistro_LanEstoque rEstoque in lEstoque)
            {
                TRegistro_Inventario_Item reg = new TRegistro_Inventario_Item()
                {
                    Id_inventario = (bsInventario.Current as Tregistro_Inventario).Id_inventario,
                    Cd_produto    = rEstoque.Cd_produto,
                    Ds_produto    = rEstoque.Ds_produto,
                    Cd_grupo      = rEstoque.Cd_grupo,
                    Ds_grupo      = rEstoque.Ds_grupo
                };
                if (!(bsInventario.Current as Tregistro_Inventario).lItensInventario.Exists(p => p.Id_inventario.Equals(reg.Id_inventario) &&
                                                                                            p.Cd_produto.Trim().Equals(reg.Cd_produto.Trim()) && p.Cd_grupo.Trim().Equals(reg.Cd_grupo.Trim())))
                {
                    //Incluir o produto
                    (bsInventario.Current as Tregistro_Inventario).lItensInventario.Add(reg);
                }
            }
            MontarArvoreItensInventario();
        }
예제 #5
0
 private void Busca()
 {
     if (tcConsulta.SelectedTab.Equals(tpAnalitico))
     {
         string auxtpmov = string.Empty;
         string virg     = string.Empty;
         if (st_entrada.Checked)
         {
             auxtpmov = "'E'";
             virg     = ",";
         }
         if (st_saida.Checked)
         {
             auxtpmov += virg = "'S'";
             virg      = ",";
         }
         string auxtplancto = string.Empty;
         virg = string.Empty;
         if (cck_Normal.Checked)
         {
             auxtplancto = "'N'";
             virg        = ",";
         }
         if (cck_Provisao.Checked)
         {
             auxtplancto += virg + "'P'";
             virg         = ",";
         }
         if (cck_Manual.Checked)
         {
             auxtplancto += virg + "'M'";
             virg         = ",";
         }
         if (cck_Inventario.Checked)
         {
             auxtplancto += virg + "'I'";
             virg         = ",";
         }
         if (cck_Transferencia.Checked)
         {
             auxtplancto += virg + "'T'";
             virg         = ",";
         }
         if (cbCompDev.Checked)
         {
             auxtplancto += virg + "'L'";
             virg         = ",";
         }
         string auxstatus = string.Empty;
         if (st_ativo.Checked)
         {
             auxstatus = "'A'";
             virg      = ",";
         }
         if (st_cancelado.Checked)
         {
             auxstatus += virg + "'C'";
         }
         TList_RegLanEstoque lista = TCN_LanEstoque.Busca(cd_empresa.Text,
                                                          CD_Produto.Text,
                                                          cd_grupo.Text,
                                                          tp_produto.Text,
                                                          cd_marca.Text,
                                                          id_lanctoestoque.Text,
                                                          CD_Local.Text,
                                                          string.Empty,
                                                          auxtpmov,
                                                          auxtplancto,
                                                          DT_Inicial.Text,
                                                          DT_Final.Text,
                                                          auxstatus,
                                                          string.Empty,
                                                          string.Empty,
                                                          id_variedade.Text,
                                                          0,
                                                          string.Empty,
                                                          null);
         if ((lista != null) && (lista.Count > 0))
         {
             BS_Estoque.DataSource = lista;
         }
         else
         {
             BS_Estoque.Clear();
         }
     }
     else if (tcConsulta.SelectedTab.Equals(tpSintetico))
     {
         TpBusca[] filtro = new TpBusca[0];
         if (cd_empresa.Text.Trim() != string.Empty)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = "a.cd_empresa";
             filtro[filtro.Length - 1].vOperador = "=";
             filtro[filtro.Length - 1].vVL_Busca = "'" + cd_empresa.Text.Trim() + "'";
         }
         if (CD_Produto.Text.Trim() != string.Empty)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = "a.cd_produto";
             filtro[filtro.Length - 1].vOperador = "=";
             filtro[filtro.Length - 1].vVL_Busca = "'" + CD_Produto.Text.Trim() + "'";
         }
         if (cd_grupo.Text.Trim() != string.Empty)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = "b.cd_grupo";
             filtro[filtro.Length - 1].vOperador = "like";
             filtro[filtro.Length - 1].vVL_Busca = "'" + cd_grupo.Text.Trim() + "%'";
         }
         if (tp_produto.Text.Trim() != string.Empty)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = "b.tp_produto";
             filtro[filtro.Length - 1].vOperador = "=";
             filtro[filtro.Length - 1].vVL_Busca = "'" + tp_produto.Text.Trim() + "'";
         }
         if (cd_marca.Text.Trim() != string.Empty)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = "b.cd_marca";
             filtro[filtro.Length - 1].vOperador = "=";
             filtro[filtro.Length - 1].vVL_Busca = cd_marca.Text;
         }
         if (cbProdSaldoMinimo.Checked)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = string.Empty;
             filtro[filtro.Length - 1].vOperador = "exists";
             filtro[filtro.Length - 1].vVL_Busca = "(select 1 from TB_EST_Produto_QTDEstoque x " +
                                                   "where x.cd_produto = a.cd_produto " +
                                                   "and x.cd_empresa = a.cd_empresa " +
                                                   "and x.qt_min_estoque > a.tot_saldo) ";
         }
         if (cbItensSaldo.Checked)
         {
             Array.Resize(ref filtro, filtro.Length + 1);
             filtro[filtro.Length - 1].vNM_Campo = "a.Tot_Saldo";
             filtro[filtro.Length - 1].vOperador = ">";
             filtro[filtro.Length - 1].vVL_Busca = "0";
         }
         DataTable tb = new TCD_LanEstoque().BuscarEstoqueSintetico(filtro, string.Empty, "b.ds_produto");
         tb.Columns.Add(new DataColumn("saldo_futuro", typeof(decimal), "Tot_Saldo - Qtd_reservada"));
         bsSintetico.DataSource = tb;
         bsSintetico_PositionChanged(this, new EventArgs());
         //Buscar custo total do estoque
         tot_estoque.Text = TCN_LanEstoque.CustoTotalEstoque(string.IsNullOrEmpty(cd_empresa.Text) ? string.Empty : "'" + cd_empresa.Text.Trim() + "'", null).ToString("N2", new System.Globalization.CultureInfo("pt-BR", true));
     }
 }