This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2024-12-05 18:14:31 -07:00
20 changed files with 427 additions and 449 deletions

View File

@@ -202,7 +202,8 @@ Public Class ClsContratos
Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1, Optional CveTipoAF As Integer = -1, Optional CveChofer As Integer = -1,
Optional CveTipoContrato As Integer = -1, Optional CveTipoContrato As Integer = -1,
Optional FechaInicioIngreso As DateTime = MinFecha, Optional FechaInicioIngreso As DateTime = MinFecha,
Optional FechaFinIngreso As DateTime = MaxFecha) As Boolean Optional FechaFinIngreso As DateTime = MaxFecha,
Optional EsPresupuestal As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosReporteGet") DataAdapter("PA_Con_ContratosReporteGet")
@@ -218,6 +219,7 @@ Public Class ClsContratos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaInicioIngreso", SqlDbType.DateTime).Value = FechaInicioIngreso .Add("@FechaInicioIngreso", SqlDbType.DateTime).Value = FechaInicioIngreso
.Add("@FechaFinIngreso", SqlDbType.DateTime).Value = FechaFinIngreso .Add("@FechaFinIngreso", SqlDbType.DateTime).Value = FechaFinIngreso
.Add("@EsPresupuestal", SqlDbType.Int).Value = EsPresupuestal
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -521,9 +521,9 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If Not CveCliente > 0 Then If Not CveCliente > 0 Then
CveCliente = -1 CveCliente = -1
End If End If
'no se consideran, los presupuestales
If ObjContratos.GetContratosReporte(usuarioActual_.CveEmpresa, FI.ToString.ToDate, FF.ToString.ToDate, CveCliente:=CveCliente, CveTipoAF:=CveTipoActivoFijo, If ObjContratos.GetContratosReporte(usuarioActual_.CveEmpresa, FI.ToString.ToDate, FF.ToString.ToDate, CveCliente:=CveCliente, CveTipoAF:=CveTipoActivoFijo,
CveTipoContrato:=34, CveEstatus:=CveContratoEstatus) Then CveTipoContrato:=34, CveEstatus:=CveContratoEstatus, EsPresupuestal:=0) Then
'CveTipoAF 'CveTipoAF
'CveChofer, CveChofer2 'CveChofer, CveChofer2

View File

