Revert "Timbrado de prueba con nuevos certificados"

This reverts commit 49288c54a2.
This commit is contained in:
2021-06-03 17:50:59 -07:00
parent 49288c54a2
commit 4d71d73602
7 changed files with 1342 additions and 1304 deletions

View File

@@ -872,15 +872,9 @@ 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"
'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"
UrlServicio = "http://portalmacropro.com.mx/srvCFDi33prueba/service1.asmx" UrlServicio = "http://portalmacropro.com.mx/srvCFDi33prueba/service1.asmx"
TimbraProduccion = False TimbraProduccion = False
End If End If
@@ -1230,14 +1224,9 @@ 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
@@ -1816,14 +1805,9 @@ 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
@@ -3108,11 +3092,9 @@ 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"

File diff suppressed because it is too large Load Diff

View File

@@ -644,14 +644,8 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
End If End If
If UsuarioActual.CveEmpresa = 119 Then If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero ValidaLoteCaducidad = True
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))
@@ -972,8 +966,7 @@ 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
@@ -982,7 +975,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
@@ -2260,8 +2253,6 @@ 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
@@ -2309,7 +2300,6 @@ 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
@@ -2336,7 +2326,6 @@ 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
@@ -2587,97 +2576,83 @@ 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
Dim ValorTraspaso As Decimal = 0 For Each Dr As DataRow In DtTempApartados.Rows
'SI TIENE APARTADOS DEBE GENERAR LOS TRASPASOS If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
If DtTempApartados.Rows.Count > 0 Then CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
For Each Dr As DataRow In DtTempApartados.Rows CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
FolioSalida = ObjInventario.Folio
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Dim DrMovto = DtTraspasos.NewRow
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9") DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
FolioSalida = ObjInventario.Folio DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero() DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
DrMovto("FolioSalida") = FolioSalida
Dim DrMovto = DtTraspasos.NewRow DtTraspasos.Rows.Add(DrMovto)
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero() End If
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado If Not CveMovimientoSalidaApartado > 0 Then
DrMovto("FolioSalida") = FolioSalida ErrorMovInv = True
DtTraspasos.Rows.Add(DrMovto) TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
End If Exit For
End If
If Not CveMovimientoSalidaApartado > 0 Then 'If CBool(Dr("AplicaSeccion")) Then
ErrorMovInv = True ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen)
Exit For 'Else
End If ' CveSeccionAlmacen = -1
CveSeccionAlmacen = -3 '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
ErrorMovInv = True 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
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados") ErrorMovInv = True
Exit For TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
End If Exit For
Next End If
Next
If Not ErrorMovInv Then
If Not ErrorMovInv Then
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) For Each Dr1 As DataRow In DtTraspasos.Rows
If CvePrePolizaTraspaso > 0 Then CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
For Each Dr1 As DataRow In DtTraspasos.Rows CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero() -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=CveCliente, Modulo:="RE/G10")
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(), FolioEntrada = ObjInventario.Folio
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
CveCliente:=CveCliente, Modulo:="RE/G10") If Not CveMovimientoEntradaApartado > 0 Then
FolioEntrada = ObjInventario.Folio ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
If Not CveMovimientoEntradaApartado > 0 Then Exit For
ErrorMovInv = True End If
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
End If Dr1("FolioEntrada") = FolioEntrada
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dr1("FolioEntrada") = FolioEntrada For Each Dr As DataRow In ObjInventario.DtResultados.Rows
'If CBool(Dr("AplicaSeccion")) Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString().ToEntero(), Dr("CvePS"), CveSeccionAlmacen)
For Each Dr As DataRow In ObjInventario.DtResultados.Rows 'Else
' CveSeccionAlmacen = -1
CveSeccionAlmacen = -3 '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
ErrorMovInv = True 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
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") ErrorMovInv = True
Exit For TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
End If Exit For
Next End If
End If Next
End If
If ErrorMovInv Then Exit For
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 Next
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
Else
ErrorMovInv = True
End If
End If
End If End If
End If End If
@@ -2726,7 +2701,6 @@ 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
@@ -2784,7 +2758,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 Decimal = RowUsado("Cantidad").ToString().ToDecimal() Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
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()
@@ -2793,14 +2767,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
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
@@ -2953,6 +2920,7 @@ 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
@@ -2961,7 +2929,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").RoundSQL() Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0 Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1 Dim cont As Integer = 1
@@ -2981,7 +2949,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")}").RoundSQL() ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
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
@@ -2991,9 +2959,10 @@ 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, 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, CveCuenta:=CveCuenta, 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="GV" runat="server" DataKeyNames="CveUsuario, Contraseña, Usuario,CveEmpresa" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" <asp:GridView ID="GvEmpresas" runat="server" DataKeyNames="CveUsuario, Contraseña, Usuario,CveEmpresa" AutoGenerateColumns="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;" 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="GVCliente" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false" <asp:GridView ID="GvPortalRastreo" 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,71 +60,106 @@
</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">
jQuery(document).ready(function () { jQuery(document).ready(function () {
buscarDT(); buscarDT();
Sys.Application.add_load(function (s, e) { Sys.Application.add_load(function (s, e) {
buscarDT(); buscarDT();
}); });
}); });
document.body.onload = function () { document.body.onload = function () {
alertSize(); alertSize();
} }
function Ir(c) { function Ir(c) {
$get("HdnEmpresa").value = c; $get("HdnEmpresa").value = c;
$('#BtnSeleccionar').click(); $('#BtnSeleccionar').click();
} }
function Ir2() { function Ir2() {
gotourl('/PortalGPS/InicioGPS.aspx'); gotourl('/PortalGPS/InicioGPS.aspx');
} }
function Ir3() { function Ir3() {
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 == '') {
$('table' + $(this).attr('data-table') + ' tr').css('display', ''); $('table' + $(this).attr('data-table') + ' tr').css('display', '');
} else { } else {
$('table' + $(this).attr('data-table') + ' tr').css('display', 'none'); $('table' + $(this).attr('data-table') + ' tr').css('display', 'none');
$('table' + $(this).attr('data-table') + ' tr:contains("' + this.value + '")').css('display', ''); $('table' + $(this).attr('data-table') + ' tr:contains("' + this.value + '")').css('display', '');
} }
}); });
$('.TxtBusqueda').removeClass('TxtBusqueda'); $('.TxtBusqueda').removeClass('TxtBusqueda');
} }
function alertSize() { function alertSize() {
var myWidth = 0, myHeight = 0; var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number') { if (typeof (window.innerWidth) == 'number') {
//Non-IE //Non-IE
myWidth = window.innerWidth; myWidth = window.innerWidth;
myHeight = window.innerHeight; myHeight = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode' //IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth; myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight; myHeight = document.documentElement.clientHeight;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible //IE 4 compatible
myWidth = document.body.clientWidth; myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight; myHeight = document.body.clientHeight;
} }
$get("HdnAncho").value = myWidth; $get("HdnAncho").value = myWidth;
//$get("TablaGeneral").style.width = myWidth; //$get("TablaGeneral").style.width = myWidth;
$get("HdnAlto").value = myHeight; $get("HdnAlto").value = myHeight;
//$('#BtnSetWindows').click(); //$('#BtnSetWindows').click();
} }
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -12,37 +12,51 @@ 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
LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0) Dim NumRegistros As Integer = 0
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", {"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"})
GVCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa") 'GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "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"
GV.DataSource = Nothing GvEmpresas.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
GV.DataBind() GvEmpresas.DataBind()
GVCliente.DataBind() GvPortalRastreo.DataBind()
GvPortalCliente.DataBind()
GvPortalProveedor.DataBind()
UPDatos.Update() UPDatos.Update()
TblBusqueda.Visible = True TblBusqueda.Visible = True
End Sub End Sub
Protected Sub GV_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GV.RowCommand Protected Sub GvEmpresas_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvEmpresas.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)
@@ -80,35 +94,7 @@ 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)
@@ -142,32 +128,89 @@ Partial Class PopUpSeleccionarEmpresa
End If End If
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
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click Dim ObjUsuario As New ClsSisUsuarios
RegistraScript(String.Format("$get('tdContenido').style.height='{0}px'; $get('tdContenido').style.width='{1}px'", HdnAlto.Value.ToEntero - 30, HdnAncho.Value.ToEntero - 30)) Dim Usuario As Usuario = Nothing
End Sub Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose()
Private Sub CreaObjetoEmpresa() If Usuario IsNot Nothing Then
Dim ObjEmpresa As New ClsSisEmpresas() Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
'Session("Empresa") = ObjEmpresa Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then Usuario.ModoSimulacion = ModoSimulacion
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados 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
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 End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
Else
Session("Empresa") = Nothing
End If End If
ObjEmpresa.Dispose() 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
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(ByRef UsuarioActual As Usuario) Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
@@ -190,9 +233,34 @@ Partial Class PopUpSeleccionarEmpresa
Session("Empresa") = Nothing Session("Empresa") = Nothing
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,15 +1582,9 @@ 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, DdlEmpresaAsignaciones.SelectedValue.ToEntero()) CargaSubProyectos(DdlProyecto.SelectedValue.ToEntero)
End Sub End Sub
Private Sub CargaSubProyectos(Optional CveProyectoFiltrado As Integer = -1, Optional CveEmpresaFiltro As Integer = -1) Private Sub CargaSubProyectos(Optional CveProyectoFiltrado 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()
@@ -1615,7 +1609,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:=CveEmpresaRef).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, ""))
'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,16 +238,6 @@