diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index bf21e1368..6649955fd 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3770,7 +3770,7 @@ Public Class ClsGenerales End Function - Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, Tipo As String, Orden As Integer, Estatus As Integer) As Integer + Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String, Orden As Integer, Estatus As Integer, Distancia As Integer) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Inv_EntregaAlmacenRutaAdd") @@ -3783,9 +3783,11 @@ Public Class ClsGenerales .Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega + .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Estatus", SqlDbType.VarChar).Value = Estatus + .Add("@Distancia", SqlDbType.Int).Value = Distancia .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 297e8d0b4..5ed7caf39 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -209,7 +209,7 @@ Public Class ClsNominas SqlAdapter.Fill(Data) retorno = True Catch ex As Exception - OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al NominasSinTimbrar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function @@ -226,7 +226,7 @@ Public Class ClsNominas SqlAdapter.Fill(DTSet) retorno = True Catch ex As Exception - OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al Personal ISR Anual", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index b2b8b5ed5..e77192c72 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -20,8 +20,7 @@ Public Class Timbres Private Property CveMovimiento As Integer Private Property UsuarioActual As Usuario Private Property AplicaCP As Boolean - Private Property FechaSalidaLlegada As Date - + Private Property FechaSalida As Date Private Property Serie As String Private Property Folio As Integer Private Property CveTimbre As Integer @@ -116,6 +115,9 @@ Public Class Timbres Dim FI As Date = New Date(1900, 1, 1) Dim FF As Date = New Date(9999, 1, 1) + Dim FechaLlegada As DateTime + Dim Distancia As Integer = 1 + Dim ObjGrales As New ClsGenerales If ObjGrales.GetGralTimbre(CveTimbre, "-1", FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then @@ -125,7 +127,9 @@ Public Class Timbres Dim drT As DataRow = ObjGrales.DtResultados.Rows(0) CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero - FechaSalidaLlegada = drT("FechaEntrega").ToString.ToDate + FechaSalida = drT("FechaEntrega").ToString.ToDateTime + FechaLlegada = drT("FechaLlegada").ToString.ToDateTime + Distancia = drT("Distancia").ToString.ToEntero ObjFactura.Folio = drT("Folio").ToString.ToEntero ObjFactura.Serie = drT("Serie").ToString @@ -188,17 +192,16 @@ Public Class Timbres Dim Ubica As New CFDICartaPorteUbicacion Ubica.TipoEstacion = "" - Ubica.DistanciaRecorrida = 1 Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC, - .FechaHoraSalidaLlegada = Now.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", + .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", .NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa, .Domicilio = DomOrigen} CartaPorte.Ubicaciones.Add(Ubica) Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,'"CAMJ841219I33", - .FechaHoraSalidaLlegada = FechaSalidaLlegada.ToString("yyyy-MM-ddT23:59:59"), + .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), .NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa, .Domicilio = DomDestino, - .DistanciaRecorrida = 1} + .DistanciaRecorrida = Distancia} CartaPorte.Ubicaciones.Add(Ubica) CartaPorte.FiguraTransporte.ClaveTransporte = "01" diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 6a8e7f9bd..704255414 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -123,20 +123,48 @@ + + +
+ + <%----%> +
+ +
-
+
-
+
+ +
+ T.C.: + + + + +
+ +
+ +
+
+ Dolares + + <%----%> + +
+ +
@@ -1781,5 +1809,10 @@ return false; } + function CambiaTCPagoOC() { + + $("#LnkActualizaTCOC").click(); + } + diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index fa4a59b34..f24961ea0 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -297,6 +297,17 @@ Partial Class Bancos_IE End Set End Property + + Private Property CveMonedaOriginal As Integer + Get + Return ViewState("CveMonedaOriginal").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveMonedaOriginal") = value + End Set + End Property + + Private Property CveOCSolicitudAnticipo As Integer Get @@ -504,6 +515,22 @@ Partial Class Bancos_IE End Set End Property + + Private Property ImporteOriginalDolaras As Decimal + Get + If ViewState("ImporteOriginalDolaras") Is Nothing Then + Return 0 + Else + Return ViewState("ImporteOriginalDolaras").ToString().ToDecimal() + End If + + End Get + Set(value As Decimal) + ViewState("ImporteOriginalDolaras") = value + End Set + End Property + + #Region "CANCELACIÓN COMPLEMENTO MODAL V2" Property CveComplementoPagoCancelar As Integer @@ -2471,6 +2498,9 @@ Partial Class Bancos_IE If CveOCSolicitudAnticipo > 0 Then + + + Dim ObjOC As New ClsOC If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal @@ -2479,10 +2509,18 @@ Partial Class Bancos_IE End If ObjOC.Dispose() - If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + Dim ImporteComparacion As Decimal = TxtImporte.Text.ToDecimal + + ' + If ChkPagarPesos.Checked Then + ImporteComparacion = ImporteOriginalDolaras + End If + + If ImporteComparacion > SaldoOCAnticipo Then EsValido = False Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) End If + End If Return EsValido @@ -5557,11 +5595,23 @@ Partial Class Bancos_IE Else TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + ImporteOriginalDolaras = DrOC("ImporteAnticipo").ToString.ToDecimal End If DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString + CveMoneda = DrOC("CveMoneda").ToString.ToEntero CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) + + CveMonedaOriginal = DrOC("CveMoneda").ToString.ToEntero + + + If CveMonedaOriginal > 1 Then + MostrarPagoEnPesos(True) + End If + + UpCuentaDeposito.Update() If DrOC("CveProveedor").ToString.ToEntero > 0 Then HdnCveProveedor.Value = DrOC("CveProveedor").ToString @@ -5644,6 +5694,69 @@ Partial Class Bancos_IE End If End Sub + + + Private Sub MostrarPagoEnPesos(Mostrar As Boolean) + + LbTipoMoneda.Visible = Mostrar + LbTipoMoneda.Text = If(Mostrar, "Pago en doalres", "") + DVPAgoEnPesos.Visible = Mostrar + ChkPagarPesos.Visible = Mostrar + + TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + + End Sub + + + Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) + + If ChkPagarPesos.Checked Then + DivTC.Visible = True + DivTC2.Visible = True + ' DivDolaresDolares.Visible = False + 'CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) + CargaCuenta(1) + 'TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") + 'TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + TxtImporteDolares.Text = TxtImporte.Text + 'TxtImporteDolares.Text = TxtImporte.Text + 'TxtImporte.Text = (TxtImporte.Text.ToDecimal * (TxtTC.Text.ToDecimal)).ToString("###,###,###.00") + CveMoneda = 1 + Else + DivTC.Visible = False + DivTC2.Visible = False + CveMoneda = CveMonedaOriginal + 'DivDolaresDolares.Visible = True + 'CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) + CargaCuenta(CveMonedaOriginal) + 'TxtFechaDocumento.Attributes.Remove("onchange") + TxtImporte.Text = ImporteOriginalDolaras.ToString("###,###,###.00") + End If + + CambiaTCPagoOC() + + UpDatos.Update() + + ' RegistraScript("CambiaPesosDolares();") + End Sub + + + Public Sub CambiaTCPagoOC() + + If ChkPagarPesos.Checked Then + TxtImporte.Text = (TxtImporteDolares.Text.ToDecimal * (TxtTC.Text.ToDecimal)).ToString("###,###,###.00") + Else + TxtImporte.Text = TxtImporteDolares.Text + End If + + UpDatos.Update() + End Sub + + Protected Sub LnkActualizaTCOC_Click(sender As Object, e As EventArgs) + CambiaTCPagoOC() + End Sub + + Private Function GuardaSolicitudAnticipoOC(ByRef ObjOC As ClsOC) As String Dim ObjOI As New ClsOIEventos Dim CveEvento As Integer = 0 @@ -6724,4 +6837,5 @@ Partial Class Bancos_IE RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString Calendario.EndDate = DateTime.Now End Sub + End Class \ No newline at end of file diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 167e85864..78b16ec63 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -846,15 +846,17 @@ Partial Class PopUpVerFactura Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) - 'If Imagen.Exists Then - ' params.Add(New ReportParameter("LogoPath", logouri)) + 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) + + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) - 'Else - ' params.Add(New ReportParameter("LogoPath", "")) - 'End If + Else + params.Add(New ReportParameter("LogoPath", "")) + End If params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) @@ -1174,15 +1176,25 @@ Partial Class PopUpVerFactura CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ClienteRFC, Total, FolioFiscal, RutaCBB) End If - ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, SerieFolio) + + ImagenCBB = New System.IO.FileInfo(RutaCBB) + + If ImagenCBB.Exists Then + ImgCBB = String.Format("file://{0}", ImagenCBB.FullName) + Else + ImgCBB = "" + End If + End If If DtConceptos.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1295,7 +1307,7 @@ Partial Class PopUpVerFactura Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf") Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, Parametros("EXT").ToString, Parametros("TIPODOCTO").ToString, Parametros("FOLIO").ToString, Exten) Dim Archivo As New System.IO.FileInfo(Path) - Dim cvetimbre As Integer = Parametros("CVETIMBRE").ToString.ToEntero + Dim cvetimbre As Integer = IfNull(Parametros("CVETIMBRE"), "0").ToString.ToEntero If Archivo.Exists Then DescargarArchivoPDFTraslado(Archivo, Path) diff --git a/General/RepEntregaAlmacenRuta.aspx.cs b/General/RepEntregaAlmacenRuta.aspx.cs index be8c51e08..ca14bc3a4 100644 --- a/General/RepEntregaAlmacenRuta.aspx.cs +++ b/General/RepEntregaAlmacenRuta.aspx.cs @@ -238,16 +238,12 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas DdlEstatus.Items.Insert(1, new ListItem("Registrado", "0")); DdlEstatus.Items.Insert(2, new ListItem("Timbrado", "1")); DdlEstatus.Items.Insert(3, new ListItem("Cancelado ", "2")); - - } - - + } protected void InicializaFechas() { TxtFechaI.Text = DateTime.Now.AddDays(-1).ToString("dd/MM/yyyy"); TxtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy"); - } #endregion @@ -265,8 +261,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas ObjGeneral.Dispose(); GVDatos.DataBind(); UPDatos.Update(); - } - + } #endregion @@ -311,13 +306,13 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas DataTable DTDireccionesCliente = new DataTable(); ClsClientes ObjClientes = new ClsClientes(); - if (ObjClientes.DireccionEnvioGet(-1, -1, -1)) + if (ObjClientes.DireccionEnvioGet(-1, CveCliente, -1)) { DTDireccionesCliente = ObjClientes.DtResultados ; } ObjClientes.Dispose(); - DdlModalDireccionDestino.DataSource = DTDireccionesCliente.FiltraParametros($"CveCliente = {CveCliente}"); + DdlModalDireccionDestino.DataSource = DTDireccionesCliente DdlModalDireccionDestino.DataBind(); DdlModalDireccionDestino.Items.Insert(0,new ListItem("Seleccione Una", "-1")); @@ -331,7 +326,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas { DdlModalDireccionOrigen.Items.Insert(0, new ListItem($"Almacen: {Almacen}", "-2")); } - + DTDireccionesCliente.Dispose(); } diff --git a/Inventarios/EntregaAlmacenRuta.aspx b/Inventarios/EntregaAlmacenRuta.aspx index 7308c9c4f..e356f8e91 100644 --- a/Inventarios/EntregaAlmacenRuta.aspx +++ b/Inventarios/EntregaAlmacenRuta.aspx @@ -22,7 +22,7 @@ - Entrega Almacen Ruta + Ruta de Entrega/Recolección diff --git a/Inventarios/EntregaAlmacenRuta.aspx.cs b/Inventarios/EntregaAlmacenRuta.aspx.cs index ee4fa7878..f1f8567ac 100644 --- a/Inventarios/EntregaAlmacenRuta.aspx.cs +++ b/Inventarios/EntregaAlmacenRuta.aspx.cs @@ -154,7 +154,8 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas TieneError = true; break; } - int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "E",Orden,0); + DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate(); + int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "E",Orden,0,1); CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero(); if (CveEntregaAlmacen > 0) @@ -416,7 +417,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas DdlChofer.DataBind(); DdlChofer.Items.Insert(0, new ListItem("Seleccione", "-1")); - TxtFechaEntrega.Text = DateTime.Now.ToShortDateString(); + TxtFechaEntrega.Text = DateTime.Now.ToShortDateString(); + + TabRecoleccion.Visible = UsuarioActual.Empresa.Funcionalidad(531)=="1"; CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyecto); CargarCentrosDeCosto(null, DdlSubProyectoRecoleccion, null, LblSubProyectoRecoleccion); @@ -795,7 +798,8 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas if( CveEntregaAlmacen == -1) { - CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "R", 1,0); + DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate(); + CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada , "R", 1,0,1); if (CveEntregaAlmacen > 0) { //CveTimbrenuevo = ObjGenerales.AddGralTimbre("Rec", "-1", -1, "-1", TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, -1); diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index fc90b53db..4a082e289 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -206,7 +206,7 @@
-
+
@@ -217,7 +217,7 @@
-
+
@@ -248,18 +248,17 @@
-
+
-
- +
- + - - - + + +
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 9816595a8..b19bf109d 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -206,6 +206,7 @@ Partial Class Inventarios_TraspasoAlmacen If UsuarioActual.CveEmpresa.Contiene(141, 152, 158, 159, 160, 161, 162, 163) Then ChkEmitirTimbrado.Visible = False + divEmitir.Visible = False End If If UsuarioActual.CveEmpresa.Contiene(1, 119, 140, 2) Then @@ -419,7 +420,7 @@ Partial Class Inventarios_TraspasoAlmacen DdlChofer.Items.Insert(0, New ListItem("Seleccione", "-1")) TxtFechaEntrega.Text = Now.ToShortDateString - TxtFechaEnvio.Text = Now.ToShortDateString + TxtFechaLlegada.Text = Now.ToShortDateString 'Llena Responsables Transitorio 'DdlResponsable.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) @@ -1168,7 +1169,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL) Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero - Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, "T", 1, 1) + Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDatetime, "T", 1, 1, 1) If CveEntregaAlmacen > 0 Then CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked) diff --git a/OI/Normatividad.aspx.vb b/OI/Normatividad.aspx.vb index 812dfa77f..e1d44026f 100644 --- a/OI/Normatividad.aspx.vb +++ b/OI/Normatividad.aspx.vb @@ -38,7 +38,10 @@ Partial Class OI_Normatividad If ObjOIEventos.AddEventoNormatividad("PADRE", "PADRE DE TODOS", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "".ToEntero) Then If ObjOIEventos.GetEventoNormatividad(UsuarioActual.CveEmpresa) Then - IDSelected = ObjOIEventos.DtResultados(0)("CveEvento").ToString.ToEntero + IDSelected = 0 + If ObjOIEventos.DtResultados.Rows.Count > 0 Then + IDSelected = ObjOIEventos.DtResultados(0)("CveEvento").ToString.ToEntero + End If ObjOIEventos.AddEventoNormatividad("Título 1", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IDSelected) End If