@@ -1,4 +1,4 @@
Option Explicit On '{Option Explicit On
Option Strict On Option Strict On
Imports System.Data Imports System.Data
@@ -14,9 +14,6 @@ Imports System.Data.SqlClient
Imports ClsPaginas Imports ClsPaginas
Imports Microsoft.Owin.Security.Provider Imports Microsoft.Owin.Security.Provider
Partial Class Compras_Compras Partial Class Compras_Compras
Inherits ClsPaginas Inherits ClsPaginas
@@ -9364,44 +9361,94 @@ Partial Class Compras_Compras
End If End If
End If End If
If (NumeroReembolsoOriginal.Trim <> TxtRembolsoNumero.Text.Trim) Then
'NOTA. si hay un cambio en el reembolso, puede tener estas consideraciones.
'1. no tenía comprobación y se ocupa relacionar, se deberá validar que no tenga pagos contabilizados
'2. se está cambiando de comprobación
'3. se está quitando la relación de una comprobación
If (TxtRembolsoNumero.Text.Trim.Length > 0 AndAlso IdPoliza <= 0) AndAlso (NumeroReembolsoOriginal.Trim <> TxtRembolsoNumero.Text.Trim) Then If (TxtRembolsoNumero.Text.Trim.Length > 0) Then
'valida.
If NumeroReembolsoOriginal = "" Then ' se asignará a una nueva comprobación
Dim CvePersonalVal As Integer = -1
Dim CveCajaChicaVal As Integer = -1
Dim tienePagoContabilizado As Boolean = False
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA If RblRembolso.SelectedValue.ToEntero = 1 Then
If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtRembolsoNumero.Text.Trim <> "" AndAlso (DdlRembolsoPersonal.SelectedValue.ToEntero > 0 Or DdlRembolsoCajaChica.SelectedValue.ToEntero > 0) Then CvePersonalVal = DdlRembolsoPersonal.SelectedValue.ToEntero
If ObjCompra.GetComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then
Dim CvePreComprobacion As Integer
If ObjCompra.DtResultados.Rows.Count = 0 Then
'sino existe, creamos la comprobacion
Dim tConcepto As String = If(DdlRembolsoPersonal.SelectedValue.ToEntero > 0, DdlRembolsoPersonal.SelectedItem.Text, DdlRembolsoCajaChica.SelectedItem.Text)
tConcepto = String.Format("{0}-{1}", tConcepto, TxtRembolsoNumero.Text.Trim)
CvePreComprobacion = ObjContabilidad.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If ObjCompra.AddComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, CvePreComprobacion, UsuarioActual.CveEmpresa) > 0 Then
End If
Else Else
'si ya existe, obtenemos la prepóliza CveCajaChicaVal = DdlRembolsoCajaChica.SelectedValue.ToEntero
CvePreComprobacion = ObjCompra.DtResultados.FiltroPrimeroValor("CvePrePoliza").ToEntero
End If End If
ObjContabilidad.PrePolizaUnificacion(CvePreComprobacion, CvePrePoliza) If ObjCompra.GetComprobacionPagosContabilizados(CvePersonalVal, CveCajaChicaVal, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then
If ObjCompra.DtResultados IsNot Nothing AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then
tienePagoContabilizado = True
End If
If tienePagoContabilizado Then
Alert($"No se puede actualizar el número de reembolso {TxtRembolsoNumero.Text}, ya tiene pagos contabilizados.", TipoMensaje.MsgAdvertencia)
Retorno = False
End If
'If objConta.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then
' Dim FolioPoliza As Integer = objConta.DtResultados.Rows(0)("FolioPoliza").ToString.ToEntero
' If FolioPoliza > 0 Then
' If Not objConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, False, UsuarioActual.CveEmpresa) Then
' ErrorProceso = True
' End If
' End If
'End If
Else
Retorno = False
End If
End If End If
If Retorno Then
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtRembolsoNumero.Text.Trim <> "" AndAlso (DdlRembolsoPersonal.SelectedValue.ToEntero > 0 OrElse DdlRembolsoCajaChica.SelectedValue.ToEntero > 0) Then
If ObjCompra.GetComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then
Dim CvePreComprobacion As Integer
If ObjCompra.DtResultados.Rows.Count = 0 Then
'sino existe, creamos la comprobacion
Dim tConcepto As String = If(DdlRembolsoPersonal.SelectedValue.ToEntero > 0, DdlRembolsoPersonal.SelectedItem.Text, DdlRembolsoCajaChica.SelectedItem.Text)
tConcepto = String.Format("{0}-{1}", tConcepto, TxtRembolsoNumero.Text.Trim)
CvePreComprobacion = ObjContabilidad.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If ObjCompra.AddComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, CvePreComprobacion, UsuarioActual.CveEmpresa) > 0 Then
End If
Else
'si ya existe, obtenemos la prepóliza
CvePreComprobacion = ObjCompra.DtResultados.FiltroPrimeroValor("CvePrePoliza").ToEntero
End If
'cambiar la prepóliza
If Not ObjContabilidad.PrePolizaCompraCambiaReembolso(CvePreComprobacion, CvePrePoliza, CveCompra, UsuarioActual.CveEmpresa, 1) Then
Retorno = False
End If
' ObjContabilidad.PrePolizaUnificacion(CvePreComprobacion, CvePrePoliza)
End If
End If
End If
Else
'Actualizar PrePoliza Actual de Donde CveCompra = CveCompra poner CvePrePolizaOriginal
If Not ObjContabilidad.PrePolizaCompraCambiaReembolso(-1, CvePrePoliza, CveCompra, UsuarioActual.CveEmpresa, 2) Then
Retorno = False
End If
End If End If
End If End If
Else Else
Retorno = False Retorno = False
End If End If
Else Else
Alert("La compra no se puede actualizar debido a que los totales no son iguales, verifique sus cambios", TipoMensaje.MsgError) Alert("La compra no se puede actualizar debido a que los totales no son iguales, verifique sus cambios", TipoMensaje.MsgError)
End If End If
If Retorno AndAlso (CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero OrElse CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero) Then If Retorno AndAlso (CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero OrElse CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero) Then
@@ -9421,20 +9468,17 @@ Partial Class Compras_Compras
End If End If
If Retorno AndAlso Not validaNumeroReembolso(ObjCompra.IniciaTransacSQL()) Then 'If Retorno AndAlso Not validaNumeroReembolso(ObjCompra.IniciaTransacSQL()) Then
Retorno = False ' Retorno = False
End If ' End If
Catch ex As Exception Catch ex As Exception
Alert("Ocurrió un error al actualizar la compra", TipoMensaje.MsgError) Alert("Ocurrió un error al actualizar la compra", TipoMensaje.MsgError)
ObjCompra.RollBack() ObjCompra.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Finally Finally
If Retorno Then If Retorno Then
If ObjContabilidad.MensajePolizaDescuadre IsNot Nothing AndAlso ObjContabilidad.MensajePolizaDescuadre.ToString <> "" Then If ObjContabilidad.MensajePolizaDescuadre IsNot Nothing AndAlso ObjContabilidad.MensajePolizaDescuadre.ToString <> "" Then
Alert(ObjContabilidad.MensajePolizaDescuadre.ToString) Alert(ObjContabilidad.MensajePolizaDescuadre.ToString)
@@ -9546,112 +9590,95 @@ Partial Class Compras_Compras
End Function End Function
Private Function validaNumeroReembolso(ByRef transaccionSql As SqlTransaction) As Boolean 'Private Function validaNumeroReembolso(ByRef transaccionSql As SqlTransaction) As Boolean
Dim CvePersonalVal As Integer = -1 ' Dim CvePersonalVal As Integer = -1
Dim CveCajaChicaVal As Integer = -1 ' Dim CveCajaChicaVal As Integer = -1
If RblRembolso.SelectedValue.ToEntero = 1 Then ' If RblRembolso.SelectedValue.ToEntero = 1 Then
CvePersonalVal = DdlRembolsoPersonal.SelectedValue.ToEntero ' CvePersonalVal = DdlRembolsoPersonal.SelectedValue.ToEntero
Else ' Else
CveCajaChicaVal = DdlRembolsoCajaChica.SelectedValue.ToEntero ' CveCajaChicaVal = DdlRembolsoCajaChica.SelectedValue.ToEntero
End If ' End If
Dim objCompras As New ClsCompras(transaccionSql) ' Dim objCompras As New ClsCompras(transaccionSql)
Dim objConta As New ClsContabilidad(transaccionSql) ' Dim objConta As New ClsContabilidad(transaccionSql)
Dim tienePagoContabilizado As Boolean = False ' Dim tienePagoContabilizado As Boolean = False
Dim ErrorProceso As Boolean = False ' Dim ErrorProceso As Boolean = False
Dim CvePrePolizaReembolsoActual As Integer = CvePrePoliza ' Dim CvePrePolizaReembolsoActual As Integer = CvePrePoliza
Dim CvePrePolizaReembolsoNuevo As Integer = -1 ' Dim CvePrePolizaReembolsoNuevo As Integer = -1
If TxtRembolsoNumero.Text.Trim.Length > 0 Then ' If TxtRembolsoNumero.Text.Trim.Length > 0 Then
If objCompras.GetComprobacion(CvePersonalVal, CveCajaChicaVal, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then ' If objCompras.GetComprobacion(CvePersonalVal, CveCajaChicaVal, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then
If objCompras.DtResultados.Rows.Count > 0 Then ' If objCompras.DtResultados.Rows.Count > 0 Then
CvePrePolizaReembolsoNuevo = objCompras.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero ' CvePrePolizaReembolsoNuevo = objCompras.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero
Else ' Else
Dim tConcepto As String = If(DdlRembolsoPersonal.SelectedValue.ToEntero > 0, DdlRembolsoPersonal.SelectedItem.Text, DdlRembolsoCajaChica.SelectedItem.Text) ' Dim tConcepto As String = If(DdlRembolsoPersonal.SelectedValue.ToEntero > 0, DdlRembolsoPersonal.SelectedItem.Text, DdlRembolsoCajaChica.SelectedItem.Text)
tConcepto = String.Format("{0}-{1}", tConcepto, TxtRembolsoNumero.Text.Trim) ' tConcepto = String.Format("{0}-{1}", tConcepto, TxtRembolsoNumero.Text.Trim)
CvePrePolizaReembolsoNuevo = objConta.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) ' CvePrePolizaReembolsoNuevo = objConta.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not objCompras.AddComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, CvePrePolizaReembolsoNuevo, UsuarioActual.CveEmpresa) > 0 Then ' If Not objCompras.AddComprobacion(DdlRembolsoPersonal.SelectedValue.ToEntero, DdlRembolsoCajaChica.SelectedValue.ToEntero, TxtRembolsoNumero.Text.Trim, CvePrePolizaReembolsoNuevo, UsuarioActual.CveEmpresa) > 0 Then
ErrorProceso = True ' ErrorProceso = True
End If ' End If
' End If
' End If
' If NumeroReembolsoOriginal = "" And TxtRembolsoNumero.Text.Trim.Length > 0 Then
End If ' If objCompras.GetComprobacionPagosContabilizados(CvePersonalVal, CveCajaChicaVal, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then
End If
If NumeroReembolsoOriginal = "" And TxtRembolsoNumero.Text.Trim.Length > 0 Then ' If objCompras.DtResultados IsNot Nothing AndAlso objCompras.DtResultados.Rows.Count > 0 Then
' tienePagoContabilizado = True
' End If
If objCompras.GetComprobacionPagosContabilizados(CvePersonalVal, CveCajaChicaVal, TxtRembolsoNumero.Text.Trim, UsuarioActual.CveEmpresa) Then ' If tienePagoContabilizado Then
' Alert($"No se puede actualizar el número de reembolso {TxtRembolsoNumero.Text}, ya tiene pagos contabilizados.", TipoMensaje.MsgAdvertencia)
' Return False
' End If
If objCompras.DtResultados IsNot Nothing AndAlso objCompras.DtResultados.Rows.Count > 0 Then ' If objConta.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then
tienePagoContabilizado = True
End If
If tienePagoContabilizado Then ' Dim FolioPoliza As Integer = objConta.DtResultados.Rows(0)("FolioPoliza").ToString.ToEntero
Alert($"No se puede actualizar el número de reembolso {TxtRembolsoNumero.Text}, ya tiene pagos contabilizados.", TipoMensaje.MsgAdvertencia)
Return False
End If
' If FolioPoliza > 0 Then
' If Not objConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, False, UsuarioActual.CveEmpresa) Then
' ErrorProceso = True
' End If
' End If
' End If
' Else
' ErrorProceso = True
' End If
' ElseIf NumeroReembolsoOriginal.Length > 0 And TxtRembolsoNumero.Text.Trim.Length > 0 Then
' 'cambiar de prepoliza la compra actual, de la prepoliza actual a la nueva
' If Not objConta.PrePolizaCompraCambiaReembolso(CvePrePolizaReembolsoNuevo, CvePrePoliza, CveCompra, UsuarioActual.CveEmpresa, 1) Then
' ErrorProceso = True
' End If
' End If
' Else
If objConta.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then ' If NumeroReembolsoOriginal.Length > 0 And TxtRembolsoNumero.Text.Trim.Length = 0 Then
' 'Actualizar PrePoliza Actual de Donde CveCompra = CveCompra poner CvePrePolizaOriginal
' If Not objConta.PrePolizaCompraCambiaReembolso(-1, CvePrePoliza, CveCompra, UsuarioActual.CveEmpresa, 2) Then
' ErrorProceso = True
' End If
' End If
Dim FolioPoliza As Integer = objConta.DtResultados.Rows(0)("FolioPoliza").ToString.ToEntero ' End If
If FolioPoliza > 0 Then ' Return If(ErrorProceso, False, True)
If Not objConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, False, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
End If
End If
End If
Else
ErrorProceso = True
End If
ElseIf NumeroReembolsoOriginal.Length > 0 And TxtRembolsoNumero.Text.Trim.Length > 0 Then
'cambiar de prepoliza la compra actual, de la prepoliza actual a la nueva
If Not objConta.PrePolizaCompraCambiaReembolso(CvePrePolizaReembolsoNuevo, CvePrePoliza, CveCompra, UsuarioActual.CveEmpresa, 1) Then
ErrorProceso = True
End If
End If
Else
If NumeroReembolsoOriginal.Length > 0 And TxtRembolsoNumero.Text.Trim.Length = 0 Then
'Actualizar PrePoliza Actual de Donde CveCompra = CveCompra poner CvePrePolizaOriginal
If Not objConta.PrePolizaCompraCambiaReembolso(-1, CvePrePoliza, CveCompra, UsuarioActual.CveEmpresa, 2) Then
ErrorProceso = True
End If
End If
End If
Return If(ErrorProceso, False, True)
End Function
'End Function
Private Sub MandaCorreoActualizacionDetalle() Private Sub MandaCorreoActualizacionDetalle()
Dim DTCorreos As New DataTable Dim DTCorreos As New DataTable
Dim DTMovimientos As New DataTable Dim DTMovimientos As New DataTable
Dim strBody As New StringBuilder Dim strBody As New StringBuilder
@@ -9701,10 +9728,8 @@ Partial Class Compras_Compras
strBody.Append("<body>") strBody.Append("<body>")
strBody.Append($"<p> Se realizo una actualización en los detalles de la compra <a href='{URlCompleta}' >{SerieFolioCompra}</a> del proveedor {HplProveedor.Text}</p>") strBody.Append($"<p> Se realizo una actualización en los detalles de la compra <a href='{URlCompleta}' >{SerieFolioCompra}</a> del proveedor {HplProveedor.Text}</p>")
strBody.Append("</body>") strBody.Append("</body>")
strBody.Append("</html>") strBody.Append("</html>")
'' ENVIO DEL CORREO '' ENVIO DEL CORREO
Asunto = $"Actualizacion de Compra: {SerieFolioCompra} Proveedor: {HplProveedor.Text}" Asunto = $"Actualizacion de Compra: {SerieFolioCompra} Proveedor: {HplProveedor.Text}"
ArrayCC = "" ArrayCC = ""
@@ -9712,8 +9737,6 @@ Partial Class Compras_Compras
Dim Mail As New ClsSisMail() Dim Mail As New ClsSisMail()
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayCC) Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayCC)
End Sub End Sub
Private Function ComparaDatatables() As Boolean Private Function ComparaDatatables() As Boolean
@@ -9755,7 +9778,6 @@ Partial Class Compras_Compras
NumRow += 1 NumRow += 1
Next Next
Return True Return True
End Function End Function

