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

File diff suppressed because it is too large Load Diff

View File

@@ -644,14 +644,8 @@ Partial Class Inventarios_EntregaAlmacen
End If
End If
If UsuarioActual.CveEmpresa = 119 Then
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If CveSubProyectoAlmacen = 10276 Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False
End If
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then
ValidaLoteCaducidad = True
End If
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
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
e.Row.FCTextBox("TxtCaducidad").readonly = True
' e.Row.FCTextBox("TxtCaducidad").enabled = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
@@ -982,7 +975,7 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
e.Row.FCTextBox("TxtLote").ReadOnly = True
e.Row.FCTextBox("TxtLote").readonly = True
'e.Row.FCTextBox("TxtLote").enabled = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
@@ -2260,8 +2253,6 @@ Partial Class Inventarios_EntregaAlmacen
Next
If ErrorMovInv Then Exit For
Else
ErrorMovInv = True
End If
@@ -2309,7 +2300,6 @@ Partial Class Inventarios_EntregaAlmacen
End If
End If
'' TERMINA: APARTADOS
Dim TotalGarantia As Decimal = 0
' COMIENZA: GARANTIAS
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.")
Exit For
End If
TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU)
Next
End If
End If
@@ -2587,97 +2576,83 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveAlmacenApartado = -1
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero())
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 DtTempApartados.Rows.Count > 0 Then
For Each Dr As DataRow In DtTempApartados.Rows
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() 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,
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
FolioSalida = ObjInventario.Folio
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
Dim DrMovto = DtTraspasos.NewRow
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
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
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
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
Next
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)
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
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
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
Else
ErrorMovInv = True
End If
End If
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() 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,
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
FolioSalida = ObjInventario.Folio
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
Dim DrMovto = DtTraspasos.NewRow
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
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
'If CBool(Dr("AplicaSeccion")) Then
' 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
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
Next
If Not ErrorMovInv 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
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
End If
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
Dr1("FolioEntrada") = FolioEntrada
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) 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
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
Next
End If
End If
@@ -2726,7 +2701,6 @@ Partial Class Inventarios_EntregaAlmacen
ErrorMovInv = True
End If
End If
Dim TotalVirtual As Decimal = 0
' COMIENZA: VIRTUAL
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
For Each RowUsado As DataRow In DtPSVirtual.Rows
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 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.")
Exit For
End If
TotalVirtual += (CantidadUsado * PU)
Next
'insertar en prepóliza de la salida virtual
If Not ErrorMovInv Then
ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimientoVirtual, TextoError)
End If
Next
Else
ErrorMovInv = True
End If
@@ -2953,6 +2920,7 @@ Partial Class Inventarios_EntregaAlmacen
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 IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
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 ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").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 cont As Integer = 1
@@ -2981,7 +2949,7 @@ Partial Class Inventarios_EntregaAlmacen
If CvePrePoliza > 0 Then
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
'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())
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 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
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:HiddenField ID="HdnAncho" 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>
Número de registros encontrados: <b>
<asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b>
@@ -29,7 +29,7 @@
<div>
<input name="ctl00$C$TxtBusqueda" type="text" id="TxtBusqueda" class="form-control input-sm TxtBusqueda" placeholder="" data-table=".GVSearch" style="width: 100%">
</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;"
GridLines="None">
<Columns>
@@ -46,7 +46,7 @@
<AlternatingRowStyle CssClass="TextoAlterno" />
</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"
Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
@@ -60,71 +60,106 @@
</asp:TemplateField>
</Columns>
</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>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
<script type="text/javascript">
jQuery(document).ready(function () {
buscarDT();
buscarDT();
Sys.Application.add_load(function (s, e) {
buscarDT();
});
});
});
document.body.onload = function () {
alertSize();
}
}
function Ir(c) {
$get("HdnEmpresa").value = c;
$get("HdnEmpresa").value = c;
$('#BtnSeleccionar').click();
}
}
function Ir2() {
gotourl('/PortalGPS/InicioGPS.aspx');
}
}
function Ir3() {
gotourl('/Inicio.aspx');
}
}
function Ir4() {
gotourl('/PortalCliente/PortalCliente.aspx');
}
function Ir5() {
gotourl('/PortalProveedor/PortalProveedor.aspx');
}
function buscarDT() {
$('.TxtBusqueda').on('keyup', function () {
if (this.value == '') {
$('table' + $(this).attr('data-table') + ' tr').css('display', '');
} 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', '');
}
});
});
$('.TxtBusqueda').removeClass('TxtBusqueda');
}
}
function alertSize() {
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number') {
//Non-IE
myWidth = window.innerWidth;
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number') {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible
myWidth = document.body.clientWidth;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
$get("HdnAncho").value = myWidth;
//$get("TablaGeneral").style.width = myWidth;
$get("HdnAlto").value = myHeight;
//$('#BtnSetWindows').click();
}
}
$get("HdnAncho").value = myWidth;
//$get("TablaGeneral").style.width = myWidth;
$get("HdnAlto").value = myHeight;
//$('#BtnSetWindows').click();
}
</script>
</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
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
'CType(Me.Master, BaseMasterPage).PopupWidth = HdnAncho.Value.ToEntero
'RegistraScript("alertSize();")
GetEmpresas()
End If
End Sub
Private Sub GetEmpresas()
Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
If Dt IsNot Nothing Then
If Dt.Rows.Count > 0 Then
LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = Dt.FiltraParametros("CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)", "Empresa",{"CveEmpresa", "Empresa", "CveUsuario", "Contraseña", "Usuario"})
GVCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
Dim NumRegistros As Integer = 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"})
'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
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)
End If
End If
GV.DataBind()
GVCliente.DataBind()
GvEmpresas.DataBind()
GvPortalRastreo.DataBind()
GvPortalCliente.DataBind()
GvPortalProveedor.DataBind()
UPDatos.Update()
TblBusqueda.Visible = True
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
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
@@ -80,35 +94,7 @@ Partial Class PopUpSeleccionarEmpresa
End If
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
Protected Sub gvUsuarios_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GVCliente.RowCommand
Protected Sub GvPortalRastreo_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalRastreo.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
@@ -142,32 +128,89 @@ 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
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
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()
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
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
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
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
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
@@ -190,9 +233,34 @@ Partial Class PopUpSeleccionarEmpresa
Session("Empresa") = Nothing
End If
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

View File

@@ -1582,15 +1582,9 @@ Partial Class Sistemas_UsuarioDetalle
GvSubProyectos.Columns(0).Visible = False
End Sub
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
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
Private Sub CargaSubProyectos(Optional CveProyectoFiltrado As Integer = -1)
DdlSubProyecto.Items.Clear()
If CveProyectoFiltrado > 0 Then
Dim SubProyectosSinGV As String = GetSubProyectosSinGV()
@@ -1615,7 +1609,7 @@ Partial Class Sistemas_UsuarioDetalle
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), 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
'If SubProyectosSinGV.Length > 0 Then
' Dim SubProyectoFiltrado As DataTable = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero).FiltraParametros(SubProyectosSinGV)

View File

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