-mejoras, carta porte 2.0, parametro distancia y fechallegada
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Entrega Almacen Ruta
|
||||
Ruta de Entrega/Recolección
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" class="rowpadding">
|
||||
<div class="row rowpadding" id="divEmitir" runat="server">
|
||||
<label class="col-md-3">Emitir:</label>
|
||||
<div class="col-md-9">
|
||||
<table>
|
||||
@@ -217,7 +217,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" class="rowpadding">
|
||||
<div class="row rowpadding">
|
||||
<label class="col-md-3">Chofer:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
@@ -248,18 +248,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row rowpadding">
|
||||
<div class="row rowpadding" runat="server" id="divFechaEnvio" visible="false">
|
||||
<label class="col-md-3">F. Llegada:</label>
|
||||
<div class="col-md-9" style="padding-top: 0px;" runat="server" id="divFechaEnvio" visible="false">
|
||||
|
||||
<div class="col-md-9" style="padding-top: 0px;" >
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEnvio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtFechaLlegada" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEnvio" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaEnvio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaEnvio" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaEnvio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaLlegada" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaLlegada" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaLlegada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user