This commit is contained in:
Oscar Irigoyen
2023-05-26 10:00:17 -07:00
13 changed files with 138 additions and 94 deletions

View File

@@ -374,8 +374,7 @@ Partial Class AF_AF
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
InicializaValores() InicializaValores()
CargaCombos() CargaCombos()
@@ -407,6 +406,7 @@ Partial Class AF_AF
BtnEliminar.Visible = False BtnEliminar.Visible = False
CargaAFPadres() CargaAFPadres()
CargaCuentasContables()
End If End If
@@ -2498,6 +2498,11 @@ Partial Class AF_AF
FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If Not ObjContabilidad.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, CveCuenta:=DdlCtaContable.SelectedValue.ToEntero, CveActivoFijo:=ObjAF.CveActivoFijo) Then
ErrorGuardar = True
End If
End If
Else Else
ErrorGuardar = True ErrorGuardar = True
End If End If
@@ -3111,25 +3116,36 @@ Partial Class AF_AF
Private Sub CargaCuentasContables() Private Sub CargaCuentasContables()
trCuentaContable.Visible = True trCuentaContable.Visible = True
Dim DtCuentas As New DataTable
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim Conta As New ClsContabilidad
If Conta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DtCuentas = Conta.DtResultados
End If
Conta.Dispose()
DdlCtaContable.DataValueField = "CveCuenta"
Else
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
Dim CuentaPadre = UsuarioActual.Empresa.Funcionalidad(221).ToEntero
If Conta.GetCuentasRecursiva(CuentaPadre, 1) Then
DtCuentas = Conta.DtResultados
Else
DtCuentas = Nothing
Alert("Ocurrió un error al obtener las Cuentas Contables.", TipoMensaje.MsgError)
End If
Conta.Dispose()
DdlCtaContableDepreciacion.DataSource = DtCuentas
DdlCtaContableDepreciacion.DataBind()
End If
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
Dim DtCuentas As New DataTable
Dim CuentaPadre = UsuarioActual.Empresa.Funcionalidad(221).ToEntero
If Conta.GetCuentasRecursiva(CuentaPadre, 1) Then
DtCuentas = Conta.DtResultados
Else
DtCuentas = Nothing
Alert("Ocurrió un error al obtener las Cuentas Contables.", TipoMensaje.MsgError)
End If
Conta.Dispose()
DdlCtaContable.DataSource = DtCuentas DdlCtaContable.DataSource = DtCuentas
DdlCtaContable.DataBind() DdlCtaContable.DataBind()
DdlCtaContableDepreciacion.DataSource = DtCuentas
DdlCtaContableDepreciacion.DataBind()
End Sub End Sub

View File

@@ -5996,7 +5996,7 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveCredito As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveCredito As Integer = -1,
@@ -6010,7 +6010,6 @@ Public Class ClsContabilidad
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
@@ -6038,7 +6037,7 @@ Public Class ClsContabilidad
End Function End Function
Public Function UpdateCuentasAsignaciones(CveConceptoAsignacion As Integer, Optional CveConceptoContable As Integer = -1, Optional CveCuenta As Integer = -1, Public Function UpdateCuentasAsignaciones(CveConceptoAsignacion As Integer, Optional CveConceptoContable As Integer = -1, Optional CveCuenta As Integer = -1,
Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1,
Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1,
@@ -6051,7 +6050,6 @@ Public Class ClsContabilidad
.Add("@CveCuentaAsignacion", SqlDbType.Int).Value = CveConceptoAsignacion .Add("@CveCuentaAsignacion", SqlDbType.Int).Value = CveConceptoAsignacion
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal

View File

@@ -1008,6 +1008,29 @@ Public Class ClsNominas
Return Retorno Return Retorno
End Function End Function
Public Function GetNom_NominasDataXML(CveNomina As Integer, CvePersonal As Integer, CvePeriodo As Integer, CveNominaTipo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Nom_NominasDataXMLGet")
With SqlAdapter.SelectCommand.Parameters
.Add("CveNomina", SqlDbType.Int).Value = CveNomina
.Add("CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("CveNominaTipo", SqlDbType.Int).Value = CveNominaTipo
.Add("CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener La Nómina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AutorizaNom_Nominas(CvePersonal As Integer, CvePeriodo As Integer, Optional Autorizado As Boolean = True) As Boolean Public Function AutorizaNom_Nominas(CvePersonal As Integer, CvePeriodo As Integer, Optional Autorizado As Boolean = True) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Nom_Nominas_Autoriza") DataAdapter("PA_Nom_Nominas_Autoriza")

View File

@@ -4652,7 +4652,7 @@ Public Class ClsPaginas
bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "") bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "")
End If End If
RutaReporte.Replace("/", "\") RutaReporte.Replace("/", "\")
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
End If End If
If EsProduccion Then If EsProduccion Then
@@ -6720,6 +6720,10 @@ Public Class ClsPaginas
DTPercepciones = Nothing DTPercepciones = Nothing
DTDeducciones = Nothing DTDeducciones = Nothing
End If End If
Dim SalarioDiario As String
Dim SDI As String
Dim Departamento As String
Dim Puesto As String
'DATOS DEL EMPLEADO 'DATOS DEL EMPLEADO
If ObjPersonal.GetPersonal(CvePersonal, CveEmpresa) Then If ObjPersonal.GetPersonal(CvePersonal, CveEmpresa) Then
RptParametro.Add(New ReportParameter("NoEmpleado", ObjPersonal.Codigo)) RptParametro.Add(New ReportParameter("NoEmpleado", ObjPersonal.Codigo))
@@ -6729,39 +6733,49 @@ Public Class ClsPaginas
RptParametro.Add(New ReportParameter("Regimen", ObjPersonal.RegimenContratacion)) RptParametro.Add(New ReportParameter("Regimen", ObjPersonal.RegimenContratacion))
RptParametro.Add(New ReportParameter("RiesgoPuesto", ObjPersonal.RiesgoPuesto)) RptParametro.Add(New ReportParameter("RiesgoPuesto", ObjPersonal.RiesgoPuesto))
RptParametro.Add(New ReportParameter("NSS", ObjPersonal.NumeroSS)) RptParametro.Add(New ReportParameter("NSS", ObjPersonal.NumeroSS))
RptParametro.Add(New ReportParameter("Departamento", ObjPersonal.Departamento)) Departamento = ObjPersonal.Departamento
RptParametro.Add(New ReportParameter("Puesto", ObjPersonal.Puesto.ToString())) Puesto = ObjPersonal.Puesto.ToString()
RptParametro.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToString("dd/MM/yyyy"))) RptParametro.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToString("dd/MM/yyyy")))
RptParametro.Add(New ReportParameter("Contrato", ObjPersonal.TipoContrato.ToString)) RptParametro.Add(New ReportParameter("Contrato", ObjPersonal.TipoContrato.ToString))
RptParametro.Add(New ReportParameter("Jornada", ObjPersonal.Jornada)) RptParametro.Add(New ReportParameter("Jornada", ObjPersonal.Jornada))
RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo)) RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo))
RptParametro.Add(New ReportParameter("SalarioBase", ObjPersonal.SalarioDiario.ToString))
RptParametro.Add(New ReportParameter("SalarioDiarioInt", ObjPersonal.SDI.ToString))
RptParametro.Add(New ReportParameter("Banco", ObjPersonal.Banco)) RptParametro.Add(New ReportParameter("Banco", ObjPersonal.Banco))
RptParametro.Add(New ReportParameter("CLABE", ObjPersonal.CLABE)) RptParametro.Add(New ReportParameter("CLABE", ObjPersonal.CLABE))
SalarioDiario = ObjPersonal.SalarioDiario.ToString
SDI = ObjPersonal.SDI.ToString
If ObjNomina.GetNom_NominasDataXML(CveNomina, CvePersonal, CvePeriodo, 1, CveEmpresa) AndAlso ObjNomina.DtResultados.Rows.Count > 0 Then
Dim drow As DataRow = ObjNomina.DtResultados.Rows(0)
SalarioDiario = drow("SalarioDiario").ToString()
SDI = drow("NomRSalarioDiarioIntegrado").ToString()
Departamento = drow("NomRDepartamento").ToString()
Puesto = drow("NomRPuesto").ToString()
End If
RptParametro.Add(New ReportParameter("SalarioBase", SalarioDiario))
RptParametro.Add(New ReportParameter("SalarioDiarioInt", SDI))
RptParametro.Add(New ReportParameter("Departamento", Departamento))
RptParametro.Add(New ReportParameter("Puesto", Puesto))
'DATOS NOMINA 'DATOS NOMINA
If ObjNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, 1, CveEmpresa) Then If ObjNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, 1, CveEmpresa) Then
RptParametro.Add(New ReportParameter("ReciboNomina", ObjNomina.Folio.ToString)) RptParametro.Add(New ReportParameter("ReciboNomina", ObjNomina.Folio.ToString))
RptParametro.Add(New ReportParameter("Serie", ObjNomina.Serie)) RptParametro.Add(New ReportParameter("Serie", ObjNomina.Serie))
RptParametro.Add(New ReportParameter("Fecha", ObjNomina.Fecha.ToString)) RptParametro.Add(New ReportParameter("Fecha", ObjNomina.Fecha.ToString))
RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo)) RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo))
RptParametro.Add(New ReportParameter("DiasPagados", ObjNomina.DiasPagados.ToString)) RptParametro.Add(New ReportParameter("DiasPagados", ObjNomina.DiasPagados.ToString))
RptParametro.Add(New ReportParameter("MetodoPago", ObjNomina.MetodoPago)) '"""PUE"" (Pago en una sola exhibición)" RptParametro.Add(New ReportParameter("MetodoPago", ObjNomina.MetodoPago)) '"""PUE"" (Pago en una sola exhibición)"
RptParametro.Add(New ReportParameter("FormaPago", """99"" (Por definir)")) RptParametro.Add(New ReportParameter("FormaPago", """99"" (Por definir)"))
RptParametro.Add(New ReportParameter("Cantidad", "1")) RptParametro.Add(New ReportParameter("Cantidad", "1"))
RptParametro.Add(New ReportParameter("Unidad", "ACT")) RptParametro.Add(New ReportParameter("Unidad", "ACT"))
RptParametro.Add(New ReportParameter("Descripcion", "PAGO DE NÓMINA")) RptParametro.Add(New ReportParameter("Descripcion", "PAGO DE NÓMINA"))
RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString())) RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString()))
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal) cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal)
RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDouble.Texto2Letras)) RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDouble.Texto2Letras))
RptParametro.Add(New ReportParameter("Clave", "84111505")) RptParametro.Add(New ReportParameter("Clave", "84111505"))
Else
TieneError = True
End If
Else Else
TieneError = True TieneError = True
End If
Else
TieneError = True
End If End If
If Not TieneError Then If Not TieneError Then
If ObjNomina.GetPeriodos(-1, CveEmpresa, -1, -1, CvePeriodo) Then If ObjNomina.GetPeriodos(-1, CveEmpresa, -1, -1, CvePeriodo) Then

