Exemple #1
0
 void ucGe_Menu_Mantenimiento_x_usuario_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         _MoviInvenInfo = (in_movi_inve_Info)gvAjustes_Cabecera.GetFocusedRow();
         if (_MoviInvenInfo != null)
         {
             if (_MoviInvenInfo.Estado == "I")
             {
                 MessageBox.Show("El Ajuste de inventario # " + _MoviInvenInfo.IdNumMovi + " ya fue anulado", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
             else
             {
                 if (_MoviInvenInfo == null)
                 {
                     MessageBox.Show("Selecciones una fila", "sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
                 else
                 {
                     FrmIn_AjustesInventario_Mant fAjus = new FrmIn_AjustesInventario_Mant();
                     fAjus.set_Accion(Cl_Enumeradores.eTipo_action.Anular);
                     fAjus.set_AjusteMoviInven(_MoviInvenInfo);
                     fAjus.Text = fAjus.Text + " ***ANULAR REGISTRO***";
                     fAjus.Show();
                     fAjus.event_FrmIn_AjustesInventario_Mant_FormClosing += fAjus_event_FrmIn_AjustesInventario_Mant_FormClosing;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.Message);
     }
 }
Exemple #2
0
        void ucGe_Menu_Mantenimiento_x_usuario_event_btnconsultar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                _MoviInvenInfo = (in_movi_inve_Info)gvAjustes_Cabecera.GetFocusedRow();
                if (_MoviInvenInfo == null)
                {
                    MessageBox.Show("Selecciones una fila", "sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    if (_MoviInvenInfo.IdNumMovi == null || _MoviInvenInfo.IdNumMovi == 0)
                    {
                        MessageBox.Show("Selecciones una fila", "sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        FrmIn_AjustesInventario_Mant fAjus = new FrmIn_AjustesInventario_Mant();
                        fAjus.set_Accion(Cl_Enumeradores.eTipo_action.consultar);

                        fAjus.Text      = fAjus.Text + " ***COSULTAR REGISTRO***";
                        fAjus.MdiParent = this.MdiParent;
                        fAjus.Show();
                        fAjus.set_AjusteMoviInven(_MoviInvenInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
Exemple #3
0
        private void btnAnular_Click(object sender, EventArgs e)
        {
            try
            {
                Get();
                if (Bus.AnularDB(Info))
                {
                    string mensaje = "";
                    prod_GestionProductivaTechos_CusTalme_X_in_movi_inve_Bus BusAnulacion = new prod_GestionProductivaTechos_CusTalme_X_in_movi_inve_Bus();
                    var Movimientos = BusAnulacion.ObjtenerListaPorGestion(param.IdEmpresa, Info.IdGestionProductiva);
                    foreach (var item in Movimientos)
                    {
                        in_movi_inve_Info MInfo = new in_movi_inve_Info();
                        MInfo.IdNumMovi         = item.IdNumMovi;
                        MInfo.IdEmpresa         = item.IdEmpresa;
                        MInfo.IdSucursal        = item.IdSucursal;
                        MInfo.IdBodega          = item.IdBodega;
                        MInfo.IdMovi_inven_tipo = item.IdMovi_inven_tipo;
                        _movi_B.AnularDB(MInfo, Convert.ToDateTime(DateTime.Now.ToShortDateString()), ref mensaje);
                    }

                    MessageBox.Show("Anulado Con exito La Gestion #: " + Info.IdGestionProductiva);
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
        public void cargar_ajuste_inventario(int IdEmpresa, int IdSucursal, int IdBodega, int IdMovi_inven_tipo, decimal IdNumMovi)
        {
            try
            {
                InfoMoviInven = new in_movi_inve_Info();
                InfoMoviInven = MoviInBus.Get_Info_Movi_inven(IdEmpresa, IdSucursal, IdBodega, IdMovi_inven_tipo, IdNumMovi);

                lblsucursal.Text        = InfoMoviInven.nom_sucursal;
                lblbodega.Text          = InfoMoviInven.nom_bodega;
                lblNum_Transaccion.Text = InfoMoviInven.IdNumMovi.ToString();
                lblobservacion.Text     = InfoMoviInven.cm_observacion;
                dtpfecha.Value          = InfoMoviInven.cm_fecha;
                lblTipoMovi_Inven.Text  = InfoMoviInven.NomTipoMovi;


                lblanulado.Visible = (InfoMoviInven.Estado == "I") ? true : false;


                this.gridControl_producto.DataSource = InfoMoviInven.listmovi_inve_detalle_Info;
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Exemple #5
0
        private void btn_Contabilizar_Click(object sender, EventArgs e)
        {
            try
            {
                var lista_a_contabilizar = from c in list_vwin_movi_inve_x_cbteCble_Datos_no_contabilizados
                                           where c.cheked == true
                                           select c;



                foreach (var item in lista_a_contabilizar)
                {
                    string            msg             = "";
                    in_movi_inve_Bus  BusMovi_Inven   = new in_movi_inve_Bus();
                    in_movi_inve_Info Info_Movi_Inven = new in_movi_inve_Info();

                    Info_Movi_Inven = BusMovi_Inven.Get_Info_Movi_inven(Convert.ToInt32(item.IdEmpresa_inv), Convert.ToInt32(item.IdSucursal_inv),
                                                                        Convert.ToInt32(item.IdBodega_inv), Convert.ToInt32(item.IdMovi_inven_tipo_inv), Convert.ToDecimal(item.IdNumMovi_inv));

                    BusMovi_Inven.Contabilizar(Info_Movi_Inven, ref msg, ref msg);
                }

                MessageBox.Show("Contabilizacion finalizada..", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Error comunicarse con Sistemas " + ex.Message + " ", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void gridViewDespacho_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                in_movi_inve_Info row = (in_movi_inve_Info)gridViewDespacho.GetRow(e.RowHandle);

                if (row == null)
                {
                    return;
                }

                if (e.Column == colReporte)
                {
                    XINV_Rpt002_Rpt rpt = new XINV_Rpt002_Rpt();
                    rpt.IdEmpresa.Value           = row.IdEmpresa;
                    rpt.IdEmpresa.Visible         = false;
                    rpt.IdSucursal.Value          = row.IdSucursal;
                    rpt.IdSucursal.Visible        = false;
                    rpt.IdBodega.Value            = row.IdBodega;
                    rpt.IdBodega.Visible          = false;
                    rpt.IdMovi_inven_tipo.Value   = row.IdMovi_inven_tipo;
                    rpt.IdMovi_inven_tipo.Visible = false;
                    rpt.IdNumMovi.Value           = row.num_Trans;
                    rpt.IdNumMovi.Visible         = false;
                    rpt.ShowPreviewDialog();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #7
0
        private void gridViewMovi_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                if (e.Column.Caption == "*")
                {
                    Get();
                    in_movi_inve_Bus         MoviB         = new in_movi_inve_Bus();
                    in_movi_inve_Info        DataMoviInven = new in_movi_inve_Info();
                    List <in_movi_inve_Info> listMoviIn    = new List <in_movi_inve_Info>();
                    prod_GestionProductivaTechos_CusTalme_X_in_movi_inve_Bus Busrpt = new prod_GestionProductivaTechos_CusTalme_X_in_movi_inve_Bus();
                    in_producto_Bus BusPr       = new in_producto_Bus();
                    var             Movimientos = Busrpt.ObjtenerListaPorGestion(param.IdEmpresa, Info.IdGestionProductiva);
                    foreach (var item in Movimientos)
                    {
                        DataMoviInven = MoviB.Get_Info_Movi_inven_Report(param.IdEmpresa, item.IdSucursal, item.IdBodega, item.IdMovi_inven_tipo, item.IdNumMovi);

                        listMoviIn.Add(DataMoviInven);
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
Exemple #8
0
        private void limpiar()
        {
            try
            {
                this.txtcodigoAjuste.Text = "";
                this.txtNumAjuste.Text    = "0";
                this.txtObservacion.Text  = "";

                _sucursalInfo = null;
                _bodegaInfo   = null;

                dtpFecha.Value     = DateTime.Now;
                lblAnulado.Visible = false;

                _movi_inve_detalle_List_Info.Clear();
                _movi_inve_Info = null;

                //cmb_tipoMoviInven.SelectedValue = -999;
                this.UCGridDetalleProduc.LimpiarGrid();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
        private bool Contabilizar()
        {
            try
            {
                cmb_estado_contabilizacion.Focus();

                if (cmb_estado_contabilizacion.SelectedItem.ToString() == "CONTABILIZADO")
                {
                    MessageBox.Show("Los movimientos seleccionados, ya se encuentran contabilizados", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                string mensaje_cbte  = "";
                string mensaje_error = "";
                foreach (var item in lst_movi_inven.Where(q => q.Checked == true).ToList())
                {
                    info_movi_inven = bus_movi_inven.Get_Info_Movi_inven(item.IdEmpresa, item.IdSucursal, item.IdBodega, item.IdMovi_inven_tipo, item.IdNumMovi);
                    if (!bus_movi_inven.Contabilizar(info_movi_inven, ref mensaje_cbte, ref mensaje_error))
                    {
                        MessageBox.Show("Sucursal: " + item.nom_sucursal.Trim() + "\nBodega: " + item.nom_bodega.Trim() + "\nTipo movimiento: " + item.tipo_movi_inven + "\n# Movi: " + item.IdNumMovi.ToString() + "\n" + mensaje_error, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Buscar_movimientos_para_contabilizar();
                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Comuníquese con sistemas, " + ex.Message, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
        public in_movi_inve_Info setInventarioMovi(fa_devol_venta_Info Info)
        {
            try
            {
                in_movi_inve_Info invCabInfo = new in_movi_inve_Info();
                fa_parametro_info inf        = new fa_parametro_info();
                fa_parametro_Bus  FaPaBus    = new fa_parametro_Bus();
                invCabInfo.IdEmpresa  = Info.IdEmpresa;
                invCabInfo.IdBodega   = Info.IdBodega;
                invCabInfo.IdSucursal = Info.IdSucursal;
                invCabInfo.IdNumMovi  = Info.IdDevolucion;

                inf = FaPaBus.Get_Info_parametro(param.IdEmpresa);
                invCabInfo.IdMovi_inven_tipo = inf.IdMovi_inven_tipo_Dev_Vta;
                invCabInfo.cm_tipo           = "+";
                invCabInfo.CodMoviInven      = "DEV" + Info.IdDevolucion;
                invCabInfo.cm_observacion    = "DEV VTA " + Info.IdDevolucion + " A LA FAC # " + Info.IdCbteVta + "/" + Info.IdCbteVta + " Al Cliente: " + Info.IdCliente + " por el monto de: " + Info.totalDev;
                invCabInfo.cm_fecha          = Info.dv_fecha;
                invCabInfo.Estado            = Info.Estado;
                invCabInfo.ip        = param.ip;
                invCabInfo.IdUsuario = Info.IdUsuario;
                invCabInfo.nom_pc    = param.nom_pc;

                //detalle movimiento inventario
                List <in_movi_inve_detalle_Info> invList = new List <in_movi_inve_detalle_Info>();

                int secuencia = 0;
                foreach (var item in Info.DetalleDeVta)
                {
                    in_movi_inve_detalle_Info info = new in_movi_inve_detalle_Info();
                    info.IdEmpresa         = item.IdEmpresa;
                    info.IdBodega          = item.IdBodega;
                    info.IdSucursal        = item.IdSucursal;
                    info.IdNumMovi         = invCabInfo.IdNumMovi;
                    info.IdMovi_inven_tipo = inf.IdMovi_inven_tipo_Dev_Vta;
                    //info.IdNumMovi = item.IdCbteVta;
                    secuencia        += 1;
                    info.Secuencia   += secuencia;
                    info.mv_tipo_movi = "+";
                    info.IdProducto   = item.IdProducto;
                    info.dm_cantidad  = +item.dv_cantidad;
                    //info.dm_stock_actu = item.IdSucursal;
                    info.dm_observacion = invCabInfo.cm_observacion;
                    info.mv_costo       = item.dv_costo;
                    invList.Add(info);
                }
                invCabInfo.listmovi_inve_detalle_Info = invList;
                return(invCabInfo);
            }
            catch (Exception ex)
            {
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "setInventarioMovi", ex.Message), ex)
                      {
                          EntityType = typeof(fa_devol_venta_Bus)
                      };
            }
        }
Exemple #11
0
        public Boolean GrabarDB(in_movi_inve_Info prI, ref string mensaje)
        {
            try
            {
                using (EntitiesInventario context = new EntitiesInventario())
                {
                    EntitiesInventario EDB = new EntitiesInventario();

                    var Q = from per in EDB.in_movi_inve_x_in_ordencompra_local
                            where per.IdEmpresa == prI.IdEmpresa &&
                            per.IdSucursal == prI.IdSucursal &&
                            per.IdBodega == prI.IdBodega &&
                            per.IdMovi_inven_tipo == prI.IdMovi_inven_tipo &&
                            per.IdNumMovi == prI.IdNumMovi &&
                            per.IdEmpresaOC == prI.IdEmpresa &&
                            per.IdSucursalOC == prI.IdSucursal &&
                            per.IdOrdenCompra == prI.IdOrdenCompra

                            select per;

                    if (Q.ToList().Count == 0)
                    {
                        var address = new in_movi_inve_x_in_ordencompra_local();

                        address.IdEmpresa         = prI.IdEmpresa;
                        address.IdSucursal        = prI.IdSucursal;
                        address.IdBodega          = prI.IdBodega;
                        address.IdMovi_inven_tipo = prI.IdMovi_inven_tipo;
                        address.IdNumMovi         = prI.IdNumMovi;
                        address.IdEmpresaOC       = prI.IdEmpresa;
                        address.IdSucursalOC      = prI.IdSucursal;
                        address.IdOrdenCompra     = prI.IdOrdenCompra;
                        context.in_movi_inve_x_in_ordencompra_local.Add(address);
                        context.SaveChanges();
                        mensaje = "Grabacion ok..";
                    }
                    else
                    {
                        return(false);
                    }

                    return(true);
                }
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemple #12
0
        private void btn_mostrar_listado_costo_0_Click(object sender, EventArgs e)
        {
            try
            {
                splashScreenManager1.ShowWaitForm();
                List <in_Producto_Info> lst_costo_0 = new List <in_Producto_Info>();
                foreach (var item in lst_movi_inven.Where(q => q.Checked == true).ToList())
                {
                    info_movi_inven = bus_movi_inven.Get_Info_Movi_inven(item.IdEmpresa, item.IdSucursal, item.IdBodega, item.IdMovi_inven_tipo, item.IdNumMovi);
                    foreach (var i_det in info_movi_inven.listmovi_inve_detalle_Info.Where(q => q.mv_costo == 0).ToList())
                    {
                        if (lst_costo_0.Where(q => q.IdProducto == i_det.IdProducto).Count() == 0)
                        {
                            in_Producto_Info i_producto = new in_Producto_Info
                            {
                                IdEmpresa  = param.IdEmpresa,
                                IdProducto = i_det.IdProducto
                            };
                            lst_costo_0.Add(i_producto);
                        }
                    }
                }

                if (lst_costo_0.Count != 0)
                {
                    string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                    if (File.Exists(filePath + @"\" + "listado productos con costo cero " + param.NombreEmpresa + "-" + param.Nombre_sistema + ".txt"))
                    {
                        File.Delete(filePath + @"\" + "listado productos con costo cero " + param.NombreEmpresa + "-" + param.Nombre_sistema + ".txt");
                    }

                    StreamWriter outputFile;
                    outputFile = File.CreateText(filePath + "\\listado productos con costo cero " + param.NombreEmpresa.Trim() + "-" + param.Nombre_sistema.Trim() + ".txt");
                    foreach (var i_costo in lst_costo_0)
                    {
                        info_producto = bus_producto.Get_info_Product(param.IdEmpresa, i_costo.IdProducto);
                        outputFile.WriteLine("[" + (info_producto.pr_codigo == null ? "" : info_producto.pr_codigo.Trim()) + "] " + info_producto.pr_descripcion.Trim() + "\n");
                    }
                    outputFile.Close();
                    MessageBox.Show("Archivo: listado productos con costo cero " + param.NombreEmpresa.Trim() + "-" + param.Nombre_sistema.Trim() + "\n" + "Creado exitósamente", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Process.Start(filePath + "\\listado productos con costo cero " + param.NombreEmpresa.Trim() + "-" + param.Nombre_sistema.Trim() + ".txt");
                }
                splashScreenManager1.CloseWaitForm();
            }
            catch (Exception ex)
            {
                if (splashScreenManager1.IsSplashFormVisible == true)
                {
                    splashScreenManager1.CloseWaitForm();
                }
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Comuníquese con sistemas, " + ex.Message, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void gvAjustes_Cabecera_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     try
     {
         Gview          = (DevExpress.XtraGrid.Views.Grid.GridView)sender;
         _MoviInvenInfo = (in_movi_inve_Info)Gview.GetRow(Gview.FocusedRowHandle);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
 private void gridViewRepcMat_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info = (in_movi_inve_Info)gridViewRepcMat.GetFocusedRow();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.Message);
     }
 }
Exemple #15
0
        private bool Contabilizar()
        {
            try
            {
                cmb_estado_contabilizacion.Focus();

                if (cmb_estado_contabilizacion.SelectedItem.ToString() == "CONTABILIZADO")
                {
                    MessageBox.Show("Los movimientos seleccionados, ya se encuentran contabilizados", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                string mensaje_cbte  = "";
                string mensaje_error = "";
                foreach (var item in lst_movi_inven.Where(q => q.Checked == true).ToList())
                {
                    info_movi_inven = bus_movi_inven.Get_Info_Movi_inven(item.IdEmpresa, item.IdSucursal, item.IdBodega, item.IdMovi_inven_tipo, item.IdNumMovi);
                    int cont = 0;
                    foreach (var i_det in info_movi_inven.listmovi_inve_detalle_Info.Where(q => q.mv_costo == 0).ToList())
                    {
                        if (cont == 0)
                        {
                            mensaje_error = "Listado de productos con costo 0:\n";
                            cont          = 1;
                        }
                        info_producto  = bus_producto.Get_info_Product(param.IdEmpresa, i_det.IdProducto);
                        mensaje_error += "[" + info_producto.pr_codigo == null ? "" : info_producto.pr_codigo.Trim() + "]" + " " + info_producto.pr_descripcion + "\n";
                    }
                    if (mensaje_error != "")
                    {
                        MessageBox.Show("Sucursal: " + item.nom_sucursal.Trim() + "\nBodega: " + item.nom_bodega.Trim() + "\nTipo movimiento: " + item.tipo_movi_inven + "\n# Movi: " + item.IdNumMovi_Ing_Egr.ToString() + "\n" + mensaje_error, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Buscar_movimientos_para_contabilizar();
                        return(false);
                    }
                    if (!bus_movi_inven.Contabilizar(info_movi_inven, ref mensaje_cbte, ref mensaje_error))
                    {
                        MessageBox.Show("Sucursal: " + item.nom_sucursal.Trim() + "\nBodega: " + item.nom_bodega.Trim() + "\nTipo movimiento: " + item.tipo_movi_inven + "\n# Movi: " + item.IdNumMovi_Ing_Egr.ToString() + "\n" + mensaje_error, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Buscar_movimientos_para_contabilizar();
                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Comuníquese con sistemas, " + ex.Message, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
Exemple #16
0
        private void ucGe_Menu_event_btnAnular_Click(object sender, EventArgs e)
        {
            try
            {
                Get_info();
                string mensaje = "";
                if (Info_AjusteFisico.Estado == "I")
                {
                    MessageBox.Show("No se puede anular ya que el ajuste se encuentra anulado");
                    return;
                }

                if (MessageBox.Show("¿Está seguro que desea anular el ajuste fisico ?", "Anulación de Ajuste fisico " + param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    FrmGe_MotivoAnulacion ofrm = new FrmGe_MotivoAnulacion();
                    ofrm.ShowDialog();


                    Info_AjusteFisico.IdAjusteFisico     = Convert.ToDecimal(txtNumAjusteFisico.Text);
                    Info_AjusteFisico.ip                 = param.ip;
                    Info_AjusteFisico.nom_pc             = param.nom_pc;
                    Info_AjusteFisico.IdUsuarioAnulacion = param.IdUsuario;
                    Info_AjusteFisico.motivo_anula       = ofrm.motivoAnulacion;
                    Info_AjusteFisico.FechaAnulacion     = DateTime.Now;

                    if (Bus_AjustFisico.AnularDB(Info_AjusteFisico))
                    {
                        in_movi_inve_Info InfoMoviInve = new in_movi_inve_Info();

                        InfoMoviInve.IdEmpresa         = Info_AjusteFisico.IdEmpresa;
                        InfoMoviInve.IdSucursal        = Info_AjusteFisico.IdSucursal;
                        InfoMoviInve.IdBodega          = Info_AjusteFisico.IdBodega;
                        InfoMoviInve.IdMovi_inven_tipo = Info_AjusteFisico.IdMovi_inven_tipo_Egr;
                        InfoMoviInve.IdNumMovi         = (Info_AjusteFisico.IdNumMovi_Egr == null) ? 0 : Convert.ToDecimal(Info_AjusteFisico.IdNumMovi_Egr);
                        Bus_MoviInven.AnularDB(InfoMoviInve, Convert.ToDateTime(DateTime.Now.ToShortDateString()), ref mensaje);
                        InfoMoviInve.IdMovi_inven_tipo = Info_AjusteFisico.IdMovi_inven_tipo_Ing;
                        InfoMoviInve.IdNumMovi         = (Info_AjusteFisico.IdNumMovi_Ing == null) ? 0 : Convert.ToDecimal(Info_AjusteFisico.IdNumMovi_Ing);
                        Bus_MoviInven.AnularDB(InfoMoviInve, Convert.ToDateTime(DateTime.Now.ToShortDateString()), ref mensaje);
                        ucGe_Menu.Enabled_bntAnular = false;
                        MessageBox.Show("Ajuste Fisico Anulado exitosamente", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #17
0
 public List <in_movi_inve_detalle_Info> ConsultaGeneral(in_movi_inve_Info Info)
 {
     try
     {
         return(Data.Get_List_in_movi_inve_detalle(Info));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ConsultaGeneral", ex.Message), ex)
               {
                   EntityType = typeof(in_movi_inve_detalle_x_Producto_CusCider_Bus)
               };
     }
 }
 public Boolean GrabarDB(in_movi_inve_Info prI, ref string mensaje)
 {
     try
     {
         return(data.GrabarDB(prI, ref mensaje));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GrabarDB", ex.Message), ex)
               {
                   EntityType = typeof(in_movi_inve_x_in_ordencompra_local_Bus)
               };
     }
 }
Exemple #19
0
 public List <prd_ensamblado_cusCider_x_in_movi_inven_Info> TraerUnInfoTI(in_movi_inve_Info mov, ref string msg)
 {
     try
     {
         return(Data.LstTI_x_Movimiento(mov, ref msg));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "TraerUnInfoTI", ex.Message), ex)
               {
                   EntityType = typeof(prd_ensamblado_cusCider_x_in_movi_inven_Bus)
               };
     }
 }
Exemple #20
0
 public Boolean AnularDB(in_movi_inve_Info Info, ref string mensaje)
 {
     try
     {
         return(odata.AnularDB(Info, ref mensaje));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "AnularDB", ex.Message), ex)
               {
                   EntityType = typeof(in_movi_inve_detalle_Bus)
               };
     }
 }
        private void btnAnular_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Esta Seguro que desea Eliminar la Compra ?", "Anulacion", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Get();
                    string Mensaje = "";
                    if (_Bus.Anular(_Info, ref Mensaje))
                    {
                        MessageBox.Show(Mensaje);
                        btnAnular.Enabled = false;



                        prod_GestionProductivaAcero_CusTalme_x_in_movi_inven_Bus BusInte = new prod_GestionProductivaAcero_CusTalme_x_in_movi_inven_Bus();


                        var MovimientosInventario = BusInte.ConsultaGenera(param.IdEmpresa, _Info.IdSucursal, _Info.IdGestionAceria);
                        foreach (var item in MovimientosInventario)
                        {
                            in_movi_inve_Info _in_movi_inven_I = new in_movi_inve_Info();
                            _in_movi_inven_I.IdSucursal        = item.mv_IdSucursal;
                            _in_movi_inven_I.IdBodega          = item.mv_IdBodega;
                            _in_movi_inven_I.IdEmpresa         = item.mv_IdEmpresa;
                            _in_movi_inven_I.IdMovi_inven_tipo = item.mv_IdMovi_inven_tipo;
                            _in_movi_inven_I.IdNumMovi         = item.mv_IdNumMovi;
                            if (BusMOvi_B.AnularDB(_in_movi_inven_I, Convert.ToDateTime(DateTime.Now.ToShortDateString()), ref Mensaje) == false)
                            {
                                MessageBox.Show(Mensaje);
                            }
                        }
                    }
                }
            }


            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
 public void setCab(in_movi_inve_Info Info)
 {
     try
     {
         MovEgreso = Info;
         ctrl_Sucbod.cmb_sucursal.EditValue = Info.IdSucursal;
         ctrl_Sucbod.cmb_bodega.EditValue   = Info.IdBodega;
         LstProdGrid = BusCodBAr.ConsultaGeneral(Info);
         gridControlDisponible.DataSource = LstProdGrid;
         in_movi_inve_detalle_Info inf = new in_movi_inve_detalle_Info();
         inf = LstProdGrid.FirstOrDefault();
         UCObra.set_item(inf.ot_CodObra);
         CmbOrdenTaller.EditValue = inf.ot_IdordenTaller;
         txtObservacion.Text      = inf.observacion;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.Message);
     }
 }
        private void gvAjustes_Cabecera_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            try
            {
                in_movi_inve_Info data = (in_movi_inve_Info)gvAjustes_Cabecera.GetRow(e.RowHandle);

                if (data == null)
                {
                    return;
                }

                if (data.Estado == "I")
                {
                    e.Appearance.ForeColor = Color.Red;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
        private void btnAnular_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Esta Seguro que desea Anular a transaccion ?", "Anulacion", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    prod_CompraChatarra_CusTalme_x__in_movi_inven_Bus Chat_X_moVI_B = new prod_CompraChatarra_CusTalme_x__in_movi_inven_Bus();
                    in_movi_inve_Bus _MoviInven_B = new in_movi_inve_Bus();
                    Get();
                    string Mensaje = "";
                    if (Bus.Anular(_Info, ref Mensaje))
                    {
                        var movimientoInv        = Chat_X_moVI_B.ObtenerObjeto(param.IdEmpresa, _Info.IdLiquidacion);
                        in_movi_inve_Info Movi_I = new in_movi_inve_Info();
                        Movi_I.IdMovi_inven_tipo = movimientoInv.mv_IdMovi_inven_tipo;
                        Movi_I.IdNumMovi         = movimientoInv.mv_IdNumMovi;
                        Movi_I.IdEmpresa         = param.IdEmpresa;
                        Movi_I.IdBodega          = movimientoInv.mv_IdBodega;
                        Movi_I.IdSucursal        = movimientoInv.mv_IdSucursal;

                        if (_MoviInven_B.AnularDB(Movi_I, Convert.ToDateTime(DateTime.Now.ToShortDateString()), ref Mensaje) == false)
                        {
                            MessageBox.Show(Mensaje);
                        }
                        btnAnular.Enabled = false;

                        MessageBox.Show(Mensaje);
                    }
                    else
                    {
                        MessageBox.Show(Mensaje);
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
Exemple #25
0
        public Boolean AnularDB(in_movi_inve_Info Info, ref string mensaje)
        {
            try
            {
                using (EntitiesInventario context = new EntitiesInventario())
                {
                    string Query = "delete from in_movi_inve_detalle_x_com_ordencompra_local_det where mi_IdEmpresa = " + Info.IdEmpresa + " and mi_IdBodega =" + Info.IdBodega + " and mi_IdSucursal =" + Info.IdSucursal + " and mi_IdMovi_inven_tipo= " + Info.IdMovi_inven_tipo + " and mi_IdNumMovi=" + Info.IdNumMovi + "";

                    var Consulta = context.Database.SqlQuery <in_movi_inve_Info>(Query);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemple #26
0
        private List <in_movi_inve_detalle_Info> OptenerDetalleMoviInven(in_movi_inve_Info MoviInven)
        {
            try
            {
                List <in_movi_inve_detalle_Info> listMoviInve_detalle = new List <in_movi_inve_detalle_Info>();

                listMoviInve_detalle = MoviInvenDetB.Obtener_list_Movi_inven_det(MoviInven.IdEmpresa, MoviInven.IdSucursal, MoviInven.IdBodega, MoviInven.IdMovi_inven_tipo, MoviInven.IdNumMovi);


                if (MoviInven.cm_tipo == "-")
                {
                    (from Movi in listMoviInve_detalle select Movi).ToList().ForEach(var => { var.dm_cantidad = var.dm_cantidad * -1; });
                }

                return(listMoviInve_detalle);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                return(new List <in_movi_inve_detalle_Info>());
            }
        }
 public Boolean AnularEnsamb_Mov(prd_Ensamblado_CusCider_Info ensamblado, ref string msg)
 {
     try
     {
         LstTI = dataTI.LstTI_x_Ensamblado(ensamblado, ref msg);
         foreach (var item in LstTI)
         {
             in_movi_inve_Info mov = new in_movi_inve_Info();
             mov.IdEmpresa         = item.IdEmpresa;
             mov.IdSucursal        = item.IdSucursal;
             mov.IdBodega          = item.IdBodega;
             mov.IdMovi_inven_tipo = item.IdMovi_inven_tipo;
             mov.IdNumMovi         = item.IdNumMovi;
             //if (datamovi.AnularCabeceraYDetalleyActualizaStock(mov, ref msg) == false)
             if (datamovi.AnularDB(mov, ref msg) == false)
             {
                 return(false);
             }
             //if (dataxprodxcidersus.AnularDB(item.IdEmpresa, item.IdSucursal, item.IdBodega,
             //    item.IdNumMovi, item.IdMovi_inven_tipo, ref msg) == false)
             //    return false;
         }
         if (AnularDB(ensamblado, ref msg) == false)
         {
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         msg = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         return(false);
     }
 }
        public Boolean GuardarDB(fa_devol_venta_Info Info, ref string msg)
        {
            try
            {
                // nota de credito
                fa_notaCredDeb_Bus         BusBNotaDB = new fa_notaCredDeb_Bus();
                in_movi_inve_Info          invCabInfo = new in_movi_inve_Info();
                in_movi_inve_Bus           inBus      = new in_movi_inve_Bus();
                cxc_cobro_Info             Cobro      = new cxc_cobro_Info();
                cl_parametrosGenerales_Bus param      = cl_parametrosGenerales_Bus.Instance;
                string  mensaje_cbte_cble             = "";
                decimal idNota                = 0;
                string  codigoNota            = "";
                string  mensajeDocumentoDupli = "";
                string  mensajeError          = "";
                string  numDocumento          = "";


                if (BusBNotaDB.GuardarDB(Info.InfoNotaCreDeb, ref idNota, ref mensajeDocumentoDupli, ref mensajeError))
                {
                    Info.IdNota = idNota;
                    data.GuardarDB(Info, ref msg);
                    invCabInfo = setInventarioMovi(Info);
                    inBus.GrabarDB(invCabInfo, ref idNota, ref mensaje_cbte_cble, ref msg);
                }


                return(true);
            }
            catch (Exception ex)
            {
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GuardarDB", ex.Message), ex)
                      {
                          EntityType = typeof(fa_devol_venta_Bus)
                      };
            }
        }
Exemple #29
0
        private void Imprimir()
        {
            try
            {
                in_movi_inve_Bus         MoviB         = new in_movi_inve_Bus();
                in_movi_inve_Info        DataMoviInven = new in_movi_inve_Info();
                List <in_movi_inve_Info> listMoviIn    = new List <in_movi_inve_Info>();



                DataMoviInven = MoviB.Obtener_list_Movi_inven_Reporte(param.IdEmpresa, _sucursalInfo.IdSucursal, _bodegaInfo.IdBodega, _TipoMoviInven.IdMovi_inven_tipo, Convert.ToDecimal(this.txtNumAjuste.Text));

                listMoviIn.Add(DataMoviInven);


                XRpt_in_Ajuste_inventario RptAjuste = new XRpt_in_Ajuste_inventario();
                RptAjuste.cargarData(listMoviIn.ToArray());
                RptAjuste.ShowPreviewDialog();



                //XRpt_cp_OrdenGiro reprtOG = new XRpt_cp_OrdenGiro(param.IdUsuario);
                //ReportParameter reprtOG_Parametro = new ReportParameter();
                //cp_orden_giro_Bus ob = new cp_orden_giro_Bus();
                //List<cp_orden_giro_Info> lOg = new List<cp_orden_giro_Info>();
                //lOg = ob.ObtenerOrdenGiro(param.IdEmpresa, ordenGiro_I.IdCbteCble_Ogiro);


                //reprtOG.loadData(lOg.ToArray());
                //reprtOG.ShowPreviewDialog();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
Exemple #30
0
        public void set_AjusteMoviInven(in_movi_inve_Info MoviInven_I)
        {
            try
            {
                _movi_inve_Info = MoviInven_I;
                _movi_inve_detalle_List_Info = OptenerDetalleMoviInven(MoviInven_I);
                _bodegaInfo.IdEmpresa        = _movi_inve_Info.IdEmpresa;

                _sucursalInfo.IdSucursal = _movi_inve_Info.IdSucursal;

                _bodegaInfo.IdBodega                  = _movi_inve_Info.IdBodega;
                UCGridDetalleProduc.idSucursal        = _movi_inve_Info.IdSucursal;
                UCGridDetalleProduc.idBodega          = _movi_inve_Info.IdBodega;
                UCSucurBod.cmb_sucursal.SelectedValue = _movi_inve_Info.IdSucursal;
                UCSucurBod.cmb_bodega.SelectedValue   = _movi_inve_Info.IdBodega;
                UCSucurBod.Enabled = false;

                cmb_tipoMoviInven.EditValue = MoviInven_I.IdMovi_inven_tipo;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }