Timbrado de prueba con nuevos certificados

This commit is contained in:
2021-06-03 17:50:41 -07:00
parent b383cfe564
commit 49288c54a2
7 changed files with 1307 additions and 1345 deletions

View File

@@ -872,9 +872,15 @@ Public Class Timbrado
UsuarioServicio = UsuarioActual.Empresa.BIUsuario UsuarioServicio = UsuarioActual.Empresa.BIUsuario
ClaveServicio = UsuarioActual.Empresa.BIContraseña ClaveServicio = UsuarioActual.Empresa.BIContraseña
Clave = "12345678a" Clave = "12345678a"
EmisorRFC = "AAA010101AAA"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key" 'EmisorRFC = "AAA010101AAA"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer" 'ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key"
'ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer"
EmisorRFC = "ZUÑ920208KL4"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer"
UrlServicio = "http://portalmacropro.com.mx/srvCFDi33prueba/service1.asmx" UrlServicio = "http://portalmacropro.com.mx/srvCFDi33prueba/service1.asmx"
TimbraProduccion = False TimbraProduccion = False
End If End If
@@ -1224,9 +1230,14 @@ Public Class Timbrado
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
EmisorRFC = "AAA010101AAA" 'EmisorRFC = "AAA010101AAA"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key" 'ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer" 'ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer"
EmisorRFC = "ZUÑ920208KL4"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer"
Clave = "12345678a" Clave = "12345678a"
TimbraProduccion = False TimbraProduccion = False
Select Case UsuarioActual.Empresa.CvePAC Select Case UsuarioActual.Empresa.CvePAC
@@ -1805,9 +1816,14 @@ Public Class Timbrado
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
EmisorRFC = "AAA010101AAA" 'EmisorRFC = "AAA010101AAA"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key" 'ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer" 'ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer"
EmisorRFC = "ZUÑ920208KL4"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer"
Clave = "12345678a" Clave = "12345678a"
TimbraProduccion = False TimbraProduccion = False
Select Case CvePACEspecial Select Case CvePACEspecial
@@ -3092,9 +3108,11 @@ Public Class Timbrado
UsuarioServicio = "fgomez" UsuarioServicio = "fgomez"
ClaveServicio = "12121212" ClaveServicio = "12121212"
Clave = "12345678a" Clave = "12345678a"
'EmisorRFC = "AAA010101AAA" 'EmisorRFC = "AAA010101AAA"
'ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key" 'ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key"
'ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer" 'ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer"
EmisorRFC = "ZUÑ920208KL4" EmisorRFC = "ZUÑ920208KL4"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key" ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer" ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer"

View File