View File

@@ -1102,10 +1102,14 @@ Partial Class Bancos_ProveedoresAbonar
Msg.AppendFormat(" Folio: <a class=""Texto"" target='_blank' href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a><br/> <br/> ", CveIE, TxtFolio.Text) Msg.AppendFormat(" Folio: <a class=""Texto"" target='_blank' href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a><br/> <br/> ", CveIE, TxtFolio.Text)
Msg.AppendFormat(" <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir movimiento</a><br/> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE))) Msg.AppendFormat(" <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir movimiento</a><br/> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)))
'End If
Msg.AppendFormat(" <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Listado</a><br/> ", Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIE))) Msg.AppendFormat(" <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Listado</a><br/> ", Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIE)))
If IDPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then Msg.AppendFormat(" <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Póliza</a><br/> ", IDPoliza) If IDPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then Msg.AppendFormat(" <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Póliza</a><br/> ", IDPoliza)
If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={0}"">Ver Póliza</a>&nbsp;&nbsp; ", CvePrePoliza)
End If
Dim Mensaje As String = String.Format("El Documento se generó correctamente.<br /><br /> {0} ", Msg.ToString) Dim Mensaje As String = String.Format("El Documento se generó correctamente.<br /><br /> {0} ", Msg.ToString)
'LIMPIA 'LIMPIA

View File

@@ -27,9 +27,8 @@ Partial Class Contabilidad_CatCuentas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
'inicio()
'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');") If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
If UsuarioActual.Empresa.TipoContabilidad = 1 OrElse UsuarioActual.CveEmpresa = 119 Then
Server.Transfer("/Contabilidad2/CatCuentas.aspx") Server.Transfer("/Contabilidad2/CatCuentas.aspx")
End If End If