View File

@@ -195,9 +195,7 @@ Partial Class Inventarios_CartaPorteManual
TxtFecha.Text = NowADS().ToShortDateString TxtFecha.Text = NowADS().ToShortDateString
CEFecha.EndDate = NowADS().AddDays(-1) CEFecha.EndDate = NowADS().AddDays(-1)
RVFecha.MaximumValue = NowADS().ToShortDateString RVFecha.MaximumValue = NowADS().ToShortDateString
Folio = 0 Folio = 0
CargaCombos() CargaCombos()
CreaDT() CreaDT()
@@ -222,7 +220,6 @@ Partial Class Inventarios_CartaPorteManual
End If End If
'If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then 'If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
' TxtFecha.Enabled = False ' TxtFecha.Enabled = False
@@ -233,7 +230,6 @@ Partial Class Inventarios_CartaPorteManual
End Sub End Sub
#Region "CARGA DATOS" #Region "CARGA DATOS"
Protected Sub CreaDT() Protected Sub CreaDT()
Dim dt As New DataTable Dim dt As New DataTable
@@ -247,8 +243,6 @@ Partial Class Inventarios_CartaPorteManual
dt.Columns.Add(column) dt.Columns.Add(column)
dt.Columns.Add("Cantidad", Type.GetType("System.Double")) dt.Columns.Add("Cantidad", Type.GetType("System.Double"))
dt.Columns.Add("CveUM", Type.GetType("System.Int32")) dt.Columns.Add("CveUM", Type.GetType("System.Int32"))
dt.Columns.Add("UnidadMedida") dt.Columns.Add("UnidadMedida")
@@ -265,8 +259,6 @@ Partial Class Inventarios_CartaPorteManual
dt.Columns.Add("Lote") dt.Columns.Add("Lote")
dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime")) dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
dt.Columns.Add("CveClasificacion", Type.GetType("System.Int32")) dt.Columns.Add("CveClasificacion", Type.GetType("System.Int32"))
dt.Columns.Add("EstatusExistencia") dt.Columns.Add("EstatusExistencia")
@@ -285,14 +277,10 @@ Partial Class Inventarios_CartaPorteManual
dt.Columns.Add("Embalaje") dt.Columns.Add("Embalaje")
dt.Columns.Add("PesoKg", Type.GetType("System.Decimal")) dt.Columns.Add("PesoKg", Type.GetType("System.Decimal"))
DtMovimientos = dt DtMovimientos = dt
CargaGvDatos() CargaGvDatos()
End Sub End Sub
Private Sub CargaCombos() Private Sub CargaCombos()
'CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, AplicaTodos:="") 'CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, AplicaTodos:="")
@@ -307,17 +295,12 @@ Partial Class Inventarios_CartaPorteManual
' TxtFechaEntrega.Text = NowADS().ToShortDateString ' TxtFechaEntrega.Text = NowADS().ToShortDateString
TxtFechaLlegada.Text = NowADS().ToShortDateString TxtFechaLlegada.Text = NowADS().ToShortDateString
CargaPS() CargaPS()
CargarCamiones() CargarCamiones()
End Sub End Sub
Private Sub CargaPS() Private Sub CargaPS()
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
DdlProducto2.setEsWebService(EsWS) DdlProducto2.setEsWebService(EsWS)
@@ -328,7 +311,12 @@ Partial Class Inventarios_CartaPorteManual
DdlProducto2.ddlWS.Attributes.Add("Data-onresult", "CargaExistenciaAlmacenes") DdlProducto2.ddlWS.Attributes.Add("Data-onresult", "CargaExistenciaAlmacenes")
End If End If
Else
DdlProducto2.ddl.Items.Clear()
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
DdlProducto2.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=-1, Estatus:=1, AplicaParaVenta:=-1)
DdlProducto2.ddl.DataBind()
DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If End If
End Sub End Sub

View File

@@ -2186,16 +2186,17 @@ Partial Class Inventarios_EntregaAlmacen
DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
'Esto es por que
Dim DdlCaducidadProducto As DropDownList = gvr.FCDropDownList("DdlCaducidadProducto") Dim DdlCaducidadProducto As DropDownList = gvr.FCDropDownList("DdlCaducidadProducto")
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c) If DdlCaducidadProducto.SelectedValue <> "" AndAlso DdlCaducidadProducto.SelectedValue <> "|" Then
Dim Lote As String = ArrayCaducidad(0) Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
Dim FechaCaducidad As String = ArrayCaducidad(1) Dim Lote As String = ArrayCaducidad(0)
Dim FechaCaducidad As String = ArrayCaducidad(1)
DtDatos.Rows(Index)("FechaCaducidad") = FechaCaducidad.ToDate
DtDatos.Rows(Index)("Lote") = Lote
DtDatos.Rows(Index)("FechaCaducidad") = FechaCaducidad.ToDate
DtDatos.Rows(Index)("Lote") = Lote
End If
Else Else
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text

View File