@@ -644,8 +644,14 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
End If End If
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then If UsuarioActual.CveEmpresa = 119 Then
ValidaLoteCaducidad = True Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If CveSubProyectoAlmacen = 10276 Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False
End If
End If End If
If Not DtDatos.Columns.Contains("Serie") Then DtDatos.Columns.Add("Serie", GetType(String)) If Not DtDatos.Columns.Contains("Serie") Then DtDatos.Columns.Add("Serie", GetType(String))
@@ -966,7 +972,8 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").readonly = True e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
' e.Row.FCTextBox("TxtCaducidad").enabled = True ' e.Row.FCTextBox("TxtCaducidad").enabled = True
Else Else
e.Row.FCTextBox("TxtCaducidad").Visible = False e.Row.FCTextBox("TxtCaducidad").Visible = False
@@ -975,7 +982,7 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaLote")) Then If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True e.Row.FCTextBox("TxtLote").Visible = True
e.Row.FCTextBox("TxtLote").readonly = True e.Row.FCTextBox("TxtLote").ReadOnly = True
'e.Row.FCTextBox("TxtLote").enabled = True 'e.Row.FCTextBox("TxtLote").enabled = True
Else Else
e.Row.FCTextBox("TxtLote").Visible = False e.Row.FCTextBox("TxtLote").Visible = False
@@ -2253,6 +2260,8 @@ Partial Class Inventarios_EntregaAlmacen
Next Next
If ErrorMovInv Then Exit For If ErrorMovInv Then Exit For
Else Else
ErrorMovInv = True ErrorMovInv = True
End If End If
@@ -2300,6 +2309,7 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
End If End If
'' TERMINA: APARTADOS '' TERMINA: APARTADOS
Dim TotalGarantia As Decimal = 0
' COMIENZA: GARANTIAS ' COMIENZA: GARANTIAS
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then
@@ -2326,6 +2336,7 @@ Partial Class Inventarios_EntregaAlmacen
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Exit For
End If End If
TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU)
Next Next
End If End If
End If End If
@@ -2576,83 +2587,97 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveAlmacenApartado = -1 Dim CveAlmacenApartado = -1
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero()) Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero())
Dim CveSeccionAlmacen As Integer = 0 Dim CveSeccionAlmacen As Integer = 0
For Each Dr As DataRow In DtTempApartados.Rows Dim ValorTraspaso As Decimal = 0
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then 'SI TIENE APARTADOS DEBE GENERAR LOS TRASPASOS
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, If DtTempApartados.Rows.Count > 0 Then
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
FolioSalida = ObjInventario.Folio
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
Dim DrMovto = DtTraspasos.NewRow For Each Dr As DataRow In DtTempApartados.Rows
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
DrMovto("FolioSalida") = FolioSalida
DtTraspasos.Rows.Add(DrMovto)
End If
If Not CveMovimientoSalidaApartado > 0 Then If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
ErrorMovInv = True CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
Exit For CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
End If FolioSalida = ObjInventario.Folio
'If CBool(Dr("AplicaSeccion")) Then CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen)
'Else
' CveSeccionAlmacen = -1
'End If
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then Dim DrMovto = DtTraspasos.NewRow
ErrorMovInv = True DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
Exit For DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
End If DrMovto("FolioSalida") = FolioSalida
Next DtTraspasos.Rows.Add(DrMovto)
End If
If Not ErrorMovInv Then If Not CveMovimientoSalidaApartado > 0 Then
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
CveCliente:=CveCliente, Modulo:="RE/G10")
FolioEntrada = ObjInventario.Folio
If Not CveMovimientoEntradaApartado > 0 Then
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For Exit For
End If End If
CveSeccionAlmacen = -3
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
Dr1("FolioEntrada") = FolioEntrada ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
Next
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then If Not ErrorMovInv Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
'If CBool(Dr("AplicaSeccion")) Then
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString().ToEntero(), Dr("CvePS"), CveSeccionAlmacen)
'Else
' CveSeccionAlmacen = -1
'End If
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaTraspaso > 0 Then
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
CveCliente:=CveCliente, Modulo:="RE/G10")
FolioEntrada = ObjInventario.Folio
If Not CveMovimientoEntradaApartado > 0 Then
ErrorMovInv = True ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Exit For
End If End If
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
Dr1("FolioEntrada") = FolioEntrada
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
End If
Next
End If
If ErrorMovInv Then Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
ErrorMovInv = True
End If
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
ErrorMovInv = True
End If
Next Next
Else
ErrorMovInv = True
End If End If
End If
If ErrorMovInv Then Exit For
Next
End If End If
End If End If
@@ -2701,6 +2726,7 @@ Partial Class Inventarios_EntregaAlmacen
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
Dim TotalVirtual As Decimal = 0
' COMIENZA: VIRTUAL ' COMIENZA: VIRTUAL
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Dev") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso CveMovimiento > 0 Then If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Dev") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso CveMovimiento > 0 Then
@@ -2758,7 +2784,7 @@ Partial Class Inventarios_EntregaAlmacen
If CveMovimientoVirtual > 0 Then If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero() Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
@@ -2767,7 +2793,14 @@ Partial Class Inventarios_EntregaAlmacen
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Exit For
End If End If
TotalVirtual += (CantidadUsado * PU)
Next Next
'insertar en prepóliza de la salida virtual
If Not ErrorMovInv Then
ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimientoVirtual, TextoError)
End If
Else Else
ErrorMovInv = True ErrorMovInv = True
End If End If
@@ -2920,7 +2953,6 @@ Partial Class Inventarios_EntregaAlmacen
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero() Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero()
'Dim CveCuentaAlmacen As Integer = 0 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero() 'Dim CveCuentaAlmacen As Integer = 0 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero()
Dim IdCtaContable As Integer = 0 Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
If tmpCostos.Rows.Count > 0 Then If tmpCostos.Rows.Count > 0 Then
@@ -2929,7 +2961,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero() Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero()
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString() Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString()
Dim Serie As String = ObjVentas.DtResultados(0)("SerieFolio").ToString() Dim Serie As String = ObjVentas.DtResultados(0)("SerieFolio").ToString()
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD() Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL()
Dim TotalCostoAcumulado As Decimal = 0 Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1 Dim cont As Integer = 1
@@ -2949,7 +2981,7 @@ Partial Class Inventarios_EntregaAlmacen
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
For Each RowInv As DataRow In tmpCostos.Rows For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD() ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
TotalCostoAcumulado += ValorInventario TotalCostoAcumulado += ValorInventario
'cuando es el último movimiento y hay diferencias en los importes 'cuando es el último movimiento y hay diferencias en los importes
@@ -2959,10 +2991,9 @@ Partial Class Inventarios_EntregaAlmacen
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString()) 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
If Not ErrorMovInv Then If Not ErrorMovInv Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorMultiplicador * ValorInventario, Serie, 69, Serie, Fecha, IdCtaContable, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, ImporteMX:=ValorMultiplicador * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero()) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorMultiplicador * ValorInventario, Serie, 69, Serie, Fecha, IdCtaContable, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, ImporteMX:=ValorMultiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero()) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If

