diff --git a/AC/RepSituacionFinanciera.aspx.vb b/AC/RepSituacionFinanciera.aspx.vb
index 8a1a83a5d..eff165c70 100644
--- a/AC/RepSituacionFinanciera.aspx.vb
+++ b/AC/RepSituacionFinanciera.aspx.vb
@@ -181,8 +181,8 @@ Partial Class AC_SituacionFinanciera
Private Sub CargaDatos()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
- Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
- Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString
+ Dim FechaI As String = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
+ Dim FechaF As String = FechaI.ToDate.LastDayOfMonth.ToShortDateString
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
@@ -191,7 +191,7 @@ Partial Class AC_SituacionFinanciera
GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue
GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString
- Dim IdCuentaAhorroDesahorro = 9999
+ Dim IdCuentaAhorroDesahorro As Integer = 9999
If UsuarioActual.CveEmpresa = 48 Then
IdCuentaAhorroDesahorro = 87
@@ -237,7 +237,7 @@ Partial Class AC_SituacionFinanciera
If UsuarioActual.CveEmpresa = 48 Then Orden7 = "00033%" Else Orden7 = "033%"
'ACTIVO
- Dim DtActivoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden1}' ")
+ Dim DtActivoCirculante As DataTable = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden1}' ")
Dim DtActivoNoCirculante As DataTable
@@ -298,8 +298,8 @@ Partial Class AC_SituacionFinanciera
'PASIVO
- Dim DtPasivoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden3}' ")
- Dim DtPasivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden4}' ")
+ Dim DtPasivoCirculante As DataTable = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden3}' ")
+ Dim DtPasivoNoCirculante As DataTable = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden4}' ")
Row = DtPasivoCirculante.NewRow
If DtPasivoCirculante.Rows.Count > 0 Then
@@ -340,9 +340,9 @@ Partial Class AC_SituacionFinanciera
'PATRIMONIO
- Dim DtPatrimonioContribuido = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden5}' ")
- Dim DtPatrimonioGenerado = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden6}' ")
- Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden7}' ")
+ Dim DtPatrimonioContribuido As DataTable = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden5}' ")
+ Dim DtPatrimonioGenerado As DataTable = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden6}' ")
+ Dim DtPatrimonioActualizacion As DataTable = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden7}' ")
Row = DtPatrimonioContribuido.NewRow
If DtPatrimonioContribuido.Rows.Count > 0 Then
@@ -421,8 +421,7 @@ Partial Class AC_SituacionFinanciera
LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero
LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero
-
- Dim Descuadre = False
+ Dim Descuadre As Boolean = False
'COLOREA ROJO SI NO CUADRAN TOTALES
If TotalActivoActual <> TotalPasivoPatrimonioActual Then
LbTotalActivoActual.ForeColor = Drawing.Color.Red
@@ -603,8 +602,8 @@ Partial Class AC_SituacionFinanciera
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
- Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
- Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
+ Dim FechaI As String = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
+ Dim FechaF As String = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'nombre del archivo a generar
Dim fileName As String = "EdoSituacionFinanciera"
'ubicacion del rdlc
@@ -615,13 +614,13 @@ Partial Class AC_SituacionFinanciera
If Not DtCuentasOrden.Columns.Contains("Importe") Then DtCuentasOrden.Columns.Add("Importe", GetType(String))
If Not DtCuentasOrden.Columns.Contains("Nivel") Then DtCuentasOrden.Columns.Add("Nivel", GetType(String))
- Dim Dr = DtCuentasOrden.NewRow
+ Dim Dr As DataRow = DtCuentasOrden.NewRow
Dr("Concepto") = "PRUEBA"
Dr("Importe") = "15236.85"
Dr("Nivel") = "1"
DtCuentasOrden.Rows.Add(Dr)
- Dim DDdr = DtCuentasOrden.NewRow
+ Dim DDdr As DataRow = DtCuentasOrden.NewRow
DDdr("Concepto") = "PRUEBA 2"
DDdr("Importe") = "15236.85"
DDdr("Nivel") = "2"
diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index f900e0f50..0d497a0ad 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -678,7 +678,7 @@ Partial Class AF_AF
End Sub
Private Sub CargaDispositivos()
DivDispositivo.Visible = False
- Dim AplicaGPSStr = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltroPrimeroValor("AplicaGPS", $"CveSubTipoActivoFijo = {DdlSubTipoActivoFijo.SelectedValue.ToEntero}")
+ Dim AplicaGPSStr As String = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltroPrimeroValor("AplicaGPS", $"CveSubTipoActivoFijo = {DdlSubTipoActivoFijo.SelectedValue.ToEntero}")
Dim AplicaGPS As Boolean = CBool(If(String.IsNullOrEmpty(AplicaGPSStr), "False", AplicaGPSStr))
If AplicaGPS Then
Dim ObjGPS As New ClsGPS
@@ -719,7 +719,7 @@ Partial Class AF_AF
DdlGrupo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaResponsable()
- Dim DtPersonal = GlobalDTRHPersonal(CveEmpresaActual).FiltraParametros("", "NombreCompleto")
+ Dim DtPersonal As DataTable = GlobalDTRHPersonal(CveEmpresaActual).FiltraParametros("", "NombreCompleto")
DdlResponsable.DataSource = DtPersonal
DdlResponsable.DataBind()
End Sub
@@ -991,7 +991,7 @@ Partial Class AF_AF
TxtNoSerie.Text = ObjActivoFijo.NoSerie
TxtAño.Text = ObjActivoFijo.Año.ToString
'CargaSubProyecto()
- DdlCtaContable.SelectedValue = ObjActivoFijo.Cuenta.ToString
+ 'DdlCtaContable.SelectedValue = ObjActivoFijo.Cuenta.ToString
LblFechaCaptura.Text = ObjActivoFijo.FechaIng.ToShortDateString
LblUsuarioCapturo.Text = ObjActivoFijo.Usuario
TxtPorDepreciacion.Text = ObjActivoFijo.PorDepreciacion.ToString
@@ -1281,20 +1281,20 @@ Partial Class AF_AF
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
Dim separado As Char() = ".".ToCharArray
Dim array() As String = Adjunto.Split(separado)
- Dim extencion As String = ""
+ Dim extension As String = ""
If array.Length > 0 Then
- extencion = array(array.Length - 1)
+ extension = array(array.Length - 1)
End If
If Adjunto.Trim.Length > 0 Then
- Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Licencias/" & Adjunto & "." & extencion
- Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "AF/Licencias/" & Adjunto & "." & extencion
+ Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Licencias/" & Adjunto & "." & extension
+ Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "AF/Licencias/" & Adjunto & "." & extension
If File.Exists(linkDescargaArchivo) Then
ImgDownLoad.Visible = True
- If extencion.Length > 0 Then
- ImgDownLoad.Text = String.Format(" ", linkDescarga, "Licencia" & "." & extencion)
+ If extension.Length > 0 Then
+ ImgDownLoad.Text = String.Format(" ", linkDescarga, "Licencia" & "." & extension)
Else
ImgDownLoad.Text = String.Format(" ", linkDescarga, "Licencia")
End If
@@ -1308,20 +1308,20 @@ Partial Class AF_AF
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
Dim separado As Char() = ".".ToCharArray
Dim array() As String = Adjunto.Split(separado)
- Dim extencion As String = ""
+ Dim extension As String = ""
If array.Length > 0 Then
- extencion = array(array.Length - 1)
+ extension = array(array.Length - 1)
End If
If Adjunto.Trim.Length > 0 Then
- Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Polizas/" & Adjunto & "." & extencion
- Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "AF/Polizas/" & Adjunto & "." & extencion
+ Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Polizas/" & Adjunto & "." & extension
+ Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "AF/Polizas/" & Adjunto & "." & extension
If File.Exists(linkDescargaArchivo) Then
ImgDownLoad.Visible = True
- If extencion.Length > 0 Then
- ImgDownLoad.Text = String.Format(" ", linkDescarga, "Poliza" & "." & extencion)
+ If extension.Length > 0 Then
+ ImgDownLoad.Text = String.Format(" ", linkDescarga, "Poliza" & "." & extension)
Else
ImgDownLoad.Text = String.Format(" ", linkDescarga, "Poliza")
End If
@@ -1532,7 +1532,7 @@ Partial Class AF_AF
End Sub
Private Sub BtnAgregarFalla_Click(sender As Object, e As EventArgs) Handles BtnAgregarFalla.Click
Dim ObjAF As New ClsAF
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If HdnModalidadFalla.Value = "A" Then
If ObjAF.AddFalla(CveActivoFijo, TxtAsuntoFalla.Text.Trim, TxtDescripcionFalla.Text.Trim, TxtAFMedida.Text.ToEntero, DdlPrioridad.SelectedValue.ToEntero, TxtFechaFalla.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTipoFallas.SelectedValue.ToEntero, TxtCorreoNotificacion.Text.Trim) Then
@@ -1561,9 +1561,9 @@ Partial Class AF_AF
End Sub
Private Sub EnviaCorreoFallas()
Try
- Dim Para = TxtCorreoNotificacion.Text.Trim
- Dim Asunto = "Registro de Falla de Activo Fijo"
- Dim Body = ""
+ Dim Para As String = TxtCorreoNotificacion.Text.Trim
+ Dim Asunto As String = "Registro de Falla de Activo Fijo"
+ Dim Body As String = ""
Dim strBody As New StringBuilder
strBody.Append("Registro de Falla de Activo Fijo")
@@ -1720,7 +1720,7 @@ Partial Class AF_AF
End Sub
Private Sub BtnRegistrarAccidente_Click(sender As Object, e As EventArgs) Handles BtnRegistrarAccidente.Click
Dim ObjAF As New ClsAF
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If HdnModalidadAccidente.Value = "A" Then
If ObjAF.AddFalla(CveActivoFijo, TxtAsuntoAccidente.Text.Trim, TxtDescripcionAccidente.Text.Trim, TxtAFMedidaAccidente.Text.ToEntero, DdlPrioridadAccidente.SelectedValue.ToEntero, TxtFechaAccidente.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTipoFallaAccidente.SelectedValue.ToEntero, TxtCorreoNotificacionAccidente.Text.Trim) Then
@@ -1747,9 +1747,9 @@ Partial Class AF_AF
End Sub
Private Sub EnviaCorreoAccidente()
Try
- Dim Para = TxtCorreoNotificacion.Text.Trim
- Dim Asunto = "Registro de Accidente de Activo Fijo"
- Dim Body = ""
+ Dim Para As String = TxtCorreoNotificacion.Text.Trim
+ Dim Asunto As String = "Registro de Accidente de Activo Fijo"
+ Dim Body As String = ""
Dim strBody As New StringBuilder
strBody.Append("Registro de Accidente de Activo Fijo")
@@ -1929,7 +1929,7 @@ Partial Class AF_AF
ObjMF.Dispose()
End Sub
Private Sub BtnAgregarActividades_Click(sender As Object, e As EventArgs) Handles BtnAgregarActividades.Click
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If HdnIDActividades.Value.ToEntero > 0 Then
If TxtHorometroInicial.Text.ToEntero < HdnHorometroAnterior.Value.ToEntero Then
@@ -2473,9 +2473,9 @@ Partial Class AF_AF
If CveActivoFijo <= 0 Then
'SALIDA DE ALMACEN PARA IMPORTACION
- Dim CveMovimientoSalidaInv = -1
+ Dim CveMovimientoSalidaInv As Integer = -1
If AFInvCvePS > 0 AndAlso AFInvCveAlmacen > 0 Then
- Dim CveUMInv = GlobalDTPS(CveEmpresaActual, CvePS:=AFInvCvePS).FiltroPrimeroValor("CveUM").ToEntero
+ Dim CveUMInv As Integer = GlobalDTPS(CveEmpresaActual, CvePS:=AFInvCvePS).FiltroPrimeroValor("CveUM").ToEntero
If CveUMInv > 0 Then
CveMovimientoSalidaInv = ObjInventarios.AddMovimiento(AFInvCveAlmacen, 3, 1, NowADS(), -1, UsuarioActual.CveUsuario, CveEmpresaActual, -1, -1, -1, -1, Observaciones:=$"Salida de inventario para Activo Fijo | {TxtCodigo.Text.Trim}", Modulo:="AF1")
If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaInv, 1, CveUMInv, AFInvCvePS, 0, -1, Serie:=AFInvSerie, CveSeccionAlmacen:=AFInvCveSeccionAlmacen) Then
@@ -3027,11 +3027,11 @@ Partial Class AF_AF
#Region "GUARDAR ARCHIVO"
Protected Sub BtnGuardaArchivo1_Click(sender As Object, e As ImageClickEventArgs)
Dim objResguardos As New ClsAF
- Dim cve = CType(sender, ImageButton).CommandArgument.ToEntero
+ Dim cve As Integer = CType(sender, ImageButton).CommandArgument.ToEntero
Dim btn As ImageButton = CType(sender, ImageButton)
Dim URL As String = cve.ToString
- Dim RutaGuardar = ""
- Dim RutaArchivo = ""
+ Dim RutaGuardar As String = ""
+ Dim RutaArchivo As String = ""
Dim Archivo As String = ""
@@ -3067,11 +3067,11 @@ Partial Class AF_AF
Protected Sub BtnGuardaArchivo2_Click(sender As Object, e As ImageClickEventArgs)
Dim objResguardos As New ClsAF
- Dim cve = CType(sender, ImageButton).CommandArgument.ToEntero
+ Dim cve As Integer = CType(sender, ImageButton).CommandArgument.ToEntero
Dim btn As ImageButton = CType(sender, ImageButton)
Dim URL As String = cve.ToString
- Dim RutaGuardar = ""
- Dim RutaArchivo2 = ""
+ Dim RutaGuardar As String = ""
+ Dim RutaArchivo2 As String = ""
Dim Archivo2 As String = ""
@@ -3126,7 +3126,7 @@ Partial Class AF_AF
Else
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
- Dim CuentaPadre = UsuarioActual.Empresa.Funcionalidad(221).ToEntero
+ Dim CuentaPadre As Integer = UsuarioActual.Empresa.Funcionalidad(221).ToEntero
If Conta.GetCuentasRecursiva(CuentaPadre, 1) Then
DtCuentas = Conta.DtResultados
@@ -3532,9 +3532,8 @@ Partial Class AF_AF
AFInvSerie = If(Inv_CveMetodoInventario = 5, TxtAFInvSerie.Text.Trim, "-1")
-
Dim ObjInventario As New ClsInventarios
- Dim Existencia = ObjInventario.GetExistenciasPS(DdlAFInvPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAFInvAlmacen.SelectedValue.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=NowADS().ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=AFInvSerie)
+ Dim Existencia As Decimal = ObjInventario.GetExistenciasPS(DdlAFInvPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAFInvAlmacen.SelectedValue.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=NowADS().ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=AFInvSerie)
Dim Costo As Decimal = 0
If Inv_CveMetodoInventario = 5 Then
Costo = ObjInventario.GetCostoPSSerie(DdlAFInvPS.SelectedValue.ToEntero, AFInvSerie, DdlAFInvAlmacen.SelectedValue.ToEntero, CveEmpresaActual)
@@ -3688,7 +3687,7 @@ Partial Class AF_AF
Private Sub BtnAgregarGrupoAF_Click(sender As Object, e As EventArgs) Handles BtnAgregarGrupoAF.Click
Dim ObjAF As New ClsAF
Dim CveGrupo As Integer
- Dim TieneError = False
+ Dim TieneError As Boolean = False
For Each Dr As DataRow In DTGrupos.Rows
@@ -3781,7 +3780,7 @@ Partial Class AF_AF
SBJS.Append("setTimeout(function(){initMapRastreo();")
Try
- Dim Coord = "", Fecha = "", Vehiculo = "", Icono = "", Info As String = ""
+ Dim Coord As String = "", Fecha As String = "", Vehiculo As String = "", Icono As String = "", Info As String = ""
If ObjGPS.UltimaPosicionEquipoGet($"{CveDispositivo};", CveClienteGPS) Then
If ObjGPS.DtResultados.Rows.Count > 0 Then
For Each row As DataRow In ObjGPS.DtResultados.Rows
@@ -3850,7 +3849,7 @@ Partial Class AF_AF
Protected Sub BtnConsultarHistorico_Click(sender As Object, e As EventArgs)
Dim ObjGPS As New ClsGPS
Try
- Dim CveDispositivo = DdlDispositivo.SelectedValue.ToEntero
+ Dim CveDispositivo As Integer = DdlDispositivo.SelectedValue.ToEntero
If ObjGPS.GetPosicionEquipo(CveDispositivo, TxtFechaIH.Text.ToDateTime(), TxtFechaFH.Text.ToDateTime()) Then
If ObjGPS.DtResultados.Rows.Count > 0 Then
Dim SBJS As New StringBuilder
@@ -3858,10 +3857,10 @@ Partial Class AF_AF
Dim StrPolyPath As New StringBuilder
StrPolyPath.Append("[")
Dim POLYPATH As String = "["
- Dim Contador = 0
+ Dim Contador As Integer = 0
Dim RowDispositivo As DataRow = GlobalDTDispositivosUsuarios(CveClienteGPS).FiltroPrimero($"CveDispositivo = {CveDispositivo}")
Dim CordenadaAnterior As String = ""
- Dim Coord = "", Fecha = "", Vehiculo = "", Icono = "", Info As String = ""
+ Dim Coord As String = "", Fecha As String = "", Vehiculo As String = "", Icono As String = "", Info As String = ""
SBJS.Append("initMapHistorico();")
For Each row As DataRow In ObjGPS.DtResultados.Rows
@@ -3914,9 +3913,9 @@ Partial Class AF_AF
Private Sub CargaDatosCombustible()
'LtlUnidad.Text = DdlDispositivo.SelectedItem.Text
- Dim CveDispositivo = DdlDispositivo.SelectedValue.ToEntero()
- Dim FechaI = TxtFechaIC.Text.ToDateTime
- Dim FechaF = TxtFechaFC.Text.ToDateTime
+ Dim CveDispositivo As Integer = DdlDispositivo.SelectedValue.ToEntero()
+ Dim FechaI As DateTime = TxtFechaIC.Text.ToDateTime
+ Dim FechaF As DateTime = TxtFechaFC.Text.ToDateTime
'UpReportes.Update()
Dim GPS As New ClsGPS
If GPS.RepCombustibleGet(DdlDispositivo.SelectedValue.ToEntero(), FechaI, FechaF) AndAlso GPS.DtResultados.Rows.Count > 0 Then
@@ -4050,15 +4049,15 @@ Partial Class AF_AF
Protected Sub BtnConsultarGeoReferencia_Click(sender As Object, e As EventArgs)
Dim LastCoord As String = ""
Dim DtPosiciones As New DataTable
- Dim Info = ""
+ Dim Info As String = ""
Dim SBBody As New StringBuilder
Dim Icono As String = "/Imagenes/rsz_11rsz_car.png"
Dim CoordsPoligono As JArray
Dim Coords As JObject
- Dim Titulo = ""
- Dim COUNT = 0
- Dim FechaI = If(TxtFechaIG.Text.Trim = "", MinFecha, TxtFechaIG.Text.Trim.ToDate)
- Dim FechaF = If(TxtFechaFG.Text.Trim = "", MaxFecha, TxtFechaFG.Text.Trim.ToDate)
+ Dim Titulo As String = ""
+ Dim COUNT As Integer = 0
+ Dim FechaI As Date = If(TxtFechaIG.Text.Trim = "", MinFecha, TxtFechaIG.Text.Trim.ToDate)
+ Dim FechaF As Date = If(TxtFechaFG.Text.Trim = "", MaxFecha, TxtFechaFG.Text.Trim.ToDate)
Dim CveDispositivo As Integer = DdlDispositivo.SelectedValue.ToEntero
Dim SBJS As New StringBuilder
Dim ArrayGeocercas As New JArray
diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb
index 70eec9006..4e6b3ad42 100644
--- a/App_Code/ClsContPAQi.vb
+++ b/App_Code/ClsContPAQi.vb
@@ -7333,7 +7333,7 @@ Public Class ClsContPAQi
Dim Retorno As Boolean = False
StrSQL.Clear()
- StrSQL.Append(" INSERT INTO [192.168.0.2].Ventas.dbo.Conta_Cuentas (CveClasificacionCuenta, Codigo, Nombre, Afectable,TipoCuenta,Estatus,FechaIng,CveUsuario,CveEmpresa,CveMoneda,IdCompaq,CvePadre) ")
+ StrSQL.Append(" INSERT INTO [SERVIDOR].Ventas.dbo.Conta_Cuentas (CveClasificacionCuenta, Codigo, Nombre, Afectable,TipoCuenta,Estatus,FechaIng,CveUsuario,CveEmpresa,CveMoneda,IdCompaq,CvePadre) ")
StrSQL.Append("SELECT CASE ")
StrSQL.Append(" WHEN Tipo = 'A' THEN 1 ")
StrSQL.Append(" WHEN Tipo = 'B' THEN 2 ")
@@ -7351,10 +7351,10 @@ Public Class ClsContPAQi
StrSQL.Append(" Codigo, Nombre, Afectable, CtaMayor AS TipoCuenta, 1 AS Estatus, Getdate() AS FechaIng, 100 ASCveUsuario, ")
StrSQL.Append(" @CveEmpresa AS CveEmpresa, ")
StrSQL.Append(" IdMoneda AS CveMoneda, C.Id AS IdCompaq, ")
- StrSQL.Append(" (select cc.CveCuenta from [192.168.0.2].Ventas.dbo.Conta_Cuentas cc where cc.IdCompaq = a.IdCtaSup AND cc.CveEmpresa = @CveEmpresa ) as CvePadre ")
+ StrSQL.Append(" (select cc.CveCuenta from [SERVIDOR].Ventas.dbo.Conta_Cuentas cc where cc.IdCompaq = a.IdCtaSup AND cc.CveEmpresa = @CveEmpresa ) as CvePadre ")
StrSQL.Append(" FROM Cuentas c ")
StrSQL.Append(" INNER JOIN Asociaciones a on c.Id = a.IdSubCtade ")
- StrSQL.Append(" WHERE c.Id IN(SELECT CC.Id FROM Cuentas CC LEFT JOIN [192.168.0.2].Ventas.dbo.Conta_Cuentas CS on CC.Id = CS.IdCompaq AND CS.CveEmpresa = @CveEmpresa WHERE CC.Codigo NOT IN('_BPASIVO') AND CS.CveCuenta IS NULL) ")
+ StrSQL.Append(" WHERE c.Id IN(SELECT CC.Id FROM Cuentas CC LEFT JOIN [SERVIDOR].Ventas.dbo.Conta_Cuentas CS on CC.Id = CS.IdCompaq AND CS.CveEmpresa = @CveEmpresa WHERE CC.Codigo NOT IN('_BPASIVO') AND CS.CveCuenta IS NULL) ")
StrSQL.Append(" ORDER BY Codigo; ")
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index f925e5065..bcc544f2b 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2126,17 +2126,17 @@ Public Class ClsPaginas
Property GlobalDTTipoVenta(Optional CveEmpresa As Integer = -1) As DataTable
Get
- Dim AppNombre As String = $"GlobalDTTipoVenta"
+ Dim AppNombre As String = $"GlobalDTTipoVenta-{CveEmpresa}"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetTipoVenta() Then Application(AppNombre) = ObjVentas.DtResultados
+ If ObjVentas.GetTipoVenta(CveEmpresa) Then Application(AppNombre) = ObjVentas.DtResultados
ObjVentas.Dispose()
End If
GlobalDTTipoVenta = DirectCast(Application(AppNombre), DataTable)
End Get
Set(value As DataTable)
- Dim AppNombre As String = $"GlobalDTTipoVenta"
+ Dim AppNombre As String = $"GlobalDTTipoVenta-{CveEmpresa}"
Application(AppNombre) = value
End Set
End Property
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 4c1bf4982..6f2f06af9 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -5953,10 +5953,12 @@ Public Class ClsVentas
#Region "TIPO VENTA"
- Public Function GetTipoVenta() As Boolean
-
+ Public Function GetTipoVenta(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_TipoVentaGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
Try
SqlAdapter.Fill(Data)
Retorno = True
diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx
index 43b258bd9..7d885cd86 100644
--- a/Compras/Proveedores.aspx
+++ b/Compras/Proveedores.aspx
@@ -867,14 +867,24 @@
@@ -4160,6 +4170,46 @@
+
+
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index 84c730ac7..6b144f494 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -518,7 +518,7 @@ Partial Class Compras_Proveedores
'Configuración de Modalidad Update
- ActivarRegistroAutomatico()
+ 'ActivarRegistroAutomatico()
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Proveedor:"
'ImgAddVenta
@@ -589,7 +589,6 @@ Partial Class Compras_Proveedores
If UsuarioActual.TienePermisoProceso(256) Then LnkParametros.Visible = True 'Actualizar Límite de Crédito
- ActivarRegistroAutomatico()
End If
'Crea y carga CuentasBancarias - tab:Bancos
@@ -692,34 +691,25 @@ Partial Class Compras_Proveedores
If CveProveedor > 0 Then
Dim ObjProveedores As New ClsCompProveedores
-
If ObjProveedores.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa, CveProveedor) Then
-
GvRepresentante.DataSource = ObjProveedores.DtResultados
- Else
- GvRepresentante.DataSource = Nothing
End If
-
ObjProveedores.Dispose()
-
GvRepresentante.DataBind()
End If
-
End Sub
-
-
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
- If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then
- Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
- If ObjContabilidad.GetCuentasRecursiva(IdCuentaPadre, 1) Then
- DtCuentasContables = ObjContabilidad.DtResultados
- Else
- DtCuentasContables = Nothing
- End If
- ObjContabilidad.Dispose()
- ElseIf UsuarioActual.Empresa.TipoContabilidad = 1 Then
+ 'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then
+ ' Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
+ ' If ObjContabilidad.GetCuentasRecursiva(IdCuentaPadre, 1) Then
+ ' DtCuentasContables = ObjContabilidad.DtResultados
+ ' Else
+ ' DtCuentasContables = Nothing
+ ' End If
+ ' ObjContabilidad.Dispose()
+ If UsuarioActual.Empresa.TipoContabilidad = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83) Then
Dim ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DtCuentasContables = ObjContabilidad.DtResultados
@@ -916,7 +906,7 @@ Partial Class Compras_Proveedores
DdlRegimenFiscal.SelectedValueExist(ObjProveedor.CveRegimenFiscal
)
- If UsuarioActual.Empresa.TipoContabilidad = 1 Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83) Then
CargaCuentasConceptos()
divCuentas.Visible = True
divCuentasContp.Visible = False
@@ -1042,12 +1032,18 @@ Partial Class Compras_Proveedores
End Sub
Private Sub CargaCuentasConceptos()
+ If UsuarioActual.TienePermisoProceso(88) OrElse UsuarioActual.TienePermisoProceso(87) Then
+ BtnVincularCuenta.Visible = True
+ If UsuarioActual.CveEmpresa = 13 Then BtnCuentaDesglose.Visible = True
+ End If
Dim ObjConta As New ClsContabilidad
- If ObjConta.GetCuentasConceptos(1, UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) Then
+ If ObjConta.GetCuentasConceptos(-1, UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) Then
GvCta.DataSource = ObjConta.DtResultados
+ If ObjConta.DtResultados.Rows.Count = 0 Then BtnCuentaDesglose.Visible = True Else BtnCuentaDesglose.Visible = False
End If
ObjConta.Dispose()
GvCta.DataBind()
+ UPPContable.Update()
End Sub
@@ -1550,128 +1546,13 @@ Partial Class Compras_Proveedores
Dim codigo As String = "-1"
Dim MsgCuentaContable As String = ""
- Dim IdCuentaContable As Integer = -1
- Dim IdCuentaAltaCompaq As Integer = -1
- Dim CodigoCuentaAltaCompaq As String = ""
- Dim NombreCuentaCuentaAltaCompaq As String = ""
-
- Dim IdProveedor As Integer = -1
-
- Dim errorContPaq As Boolean = False
-
Dim AplicarEvaluacion As Boolean = ChkAplicarEvaluacion.Checked
Dim FechaEvaluacion As String = If(IsDate(TxtFechaEva.Text.Trim()), TxtFechaEva.Text, "-1")
Dim CicloEvaluacion As Integer = If(AplicarEvaluacion, DdlCicloEvaluacion.SelectedValue.ToEntero(), -1)
- 'Dim IdContPaqi As Integer
- 'Dim CodigoPersona As Integer
-
- 'If UsuarioActual.Empresa.Funcionalidad(522).ToString = "1" Then
- ' Dim ObjContPaqi As New ClsContPAQi(UsuarioActual.Empresa)
-
- ' If UsuarioActual.Empresa.UsaContabilidad Then
-
- ' If ObjContPaqi.GetPersona(TxtRFC.Text) Then
-
- ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then
-
- ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("Id").ToString.ToEntero
- ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString.ToEntero
-
- ' Dim Cont_EsProveedor As Integer = If(Boolean.Parse(ObjContPaqi.DtResultados.Rows(0)("EsProveedor").ToString), 1, 0)
- ' Dim Cont_Nombre As String = ObjContPaqi.DtResultados(0)("Nombre").ToString
- ' Dim Cont_RFC As String = ObjContPaqi.DtResultados(0)("RFC").ToString
-
- ' If ObjContPaqi.UpdatePersona(IdContPaqi, Cont_Nombre, Cont_RFC, 1, Cont_EsProveedor) Then
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
-
- ' Else
- ' If ObjContPaqi.AddPersona(TxtNombreComercial.Text.Trim, TxtRFC.Text.Trim, 0, 1) Then
- ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiPersona").ToString.ToEntero
- ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString.ToEntero
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
- ' End If
- ' End If
-
- ' End If
-
- ' If Not errorContPaq Then
- ' ObjContPaqi.Commit()
- ' ObjContPaqi.Dispose()
- ' Else
- ' ObjContPaqi.RollBack()
- ' ObjContPaqi.Dispose()
- ' Exit Sub
- ' End If
-
- 'End If
-
- Dim ClaveFuncionalidad As Integer = UsuarioActual.Empresa.Funcionalidad(201).ToEntero
If CveProveedor = -1 Then
- Dim ObjContaAC As ClsContPAQi = Nothing
-
- If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ((UsuarioActual.Empresa.Funcionalidad(200).ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(201).ToEntero > 0)) Then 'FUNCIONALIDAD 112=AGREGAR CTA CONTABLE PROVEEDOR
-
- ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
- ObjContaAC.IniciaTransacSQL()
-
-
- If DdlCveTipoProveedor.SelectedValue = "2" Then 'cuando es acreedor
- ClaveFuncionalidad = UsuarioActual.Empresa.Funcionalidad(202).ToEntero
- End If
-
-
- If UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero > 0 Then
- IdCuentaContable = UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero
- Else
- IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(ClaveFuncionalidad, TxtRazonSocial.Text.Trim, "D", 2)
- IdCuentaAltaCompaq = IdCuentaContable
- End If
-
-
-
- If IdCuentaContable > 0 Then
-
- ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1)
- Dim dt As DataTable = ObjContaAC.DtResultados
- Dim CtaCodigo As String
-
- If dt.Rows.Count = 1 Then
- Dim row As DataRow = dt.Rows(0)
- CtaCodigo = CStr(row("CtaCodigo"))
- CodigoCuentaAltaCompaq = CStr(row("Codigo"))
- NombreCuentaCuentaAltaCompaq = TxtRazonSocial.Text.Trim
- DdlCtaContProveedores.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : DdlCtaContProveedores.SelectedValueExist(IdCuentaContable.ToString)
- End If
-
-
-
- IdProveedor = ObjContaAC.AddProveedor(IdCuentaContable, TxtRFC.Text.Trim, TxtRazonSocial.Text.Trim, "")
-
- If IdProveedor > 0 Then
-
- Else
- ObjContaAC.RollBack()
- Alert("Ocurrio un error al guardar en el padron de proveedores")
- ErrorConta = True
- End If
- Else
- ObjContaAC.RollBack()
- ErrorConta = True
- Alert("Ocurrio un error al guardar la cuenta contable")
- End If
-
-
- End If
-
Dim ObjProveedores As New ClsCompProveedores()
Dim ObjCuentasDeposito As New ClsGenerales(ObjProveedores.IniciaTransacSQL())
@@ -1696,13 +1577,6 @@ Partial Class Compras_Proveedores
Next
End If
- 'If UsuarioActual.CveEmpresa = 119 Then
- ' If Not AsignaCuentasAutomaticas(ObjProveedores, NuevoCveProveedor) Then
- ' ErrorCuentasContables = True
- ' End If
- 'End If
-
-
''Agrega Sucursales
If TempDTSucursales.Rows.Count > 0 Then
For Each row As DataRow In TempDTSucursales.Rows
@@ -1742,25 +1616,8 @@ Partial Class Compras_Proveedores
Next
End If
- If IdCuentaAltaCompaq > 0 Then
-
- Dim CveConceptoContable As Integer
- If DdlCveTipoProveedor.SelectedValue.ToEntero.Contiene(1, 3) Then
- CveConceptoContable = 5
- Else
- CveConceptoContable = 305
- End If
-
- If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, CveConceptoContable, ObjProveedores.IniciaTransacSQL, IdCompaqPadre:=ClaveFuncionalidad, CveProveedorCuenta:=NuevoCveProveedor) Then
- ErrorCuentasContablesSIG = True
- End If
-
- End If
-
-
If ErrorBancos Or ErrorContactos Or ErrorSucursales Or ErrorCuentasContables Or ErrorCuentasContablesSIG Then ''se deben validar las 3 juntas????????
ObjProveedores.RollBack()
- If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
If ErrorBancos Then
Alert("Ocurrió un error al registrar las Cuentas Bancarias", TipoMensaje.MsgError)
Else
@@ -1779,8 +1636,6 @@ Partial Class Compras_Proveedores
End If
Else
ObjProveedores.Commit()
- If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
-
'ACTUALIZAR GLOBAL
GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing
@@ -1792,43 +1647,9 @@ Partial Class Compras_Proveedores
ObjProveedores.Dispose()
ObjCuentasDeposito.Dispose()
- If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
+
Else
- 'If UsuarioActual.Empresa.Funcionalidad(522).ToString = "1" Then
- ' If UsuarioActual.Empresa.UsaContabilidad Then
- ' Dim ObjContPaqi As New ClsContPAQi(UsuarioActual.Empresa)
- ' If Not errorContPaq Then
- ' If ObjContPaqi.GetProveedor(TxtRFC.Text.Trim) Then
- ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then
- ' IdProveedor = ObjContPaqi.DtResultados.Rows(0)("Id").ToString.ToEntero
- ' errorContPaq = False
- ' Else
- ' IdProveedor = ObjContPaqi.AddProveedor(DdlCtaContProveedores.SelectedValue.ToEntero, TxtRFC.Text.Trim, TxtNombreComercial.Text.Trim, "", CodigoPersona)
- ' If IdProveedor > 0 Then
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
- ' End If
- ' Else
- ' errorContPaq = True
- ' End If
- ' End If
-
-
- ' If Not errorContPaq Then
- ' ObjContPaqi.Commit()
- ' ObjContPaqi.Dispose()
- ' Else
- ' ObjContPaqi.RollBack()
- ' ObjContPaqi.Dispose()
- ' Alert("Se Presento un Error al Guardar el Proveedor en ContPAQi.", TipoMensaje.MsgError)
- ' Exit Sub
- ' End If
- ' End If
-
- 'End If
Dim CreoCuenta As Boolean = False
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or (UsuarioActual.Empresa.UsaContabilidad And UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero = 0)) Then
@@ -2022,73 +1843,6 @@ Partial Class Compras_Proveedores
End Sub
- Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, CveConceptoContable As Integer, Optional Transaccion As SqlClient.SqlTransaction = Nothing, Optional IdCompaqPadre As Integer = -1, Optional CveProveedorCuenta As Integer = -1) As Boolean
-
- If Not UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
- Return True
- End If
-
- If Not IdCompaqPadre > 0 Then
- Alert("Erroa al agregar la cuenta SIG, IdCompaq sin definir.", TipoMensaje.MsgError)
- Return False
- End If
-
- Dim Respuesta As Boolean = False
- Dim DisposeClases As Boolean = False
- Dim Tipo As String = "B"
-
- If CveConceptoContable.Contiene(5, 305) Then
- Tipo = "D"
- ElseIf CveConceptoContable.Contiene(10) Then
- Tipo = "A"
- End If
-
- Dim ObjContabilidad As ClsContabilidad
-
- If Transaccion Is Nothing Then
- ObjContabilidad = New ClsContabilidad
- DisposeClases = True
- Else
- ObjContabilidad = New ClsContabilidad(Transaccion)
- DisposeClases = False
- End If
-
- If UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
- If ObjContabilidad.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
-
- Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta", $"IdCompaq={IdCompaqPadre}").ToEntero
-
- If CvePadre > 0 Then
-
- Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, Tipo, 2, 1, CveProveedor:=CveProveedor, IdCompaq:=IdCuentaAltaCompaq)
-
- If CvecuentaNueva > 0 Then
- If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, UsuarioActual.CveEmpresa, CvecuentaNueva, CveProveedor:=CveProveedorCuenta, PorcentajeIVA:=0) Then
- Respuesta = True
- End If
- End If
-
- End If
- End If
- Else
- Respuesta = True
- End If
-
- If DisposeClases Then
- ObjContabilidad.Dispose()
-
- If Not Respuesta Then
- Alert("Se presento un error al agregar y asignar la cuenta (Conta SIG).", TipoMensaje.MsgAdvertencia)
- End If
-
- End If
-
-
-
-
- Return Respuesta
- End Function
-
#End Region
@@ -4371,11 +4125,9 @@ Partial Class Compras_Proveedores
Else
TieneError = True
End If
-
-
- If Not AltaCuentaContabilidadSIG(Codigo, NombreCuenta, IdCuentaContable, CveConceptoContable, ObjProveedores.IniciaTransacSQL, IdCompaqPadre:=CuentaPadre, CveProveedorCuenta:=CveProveedor) Then
- TieneError = True
- End If
+ 'If Not AltaCuentaContabilidadSIG(Codigo, NombreCuenta, IdCuentaContable, CveConceptoContable, ObjProveedores.IniciaTransacSQL, IdCompaqPadre:=CuentaPadre, CveProveedorCuenta:=CveProveedor) Then
+ ' TieneError = True
+ 'End If
If Not TieneError Then
@@ -5437,11 +5189,11 @@ Partial Class Compras_Proveedores
Dim Row As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CargaEvaluacion(Row)
- Dim Fecha = TxtFechaE.Text.ToDateTime()
- Dim Mes = Fecha.ToString("MMMM", New CultureInfo("es-MX"))
- Dim Obs = TxtObsE.Text.Trim()
- Dim Calificacion = TxtCalificacion.Text.ToEntero()
- Dim Firma = TxtFirma.Text
+ Dim Fecha As DateTime = TxtFechaE.Text.ToDateTime()
+ Dim Mes As String = Fecha.ToString("MMMM", New CultureInfo("es-MX"))
+ Dim Obs As String = TxtObsE.Text.Trim()
+ Dim Calificacion As Integer = TxtCalificacion.Text.ToEntero()
+ Dim Firma As String = TxtFirma.Text
Dim Resultado As String = ""
@@ -5459,12 +5211,12 @@ Partial Class Compras_Proveedores
Dim Row As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CargaEvaluacion(Row)
- Dim Fecha = TxtFechaE.Text.ToDateTime()
+ Dim Fecha As DateTime = TxtFechaE.Text.ToDateTime()
- Dim Mes = Fecha.ToString("MMMM", New CultureInfo("es-MX"))
- Dim Obs = TxtObsE.Text.Trim()
- Dim Calificacion = TxtCalificacion.Text.ToEntero()
- Dim Firma = TxtFirma.Text
+ Dim Mes As String = Fecha.ToString("MMMM", New CultureInfo("es-MX"))
+ Dim Obs As String = TxtObsE.Text.Trim()
+ Dim Calificacion As Integer = TxtCalificacion.Text.ToEntero()
+ Dim Firma As String = TxtFirma.Text
Dim Resultado As String = ""
@@ -5485,9 +5237,9 @@ Partial Class Compras_Proveedores
e.Row.FCRadioButtonList("RblRespuesta").Visible = False
End If
If e.Row.DBCampo("TipoDato") = "2" Then
- Dim CvePregunta = e.Row.DBCampo("CvePreguntaEvaluacion").ToEntero()
+ Dim CvePregunta As Integer = e.Row.DBCampo("CvePreguntaEvaluacion").ToEntero()
If CvePregunta > 0 AndAlso DtRespuestasEvaluacion IsNot Nothing Then
- Dim Respuesta = DtRespuestasEvaluacion.FiltroPrimeroValor("RespuestaBit", $"CvePreguntaEvaluacion={CvePregunta}")
+ Dim Respuesta As String = DtRespuestasEvaluacion.FiltroPrimeroValor("RespuestaBit", $"CvePreguntaEvaluacion={CvePregunta}")
e.Row.FCRadioButtonList("RblRespuesta").SelectedValue = Respuesta
End If
End If
@@ -5497,8 +5249,8 @@ Partial Class Compras_Proveedores
Private Sub CargaEvaluacion(Row As GridViewRow)
LimpiarDatosEvaluacion()
- Dim CveEvaluacionProveedor = Row.DataKey("CveEvaluacionProveedor").ToEntero()
- Dim CveCompra = Row.DataKey("CveCompra").ToEntero()
+ Dim CveEvaluacionProveedor As Integer = Row.DataKey("CveEvaluacionProveedor").ToEntero()
+ Dim CveCompra As Integer = Row.DataKey("CveCompra").ToEntero()
TxtRS.Text = Row.DataKey("RazonSocial")
TxtCodigoE.Text = Row.DataKey("Codigo")
@@ -5567,7 +5319,7 @@ Partial Class Compras_Proveedores
End Sub
Protected Function GetTagsCartaEvaluacion(Proveedor As String, Dia As String, Mes As String, Calificacion As String, Resultado As String) As List(Of TagsDocumentos)
- Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
+ Dim ListaTagsDocumentost As New List(Of TagsDocumentos)
ListaTagsDocumentost.Add(New TagsDocumentos("{{Proveedor}}", Proveedor))
ListaTagsDocumentost.Add(New TagsDocumentos("{{Dia}}", Dia))
ListaTagsDocumentost.Add(New TagsDocumentos("{{Mes}}", Mes))
@@ -5598,7 +5350,7 @@ Partial Class Compras_Proveedores
Return ListaTagsDocumentost
End Function
Protected Function GetTagsFormatoEvaluacion() As List(Of TagsDocumentos)
- Dim ListaTagsDocumentos = New List(Of TagsDocumentos)
+ Dim ListaTagsDocumentos As New List(Of TagsDocumentos)
ListaTagsDocumentos.Add(New TagsDocumentos("{{Proveedor}}", TxtRS.Text.Trim()))
ListaTagsDocumentos.Add(New TagsDocumentos("{{Codigo}}", TxtCodigoE.Text.Trim()))
ListaTagsDocumentos.Add(New TagsDocumentos("{{Fecha}}", TxtFechaE.Text))
@@ -5883,7 +5635,7 @@ Partial Class Compras_Proveedores
Private Sub BtnSendMail_Click(sender As Object, e As EventArgs) Handles BtnSendMail.Click
'NotificacionPago(HdnCveIE.Value.ToEntero, Txt)
Dim ObjMail As New ClsSisMail()
- Dim Body = GeneraCorreo(HdnCveIE.Value.ToEntero)
+ Dim Body As String = GeneraCorreo(HdnCveIE.Value.ToEntero)
Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
@@ -6079,6 +5831,122 @@ Partial Class Compras_Proveedores
End If
ObjBancos.Dispose()
End Sub
+
+
+#Region "Asignación-Cuentas"
+
+ Protected Sub BtnCuentaDesglose_Click(sender As Object, e As EventArgs)
+ Dim tCveConcepto As Integer = 5
+ Dim tError As Boolean = False
+ Dim Msg As String = ""
+ Dim ObjConta As New ClsContabilidad
+ Dim ObjContai As ClsContPAQi = Nothing
+ ObjConta.IniciaTransacSQL()
+ Dim CveCuentaGlobal As Integer = -2
+ If UsuarioActual.CveEmpresa = 13 Then
+ CveCuentaGlobal = 84157
+ Else
+
+ End If
+ 'If ObjConta.GetCuentasGlobales(UsuarioActual.CveEmpresa, tCveConcepto) Then
+ Dim Cve As Integer = ObjConta.GeneraCuentaDesglose(tCveConcepto, 1, CveCuentaGlobal, CveProveedor, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If Cve > 0 Then
+ If ObjConta.GetCuentas(Cve, "-1", -1, UsuarioActual.CveEmpresa) Then
+ Dim drt As DataRow
+ drt = ObjConta.DtResultados.FiltroPrimero("")
+ If drt IsNot Nothing Then
+ Msg = drt("Codigo").ToString & "-" & drt("Nombre").ToString
+ End If
+ If UsuarioActual.Empresa.TipoContabilidad = 2 Then
+ If ObjConta.GetCuentas(drt("CvePadre").ToString.ToEntero, "-1", -1, UsuarioActual.CveEmpresa) Then
+ Dim idpadre As Integer = ObjConta.DtResultados.FiltroPrimeroValor("IdCompaq").ToEntero
+ ObjContai = New ClsContPAQi(UsuarioActual.Empresa)
+ Dim tidcon As Integer = ObjContai.AddCuenta(drt("Codigo").ToString, drt("Nombre").ToString, "D", 2, 0, 1, 0, "", 1, idpadre)
+ If tidcon > 0 Then
+ If Not ObjConta.UpdateCuentaCompaq(Cve, tidcon, UsuarioActual.CveEmpresa) Then
+ tError = True
+ End If
+ Else
+ tError = True
+ End If
+ End If
+ If Not tError AndAlso UsuarioActual.CveEmpresa.Contiene(13) Then
+ 'para EMD, vincular la de anticipos
+ ObjConta.AddCuentasAsignaciones(10, UsuarioActual.CveEmpresa, Cve, CveProveedor:=CveProveedor)
+ End If
+ End If
+ End If
+ Else
+ tError = True
+ End If
+
+ 'End If
+ 'crear la cuenta en el contpaqi
+ If Not tError Then
+ Alert("Cuenta Generada correctamente.
" & Msg)
+ ObjConta.Commit()
+ If ObjContai IsNot Nothing Then ObjContai.Commit()
+ CargaCuentasConceptos()
+ Else
+ ObjConta.RollBack()
+ If ObjContai IsNot Nothing Then ObjContai.RollBack()
+ ObjConta.Dispose()
+ End If
+ ObjConta.Dispose()
+ End Sub
+
+ Private Sub BtnVincularCuenta_Click(sender As Object, e As EventArgs) Handles BtnVincularCuenta.Click
+ RegistraScript("$('#ModalContaCuenta').modal('show');")
+ DdlContaCuenta.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1)
+ DdlContaCuenta.DataBind()
+ DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1).FiltraParametros(" CveConceptoContable in (5,305,10,311)")
+ DdlConceptosContables.DataBind()
+ UPPCta.Update()
+
+ End Sub
+
+ Protected Sub BtnCuentaAsociar_Click(sender As Object, e As EventArgs)
+ Dim ObjConta As New ClsContabilidad
+ ObjConta.IniciaTransacSQL()
+ Dim ErrorString As String = ""
+ If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then
+ If Not ObjConta.AddCuentasAsignaciones(DdlConceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlContaCuenta.SelectedValue.ToEntero, CveProveedor:=CveProveedor) Then
+ ErrorString = "Error al agregar"
+ End If
+ ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then
+ If Not ObjConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, DdlConceptosContables.SelectedValue.ToEntero, CveCuenta:=DdlContaCuenta.SelectedValue.ToEntero, CveProveedor:=CveProveedor) Then
+ ErrorString = "Error al actualizar"
+ End If
+ End If
+ If ErrorString.Length > 0 Then
+ ObjConta.RollBack()
+ Else
+ ObjConta.Commit()
+
+ RegistraScript("$('#ModalContaCuenta').modal('hide');")
+ Alert("Agregado correctamente")
+ End If
+ ObjConta.Dispose()
+ End Sub
+ Protected Sub ActualizaContaCuenta(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ Dim CveConceptoContable As Integer = GvRow.DataKey("CveConceptoContable").ToString.ToEntero
+ HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString
+ HdnCveConceptoContable.Value = GvRow.DataKey("CveConceptoContable").ToString
+ DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1).FiltraParametros(" CveConceptoContable in (5,305,10,311)")
+ DdlConceptosContables.DataBind()
+ DdlContaCuenta.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1)
+ DdlContaCuenta.DataBind()
+ DdlContaCuenta.SelectedValue = GvRow.DataKey("CveCuenta").ToString
+ DdlConceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable"))
+
+ RegistraScript("$('#ModalContaCuenta').modal('show');")
+ UPPCta.Update()
+ End Sub
+
+#End Region
End Class
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index 04a1d755f..0397fbc36 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -1086,10 +1086,9 @@ Partial Class ContabilidadC_RegPrePolizaS
If MsgError = "" AndAlso Not ObjMov.ValidacionesPrePoliza(CvePrePolizaInsertada, UsuarioActual) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePolizaInsertada}", "LogPrePolizas")
- MsgError = ObjMov.MensajePolizaDescuadre
+ MsgError = ObjMov.MensajePolizaDescuadre & "."
End If
End If
-
Else
MsgError = "No se pudo insertar la póliza"
End If
diff --git a/Contabilidad2/RepSituacionFinanciera.aspx.vb b/Contabilidad2/RepSituacionFinanciera.aspx.vb
index 2ca674bfc..0cd4a90b7 100644
--- a/Contabilidad2/RepSituacionFinanciera.aspx.vb
+++ b/Contabilidad2/RepSituacionFinanciera.aspx.vb
@@ -497,8 +497,8 @@ Partial Class AC2_SituacionFinanciera
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
Else
- e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
- e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}&TP={2}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
+ e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.FirstDayOfMonth.ToShortDateString, e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
+ e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.FirstDayOfMonth.ToShortDateString, e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
@@ -529,8 +529,10 @@ Partial Class AC2_SituacionFinanciera
e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;")
'Cuentas
Else
- e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
- e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
+ e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.FirstDayOfMonth.ToShortDateString, e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
+ e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.FirstDayOfMonth.ToShortDateString, e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
+ 'e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
+ 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
@@ -563,8 +565,10 @@ Partial Class AC2_SituacionFinanciera
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
'e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CveCuenta") <> "55276" Then
- e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
- e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
+ e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.FirstDayOfMonth.ToShortDateString, e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte)
+ e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.FirstDayOfMonth.ToShortDateString, e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte)
+ 'e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString)
+ 'e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={0}&FF={1}", e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 8dfde2983..c15e1b5c5 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -1252,8 +1252,6 @@ Partial Class General_SaldosIniciales
End If
-
-
ObjClientes.IniciaTransacSQL()
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
NumRow = NumRow + 1
@@ -1389,13 +1387,8 @@ Partial Class General_SaldosIniciales
Exit Select
Case Else
CveFormaPago33 = 99
-
End Select
-
-
- 'Dim RazonSocial As String = Row("RazonSocial").ToString()
-
'Contacto
If CveCliente > 0 Then
@@ -1422,16 +1415,10 @@ Partial Class General_SaldosIniciales
CveTipoGasto:=-1, RegeneraCuenta:=False) Then
ErrorClientes = True
End If
-
End If
-
End If
-
Next
-
-
-
If Not ErrorClientes Then
ObjClientes.Commit()
'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 91c9a70b6..6e11b2adc 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -973,7 +973,7 @@ Partial Class Inventarios_EntradasSalidas
If Mov.CveOrdenCompraLiga > 0 Then
HplOrdenCompra.Visible = True
HdnCveOrdenCompra.Value = Mov.CveOrdenCompraLiga.ToString
- HplOrdenCompra.Text = DtMov.Rows(0)("FolioOC").ToString
+ HplOrdenCompra.Text = $"OC: {DtMov.Rows(0)("FolioOC")}"
If UsuarioActual.TienePermisoProceso(201) Then
HplOrdenCompra.NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", Mov.CveOrdenCompraLiga)
End If
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs
index 0a477f5dd..1906d0fdb 100644
--- a/Nomina/Nomina.aspx.cs
+++ b/Nomina/Nomina.aspx.cs
@@ -9018,20 +9018,10 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkGuardarConceptosProvision_Click(object sender, EventArgs e)
{
- bool continuar = true;
- DataTable dtconta = null;
+ bool continuar = true;
using (ClsContabilidad ObjConta = new ClsContabilidad())
- {
- int CveProveedor = -1;
- int CveClientes = -1;
- int CveClasificacion = -1;
- int CveAlmacen = -1;
-
-
- if (ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa))
- {
- dtconta = ObjConta.DtResultados;
- }
+ {
+ int CveClasificacion = -1;
ObjConta.IniciaTransacSQL();
foreach (GridViewRow gvrow in GVProvision.Rows)
{
@@ -9039,42 +9029,19 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (continuar && CveConceptoNomina > 0)
{
int CvePersonal = gvrow.DataKey("CvePersonal").ToEntero();
- int CveconceptosContables = ((DropDownList)gvrow.FindControl("DdlCconceptosContables")).SelectedValue.ToEntero();
- int Cve = ((DropDownList)gvrow.FindControl("Ddlcuentassd")).SelectedValue.ToEntero();
-
- int CveCuenta = -1;
- int IdCuentaContable = -1;
- if (UsuarioActual.Empresa.TipoContabilidad == 1)
- {
- DataRow drcuenta = dtconta.FiltroPrimero(string.Format(" CveCuenta ={0}", Cve));
- if (drcuenta != null)
- {
- IdCuentaContable = drcuenta["IdCompaq"].ToString().ToEntero();
- }
- CveCuenta = Cve;
- }
- else
- {
- DataRow drcuenta = dtconta.FiltroPrimero(string.Format("IdCompaq ={0}", Cve));
- if (drcuenta != null)
- {
- CveCuenta = drcuenta["CveCuenta"].ToString().ToEntero();
- }
- IdCuentaContable = Cve;
- }
+ int CveconceptosContables = gvrow.FCDropDownList("DdlCconceptosContables").SelectedValue.ToEntero();
+ int CveCuenta = gvrow.FCDropDownList("Ddlcuentassd").SelectedValue.ToEntero();
if (CveconceptosContables > 0 && CveCuenta > 0)
{
- if (!ObjConta.AddCuentasAsignaciones(CveconceptosContables, UsuarioActual.CveEmpresa, CveCuenta, CveProveedor, CveClientes,
- CvePersonal, CveClasificacion, CveAlmacen, -1, CveBancoCuenta: -1, CveConceptoNomina: CveConceptoNomina))
+ if (!ObjConta.AddCuentasAsignaciones(CveconceptosContables, UsuarioActual.CveEmpresa, CveCuenta,
+ CvePersonal: CvePersonal, CveClasificacion: CveClasificacion, CveConceptoNomina: CveConceptoNomina))
{ continuar = false; }
-
}
else { continuar = false; }
}
}
if (continuar)
{
-
ObjConta.Commit();
}
else
@@ -9082,7 +9049,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
ObjConta.RollBack();
}
}
-
if (continuar)
{
Alert("las cuentas hán sido asignadas.");
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 26fe6e0c7..bca8c6791 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -989,7 +989,7 @@ Partial Class OC_OC
Dim DrPS As DataRow = GlobalDTPS(CveEmpresaActual, CvePS:=Dr("CvePS").ToString.ToEntero).FiltroPrimero("")
If DrPS IsNot Nothing AndAlso DrPS("IVA").ToString.ToEntero = -1 Then
Dr("IVA") = Math.Round(Dr("Total").ToString.ToDecimal * Porcentaje, 6)
- Dr("IVAPorcentaje") = Math.Round(Porcentaje, 2)
+ Dr("IVAPorcentaje") = If(Math.Round(Porcentaje, 2) > 0.14, 0.16, Math.Round(Porcentaje, 2))
' Tipo Dato '0' es Cuando es Nuevo, '1' para editar y '2' viene de la BD
Dr("TipoDato") = If(Dr("TipoDato").ToString.ToEntero = 0, 0, 1)
@@ -2592,7 +2592,7 @@ Partial Class OC_OC
Dim PorcentajeIVADetalle As Decimal = Me.DtDetalle.MAX("IVAPorcentaje", "IVAPorcentaje > 0").ToDecimal()
If PorcentajeIVADetalle > 0 AndAlso (PorcentajeIVA <> PorcentajeIVADetalle) Then
- Alert("El IVA de los conceptos no coincide con el IVA a facturar.", TipoMensaje.MsgAdvertencia)
+ Alert($"El IVA de los conceptos no coincide con el IVA a facturar.[{PorcentajeIVA}-{PorcentajeIVADetalle}]", TipoMensaje.MsgAdvertencia)
TieneError = True
End If
diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb
index bd3c7e951..cd917fcd3 100644
--- a/PortalCliente/PortalCliente.aspx.vb
+++ b/PortalCliente/PortalCliente.aspx.vb
@@ -1879,7 +1879,7 @@ Partial Class Ventas_PortalCliente
End If
If MsgError = "" Then
- If ObjMov.sValidacionePrePoliza(CvePrePoliza, UsuarioActual) Then
+ If ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
diff --git a/Sistemas/CatRoles.aspx.vb b/Sistemas/CatRoles.aspx.vb
index 679ff144d..893e8e3d3 100644
--- a/Sistemas/CatRoles.aspx.vb
+++ b/Sistemas/CatRoles.aspx.vb
@@ -86,7 +86,7 @@ Partial Class CatRoles
Protected Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
If e.CommandName = "Permisos" Then
- Dim Array = e.CommandArgument.ToString.Split("|"c)
+ Dim Array As String() = e.CommandArgument.ToString.Split("|"c)
If Array.Length = 2 Then
Dim ObjPermisos As New ClsSisRoles()
ViewState("CveRol") = Array(0).ToEntero
@@ -105,7 +105,7 @@ Partial Class CatRoles
End If
End If
If e.CommandName = "Procesos" Then
- Dim Array = e.CommandArgument.ToString.Split("|"c)
+ Dim Array As String() = e.CommandArgument.ToString.Split("|"c)
If Array.Length = 2 Then
Dim ObjPermisos As New ClsSisRoles()
ViewState("CveProceso") = Array(0).ToEntero
@@ -173,7 +173,7 @@ Partial Class CatRoles
Protected Sub GvDatos_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Rol As New ClsSisRoles
- Dim Clave = GvDatos.Rows(e.RowIndex).DataKey("CveRol").ToEntero
+ Dim Clave As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveRol").ToEntero
If Rol.RemoveRol(Clave) Then
Alert("Se ha eliminado correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
diff --git a/Ventas/CatClasificaciones.aspx b/Ventas/CatClasificaciones.aspx
index c1e894b28..2574ba124 100644
--- a/Ventas/CatClasificaciones.aspx
+++ b/Ventas/CatClasificaciones.aspx
@@ -101,7 +101,7 @@
-
+
diff --git a/Ventas/CatClasificacionesDetalle.aspx b/Ventas/CatClasificacionesDetalle.aspx
index 83f4cb1f0..b85fdb71d 100644
--- a/Ventas/CatClasificacionesDetalle.aspx
+++ b/Ventas/CatClasificacionesDetalle.aspx
@@ -110,7 +110,7 @@
-
+
@@ -135,11 +135,11 @@
-
+
-
+
@@ -148,7 +148,7 @@
-
+
diff --git a/Ventas/CatClasificacionesDetalle.aspx.vb b/Ventas/CatClasificacionesDetalle.aspx.vb
index e59d1ce2b..6be5b9dc7 100644
--- a/Ventas/CatClasificacionesDetalle.aspx.vb
+++ b/Ventas/CatClasificacionesDetalle.aspx.vb
@@ -40,32 +40,32 @@ Partial Class CatClasificacionesDetalle
If CargaDatos() Then
- If UsuarioActual.Empresa.TipoContabilidad = 2 Then
- Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
+ 'If UsuarioActual.Empresa.TipoContabilidad = 2 Then
+ ' Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
- If Cuenta.GetCuentas(-1, "-1", -1) Then
- DtCuentas = Cuenta.DtResultados
- End If
- Cuenta.Dispose()
- Try
- DdlCuentaGasto.DataSource = DtCuentas : DdlCuentaGasto.DataBind()
- Catch ex As Exception
+ ' If Cuenta.GetCuentas(-1, "-1", -1) Then
+ ' DtCuentas = Cuenta.DtResultados
+ ' End If
+ ' Cuenta.Dispose()
+ ' Try
+ ' DdlCuentaGasto.DataSource = DtCuentas : DdlCuentaGasto.DataBind()
+ ' Catch ex As Exception
- End Try
+ ' End Try
- Try
- DdlCuentaCostos.DataSource = DtCuentas : DdlCuentaCostos.DataBind()
- Catch ex As Exception
+ ' Try
+ ' DdlCuentaCostos.DataSource = DtCuentas : DdlCuentaCostos.DataBind()
+ ' Catch ex As Exception
- End Try
+ ' End Try
- Try
- DdlCuentaIngresos.DataSource = DtCuentas : DdlCuentaIngresos.DataBind()
- Catch ex As Exception
+ ' Try
+ ' DdlCuentaIngresos.DataSource = DtCuentas : DdlCuentaIngresos.DataBind()
+ ' Catch ex As Exception
- End Try
+ ' End Try
- End If
+ 'End If
DdlCuentaGasto.Items.Insert(0, New ListItem("-", "-1"))
DdlCuentaCostos.Items.Insert(0, New ListItem("-", "-1"))
DdlCuentaIngresos.Items.Insert(0, New ListItem("-", "-1"))
@@ -103,9 +103,9 @@ Partial Class CatClasificacionesDetalle
If dr IsNot Nothing Then
TxtClasificacion.Text = dr("Clasificacion").ToString
LblClasificacion.Text = dr("Clasificacion").ToString
- DdlCuentaGasto.SelectedValue = dr("IdCuentaGasto").ToString
- DdlCuentaCostos.SelectedValue = dr("IdCuentaCostos").ToString
- DdlCuentaIngresos.SelectedValue = dr("IdCuentaIngresos").ToString
+ 'DdlCuentaGasto.SelectedValue = dr("CveCuentaGasto").ToString
+ 'DdlCuentaCostos.SelectedValue = dr("IdCuentaCostos").ToString
+ 'DdlCuentaIngresos.SelectedValue = dr("IdCuentaIngresos").ToString
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
DdlCategoria.DataBind()
@@ -117,7 +117,6 @@ Partial Class CatClasificacionesDetalle
If ObjClasificaciones.GetClasificacionesSubProyecto(CveClasificacion, UsuarioActual.CveEmpresa) Then
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados
-
Else
Me.GvDatos.DataSource = Nothing
End If
@@ -159,34 +158,34 @@ Partial Class CatClasificacionesDetalle
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.RowIndex = 0 Then
- e.Row.Cells(0).Width = Unit.Pixel(150)
- e.Row.Cells(1).Width = Unit.Pixel(150)
- e.Row.Cells(2).Width = Unit.Pixel(220)
- e.Row.Cells(3).Width = Unit.Pixel(220)
+ 'If e.Row.RowIndex = 0 Then
+ ' e.Row.Cells(0).Width = Unit.Pixel(150)
+ ' e.Row.Cells(1).Width = Unit.Pixel(150)
+ ' e.Row.Cells(2).Width = Unit.Pixel(220)
+ ' e.Row.Cells(3).Width = Unit.Pixel(220)
- e.Row.Cells(4).Width = Unit.Pixel(60)
- e.Row.Cells(5).Width = Unit.Pixel(61)
- 'e.Row.Cells(7).Width = Unit.Pixel(50)
- 'e.Row.Cells(8).Width = Unit.Pixel(50)
- End If
+ ' e.Row.Cells(4).Width = Unit.Pixel(60)
+ ' e.Row.Cells(5).Width = Unit.Pixel(61)
+ ' 'e.Row.Cells(7).Width = Unit.Pixel(50)
+ ' 'e.Row.Cells(8).Width = Unit.Pixel(50)
+ 'End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
- e.Row.FCDropDownList("DdlCuentaGasto").DataSource = DtCuentas
+ e.Row.FCDropDownList("DdlCuentaGasto").DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1)
e.Row.FCDropDownList("DdlCuentaGasto").DataBind()
e.Row.FCDropDownList("DdlCuentaGasto").Items.Insert(0, New ListItem("-", "-1"))
- e.Row.FCDropDownList("DdlCuentaGasto").SelectedValue = e.Row.DBCampo("IdCuentaGasto")
+ e.Row.FCDropDownList("DdlCuentaGasto").SelectedValue = e.Row.DBCampo("CveCuentaGasto")
- e.Row.FCDropDownList("DdlCuentaCostos").DataSource = DtCuentas
- e.Row.FCDropDownList("DdlCuentaCostos").DataBind()
- e.Row.FCDropDownList("DdlCuentaCostos").Items.Insert(0, New ListItem("-", "-1"))
- e.Row.FCDropDownList("DdlCuentaCostos").SelectedValue = e.Row.DBCampo("IdCuentaCostos")
+ 'e.Row.FCDropDownList("DdlCuentaCostos").DataSource = DtCuentas
+ 'e.Row.FCDropDownList("DdlCuentaCostos").DataBind()
+ 'e.Row.FCDropDownList("DdlCuentaCostos").Items.Insert(0, New ListItem("-", "-1"))
+ 'e.Row.FCDropDownList("DdlCuentaCostos").SelectedValue = e.Row.DBCampo("IdCuentaCostos")
- e.Row.FCDropDownList("DdlCuentaIngresos").DataSource = DtCuentas
- e.Row.FCDropDownList("DdlCuentaIngresos").DataBind()
- e.Row.FCDropDownList("DdlCuentaIngresos").Items.Insert(0, New ListItem("-", "-1"))
- e.Row.FCDropDownList("DdlCuentaIngresos").SelectedValue = e.Row.DBCampo("IdCuentaIngresos")
+ 'e.Row.FCDropDownList("DdlCuentaIngresos").DataSource = DtCuentas
+ 'e.Row.FCDropDownList("DdlCuentaIngresos").DataBind()
+ 'e.Row.FCDropDownList("DdlCuentaIngresos").Items.Insert(0, New ListItem("-", "-1"))
+ 'e.Row.FCDropDownList("DdlCuentaIngresos").SelectedValue = e.Row.DBCampo("IdCuentaIngresos")
'e.Row.FCDropDownList("DdlCuentaInventario").DataSource = DtCuentas
'e.Row.FCDropDownList("DdlCuentaInventario").DataBind()
@@ -210,15 +209,27 @@ Partial Class CatClasificacionesDetalle
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
- Dim ObjClasificaciones As New ClsClasificaciones
- If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
+ 'Dim ObjClasificaciones As New ClsClasificaciones
+ 'If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
+ ' GvDatos.EditIndex = -1
+ ' ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ ' Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
+ 'Else
+ ' Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ 'End If
+ 'CargaGlobal()
+ 'ObjClasificaciones.Dispose()
+
+ Dim ObjClasificaciones As New ClsContabilidad
+ If ObjClasificaciones.RemoveCuentasAsignaciones(GvDatos.Rows(e.RowIndex).DataKey("CveCuentaAsignacionGasto").ToEntero) Then
GvDatos.EditIndex = -1
- ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ CargaDatos()
+ 'ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
- CargaGlobal()
+
ObjClasificaciones.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
@@ -227,7 +238,6 @@ Partial Class CatClasificacionesDetalle
CargaGrid("")
End If
-
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
@@ -240,14 +250,14 @@ Partial Class CatClasificacionesDetalle
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
- Dim ObjClasificaciones As New ClsClasificaciones
+ 'Dim ObjClasificaciones As New ClsClasificaciones
Dim CveSubProyecto As Integer = e.Keys("CveSubProyecto").ToString.ToEntero
Dim tCveClasificacion As Integer = e.Keys("CveClasificacion").ToString.ToEntero
Dim DdlGasto As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaGasto")
- Dim DdlCostos As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaCostos")
- Dim DdlIngresos As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaIngresos")
+ 'Dim DdlCostos As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaCostos")
+ 'Dim DdlIngresos As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaIngresos")
'If ObjClasificaciones.UpdateClasificacionSubProyecto(tCveClasificacion, CveSubProyecto, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text) Then
' GvDatos.EditIndex = -1
@@ -256,6 +266,54 @@ Partial Class CatClasificacionesDetalle
'Else
' Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
'End If
+ Dim gvr As GridViewRow = GvDatos.Rows(e.RowIndex)
+
+
+
+ Dim ObjClasificaciones As New ClsContabilidad
+
+ If gvr.DataKey("CveCuentaAsignacionGasto").ToEntero = 0 Then
+
+ If ObjClasificaciones.AddCuentasAsignaciones(6, UsuarioActual.CveEmpresa,
+ DdlGasto.SelectedValue.ToEntero,
+ CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
+ CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero) Then
+ GvDatos.EditIndex = -1
+ CargaDatos()
+ 'ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ Alert("La Clasificación se registró correctamente.", TipoMensaje.MsgInformacion)
+ Else
+ Alert("Ocurrió un error al registró la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ End If
+ Else
+
+ If DdlGasto.SelectedValue.ToEntero > 0 Then
+ If ObjClasificaciones.UpdateCuentasAsignaciones(gvr.DataKey("CveCuentaAsignacionGasto").ToEntero,
+ CveConceptoContable:=6,
+ CveCuenta:=DdlGasto.SelectedValue.ToEntero,
+ CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
+ CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero) Then
+ GvDatos.EditIndex = -1
+ CargaDatos()
+ 'ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ Alert("La Clasificación se actualizo correctamente.", TipoMensaje.MsgInformacion)
+ Else
+ Alert("Ocurrió un error se actualizó la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ End If
+ Else
+ If ObjClasificaciones.RemoveCuentasAsignaciones(gvr.DataKey("CveCuentaAsignacionGasto").ToEntero) Then
+ GvDatos.EditIndex = -1
+ CargaDatos()
+ 'ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
+ Else
+ Alert("Ocurrió un error se eliminó la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ End If
+ End If
+
+
+ End If
+
ObjClasificaciones.Dispose()
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index c06eff418..34e5ce3ae 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -800,11 +800,11 @@ Partial Class Clientes
If Request("ATI") IsNot Nothing AndAlso IsNumeric(Request("ATI")) Then
Tab.ActiveTabIndex = Request("ATI").ToEntero()
- End If
- 'CargaCuentasyConceptos()
-
+ End If
+
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.TienePermisoProceso(353) Then
DVLnkCambiarVendedor.Visible = True
+ DdlVendedor.Enabled = True
End If
@@ -10325,12 +10325,6 @@ Partial Class Clientes
Exit Sub
End If
-
- If CveVendedorOriginal = DdlVendedor.SelectedValue.ToEntero Then
- Alert("Debe de seleccionar un vendedor distinto para actualizar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
Dim ObjVentas As New ClsVentas
Dim ErrorCambio As Boolean = False
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 959bef263..baea76166 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -8911,13 +8911,9 @@ Partial Class Ventas
Exit Sub
End If
- If Not LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso RegimenFiscalCliente = "616" Then
- Alert("El Regimen fiscal del cliente no puede ser '616 - Sin obligaciones fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'If Not LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDI.SelectedValue = "23" Then
- ' Alert("El uso cfdi del cliente no puede ser 'S01 - Sin efectos fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
+ 'hay RFC con regimen 616, con evidencia de constancia
+ 'If Not LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso RegimenFiscalCliente = "616" Then
+ ' Alert("El Regimen fiscal del cliente no puede ser '616 - Sin obligaciones fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
@@ -15739,10 +15735,8 @@ Partial Class Ventas
End Sub
Private Sub AplicaAnticipos()
-
If CveVenta > 0 And CveCliente > 0 And Not EsCreaApartirDe And CveDevolucion <= 0 Then
-
Dim EsAnticipo2017Jam As Boolean = False
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
@@ -15764,20 +15758,7 @@ Partial Class Ventas
Dim ErrorConta As Boolean
Dim CveIEAnticipo As Integer
Dim CvePlantillaPoliza As Integer = 10
- 'Dim PorcentajeAmortizacion As Decimal
- 'Dim sumaAmorticaciones As Decimal = 0
- 'Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:
"
- 'Dim CveCuentaContabilizacion As Integer = 1
- Dim CuentasContablesInvalidas As New StringBuilder
- Dim ContaIdPoliza As Integer = 0
- 'Dim ConceptoAmortizacion As Integer = 0
- 'Dim UsaComplementariaClientes As Boolean = True
- ''[IPP] PARCHE TEMPORAL PARA ANTICIPOS DE JAM
- 'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then
- ' FechaMaxima = "01/01/2018".ToDate
- 'End If
- 'Dim NowADS() As DateTime = New DateTime(2020, 2, 19)
Try
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero(), TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
@@ -15802,7 +15783,6 @@ Partial Class Ventas
Dim tFecha As Date = NowADS()
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
-
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
@@ -15923,39 +15903,19 @@ Partial Class Ventas
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
- 'Dim Pago As New VentaPago
- 'Pago.ImportePagoVenta = importeMovimiento
- 'Pago.ImportePago = importeMovimiento
- 'Pago.CveIE = CveIEAnticipo
- 'Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
- 'Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
- 'Pago.TipoPago = "I"
- 'Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
- 'Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
- 'Pago.Referencia = gvr.DataKey("Folio")
-
- 'importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal)
- 'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
-
- ''Agregamos el 92
- 'importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
- 'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
-
End If
End If
End Select
-
End If
Next
Else
ErrorConta = True
End If
-
- If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 3) Then
+ ''OPCION:99 - NO SIMPLIFICAR
+ If Not ErrorConta AndAlso ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=99, AutoConta:=False) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Ventas/Ventas-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
ErrorConta = True
-
End If
End If
@@ -15972,8 +15932,8 @@ Partial Class Ventas
Msg.Append("Se ha amortizado correctamente")
'AJUSTA POLIZA
- If ContaIdPoliza > 0 Then
- Msg.AppendFormat("
Ver Póliza", ContaIdPoliza)
+ If ObjConta.ContaFolio > 0 Then
+ Msg.AppendFormat("
Ver Póliza", CvePrePoliza)
End If
ObjConta.Commit()
@@ -16130,14 +16090,12 @@ Partial Class Ventas
End If
End If
- LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
-
+ LblAmortizacion.Text = Amortizacion.FormatoNumero
HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();")
HdnTieneAnticiposVinculados.Value = "1"
-
End If
CalculaTotalesVenta(ValidarDescuentos:=True)
End If