@@ -108,24 +108,25 @@
<asp:GridView ID="GvT" Width="100%" runat="server" GridLines="None" BorderWidth="0" data-heighterror="330" data-freezecols="0" CssClass="table table-advance table-hover mysmallbtn ScrollAD Widthall" <asp:GridView ID="GvT" Width="100%" runat="server" GridLines="None" BorderWidth="0" data-heighterror="330" data-freezecols="0" CssClass="table table-advance table-hover mysmallbtn ScrollAD Widthall"
ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False" OnRowDataBound="GvT_RowDataBound" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False" OnRowDataBound="GvT_RowDataBound"
DataKeyNames="CveTraspasoSolicitud,Folio,Fecha,CveUsuario,CveAlmacenOrigen,CveAlmacenDestino,CveTrasladoEstatus,PermisoOrigen,PermisoDestino,TraspasoEstatus,AlmacenOrigen,AlmacenDestino,Nombre,CveMovimientoAlmacen,FolioMovimiento,CveMovimientoTransitorio,CveAlmacenTransitorio,CveMomientoEntrada,CveMovimientoRelacionado" > DataKeyNames="CveTraspasoSolicitud,Folio,Fecha,CveUsuario,CveAlmacenOrigen,CveAlmacenDestino,CveTrasladoEstatus,PermisoOrigen,PermisoDestino,TraspasoEstatus,AlmacenOrigen,AlmacenDestino,Nombre,CveMovimientoAlmacen,FolioMovimiento,CveMovimientoTransitorio,CveAlmacenTransitorio,CveMovientoEntrada,CveMovimientoRelacionado" >
<Columns> <Columns>
<asp:BoundField DataField="Folio" HeaderText="Folio" ItemStyle-Width="80px" /> <asp:BoundField DataField="Folio" HeaderText="Folio" ItemStyle-Width="80px" />
<asp:BoundField DataField="AlmacenOrigen" HeaderText="Origen" ItemStyle-Width="200px" /> <asp:BoundField DataField="AlmacenOrigen" HeaderText="Origen" />
<asp:BoundField DataField="AlmacenDestino" HeaderText="Destino" ItemStyle-Width="200px" /> <asp:BoundField DataField="AlmacenDestino" HeaderText="Destino" />
<asp:BoundField DataField="Observaciones" HeaderText="Observaciones" /> <asp:BoundField DataField="Observaciones" HeaderText="Observaciones" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-Width="90px" DataFormatString="{0:d}" /> <asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-Width="80px" DataFormatString="{0:d}" />
<asp:BoundField DataField="Nombre" HeaderText="Solicitante" /> <asp:BoundField DataField="Nombre" HeaderText="Solicitante" />
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Estatus" ItemStyle-Width="70px" > <asp:TemplateField HeaderText="Estatus" ItemStyle-Width="70px" >
<ItemTemplate> <ItemTemplate>
<asp:Label runat="server" ID="LblTraspasoEstatus" Width="70px" Height="15px" Text='<%# Eval("TraspasoEstatus") %>'></asp:Label> <asp:Label runat="server" ID="LblTraspasoEstatus" Width="70px" Height="15px" Text='<%# Eval("TraspasoEstatus") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveMovimientoAlmacen" DataNavigateUrlFormatString="~/Inventarios/EntradasSalidas.aspx?CveMovimiento={0} " <asp:HyperLinkField DataNavigateUrlFields="CveMovimientoAlmacen" DataNavigateUrlFormatString="~/Inventarios/EntradasSalidas.aspx?CveMovimiento={0} "
Target="_blank" ItemStyle-Width="5%" HeaderText="Movimiento" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="FolioMovimiento" /> Target="_blank" HeaderText="Movimiento" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Center" DataTextField="FolioMovimiento" />
<asp:BoundField DataField="RecibidaSolicitada" HeaderText="Cantidades" ItemStyle-HorizontalAlign="Right"/>
<%--<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="100px"> <%--<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="100px">
<ItemTemplate> <ItemTemplate>
<div class="row"> <div class="row">

View File

@@ -758,7 +758,7 @@ Partial Class Inventarios_TrasladoSolicitud
Dim CveMovimientoTransitorio As Integer = e.Row.DataKey("CveMovimientoTransitorio").ToEntero Dim CveMovimientoTransitorio As Integer = e.Row.DataKey("CveMovimientoTransitorio").ToEntero
Dim CveAlmacenTransitorio As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero Dim CveAlmacenTransitorio As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero
Dim CveMomientoEntrada As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero ' Este es el movmiento de recepcion de traspaso 'Dim CveMovimientoEntrada As Integer = e.Row.DataKey("CveAlmacenTransitorio").ToEntero ' Este es el movmiento de recepcion de traspaso
e.Row.FCLinkButton("LnkMostrarTraspaso").Visible = True e.Row.FCLinkButton("LnkMostrarTraspaso").Visible = True

View File

@@ -124,7 +124,7 @@ Partial Class Portal_PortalProveedor
#Region "C A R G A - D A T O S" #Region "C A R G A - D A T O S"
Protected Sub CargaDatos() Protected Sub CargaDatos()
GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}")
Dim ObjProveedor As New ClsCompProveedores() Dim ObjProveedor As New ClsCompProveedores()
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, UsuarioActual.CveEmpresa) Then If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, UsuarioActual.CveEmpresa) Then
If ObjProveedor.DtResultados.Rows.Count > 0 Then If ObjProveedor.DtResultados.Rows.Count > 0 Then
@@ -259,7 +259,7 @@ Partial Class Portal_PortalProveedor
Private Sub CargaBancos(SerieSucursal As String, SelectTop As Integer) Private Sub CargaBancos(SerieSucursal As String, SelectTop As Integer)
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
'CxC Activas 'CxC Activas
If ObjMovtos.GetProveedorBancos(CveProveedor, CveProveedorSucursal:=-1, SelectTop:=SelectTop) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then If ObjMovtos.GetProveedorBancos(CveProveedor, UsuarioActual.CveEmpresa, CveProveedorSucursal:=-1, SelectTop:=SelectTop) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then
GvBancos.DataSource = ObjMovtos.DtResultados GvBancos.DataSource = ObjMovtos.DtResultados
BtnVerMasBancos.Visible = ObjMovtos.DtResultados.Rows.Count > 19 BtnVerMasBancos.Visible = ObjMovtos.DtResultados.Rows.Count > 19
DtBancos = ObjMovtos.DtResultados DtBancos = ObjMovtos.DtResultados

View File

@@ -33,11 +33,11 @@
<asp:UpdatePanel runat="server" ID="Updatos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="Updatos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet light smmallpadding bordered" id="portlet19"> <div class="portlet light smallpadding bordered" id="portlet19">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Filtros</span> <span class="caption-subject bold uppercase">Filtros<asp:Label ID="LblNumero" runat="server" Text=""></asp:Label></span>
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a> <a href="javascript:;" class="collapse" data-original-title="" title=""></a>

View File

@@ -87,6 +87,7 @@ Partial Class SessionesActivas
dtF.Rows.Add(row.ItemArray()) dtF.Rows.Add(row.ItemArray())
End If End If
Next Next
dtU.Dispose() dtU.Dispose()
Dim GroupBy1 As String() = {"CveEmpresa", "Empresa"} Dim GroupBy1 As String() = {"CveEmpresa", "Empresa"}
DdlEmpresa.DataSource = dtF.FiltraParametros("", "", {"CveEmpresa", "Empresa"}) DdlEmpresa.DataSource = dtF.FiltraParametros("", "", {"CveEmpresa", "Empresa"})
@@ -94,6 +95,8 @@ Partial Class SessionesActivas
dtF = dtF.GroupByDT(filtros, "", {GroupBy1}, Nothing, Nothing,) dtF = dtF.GroupByDT(filtros, "", {GroupBy1}, Nothing, Nothing,)
GVDatos.DataSource = dtF GVDatos.DataSource = dtF
GVDatos.DataBind() GVDatos.DataBind()
LblNumero.Text = $" ({dtF.COUNT("CveUsuario", "CveUsuario > 0")})"
objUsuarios.Dispose() objUsuarios.Dispose()
End Sub End Sub
Protected Sub GVDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GVDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)

View File

@@ -379,10 +379,9 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-md-4">Es Presupuestal</label> <label class="col-md-4">NO Requiere Unidad</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:CheckBox runat="server" ID="ChkEsPresupuestal" CssClass="make-switchsd" data-size="small" Checked="true" /> <asp:CheckBox runat="server" ID="ChkEsPresupuestal" Checked="true" />
</div> </div>
</div> </div>
</div> </div>
@@ -419,8 +418,7 @@
<div class="col-md-12" style="text-align: center;"> <div class="col-md-12" style="text-align: center;">
<asp:UpdatePanel ID="UpPagos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpPagos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row" runat="server" id="DVFactura">
<div class="row" runat="server" visible="false" id="DVFactura">
<label class="col-md-2">Factura: </label> <label class="col-md-2">Factura: </label>
<div class="col-md-3"> <div class="col-md-3">
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink> <asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>

