From 420817fea0dcd82627ff64eb597181e8edb2ff39 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 13 Dec 2021 08:50:53 -0700 Subject: [PATCH] -mejoras, carta porte 2.0, parametro distancia y fechallegada --- App_Code/ClsGenerales.vb | 4 +++- App_Code/Timbres.vb | 17 ++++++++++------- General/RepEntregaAlmacenRuta.aspx.cs | 15 +++++---------- Inventarios/EntregaAlmacenRuta.aspx | 2 +- Inventarios/EntregaAlmacenRuta.aspx.cs | 10 +++++++--- Inventarios/TraspasoAlmacen.aspx | 17 ++++++++--------- Inventarios/TraspasoAlmacen.aspx.vb | 5 +++-- 7 files changed, 37 insertions(+), 33 deletions(-) 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/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/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)