View File

@@ -21,7 +21,7 @@
<asp:Button ID="BtnSetWindows" runat="server" ClientIDMode="Static" Text="Set Window" Style="display: none;" class="btn btn-primary" /> <asp:Button ID="BtnSetWindows" runat="server" ClientIDMode="Static" Text="Set Window" Style="display: none;" class="btn btn-primary" />
<asp:HiddenField ID="HdnAncho" runat="server" ClientIDMode="Static" Value="-1" /> <asp:HiddenField ID="HdnAncho" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnAlto" runat="server" ClientIDMode="Static" Value="-1" /> <asp:HiddenField ID="HdnAlto" runat="server" ClientIDMode="Static" Value="-1" />
<div id="TblBusqueda" runat="server" border="0" visible="false"> <div id="TblBusqueda" runat="server" border="0" visible="false" >
<div> <div>
Número de registros encontrados: <b> Número de registros encontrados: <b>
<asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b> <asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b>
@@ -29,7 +29,7 @@
<div> <div>
<input name="ctl00$C$TxtBusqueda" type="text" id="TxtBusqueda" class="form-control input-sm TxtBusqueda" placeholder="" data-table=".GVSearch" style="width: 100%"> <input name="ctl00$C$TxtBusqueda" type="text" id="TxtBusqueda" class="form-control input-sm TxtBusqueda" placeholder="" data-table=".GVSearch" style="width: 100%">
</div> </div>
<asp:GridView ID="GvEmpresas" runat="server" DataKeyNames="CveUsuario, Contraseña, Usuario,CveEmpresa" AutoGenerateColumns="false" <asp:GridView ID="GV" runat="server" DataKeyNames="CveUsuario, Contraseña, Usuario,CveEmpresa" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch" Style="margin-top: -10px; text-align: center;" Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch" Style="margin-top: -10px; text-align: center;"
GridLines="None"> GridLines="None">
<Columns> <Columns>
@@ -46,7 +46,7 @@
<AlternatingRowStyle CssClass="TextoAlterno" /> <AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView> </asp:GridView>
<asp:GridView ID="GvPortalRastreo" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false" <asp:GridView ID="GVCliente" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch" Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch"
Style="margin-top: -10px; text-align: center;" GridLines="None"> Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns> <Columns>
@@ -60,39 +60,11 @@
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<asp:GridView ID="GvPortalCliente" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario, CveEmpresa" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch"
Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Portal del Cliente</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkEmp" runat="server" CssClass="Texto" Text='<%# Eval("ClienteEmpresa")%>' CommandArgument='<%# Eval("CveCliente") %>' CommandName="Cambia"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:GridView ID="GvPortalProveedor" runat="server" DataKeyNames="CveUsuario, CveProveedor, Contraseña, Usuario, CveEmpresa" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch"
Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Portal del Proveedor</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkEmp" runat="server" CssClass="Texto" Text='<%# Eval("ProveedorEmpresa")%>' CommandArgument='<%# Eval("CveProveedor") %>' CommandName="Cambia"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript"> <script type="text/javascript">
@@ -121,13 +93,6 @@
gotourl('/Inicio.aspx'); gotourl('/Inicio.aspx');
} }
function Ir4() {
gotourl('/PortalCliente/PortalCliente.aspx');
}
function Ir5() {
gotourl('/PortalProveedor/PortalProveedor.aspx');
}
function buscarDT() { function buscarDT() {
$('.TxtBusqueda').on('keyup', function () { $('.TxtBusqueda').on('keyup', function () {
if (this.value == '') { if (this.value == '') {

View File

@@ -12,51 +12,37 @@ Partial Class PopUpSeleccionarEmpresa
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True CType(Me.Master, BaseMasterPage).EsPopup = True
'CType(Me.Master, BaseMasterPage).PopupWidth = HdnAncho.Value.ToEntero
'RegistraScript("alertSize();")
GetEmpresas() GetEmpresas()
End If End If
End Sub End Sub
Private Sub GetEmpresas() Private Sub GetEmpresas()
Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario) Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
If Dt IsNot Nothing Then If Dt IsNot Nothing Then
If Dt.Rows.Count > 0 Then If Dt.Rows.Count > 0 Then
Dim NumRegistros As Integer = 0 LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0)
GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa", {"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"}) GV.DataSource = Dt.FiltraParametros("CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)", "Empresa",{"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"})
'GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") GVCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count
GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
NumRegistros += DirectCast(GvPortalRastreo.DataSource, System.Data.DataTable).Rows.Count
GvPortalCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 6 AND CveCliente IS NOT NULL", "Empresa")
NumRegistros += DirectCast(GvPortalCliente.DataSource, System.Data.DataTable).Rows.Count
GvPortalProveedor.DataSource = Dt.FiltraParametros("CvePlataforma = 7 AND CveProveedor IS NOT NULL", "Empresa")
NumRegistros += DirectCast(GvPortalProveedor.DataSource, System.Data.DataTable).Rows.Count
LtlTotalRegistros.Text = NumRegistros.ToString().FormatoNumero(0)
Else Else
LtlTotalRegistros.Text = "0" LtlTotalRegistros.Text = "0"
GvEmpresas.DataSource = Nothing GV.DataSource = Nothing
GvPortalRastreo.DataSource = Nothing
GvPortalCliente.DataSource = Nothing
GvPortalProveedor.DataSource = Nothing
Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If End If
End If End If
GvEmpresas.DataBind() GV.DataBind()
GvPortalRastreo.DataBind() GVCliente.DataBind()
GvPortalCliente.DataBind()
GvPortalProveedor.DataBind()
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
End Sub End Sub
Protected Sub GvEmpresas_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvEmpresas.RowCommand Protected Sub GV_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GV.RowCommand
If e.CommandName = "Cambia" Then If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
@@ -94,7 +80,35 @@ Partial Class PopUpSeleccionarEmpresa
End If End If
End Sub End Sub
Protected Sub GvPortalRastreo_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalRastreo.RowCommand
Private Sub GuardaLogR(Mensaje As String)
Dim ArchivoW As IO.StreamWriter
Dim MensajeLog As String = ""
Dim continuar As Boolean = True
Try
If Not IsNothing(System.Web.HttpContext.Current) Then
If Not IsNothing(System.Web.HttpContext.Current.Request) Then
MensajeLog = $"{HttpContext.Current.Request.Url.ToString()}{Environment.NewLine}"
End If
End If
Catch
End Try
MensajeLog = $"{System.Environment.NewLine}'{DateTime.Now:dd/MM/yyyy hh:mm}' -- {MensajeLog}{Mensaje.Trim()}{Environment.NewLine}"
Try
ArchivoW = New IO.StreamWriter(String.Format("{0}\LogSession.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch
Exit Sub
End Try
Try
ArchivoW.Write(MensajeLog)
Catch
End Try
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
Protected Sub gvUsuarios_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GVCliente.RowCommand
If e.CommandName = "Cambia" Then If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
@@ -129,90 +143,33 @@ Partial Class PopUpSeleccionarEmpresa
End If End If
End Sub End Sub
Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
Usuario.ModoSimulacion = ModoSimulacion
ADSSession.ADSSessionConfig.sessionUser = Usuario
ADSSession.ADSSessionConfig.sessionDpage = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
Usuario.CvePlataforma = 6
UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
CreaObjetoEmpresa(Usuario)
'si la contraseña es la prederminada, pide la nueva contraseña
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
RegistraScript("Ir4();")
End If
End If
dt.Dispose()
End If
End If
End If
End Sub
Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
Usuario.ModoSimulacion = ModoSimulacion
ADSSession.ADSSessionConfig.sessionUser = Usuario
ADSSession.ADSSessionConfig.sessionDpage = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
Usuario.CvePlataforma = 7
UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero()
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa)
CreaObjetoEmpresa(Usuario)
'si la contraseña es la prederminada, pide la nueva contraseña
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
RegistraScript("Ir5();")
End If
End If
dt.Dispose()
End If
End If
End If
End Sub
#Region "F U N C I O N E S"
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click
RegistraScript(String.Format("$get('tdContenido').style.height='{0}px'; $get('tdContenido').style.width='{1}px'", HdnAlto.Value.ToEntero - 30, HdnAncho.Value.ToEntero - 30)) RegistraScript(String.Format("$get('tdContenido').style.height='{0}px'; $get('tdContenido').style.width='{1}px'", HdnAlto.Value.ToEntero - 30, HdnAncho.Value.ToEntero - 30))
End Sub End Sub
Private Sub CreaObjetoEmpresa()
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
'Session("Empresa") = ObjEmpresa
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
Else
Session("Empresa") = Nothing
End If
ObjEmpresa.Dispose()
End Sub
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario) Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
Dim ObjEmpresa As New ClsSisEmpresas() Dim ObjEmpresa As New ClsSisEmpresas()
@@ -234,33 +191,8 @@ Partial Class PopUpSeleccionarEmpresa
End If End If
ObjEmpresa.Dispose() ObjEmpresa.Dispose()
End Sub End Sub
Private Sub GuardaLogR(Mensaje As String)
Dim ArchivoW As IO.StreamWriter
Dim MensajeLog As String = ""
Dim continuar As Boolean = True
Try
If Not IsNothing(System.Web.HttpContext.Current) Then
If Not IsNothing(System.Web.HttpContext.Current.Request) Then
MensajeLog = $"{HttpContext.Current.Request.Url.ToString()}{Environment.NewLine}"
End If
End If
Catch
End Try
MensajeLog = $"{System.Environment.NewLine}'{DateTime.Now:dd/MM/yyyy hh:mm}' -- {MensajeLog}{Mensaje.Trim()}{Environment.NewLine}"
Try
ArchivoW = New IO.StreamWriter(String.Format("{0}\LogSession.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch
Exit Sub
End Try
Try
ArchivoW.Write(MensajeLog)
Catch
End Try
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
#End Region
End Class End Class

View File

@@ -1582,9 +1582,15 @@ Partial Class Sistemas_UsuarioDetalle
GvSubProyectos.Columns(0).Visible = False GvSubProyectos.Columns(0).Visible = False
End Sub End Sub
Protected Sub CboProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged Protected Sub CboProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyectos(DdlProyecto.SelectedValue.ToEntero) CargaSubProyectos(DdlProyecto.SelectedValue.ToEntero, DdlEmpresaAsignaciones.SelectedValue.ToEntero())
End Sub End Sub
Private Sub CargaSubProyectos(Optional CveProyectoFiltrado As Integer = -1) Private Sub CargaSubProyectos(Optional CveProyectoFiltrado As Integer = -1, Optional CveEmpresaFiltro As Integer = -1)
Dim CveEmpresaRef As Integer = UsuarioActual.CveEmpresa
If CveEmpresaFiltro > 0 Then
CveEmpresaRef = CveEmpresaFiltro
End If
DdlSubProyecto.Items.Clear() DdlSubProyecto.Items.Clear()
If CveProyectoFiltrado > 0 Then If CveProyectoFiltrado > 0 Then
Dim SubProyectosSinGV As String = GetSubProyectosSinGV() Dim SubProyectosSinGV As String = GetSubProyectosSinGV()
@@ -1609,7 +1615,7 @@ Partial Class Sistemas_UsuarioDetalle
Else Else
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(If(CveProyectoFiltrado > 0, CveProyectoFiltrado, DdlProyecto.SelectedValue.ToEntero)).FiltraParametros(If(SubProyectosSinGV.Length > 0, SubProyectosSinGV, "")) 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(If(CveProyectoFiltrado > 0, CveProyectoFiltrado, DdlProyecto.SelectedValue.ToEntero)).FiltraParametros(If(SubProyectosSinGV.Length > 0, SubProyectosSinGV, ""))
DdlSubProyecto.DataSource = GlobalDTSubProyectos(If(CveProyectoFiltrado > 0, CveProyectoFiltrado, DdlProyecto.SelectedValue.ToEntero), CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(If(SubProyectosSinGV.Length > 0, SubProyectosSinGV, "")) DdlSubProyecto.DataSource = GlobalDTSubProyectos(If(CveProyectoFiltrado > 0, CveProyectoFiltrado, DdlProyecto.SelectedValue.ToEntero), CveEmpresa:=CveEmpresaRef).FiltraParametros(If(SubProyectosSinGV.Length > 0, SubProyectosSinGV, ""))
'NO SE PARA QUE SE USA - COMENTADO IPP 30 AGOSTO 2017 'NO SE PARA QUE SE USA - COMENTADO IPP 30 AGOSTO 2017
'If SubProyectosSinGV.Length > 0 Then 'If SubProyectosSinGV.Length > 0 Then
' Dim SubProyectoFiltrado As DataTable = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero).FiltraParametros(SubProyectosSinGV) ' Dim SubProyectoFiltrado As DataTable = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero).FiltraParametros(SubProyectosSinGV)

View File

@@ -238,6 +238,16 @@