View File

@@ -7,8 +7,6 @@ Imports System.IO
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Partial Class RepContratoDetalle Partial Class RepContratoDetalle
Inherits ClsPaginas Inherits ClsPaginas
#Region "Propiedades" #Region "Propiedades"
@@ -279,18 +277,8 @@ Partial Class RepContratoDetalle
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-light"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveContrato:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveContrato) LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-light"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveContrato:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveContrato)
CargaEventoBitacora() CargaEventoBitacora()
End If End If
If CveVentaRemision > 0 Then
DVFactura.Visible = True
ChkEsPresupuestal.Enabled = False
ChkEsPresupuestal.Checked = False
End If
End If End If
End Sub End Sub
Private Sub InicializaCombos() Private Sub InicializaCombos()
'Lista Tipo AF 'Lista Tipo AF
@@ -325,16 +313,12 @@ Partial Class RepContratoDetalle
DdlVendedor.Enabled = False DdlVendedor.Enabled = False
End If End If
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
CargaDatosContrato() CargaDatosContrato()
CargaDatosViajes() CargaDatosViajes()
'Información General 'Información General
End Sub End Sub
Private Sub CargaDatosContrato() Private Sub CargaDatosContrato()
@@ -440,7 +424,6 @@ Partial Class RepContratoDetalle
UpTabContainer.Update() UpTabContainer.Update()
End Sub End Sub
#End Region #End Region
Protected Sub DdlUsuarioFiltroBoletos_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlUsuarioFiltroBoletos_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatosViajes() CargaDatosViajes()
@@ -478,8 +461,6 @@ Partial Class RepContratoDetalle
Filename = fileItem.filename Filename = fileItem.filename
Next Next
If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
If Filename <> "" Then If Filename <> "" Then
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
@@ -499,7 +480,6 @@ Partial Class RepContratoDetalle
CargaEventoBitacora() CargaEventoBitacora()
UPAddEventoBitacora.Update() UPAddEventoBitacora.Update()
End Sub End Sub
Private Sub CargaEventoBitacora() Private Sub CargaEventoBitacora()
If CveContrato > 0 Then If CveContrato > 0 Then
@@ -515,8 +495,6 @@ Partial Class RepContratoDetalle
End If End If
End Sub End Sub
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs) Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument) Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
Dim Archivo As New System.IO.FileInfo(filePath) Dim Archivo As New System.IO.FileInfo(filePath)
@@ -578,8 +556,6 @@ Partial Class RepContratoDetalle
BtnDescargar.Visible = True BtnDescargar.Visible = True
End If End If
End Sub End Sub
Public Function ObtenerUrlCompleta() As String Public Function ObtenerUrlCompleta() As String
Dim Solicitud As HttpRequest = HttpContext.Current.Request Dim Solicitud As HttpRequest = HttpContext.Current.Request
@@ -589,7 +565,6 @@ Partial Class RepContratoDetalle
url &= ":" & Solicitud.Url.Port url &= ":" & Solicitud.Url.Port
End If End If
url &= Solicitud.ApplicationPath url &= Solicitud.ApplicationPath
If Not url.EndsWith("/") Then If Not url.EndsWith("/") Then
@@ -599,15 +574,12 @@ Partial Class RepContratoDetalle
Return url Return url
End Function End Function
Protected Sub UpdateContrato(sender As Object, e As EventArgs) Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim ArchivoUpdate As String = "-1" Dim ArchivoUpdate As String = "-1"
Dim ErrorProceso As Boolean = False Dim ErrorProceso As Boolean = False
Dim SeGeneroRemision As Boolean = False Dim SeGeneroRemision As Boolean = False
Dim SerieFolioRemision As String = "" Dim SerieFolioRemision As String = ""
If Session("FileExtension").ToString <> "" Then If Session("FileExtension").ToString <> "" Then
'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}" 'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}"
ArchivoUpdate = $".{Session("FileExtension").ToString}" ArchivoUpdate = $".{Session("FileExtension").ToString}"
Else Else
@@ -617,7 +589,6 @@ Partial Class RepContratoDetalle
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
If Not ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", If Not ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkEsPresupuestal.Checked, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkEsPresupuestal.Checked, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
@@ -639,24 +610,24 @@ Partial Class RepContratoDetalle
End If End If
End If End If
If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then 'If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then
'CveVentaRemision ' 'CveVentaRemision
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}" ' Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
Dim Respuesta As New RespuestaFacturacion() ' Dim Respuesta As New RespuestaFacturacion()
Dim CvePS As Integer = 907784 ' Dim CvePS As Integer = 907784
Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero) ' Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero)
If Respuesta.CveVenta > 0 Then ' If Respuesta.CveVenta > 0 Then
CveVentaRemision = Respuesta.CveVenta ' CveVentaRemision = Respuesta.CveVenta
SerieFolioRemision = Respuesta.SerieFolio ' SerieFolioRemision = Respuesta.SerieFolio
ErrorProceso = False ' ErrorProceso = False
SeGeneroRemision = True ' SeGeneroRemision = True
Else ' Else
ErrorProceso = True ' ErrorProceso = True
Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia) ' Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
End If ' End If
End If 'End If
If Not ErrorProceso Then If Not ErrorProceso Then
ObjContratos.Commit() ObjContratos.Commit()

View File

@@ -119,8 +119,8 @@
<%-- Centro de Costos --%> <%-- Centro de Costos --%>
<label class="col-md-1 truncate ">Centro de Costos</label> <label class="col-md-1 truncate ">Centro de Costos</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlCentroCostos" data-text="Todos" AppendDataBoundItems="true" <asp:DropDownList ID="DdlCentroCostos" data-text="Todos" AppendDataBoundItems="true"
DataTextField="" DataValueField="" CssClass="form-control ddlFiltros input-sm select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me"
Style="width: 100%;" runat="server"> Style="width: 100%;" runat="server">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
@@ -204,6 +204,11 @@
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal> <asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Rem/Invoice" >
<ItemTemplate>
<asp:HyperLink ID="HplRem" runat="server" NavigateUrl='<%#Eval("CveVentaRemision", "/Ventas/Ventas.aspx?CveVenta={0}") %>' Text='<%# Eval("RemisionSerieFolio") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<%-- Columnas Ocultas --%> <%-- Columnas Ocultas --%>
<asp:TemplateField HeaderText="Chofer 1" Visible="false"> <asp:TemplateField HeaderText="Chofer 1" Visible="false">
@@ -223,6 +228,7 @@
<asp:Literal ID="LtUnidad" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal> <asp:Literal ID="LtUnidad" runat="server" Text='<%# Eval("NombreAF") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="F. Ingreso" > <asp:TemplateField HeaderText="F. Ingreso" >
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtFingreso" runat="server" Text='<%# Eval("FechaIng","{0:d}") %>'></asp:Literal> <asp:Literal ID="LtFingreso" runat="server" Text='<%# Eval("FechaIng","{0:d}") %>'></asp:Literal>
@@ -508,15 +514,12 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4">Es Presupuestal</label> <label class="col-md-6">NO Requiere Unidad</label>
<div class="col-md-8"> <div class="col-md-6">
<asp:CheckBox runat="server" ID="ChkEsPresupuestal" CssClass="make-switchsd" data-size="small" Checked="true" /> <asp:CheckBox runat="server" ID="ChkEsPresupuestal" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -51,7 +51,7 @@ Partial Class ListadoContratos
DdlEstatus.DataBind() DdlEstatus.DataBind()
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1")) DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoModal) CargarCentrosDeCosto(Nothing, DdlCentroCostos, Nothing, LblSubProyectoModal)
DdlSubProyectoModal.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa) DdlSubProyectoModal.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa)
DdlSubProyectoModal.DataBind() DdlSubProyectoModal.DataBind()
@@ -180,7 +180,7 @@ Partial Class ListadoContratos
End If End If
Anexo.Text = "" Anexo.Text = ""
If ErrorProceso = False AndAlso Not ChkEsPresupuestal.Checked Then If ErrorProceso = False Then
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{LbFolio.Text}" Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{LbFolio.Text}"

View File

@@ -296,7 +296,7 @@
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right"> <div class="row" style="margin-right: 10px; margin-top: 8px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
@@ -317,7 +317,6 @@
<HeaderTemplate> <HeaderTemplate>
Fecha<br /> Fecha<br />
Salida Salida
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlFechaI" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy HH:mm}") %>'></asp:Literal> <asp:Literal ID="LtlFechaI" runat="server" Text='<%# Eval("FechaInicial", "{0:dd/MM/yyyy HH:mm}") %>'></asp:Literal>
@@ -775,12 +774,15 @@
<script > <script >
var chartHeader; var chartHeader;
var chartBody; var chartBody;
function cargaDiagramaGrantAMC4(data, categorias, TipoVista) { function cargaDiagramaGrantAMC4(data, categorias, TipoVista) {
try {
// Si ya hay gráficos, eliminarlos para crear nuevos // Si ya hay gráficos, eliminarlos para crear nuevos
if (chartHeader) { if (chartHeader) {
chartHeader.dispose(); chartHeader.dispose();
@@ -1009,9 +1011,10 @@
chartHeader.validateLayout(); chartHeader.validateLayout();
}); });
}
catch (error) {
console.error(error);
}
} }
function cargaDiagramaGrant(data, categorias, TipoVista) { function cargaDiagramaGrant(data, categorias, TipoVista) {

View File

@@ -189,27 +189,14 @@ Partial Class RepContratosCalendario
End Sub End Sub
Private Sub CargaCronograma(Optional TipoVista As Integer = -1) Private Sub CargaCronograma(Optional TipoVista As Integer = -1)
If DtAvance IsNot Nothing Then If DtAvance IsNot Nothing Then
Dim strData As New StringBuilder Dim strData As New StringBuilder
Dim strAFData As New StringBuilder Dim strAFData As New StringBuilder
'Dim separator As String = ""
'Dim str As New StringBuilder()
'str.AppendLine("datosGant=[")
Dim StrFiltro As String = "" Dim StrFiltro As String = ""
If DdlTipoUnidad.SelectedValue.ToEntero > 0 Then StrFiltro = " AND CveTipoActivoFijo = " & DdlTipoUnidad.SelectedValue If DdlTipoUnidad.SelectedValue.ToEntero > 0 Then StrFiltro = " AND CveTipoActivoFijo = " & DdlTipoUnidad.SelectedValue
Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3) " & StrFiltro, Orderby:=" TipoActivoFijo ASC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"}) Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3) " & StrFiltro, Orderby:=" TipoActivoFijo ASC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"})
Dim jsonData As New JArray() Dim jsonData As New JArray()
Dim jsonCategorias As New JArray() Dim jsonCategorias As New JArray()
Dim random = New Random() Dim random = New Random()
'DATOS 'DATOS
@@ -237,11 +224,11 @@ Partial Class RepContratosCalendario
Dim FF As Date = Row("FechaFinal").ToString.ToDate Dim FF As Date = Row("FechaFinal").ToString.ToDate
strData.AppendLine("{") strData.AppendLine("{")
strData.AppendLine($"category: '{Row("CodigoAF").ToString}',") strData.AppendLine($"category: '{Row("CodigoAF").ToString.Replace("'", "")}',")
strData.AppendLine($"fromDate: '{FI.ToString("yyyy-MM-dd HH:mm:ss")}',") strData.AppendLine($"fromDate: '{FI.ToString("yyyy-MM-dd HH:mm:ss")}',")
strData.AppendLine($"toDate: '{FF.ToString("yyyy-MM-dd HH:mm:ss")}',") strData.AppendLine($"toDate: '{FF.ToString("yyyy-MM-dd HH:mm:ss")}',")
'strData.AppendLine($"columnSettings: {{fill: '{String.Format("#{0:X6}", random.Next(16777216))}'}},") 'strData.AppendLine($"columnSettings: {{fill: '{String.Format("#{0:X6}", random.Next(16777216))}'}},")
strData.AppendLine($"unidad: '{Row("NombreAF").ToString}',") strData.AppendLine($"unidad: '{Row("NombreAF").ToString.Replace("'", "")}',")
strData.AppendLine($"color: am4core.color('" & String.Format("#{0:X6}", random.Next(16777216)) & "'),") strData.AppendLine($"color: am4core.color('" & String.Format("#{0:X6}", random.Next(16777216)) & "'),")
strData.AppendLine($"cveContrato: {Row("CveContrato").ToString.ToEntero},") strData.AppendLine($"cveContrato: {Row("CveContrato").ToString.ToEntero},")
strData.AppendLine($"contrato: '{Row("NumeroContrato").ToString}',") strData.AppendLine($"contrato: '{Row("NumeroContrato").ToString}',")
@@ -249,7 +236,6 @@ Partial Class RepContratosCalendario
strData.AppendLine($"cliente: '{Row("NombreComercial").ToString.Replace("'", "")}'") strData.AppendLine($"cliente: '{Row("NombreComercial").ToString.Replace("'", "")}'")
strData.AppendLine("},") strData.AppendLine("},")
strAF.AppendFormat("{0},", Row("CveAF")) strAF.AppendFormat("{0},", Row("CveAF"))
'uniad contrato y duracion 'uniad contrato y duracion
@@ -275,16 +261,15 @@ Partial Class RepContratosCalendario
New JProperty("category", Row("Codigo")) New JProperty("category", Row("Codigo"))
) )
jsonCategorias.Add(obj) jsonCategorias.Add(obj)
strAFData.AppendLine("{") strAFData.AppendLine("{")
strAFData.AppendLine($"category: '{Row("Codigo").ToString}',") strAFData.AppendFormat("category: '{0}'", Row("Codigo"))
strAFData.AppendLine("},") strAFData.AppendLine("},")
Next Next
strAFData.AppendLine("{}]") strAFData.AppendLine("{}]")
'RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", $"{random.Next(16777216)}") 'RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", $"{random.Next(16777216)}")
RegistraScript($"cargaDiagramaGrantAMC4({strData.ToString().Replace(",{}", "")},{strAFData.ToString().Replace(",{}", "")},{TipoVista});", $"{random.Next(16777216)}") RegistraScript($" cargaDiagramaGrantAMC4({strData.ToString().Replace(",{}", "")},{strAFData.ToString().Replace(",{}", "")},{TipoVista}); ", random.Next(16777216).ToString)
UPPGantt.Update() UPPGantt.Update()
UPGat.Update() UPGat.Update()
@@ -562,8 +547,6 @@ Partial Class RepContratosCalendario
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BGC_Atencion) e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BGC_Atencion)
End If End If
End If End If
End If End If
End Sub End Sub
@@ -893,7 +876,7 @@ Partial Class RepContratosCalendario
'End If 'End If
DdlAF.DataBind() DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "-1")) DdlAF.Items.Insert(0, New ListItem("-", "0")) 'DEBE DE SER CERO, SI SE QUIERE QUITAR LA UNIDAD
UpModal.Update() UpModal.Update()
End Sub End Sub

View File

@@ -990,20 +990,17 @@ Partial Class Ventas_ActualizarPrecios
For Each GvRow As GridViewRow In GvMultiple.Rows For Each GvRow As GridViewRow In GvMultiple.Rows
If GvRow.FCCheckBox("chkPS").Checked Then If GvRow.FCCheckBox("chkPS").Checked Then
For colIndex As Integer = 2 To GvRow.Cells.Count - 1 For colIndex As Integer = 2 To GvRow.Cells.Count - 3
Dim indiceColumna As Integer = (colIndex) Dim indiceColumna As Integer = (colIndex)
Dim CvePS As Integer = DtPreciosMultiple.Rows(GvRow.RowIndex)("CvePS").ToString().ToEntero()
Dim LtlId As String = "LtlLista_" + (colIndex - 1).ToString() Dim LtlId As String = "LtlLista_" + (colIndex - 1).ToString()
Dim TxtId As String = "TxtPrecio_" + (colIndex - 1).ToString() Dim TxtId As String = "TxtPrecio_" + (colIndex - 1).ToString()
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
Dim CvePrecioLista As Integer = GvMultiple.HeaderRow.FCLabel(LtlId).Attributes().Item("cvepreciolista").ToEntero() Dim CvePrecioLista As Integer = GvMultiple.HeaderRow.FCLabel(LtlId).Attributes().Item("cvepreciolista").ToEntero()
Dim CvePS As Integer = DtPreciosMultiple.Rows(GvRow.RowIndex)("CvePS").ToString().ToEntero()
Dim Precio As Decimal = GvRow.FCTextBox(TxtId).Text.ToDecimal() Dim Precio As Decimal = GvRow.FCTextBox(TxtId).Text.ToDecimal()
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True) TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
If Not TieneError Then If Not TieneError Then