View File

@@ -97,9 +97,7 @@ Partial Class Contabilidad2_CatCuentas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
'inicio()
'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');")
' If UsuarioActual.Empresa.UsaContabilidad Then
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
DdlAlmacen.DataBind() DdlAlmacen.DataBind()
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -346,7 +344,6 @@ Partial Class Contabilidad2_CatCuentas
If Tnombre.Text.Trim = "" Then Alert("Ingrese nombre de la cuenta", TipoMensaje.MsgError) : Exit Sub If Tnombre.Text.Trim = "" Then Alert("Ingrese nombre de la cuenta", TipoMensaje.MsgError) : Exit Sub
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad Dim ObjConta As New ClsContabilidad
Dim CveConceptoAdmin As Integer = DdlConcepto.SelectedValue.ToEntero() Dim CveConceptoAdmin As Integer = DdlConcepto.SelectedValue.ToEntero()

View File

@@ -344,7 +344,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
ObjConta.IniciaTransacSQL() ObjConta.IniciaTransacSQL()
Dim ErrorString As String = "" Dim ErrorString As String = ""
If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then
If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero,
@@ -352,7 +352,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
ErrorString = "Error al agregar" ErrorString = "Error al agregar"
End If End If
ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then
If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero,

View File

@@ -1179,7 +1179,7 @@ Partial Class General_SaldosIniciales
Dim ObjConta As New ClsContabilidad(ObjProv.IniciaTransacSQL) Dim ObjConta As New ClsContabilidad(ObjProv.IniciaTransacSQL)
If Not ObjConta.AddCuentasAsignaciones(CveConceptoCuentaAsiganaciones, UsuarioActual.CveEmpresa, CveCuentaContable, -1, If Not ObjConta.AddCuentasAsignaciones(CveConceptoCuentaAsiganaciones, UsuarioActual.CveEmpresa, CveCuentaContable,
ObjProv.CveProveedor, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, ObjProv.CveProveedor, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorProv = True ErrorProv = True
@@ -1419,7 +1419,7 @@ Partial Class General_SaldosIniciales
Dim ObjConta As New ClsContabilidad(ObjClientes.IniciaTransacSQL) Dim ObjConta As New ClsContabilidad(ObjClientes.IniciaTransacSQL)
If Not ObjConta.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CveCuentaContable, -1, If Not ObjConta.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CveCuentaContable,
-1, ObjClientes.CveCliente, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, -1, ObjClientes.CveCliente, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorClientes = True ErrorClientes = True
@@ -1917,21 +1917,21 @@ Partial Class General_SaldosIniciales
If CveAF > 0 Then If CveAF > 0 Then
If CveCuentaContable > 0 Then If CveCuentaContable > 0 Then
If Not ObjConta.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, CveCuentaContable, -1, If Not ObjConta.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, CveCuentaContable,
-1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF, -1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorAF = True ErrorAF = True
End If End If
End If End If
If CveCuentaContableDepreciacion > 0 Then If CveCuentaContableDepreciacion > 0 Then
If Not ObjConta.AddCuentasAsignaciones(101, UsuarioActual.CveEmpresa, CveCuentaContableDepreciacion, -1, If Not ObjConta.AddCuentasAsignaciones(101, UsuarioActual.CveEmpresa, CveCuentaContableDepreciacion,
-1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF, -1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorAF = True ErrorAF = True
End If End If
End If End If
If CveCuentaContableDepreciacion > 0 Then If CveCuentaContableDepreciacion > 0 Then
If Not ObjConta.AddCuentasAsignaciones(270, UsuarioActual.CveEmpresa, CveCuentaContableDepreciacionAcum, -1, If Not ObjConta.AddCuentasAsignaciones(270, UsuarioActual.CveEmpresa, CveCuentaContableDepreciacionAcum,
-1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF, -1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorAF = True ErrorAF = True
@@ -2976,7 +2976,7 @@ Partial Class General_SaldosIniciales
If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, CveEmpresa, CveCuentaContable, -1, If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, CveEmpresa, CveCuentaContable,
CveProveedor, CveCliente, CvePersonal, CveClasificacion, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, CveProveedor, CveCliente, CvePersonal, CveClasificacion, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
CveTipoGasto:=-1, RegeneraCuenta:=False, OpActualizarClasificacion:=OpActualizarClasificacion) Then CveTipoGasto:=-1, RegeneraCuenta:=False, OpActualizarClasificacion:=OpActualizarClasificacion) Then
Respuesta = True Respuesta = True
@@ -3628,7 +3628,7 @@ Partial Class General_SaldosIniciales
If CveCuentaContable > 0 Then If CveCuentaContable > 0 Then
Dim ObjConta As New ClsContabilidad(ObjRH.IniciaTransacSQL) Dim ObjConta As New ClsContabilidad(ObjRH.IniciaTransacSQL)
If Not ObjConta.AddCuentasAsignaciones(28, UsuarioActual.CveEmpresa, CveCuentaContable, -1, If Not ObjConta.AddCuentasAsignaciones(28, UsuarioActual.CveEmpresa, CveCuentaContable,
-1, -1, ObjRH.CvePersonal, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, -1, -1, ObjRH.CvePersonal, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1,
CveTipoGasto:=-1, RegeneraCuenta:=False) Then CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorRH = True ErrorRH = True

View File

@@ -3103,7 +3103,7 @@ Partial Class Inventarios_EntregaAlmacen
ValorMultiplicador = -1 ValorMultiplicador = -1
End If End If
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/EntregaAlmacen", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/EntregaAlmacen", 1, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Se agrega movimiento separado por la cuenta de ventas (ER) 'Se agrega movimiento separado por la cuenta de ventas (ER)
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then

View File

@@ -2776,8 +2776,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
//NomAutorizado = gvrow.DataKey("NomAutorizado").ToUpper().Contiene(new string[] { "1", "TRUE" }); //NomAutorizado = gvrow.DataKey("NomAutorizado").ToUpper().Contiene(new string[] { "1", "TRUE" });
SRCvePersonal = TxtCvePersonal.Text.ToEntero(); SRCvePersonal = TxtCvePersonal.Text.ToEntero();
showhideaccionesSR(); showhideaccionesSR();
HypXmlSobreRecibo.Attributes.Add("onclick", string.Format("GETPDF({0},{1})", SRCvePersonal, CvePeriodoSeleccionado)); HypXmlSobreRecibo.Attributes.Add("onclick", string.Format("GETXML({0},{1})", SRCvePersonal, CvePeriodoSeleccionado));
HyppdfSobreRecibo.Attributes.Add("onclick", string.Format("GETXML({0},{1})", SRCvePersonal, CvePeriodoSeleccionado)); HyppdfSobreRecibo.Attributes.Add("onclick", string.Format("GETPDF({0},{1})", SRCvePersonal, CvePeriodoSeleccionado));
DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal)); DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal));
string Nombre = ""; string Nombre = "";
@@ -8684,7 +8684,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
if (CveconceptosContables > 0 && CveCuenta > 0) if (CveconceptosContables > 0 && CveCuenta > 0)
{ {
if (!ObjConta.AddCuentasAsignaciones(CveconceptosContables, UsuarioActual.CveEmpresa, CveCuenta, IdCuentaContable, CveProveedor, CveClientes, if (!ObjConta.AddCuentasAsignaciones(CveconceptosContables, UsuarioActual.CveEmpresa, CveCuenta, CveProveedor, CveClientes,
CvePersonal, CveClasificacion, CveAlmacen, -1, CveBancoCuenta: -1, CveConceptoNomina: CveConceptoNomina)) CvePersonal, CveClasificacion, CveAlmacen, -1, CveBancoCuenta: -1, CveConceptoNomina: CveConceptoNomina))
{ continuar = false; } { continuar = false; }

View File

@@ -76,7 +76,7 @@
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="0" /> <asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="0" />
<div> <div>
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False" <asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto,CveCuentaAsignacionGasto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Clasificación"> <asp:TemplateField HeaderText="Clasificación">
<ItemTemplate> <ItemTemplate>
@@ -173,13 +173,10 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-Width="5%" HeaderText="" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaClasificacion" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaClasificacion" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" /> <asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="80" /> <ItemStyle Width="80" />
@@ -230,6 +227,7 @@
<div class="form-group input-iconright" id="DivCuentaGasto" runat="server"> <div class="form-group input-iconright" id="DivCuentaGasto" runat="server">
<asp:HiddenField ID="HdnCveCuentaAsignacion" runat="server" />
<label for="<%= DdlCuentaGasto.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Gasto:</label> <label for="<%= DdlCuentaGasto.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Gasto:</label>
<asp:DropDownList ID="DdlCuentaGasto" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaGasto" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
</div> </div>

View File

@@ -145,8 +145,8 @@ Partial Class CatClasificaciones
Public Sub CargaDatos() Public Sub CargaDatos()
Dim ObjClasificaciones As New ClsClasificaciones Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones() Then If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
Else Else
Me.GvDatos.DataSource = Nothing Me.GvDatos.DataSource = Nothing
End If End If
@@ -154,24 +154,10 @@ Partial Class CatClasificaciones
CargaGrid() CargaGrid()
End Sub End Sub
'Public Sub CargaGlobal()
' Dim ObjClasificaciones As New ClsClasificaciones
' If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
' ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
' GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
' Else
' Me.GvDatos.DataSource = Nothing
' Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
' End If
' ObjClasificaciones.Dispose()
'End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjClasificaciones As New ClsClasificaciones Dim ObjClasificaciones As New ClsClasificaciones
Dim objConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL)
Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0) Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0)
If HdnModalidadClasificacion.Value = "A" Then If HdnModalidadClasificacion.Value = "A" Then
@@ -183,7 +169,11 @@ Partial Class CatClasificaciones
RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(6, UsuarioActual.CveEmpresa, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
If DdlCuentaCostos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(69, UsuarioActual.CveEmpresa, DdlCuentaCostos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
If DdlCuentaIngresos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(4, UsuarioActual.CveEmpresa, DdlCuentaIngresos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
End If
TxtClasificacion.Text = "" TxtClasificacion.Text = ""
TxtPrecioBaseCosto.Text = "" TxtPrecioBaseCosto.Text = ""
DdlCuentaGasto.SelectedValueExist("0") DdlCuentaGasto.SelectedValueExist("0")
@@ -206,11 +196,18 @@ Partial Class CatClasificaciones
Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero,
RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 6, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=CveClasificacion)
End If
ObjClasificaciones.Commit()
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
Else Else
Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjClasificaciones.RollBack()
End If End If
End If End If
@@ -236,7 +233,7 @@ Partial Class CatClasificaciones
DtCuentasContables.Columns("CtaCodigo").ColumnName = "Cuenta" DtCuentasContables.Columns("CtaCodigo").ColumnName = "Cuenta"
End If End If
ObjContabilidad.Dispose() ObjContabilidad.Dispose()
ElseIf UsuarioActual.Empresa.TipoContabilizacion = 1 Then ElseIf UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim ObjEmpresa As New ClsSisEmpresas Dim ObjEmpresa As New ClsSisEmpresas
Dim Empresa As Empresa = Nothing Dim Empresa As Empresa = Nothing
@@ -249,11 +246,8 @@ Partial Class CatClasificaciones
ObjContabilidad.Dispose() ObjContabilidad.Dispose()
End If End If
ObjEmpresa.Dispose() ObjEmpresa.Dispose()
End If End If
End Sub End Sub
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
@@ -421,6 +415,7 @@ Partial Class CatClasificaciones
ChkRequiereAFCompra.Checked = If(GvRow.DataKey("RequiereAFCompra") = "True", True, False) ChkRequiereAFCompra.Checked = If(GvRow.DataKey("RequiereAFCompra") = "True", True, False)
ChkRequiereAFInsumo.Checked = If(GvRow.DataKey("RequiereAFInsumo") = "True", True, False) ChkRequiereAFInsumo.Checked = If(GvRow.DataKey("RequiereAFInsumo") = "True", True, False)
ChkRequierePersonal.Checked = If(GvRow.DataKey("RequierePersonal") = "True", True, False) ChkRequierePersonal.Checked = If(GvRow.DataKey("RequierePersonal") = "True", True, False)
HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacionGasto")
If CuentaGasto.Length > 1 And CargaGastos Then If CuentaGasto.Length > 1 And CargaGastos Then
DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString)) DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString))