Beispiel #1
0
 public Af_Parametros_Info get_info(int IdEmpresa)
 {
     try
     {
         Af_Parametros_Info info = new Af_Parametros_Info();
         using (Entities_activo_fijo Context = new Entities_activo_fijo())
         {
             Af_Parametros Entity = Context.Af_Parametros.FirstOrDefault(q => q.IdEmpresa == IdEmpresa);
             if (Entity == null)
             {
                 return(null);
             }
             info = new Af_Parametros_Info
             {
                 IdEmpresa                        = Entity.IdEmpresa,
                 IdTipoCbte                       = Entity.IdTipoCbte,
                 IdTipoCbteBaja                   = Entity.IdTipoCbteBaja,
                 IdTipoCbteMejora                 = Entity.IdTipoCbteMejora,
                 IdTipoCbteRetiro                 = Entity.IdTipoCbteRetiro,
                 IdTipoCbteVenta                  = Entity.IdTipoCbteVenta,
                 DiasTransaccionesAFuturo         = Entity.DiasTransaccionesAFuturo,
                 DiasTransaccionesAPasado         = Entity.DiasTransaccionesAPasado,
                 ContabilizaDepreciacionPorActivo = Entity.ContabilizaDepreciacionPorActivo
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        private void frmAF_MejoraActivo_Mant_Load(object sender, EventArgs e)
        {
            try
            {
                string MensajeError = "";

                infoParam  = busParam.Get_Info_Parametros(param.IdEmpresa);
                IdTipoCbte = infoParam.IdTipoCbteMejora;
                Per_I      = Per_B.Get_Info_Periodo(param.IdEmpresa, Convert.ToDateTime(dtpFecha.Value), ref MensajeError);
                switch (_Accion)
                {
                case Cl_Enumeradores.eTipo_action.grabar:
                    cargarCombos(Cl_Enumeradores.eEstadoActivoFijo.TIP_ESTADO_AF_ACTIVO.ToString());
                    ucGe_Menu.Enabled_bntAnular   = false;
                    ucGe_Menu.Enabled_bntImprimir = false;
                    break;

                case Cl_Enumeradores.eTipo_action.actualizar:
                    cargarCombos("");
                    set_MejoraActivo();
                    ucGe_Menu.Enabled_bntAnular       = false;
                    cmbActivoFijo.Properties.ReadOnly = true;
                    txtCodMejora.Properties.ReadOnly  = true;
                    cmbActivoFijo_EditValueChanged(null, null);
                    ucGe_Menu.Enabled_bntImprimir = false;
                    break;

                case Cl_Enumeradores.eTipo_action.Anular:
                    cargarCombos("");
                    set_MejoraActivo();
                    ucCon_GridDiarioContable.Enabled     = false;
                    ucGe_Menu.Enabled_bntGuardar_y_Salir = false;
                    ucGe_Menu.Enabled_btnGuardar         = false;
                    cmbActivoFijo.Properties.ReadOnly    = true;
                    cmbProveedor.Enabled = false;
                    txtDescripcionTecnica.Properties.ReadOnly = true;
                    txtMotivoMejora.Properties.ReadOnly       = true;
                    txtCodMejora.Properties.ReadOnly          = true;
                    txtValorMejora.Properties.ReadOnly        = true;
                    txtComrobante.Properties.ReadOnly         = true;
                    cmbActivoFijo_EditValueChanged(null, null);
                    ucGe_Menu.Enabled_bntImprimir = false;
                    break;

                case Cl_Enumeradores.eTipo_action.consultar:
                    cargarCombos("");
                    set_MejoraActivo();
                    ucGe_Menu.Enabled_bntGuardar_y_Salir = false;
                    ucGe_Menu.Enabled_btnGuardar         = false;
                    ucGe_Menu.Enabled_bntAnular          = false;
                    cmbActivoFijo_EditValueChanged(null, null);
                    break;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #3
0
        private void frmAF_Parametros_Load(object sender, EventArgs e)
        {
            try
            {
                Info = busPara.Get_Info_Parametros(param.IdEmpresa);
                cmbtipocbtecble.set_TipoCbteCble(Info.IdTipoCbte);
                cmbtipocbtecbleBaja.set_TipoCbteCble(Info.IdTipoCbteBaja);
                cmbtipocbtecbleMejora.set_TipoCbteCble(Info.IdTipoCbteMejora);
                cmbtipocbtecbleRetiro.set_TipoCbteCble(Info.IdTipoCbteRetiro);
                cmbtipocbtecbleVenta.set_TipoCbteCble(Info.IdTipoCbteVenta);
                cmPlanCtaactivos.set_PlanCtarInfo(Info.IdCtaCble_Activo);
                cmPlanCtadepre.set_PlanCtarInfo(Info.IdCtaCble_Dep_Acum);
                cmPlanCtagasto.set_PlanCtarInfo(Info.IdCtaCble_Gastos_Depre);
                cmbFormaContabiliza.EditValue = Info.FormaContabiliza;

                cmbtipoAnulaBaja.set_TipoCbteCble(Info.IdTipoCbteBaja_Anulacion);
                cmbtipoAnulaMejora.set_TipoCbteCble(Info.IdTipoCbteMejora_Anulacion);
                cmbtipoAnulaRetiro.set_TipoCbteCble(Info.IdTipoCbteRetiro_Anulacion);
                cmbtipoAnulaVenta.set_TipoCbteCble(Info.IdTipoCbteVenta_Anulacion);
                cmbtipoAnulaDepreciacion.set_TipoCbteCble(Info.IdTipoCbteDep_Acum_Anulacion);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #4
0
 public ActionResult Index(Af_Parametros_Info model)
 {
     if (!bus_parametro.guardarDB(model))
     {
         ViewBag.mensaje = "No se pudieron actualizar los registros";
     }
     cargar_combos(model.IdEmpresa);
     return(View(model));
 }
 public bool guardarDB(Af_Parametros_Info info)
 {
     try
     {
         return(odata.guardarDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #6
0
 public Boolean ModificarDB(Af_Parametros_Info info)
 {
     try
     {
         return(oDat.ModificarDB(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("", "Modificar", ex.Message), ex)
               {
                   EntityType = typeof(Af_Parametros_Bus)
               };
     }
 }
Beispiel #7
0
        public ActionResult Index()
        {
            int IdEmpresa            = Convert.ToInt32(SessionFixed.IdEmpresa);
            Af_Parametros_Info model = bus_parametro.get_info(IdEmpresa);

            if (model == null)
            {
                model = new Af_Parametros_Info {
                    IdEmpresa = IdEmpresa
                }
            }
            ;
            cargar_combos(IdEmpresa);
            return(View(model));
        }
 public bool guardarDB(Af_Parametros_Info info)
 {
     try
     {
         using (Entities_activo_fijo Context = new Entities_activo_fijo())
         {
             Af_Parametros Entity = Context.Af_Parametros.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa);
             if (Entity == null)
             {
                 Entity = new Af_Parametros
                 {
                     IdEmpresa                = info.IdEmpresa,
                     IdCtaCble_Activo         = info.IdCtaCble_Activo,
                     FormaContabiliza         = info.FormaContabiliza,
                     IdCtaCble_Dep_Acum       = info.IdCtaCble_Dep_Acum,
                     IdCtaCble_Gastos_Depre   = info.IdCtaCble_Gastos_Depre,
                     IdTipoCbte               = info.IdTipoCbte,
                     IdTipoCbteBaja           = info.IdTipoCbteBaja,
                     IdTipoCbteMejora         = info.IdTipoCbteMejora,
                     IdTipoCbteRetiro         = info.IdTipoCbteRetiro,
                     IdTipoCbteVenta          = info.IdTipoCbteVenta,
                     DiasTransaccionesAFuturo = info.DiasTransaccionesAFuturo
                 };
                 Context.Af_Parametros.Add(Entity);
             }
             else
             {
                 Entity.IdCtaCble_Activo         = info.IdCtaCble_Activo;
                 Entity.FormaContabiliza         = info.FormaContabiliza;
                 Entity.IdCtaCble_Dep_Acum       = info.IdCtaCble_Dep_Acum;
                 Entity.IdCtaCble_Gastos_Depre   = info.IdCtaCble_Gastos_Depre;
                 Entity.IdTipoCbte               = info.IdTipoCbte;
                 Entity.IdTipoCbteBaja           = info.IdTipoCbteBaja;
                 Entity.IdTipoCbteMejora         = info.IdTipoCbteMejora;
                 Entity.IdTipoCbteRetiro         = info.IdTipoCbteRetiro;
                 Entity.IdTipoCbteVenta          = info.IdTipoCbteVenta;
                 Entity.DiasTransaccionesAFuturo = info.DiasTransaccionesAFuturo;
             }
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #9
0
        private void frmAF_DepreLineaRecta_Mant_Load(object sender, EventArgs e)
        {
            try
            {
                IdTipoDepreciacion = busTipoDepre.Get_IdTipoDepre(Cl_Enumeradores.eTipoDepreciacion.DEP_LIN.ToString());
                infoParam          = busParam.Get_Info_Parametros(param.IdEmpresa);
                IdTipoCbteDepre    = infoParam.IdTipoCbte;

                cargarCombos();
                setAccion_Controls();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 void AsignarParametros()
 {
     try
     {
         Af_Parametros_Bus  busParam  = new Af_Parametros_Bus();
         Af_Parametros_Info infoParam = new Af_Parametros_Info();
         infoParam = busParam.Get_Info_Parametros(param.IdEmpresa);
         cmbPlanctaActivo.set_PlanCtarInfo(infoParam.IdCtaCble_Activo);
         cmbCtaDepreAcu.set_PlanCtarInfo(infoParam.IdCtaCble_Dep_Acum);
         cmbCtaGasto.set_PlanCtarInfo(infoParam.IdCtaCble_Gastos_Depre);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #11
0
        public Boolean ContabilizarDepreciacion(int IdEmpresa, decimal IdDepreciacion, int IdPeriodo, Cl_Enumeradores.eForma_Contabilizar sFormaContabiliza, ref decimal IdCbteCble, ref string mensaje)
        {
            try
            {
                bool Respuesta = true;

                Af_Parametros_Bus  busParam  = new Af_Parametros_Bus();
                Af_Parametros_Info infoParam = new Af_Parametros_Info();
                infoParam = busParam.Get_Info_Parametros(IdEmpresa);
                int IdTipoDepreciacion = 1; // depreacion lineal

                Af_Depreciacion_x_cta_cbtecble_Info         infoDepreCble   = new Af_Depreciacion_x_cta_cbtecble_Info();
                List <vwAf_Valores_Depre_Contabilizar_Info> lstValoresDepre = new List <vwAf_Valores_Depre_Contabilizar_Info>();
                lstValoresDepre = get_ValoresDepreciacion(IdEmpresa, IdDepreciacion, IdTipoDepreciacion, IdPeriodo, sFormaContabiliza);
                ct_Cbtecble_Info cbtCbleInfo = new ct_Cbtecble_Info();
                cbtCbleInfo = GetCbtecble_x_Depreacion(IdEmpresa, infoParam.IdTipoCbte, IdPeriodo, lstValoresDepre, sFormaContabiliza, ref mensaje);


                Respuesta = CbteCbleBus.GrabarDB(cbtCbleInfo, ref IdCbteCble, ref mensaje);

                if (Respuesta)
                {
                    infoDepreCble.IdEmpresa          = IdEmpresa;
                    infoDepreCble.IdDepreciacion     = IdDepreciacion;
                    infoDepreCble.IdTipoDepreciacion = IdTipoDepreciacion;
                    infoDepreCble.ct_IdEmpresa       = cbtCbleInfo.IdEmpresa;
                    infoDepreCble.ct_IdTipoCbte      = cbtCbleInfo.IdTipoCbte;
                    infoDepreCble.ct_IdCbteCble      = IdCbteCble;
                    busDepreCtaCble.GuardarDB(infoDepreCble);
                }

                return(Respuesta);
            }
            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("", "ContabilizarDepreciacion", ex.Message), ex)
                      {
                          EntityType = typeof(Af_Depreciacion_Bus)
                      };
            }
        }
Beispiel #12
0
        public Af_Parametros_Info Get_Info_Parametros(int IdEmpresa)
        {
            try
            {
                Af_Parametros_Info Cbt   = new Af_Parametros_Info();
                EntitiesActivoFijo param = new EntitiesActivoFijo();
                var selectBaParam        = from C in param.Af_Parametros
                                           where C.IdEmpresa == IdEmpresa
                                           select C;

                foreach (var item in selectBaParam)
                {
                    Cbt.IdEmpresa                    = IdEmpresa;
                    Cbt.IdTipoCbte                   = item.IdTipoCbte;
                    Cbt.IdTipoCbteBaja               = item.IdTipoCbteBaja;
                    Cbt.IdTipoCbteMejora             = item.IdTipoCbteMejora;
                    Cbt.IdTipoCbteRetiro             = item.IdTipoCbteRetiro;
                    Cbt.IdTipoCbteVenta              = item.IdTipoCbteVenta;
                    Cbt.IdCtaCble_Activo             = item.IdCtaCble_Activo;
                    Cbt.IdCtaCble_Dep_Acum           = item.IdCtaCble_Dep_Acum;
                    Cbt.IdCtaCble_Gastos_Depre       = item.IdCtaCble_Gastos_Depre;
                    Cbt.FormaContabiliza             = item.FormaContabiliza;
                    Cbt.IdTipoCbteMejora_Anulacion   = item.IdTipoCbteMejora_Anulacion;
                    Cbt.IdTipoCbteBaja_Anulacion     = item.IdTipoCbteBaja_Anulacion;
                    Cbt.IdTipoCbteVenta_Anulacion    = item.IdTipoCbteVenta_Anulacion;
                    Cbt.IdTipoCbteRetiro_Anulacion   = item.IdTipoCbteRetiro_Anulacion;
                    Cbt.IdTipoCbteDep_Acum_Anulacion = item.IdTipoCbteDep_Acum_Anulacion;
                    Cbt.RutaImagenesAF               = item.RutaImagenesAF;
                }
                return(Cbt);
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Beispiel #13
0
        public ct_Cbtecble_Info GetCbtecble_x_Depreacion(int IdEmpresa, int IdTipoCbteDepre,
                                                         int IdPeriodo, List <vwAf_Valores_Depre_Contabilizar_Info> ListInfo_data, Cl_Enumeradores.eForma_Contabilizar sFormaContabiliza, ref string sMensajeError)
        {
            try
            {
                ct_Cbtecble_Info CbteCbleInfo = new ct_Cbtecble_Info();
                ct_Periodo_Info  InfoPeriodo  = new ct_Periodo_Info();
                ct_Periodo_Bus   BusPeriodo   = new ct_Periodo_Bus();
                DateTime         Fecha_Contab = new DateTime();

                InfoPeriodo  = BusPeriodo.Get_Info_Periodo(IdEmpresa, IdPeriodo, ref sMensajeError);
                Fecha_Contab = InfoPeriodo.pe_FechaFin;


                CbteCbleInfo.IdEmpresa      = IdEmpresa;
                CbteCbleInfo.IdTipoCbte     = IdTipoCbteDepre;
                CbteCbleInfo.CodCbteCble    = "";
                CbteCbleInfo.IdCbteCble     = 0;
                CbteCbleInfo.IdPeriodo      = (Fecha_Contab.Year * 100) + Fecha_Contab.Month;
                CbteCbleInfo.cb_Fecha       = Fecha_Contab;
                CbteCbleInfo.cb_Valor       = ListInfo_data.Where(q => q.Valor_Depreciacion > 0).Sum(q => q.Valor_Depreciacion);
                CbteCbleInfo.cb_Observacion = "Contabilizacion " + Cl_Enumeradores.eTipoDepreciacion.DEP_LIN.ToString() + " Por " + sFormaContabiliza.ToString() + " Periodo " + IdPeriodo;
                CbteCbleInfo.Secuencia      = 0;
                CbteCbleInfo.Estado         = "A";
                CbteCbleInfo.Anio           = Convert.ToDateTime(CbteCbleInfo.cb_Fecha).Year;
                CbteCbleInfo.Mes            = Convert.ToDateTime(CbteCbleInfo.cb_Fecha).Month;
                //CbteCbleInfo.IdUsuario = param.IdUsuario;
                CbteCbleInfo.cb_FechaTransac = DateTime.Now;
                CbteCbleInfo.Mayorizado      = "N";


                List <ct_Cbtecble_det_Info> lstDetalle = new List <ct_Cbtecble_det_Info>();

                List <Af_Activo_fijo_CtasCbles_Info> ListInfo_Activos_x_ctas = new List <Af_Activo_fijo_CtasCbles_Info>();
                Af_Activo_fijo_CtasCbles_Bus         BusAf_x_ctaCbles        = new Af_Activo_fijo_CtasCbles_Bus();
                ListInfo_Activos_x_ctas = BusAf_x_ctaCbles.Get_List_Activo_fijo_CtasCbles(IdEmpresa);

                Af_Parametros_Info info_param_af = new Af_Parametros_Info();
                Af_Parametros_Bus  bus_param_af  = new Af_Parametros_Bus();
                info_param_af = bus_param_af.Get_Info_Parametros(IdEmpresa);

                #region Contabilización x activo
                foreach (var item_x_data in ListInfo_data)
                {
                    List <Af_Activo_fijo_CtasCbles_Info> ListInfo_Af_x_ctas = new List <Af_Activo_fijo_CtasCbles_Info>();

                    if (info_param_af.FormaContabiliza == Cl_Enumeradores.eForma_Contabilizar.Por_Activo.ToString())
                    {
                        ListInfo_Af_x_ctas = ListInfo_Activos_x_ctas.Where(v => v.IdEmpresa == IdEmpresa && v.IdActivoFijo == item_x_data.IdActivoFijo).ToList();
                    }

                    if (info_param_af.FormaContabiliza == Cl_Enumeradores.eForma_Contabilizar.Por_CtaCble.ToString())
                    {
                    }

                    if (info_param_af.FormaContabiliza == Cl_Enumeradores.eForma_Contabilizar.Por_Tipo_CtaCble.ToString())
                    {
                        ListInfo_Af_x_ctas = ListInfo_Activos_x_ctas.Where(v => v.IdEmpresa == IdEmpresa && v.IdActijoFijoTipo == item_x_data.IdActijoFijoTipo).ToList();
                    }

                    vwAf_Valores_Depre_Contabilizar_Info Info_valores_depre_con_x_Gasto_depre = new vwAf_Valores_Depre_Contabilizar_Info();
                    Info_valores_depre_con_x_Gasto_depre = item_x_data;



                    //////////////////////////////
                    var q_Gastos_x_depre = from C in ListInfo_Af_x_ctas
                                           where C.IdTipoCuenta == "CTA_GASTOS_DEPRE"
                                           group C by new { C.IdEmpresa, C.IdTipoCuenta, C.IdCtaCble, C.porc_distribucion }
                    into grouping
                        select new { grouping.Key, Total_reg = grouping.Count() };


                    if (q_Gastos_x_depre.Count() == 1) // solo hay una cuenta x CTA_GASTOS_DEPRE
                    {
                        foreach (var item_x_cta in q_Gastos_x_depre)
                        {
                            Info_valores_depre_con_x_Gasto_depre.IdCtaCbleGastos      = item_x_cta.Key.IdCtaCble;
                            Info_valores_depre_con_x_Gasto_depre.Valor_a_contabilizar = item_x_data.Valor_Depreciacion;
                        }
                    }
                    else// mas de una cta distribuir por %
                    {
                        foreach (var item_x_cta in q_Gastos_x_depre)
                        {
                            Info_valores_depre_con_x_Gasto_depre.IdCtaCbleGastos      = item_x_cta.Key.IdCtaCble;
                            Info_valores_depre_con_x_Gasto_depre.Valor_a_contabilizar = (item_x_data.Valor_Depreciacion * item_x_cta.Key.porc_distribucion) / 100;
                        }
                    }

                    ///

                    //////////////////////////////
                    ///////// Info_valores_depre_con_x_depre_Acum
                    vwAf_Valores_Depre_Contabilizar_Info Info_valores_depre_con_x_depre_Acum = new vwAf_Valores_Depre_Contabilizar_Info();
                    Info_valores_depre_con_x_depre_Acum = item_x_data;

                    var q_depre_Acumulada = from C in ListInfo_Af_x_ctas
                                            where C.IdTipoCuenta == "CTA_DEPRE_ACUM"
                                            group C by new { C.IdEmpresa, C.IdTipoCuenta, C.IdCtaCble, C.porc_distribucion }
                    into grouping
                        select new { grouping.Key, Total_reg = grouping.Count() };


                    if (q_depre_Acumulada.Count() == 1) // solo hay una cuenta x CTA_DEPRE_ACUM
                    {
                        foreach (var item_x_cta in q_depre_Acumulada)
                        {
                            Info_valores_depre_con_x_depre_Acum.IdCtaCbleDepre       = item_x_cta.Key.IdCtaCble;
                            Info_valores_depre_con_x_depre_Acum.Valor_a_contabilizar = item_x_data.Valor_Depreciacion;
                        }
                    }
                    else// mas de una cta distribuir por %
                    {
                        foreach (var item_x_cta in q_depre_Acumulada)
                        {
                            Info_valores_depre_con_x_depre_Acum.IdCtaCbleDepre       = item_x_cta.Key.IdCtaCble;
                            Info_valores_depre_con_x_depre_Acum.Valor_a_contabilizar = (item_x_data.Valor_Depreciacion * item_x_cta.Key.porc_distribucion) / 100;
                        }
                    }



                    ct_Cbtecble_det_Info infoDetalle = new ct_Cbtecble_det_Info();

                    infoDetalle                = new ct_Cbtecble_det_Info();
                    infoDetalle.IdEmpresa      = IdEmpresa;
                    infoDetalle.IdTipoCbte     = IdTipoCbteDepre;
                    infoDetalle.IdCtaCble      = Info_valores_depre_con_x_Gasto_depre.IdCtaCbleGastos;
                    infoDetalle.dc_Valor       = Info_valores_depre_con_x_Gasto_depre.Valor_a_contabilizar;
                    infoDetalle.dc_Observacion = CbteCbleInfo.cb_Observacion;
                    infoDetalle.secuencia      = 1;
                    lstDetalle.Add(infoDetalle);

                    //datos el haber
                    infoDetalle                = new ct_Cbtecble_det_Info();
                    infoDetalle.IdEmpresa      = IdEmpresa;
                    infoDetalle.IdTipoCbte     = IdTipoCbteDepre;
                    infoDetalle.IdCtaCble      = Info_valores_depre_con_x_depre_Acum.IdCtaCbleDepre;
                    infoDetalle.dc_Valor       = Info_valores_depre_con_x_depre_Acum.Valor_a_contabilizar * -1;
                    infoDetalle.dc_Observacion = CbteCbleInfo.cb_Observacion;
                    infoDetalle.secuencia      = 2;
                    lstDetalle.Add(infoDetalle);
                }


                CbteCbleInfo._cbteCble_det_lista_info = lstDetalle;
                #endregion


                return(CbteCbleInfo);
            }
            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("", "ContabilizarDepreciacion", ex.Message), ex)
                      {
                          EntityType = typeof(Af_Depreciacion_Bus)
                      };
            }
        }
Beispiel #14
0
        public Boolean ModificarDB(Af_Parametros_Info info)
        {
            try
            {
                using (EntitiesActivoFijo context = new EntitiesActivoFijo())
                {
                    EntitiesActivoFijo param = new EntitiesActivoFijo();
                    var selectBaParam        = (from C in param.Af_Parametros
                                                where C.IdEmpresa == info.IdEmpresa
                                                select C).Count();

                    if (selectBaParam == 0)
                    {
                        Af_Parametros addressG = new Af_Parametros();
                        addressG.IdEmpresa                    = info.IdEmpresa;
                        addressG.IdCtaCble_Activo             = info.IdCtaCble_Activo;
                        addressG.IdCtaCble_Dep_Acum           = info.IdCtaCble_Dep_Acum;
                        addressG.IdCtaCble_Gastos_Depre       = info.IdCtaCble_Gastos_Depre;
                        addressG.IdTipoCbte                   = info.IdTipoCbte;
                        addressG.IdTipoCbteBaja               = info.IdTipoCbteBaja;
                        addressG.IdTipoCbteMejora             = info.IdTipoCbteMejora;
                        addressG.IdTipoCbteRetiro             = info.IdTipoCbteRetiro;
                        addressG.IdTipoCbteVenta              = info.IdTipoCbteVenta;
                        addressG.FormaContabiliza             = info.FormaContabiliza;
                        addressG.IdTipoCbteMejora_Anulacion   = info.IdTipoCbteMejora_Anulacion;
                        addressG.IdTipoCbteBaja_Anulacion     = info.IdTipoCbteBaja_Anulacion;
                        addressG.IdTipoCbteVenta_Anulacion    = info.IdTipoCbteVenta_Anulacion;
                        addressG.IdTipoCbteRetiro_Anulacion   = info.IdTipoCbteRetiro_Anulacion;
                        addressG.IdTipoCbteDep_Acum_Anulacion = info.IdTipoCbteDep_Acum_Anulacion;
                        context.Af_Parametros.Add(addressG);
                        context.SaveChanges();
                    }
                    else
                    {
                        var contact = context.Af_Parametros.FirstOrDefault(para => para.IdEmpresa == info.IdEmpresa);
                        if (contact != null)
                        {
                            contact.IdEmpresa                    = info.IdEmpresa;
                            contact.IdCtaCble_Activo             = info.IdCtaCble_Activo;
                            contact.IdCtaCble_Dep_Acum           = info.IdCtaCble_Dep_Acum;
                            contact.IdCtaCble_Gastos_Depre       = info.IdCtaCble_Gastos_Depre;
                            contact.IdTipoCbte                   = info.IdTipoCbte;
                            contact.IdTipoCbteBaja               = info.IdTipoCbteBaja;
                            contact.IdTipoCbteMejora             = info.IdTipoCbteMejora;
                            contact.IdTipoCbteRetiro             = info.IdTipoCbteRetiro;
                            contact.IdTipoCbteVenta              = info.IdTipoCbteVenta;
                            contact.FormaContabiliza             = info.FormaContabiliza;
                            contact.IdTipoCbteMejora_Anulacion   = info.IdTipoCbteMejora_Anulacion;
                            contact.IdTipoCbteBaja_Anulacion     = info.IdTipoCbteBaja_Anulacion;
                            contact.IdTipoCbteVenta_Anulacion    = info.IdTipoCbteVenta_Anulacion;
                            contact.IdTipoCbteRetiro_Anulacion   = info.IdTipoCbteRetiro_Anulacion;
                            contact.IdTipoCbteDep_Acum_Anulacion = info.IdTipoCbteDep_Acum_Anulacion;
                            context.SaveChanges();
                        }
                    }
                }
                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());
            }
        }
Beispiel #15
0
        public ActionResult CmbCuenta_Param3()
        {
            Af_Parametros_Info model = new Af_Parametros_Info();

            return(PartialView("_CmbCuenta_Param3", model));
        }