View File

@@ -1282,9 +1282,9 @@
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val(); let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
//si es con.nc,es.el.total //si es con.nc,es.el.total
let Total = ToDouble($get("C_LtlSaldo").value); let Total = ToDouble($get("C_LtlSaldo").value.replace(",",""));
let SaldoCompra = parseFloat(parseFloat($get("C_LtlSaldo").value).toFixed(2)); let SaldoCompra = parseFloat(parseFloat($get("C_LtlSaldo").value.replace(",", "")).toFixed(2));
if (t.checked) { if (t.checked) {
@@ -1319,13 +1319,13 @@
function FnCambiaAnt(chk, txt, saldo) { function FnCambiaAnt(chk, txt, saldo) {
let Total = ToDouble($get("C_LtlSaldo").value);// ToDouble($get('TxtSubTotal').value); let Total = ToDouble($get("C_LtlSaldo").value.replace(",", ""));// ToDouble($get('TxtSubTotal').value);
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val(); let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
let importeTxt = parseFloat(txt.value.replace(/,/g, '')); let importeTxt = parseFloat(txt.value.replace(/,/g, ''));
if (TipoAnticipo == '4') { if (TipoAnticipo == '4') {
Total = ToDouble($get("C_LtlSaldo").value); Total = ToDouble($get("C_LtlSaldo").value.replace(",", ""));
} }
if (isNaN(importeTxt)) { if (isNaN(importeTxt)) {

View File

@@ -758,123 +758,122 @@ Partial Class Ventas_PVCobranza
Private Function GenerarFactura(ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura Private Function GenerarFactura(ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim DtRemisiones As New DataTable
DtRemisiones.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
DtRemisiones.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
DtRemisiones.Rows.Add({VentaRemision.CveVenta, VentaRemision.SerieFolio})
Dim RemisionesLista As New List(Of Integer)
RemisionesLista.Add(VentaRemision.CveVenta)
Dim DtRemisionesPS As New DataTable()
Dim DtPagosFacturaGlobal As New DataTable()
If ObjClientes.GetVentasRemisionesTotales(VentaRemision.CveCliente, VentaRemision.CveVenta.ToString(), 1, UsuarioActual.CveEmpresa) Then
DtRemisionesPS = ObjClientes.DtResultados.Copy()
End If
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, VentaRemision.CveSubProyecto, VentaRemision.CveCliente, VentaRemision.CveMoneda, "Ing")
ObjFactura.RemisionesLista = RemisionesLista
ObjFactura.DtRemisionesPS = DtRemisionesPS
ObjFactura.DtRemisiones = DtRemisiones
Dim DtPagos As DataTable = New DataTable("DtPagosFactura")
DtPagos.Columns.Add(New DataColumn("CveFormaPago", GetType(Integer)))
DtPagos.Columns.Add(New DataColumn("Importe", GetType(Decimal)))
If TxtImporteCredito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({4, TxtImporteCredito.Text.ToDecimal})
End If
If TxtImporteDebito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({18, TxtImporteDebito.Text.ToDecimal})
End If
If TxtImporteCheque.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({2, TxtImporteCheque.Text.ToDecimal})
End If
If TxtImporteTransferencia.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({3, TxtImporteTransferencia.Text.ToDecimal})
End If
If TxtImporteEfectivo.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({1, TxtImporteEfectivo.Text.ToDecimal})
End If
Dim PagoMaximo = DtPagos.MAX("Importe")
Dim CveFormaPago As Integer = DtPagos.FiltroPrimeroValor("CveFormaPago", $"Importe = {PagoMaximo}").ToEntero()
If CveFormaPago > 0 Then
ObjFactura.CveFormaPago33 = CveFormaPago
ObjFactura.CveMetodoPago33 = 1
End If
For Each Dr As DataRow In ObjFactura.DtRemisionesPS.Rows
ObjFactura.AgregarPS(Dr("CvePS").ToString().ToEntero(), Dr("Cantidad").ToString().ToDecimal(), Dr("PU").ToString().ToDecimal(), Dr("Descuento").ToString().ToDecimal, Dr("Obs").ToString(), CveUM:=Dr("CveUM").ToString().ToEntero(),
CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(),
PorcentajeIVA:=Dr("PorcentajeIVA").ToString().ToDecimal())
Next
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
ObjFactura.GenerarSalidaAlmacen = True
ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Copy()
ObjFactura.CveAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {VentaRemision.CveSubProyecto}", "Orden").ToString().ToEntero()
End If
ObjFactura.CalculaTotales()
ObjFactura.PreparaTimbre()
If HdnTipoAmortizacion.Value = "4" Then
Dim DtAnticipos As New DataTable()
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))
DtAnticipos.Columns.Add("CveIE", GetType(Integer))
DtAnticipos.Columns.Add("FolioFiscal", GetType(String))
DtAnticipos.Columns.Add("Descuentos", GetType(Decimal))
DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal))
DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
Dim CveVenta = GvRow.DataKey("CveVenta").ToEntero()
Dim Importe = GvRow.FCTextBox(String.Format("TxtAnticipo{0}", GvRow.RowIndex)).Text.ToDecimal()
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
End If
Next
ObjFactura.EsNCAmortizacion = True
ObjFactura.CveTipoAmortizacionAnticipo = 4
ObjFactura.DtAnticiposAplicados = DtAnticipos
End If
Dim SbAlert As New StringBuilder() Dim SbAlert As New StringBuilder()
Try Try
Dim DtRemisiones As New DataTable
DtRemisiones.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
DtRemisiones.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
DtRemisiones.Rows.Add({VentaRemision.CveVenta, VentaRemision.SerieFolio})
Dim RemisionesLista As New List(Of Integer)
RemisionesLista.Add(VentaRemision.CveVenta)
Dim DtRemisionesPS As New DataTable()
Dim DtPagosFacturaGlobal As New DataTable()
If ObjClientes.GetVentasRemisionesTotales(VentaRemision.CveCliente, VentaRemision.CveVenta.ToString(), 1, UsuarioActual.CveEmpresa) Then
DtRemisionesPS = ObjClientes.DtResultados.Copy()
End If
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, VentaRemision.CveSubProyecto, VentaRemision.CveCliente, VentaRemision.CveMoneda, "Ing")
ObjFactura.RemisionesLista = RemisionesLista
ObjFactura.DtRemisionesPS = DtRemisionesPS
ObjFactura.DtRemisiones = DtRemisiones
Dim DtPagos As DataTable = New DataTable("DtPagosFactura")
DtPagos.Columns.Add(New DataColumn("CveFormaPago", GetType(Integer)))
DtPagos.Columns.Add(New DataColumn("Importe", GetType(Decimal)))
If TxtImporteCredito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({4, TxtImporteCredito.Text.ToDecimal})
End If
If TxtImporteDebito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({18, TxtImporteDebito.Text.ToDecimal})
End If
If TxtImporteCheque.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({2, TxtImporteCheque.Text.ToDecimal})
End If
If TxtImporteTransferencia.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({3, TxtImporteTransferencia.Text.ToDecimal})
End If
If TxtImporteEfectivo.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({1, TxtImporteEfectivo.Text.ToDecimal})
End If
Dim PagoMaximo = DtPagos.MAX("Importe")
Dim CveFormaPago As Integer = DtPagos.FiltroPrimeroValor("CveFormaPago", $"Importe = {PagoMaximo}").ToEntero()
If CveFormaPago > 0 Then
ObjFactura.CveFormaPago33 = CveFormaPago
ObjFactura.CveMetodoPago33 = 1
End If
For Each Dr As DataRow In ObjFactura.DtRemisionesPS.Rows
ObjFactura.AgregarPS(Dr("CvePS").ToString().ToEntero(), Dr("Cantidad").ToString().ToDecimal(), Dr("PU").ToString().ToDecimal(), Dr("Descuento").ToString().ToDecimal, Dr("Obs").ToString(), CveUM:=Dr("CveUM").ToString().ToEntero(),
CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(),
PorcentajeIVA:=Dr("PorcentajeIVA").ToString().ToDecimal())
Next
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
ObjFactura.GenerarSalidaAlmacen = True
ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Copy()
ObjFactura.CveAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {VentaRemision.CveSubProyecto}", "Orden").ToString().ToEntero()
End If
ObjFactura.CalculaTotales()
ObjFactura.PreparaTimbre()
If HdnTipoAmortizacion.Value = "4" Then
Dim DtAnticipos As New DataTable()
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))
DtAnticipos.Columns.Add("CveIE", GetType(Integer))
DtAnticipos.Columns.Add("FolioFiscal", GetType(String))
DtAnticipos.Columns.Add("Descuentos", GetType(Decimal))
DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal))
DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
Dim CveVenta = GvRow.DataKey("CveVenta").ToEntero()
Dim Importe = GvRow.FCTextBox(String.Format("TxtAnticipo{0}", GvRow.RowIndex)).Text.ToDecimal()
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
End If
Next
ObjFactura.EsNCAmortizacion = True
ObjFactura.CveTipoAmortizacionAnticipo = 4
ObjFactura.DtAnticiposAplicados = DtAnticipos
End If
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True) Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjFactura Retorno.Factura = ObjFactura
@@ -944,81 +943,85 @@ Partial Class Ventas_PVCobranza
Private Function GenerarNC(ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura Private Function GenerarNC(ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim ObjNC = Modelos.Factura.CrearVentaNueva(UsuarioActual, Venta.CveSubProyecto, Venta.CveCliente, Venta.CveMoneda, "Egs")
Dim Total As Decimal = TxtNCDev.Text.ToDecimal()
Dim subTotal As Decimal = (Total / (1D + Venta.PorcentajeIVA))
'Dim IVA = (subTotal * Factura.PorcentajeIVA).RoundSQL(2)
Dim PU As Decimal = subTotal
Dim Cantidad As Decimal = 1D
Dim Descuento As Decimal = 0
Dim Obs = ""
ObjNC.AgregarPS(DdlNCPSAnt.SelectedValue.ToEntero(), Cantidad, PU, Descuento, Obs, CveSubProyecto:=Venta.CveSubProyecto, PorcentajeIVA:=Venta.PorcentajeIVA)
ObjNC.CalculaTotales()
Dim DtVentasNC = New DataTable
DtVentasNC.Columns.Add("CveVenta", GetType(Integer))
DtVentasNC.Columns.Add("Importe", GetType(Decimal))
DtVentasNC.Columns.Add("FolioFiscal", GetType(String))
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TC", .DataType = GetType(Decimal), .DefaultValue = 1})
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TCCambioValuacion", .DataType = GetType(Decimal), .DefaultValue = 1})
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
DtVentasNC.Rows.Add(Venta.CveVenta, Total, "")
ObjNC.DtVentasNC = DtVentasNC
Dim DtVentasRelacionadas As New DataTable()
DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
DtVentasRelacionadas.Rows.Add(Venta.CveVenta)
ObjNC.DtVentasRelacionadas = DtVentasRelacionadas
Dim DtAnticipos As New DataTable()
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))
DtAnticipos.Columns.Add("CveIE", GetType(Integer))
DtAnticipos.Columns.Add("FolioFiscal", GetType(String))
DtAnticipos.Columns.Add("Descuentos", GetType(Decimal))
DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal))
DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
Dim CveVenta = GvRow.DataKey("CveVenta").ToEntero()
Dim Importe = GvRow.FCTextBox(String.Format("TxtAnticipo{0}", GvRow.RowIndex)).Text.ToDecimal()
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
End If
Next
ObjNC.EsNCAmortizacion = True
ObjNC.CveTipoAmortizacionAnticipo = 2
ObjNC.DtAnticiposAplicados = DtAnticipos
ObjNC.PreparaTimbre()
Dim SbAlert As New StringBuilder() Dim SbAlert As New StringBuilder()
Try Try
Dim ObjNC = Modelos.Factura.CrearVentaNueva(UsuarioActual, Venta.CveSubProyecto, Venta.CveCliente, Venta.CveMoneda, "Egs")
Dim Total As Decimal = TxtNCDev.Text.ToDecimal()
Dim subTotal As Decimal = (Total / (1D + Venta.PorcentajeIVA))
'Dim IVA = (subTotal * Factura.PorcentajeIVA).RoundSQL(2)
Dim PU As Decimal = subTotal
Dim Cantidad As Decimal = 1D
Dim Descuento As Decimal = 0
Dim Obs = ""
ObjNC.AgregarPS(DdlNCPSAnt.SelectedValue.ToEntero(), Cantidad, PU, Descuento, Obs, CveSubProyecto:=Venta.CveSubProyecto, PorcentajeIVA:=Venta.PorcentajeIVA)
ObjNC.CalculaTotales()
Dim DtVentasNC = New DataTable
DtVentasNC.Columns.Add("CveVenta", GetType(Integer))
DtVentasNC.Columns.Add("Importe", GetType(Decimal))
DtVentasNC.Columns.Add("FolioFiscal", GetType(String))
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TC", .DataType = GetType(Decimal), .DefaultValue = 1})
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TCCambioValuacion", .DataType = GetType(Decimal), .DefaultValue = 1})
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
DtVentasNC.Rows.Add(Venta.CveVenta, Total, "")
ObjNC.DtVentasNC = DtVentasNC
Dim DtVentasRelacionadas As New DataTable()
DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
DtVentasRelacionadas.Rows.Add(Venta.CveVenta)
ObjNC.DtVentasRelacionadas = DtVentasRelacionadas
Dim DtAnticipos As New DataTable()
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))
DtAnticipos.Columns.Add("CveIE", GetType(Integer))
DtAnticipos.Columns.Add("FolioFiscal", GetType(String))
DtAnticipos.Columns.Add("Descuentos", GetType(Decimal))
DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal))
DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
Dim CveVenta = GvRow.DataKey("CveVenta").ToEntero()
Dim Importe = GvRow.FCTextBox(String.Format("TxtAnticipo{0}", GvRow.RowIndex)).Text.ToDecimal()
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
End If
Next
ObjNC.EsNCAmortizacion = True
ObjNC.CveTipoAmortizacionAnticipo = 2
ObjNC.DtAnticiposAplicados = DtAnticipos
ObjNC.PreparaTimbre()
ObjNC.CveFormaPago33 = 21 'Aplicación de anticipos
ObjNC.CveMetodoPago33 = 1
ObjNC.CveMetodoPago = 1
Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True) Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjNC Retorno.Factura = ObjNC

View File

@@ -7805,6 +7805,10 @@ Partial Class Ventas
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
End If End If
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem")) DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
If (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then
BtnsFacturar.Visible = False
End If
End If End If
Dim Bloqueo As Boolean = False Dim Bloqueo As Boolean = False
@@ -14319,7 +14323,7 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso EsVentaMedica Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso EsVentaMedica AndAlso factura.TipoDocto.Contiene("Ped", "Rem") Then
Dim CveClientesucursatTemp As Integer = DdlClienteSucursalSucursal() Dim CveClientesucursatTemp As Integer = DdlClienteSucursalSucursal()
If CveClientesucursatTemp > 0 Then If CveClientesucursatTemp > 0 Then
@@ -14366,17 +14370,16 @@ Partial Class Ventas
End If End If
End If End If
Dim TotalImpuestoLocal As Double = 0 Dim TotalImpuestoLocal As Decimal = 0
If GvImpuestosLocales2.Rows.Count > 0 Then If GvImpuestosLocales2.Rows.Count > 0 Then
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then If gvr.RowType = DataControlRowType.DataRow Then
If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble <> 0 Then If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal <> 0 Then
If gvr.DataKey("TipoImpuesto") = "5" Then ' cuando es traslado local If gvr.DataKey("TipoImpuesto") = "5" Then ' cuando es traslado local
TotalImpuestoLocal -= gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble TotalImpuestoLocal -= gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal
Else ' cuando es retención Else ' cuando es retención
TotalImpuestoLocal += gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble TotalImpuestoLocal += gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal
End If End If
End If End If
End If End If
Next Next