diff --git a/Inventarios/EntregaAlmacenRuta.aspx b/Inventarios/EntregaAlmacenRuta.aspx
index c4be75977..c1c60fa8a 100644
--- a/Inventarios/EntregaAlmacenRuta.aspx
+++ b/Inventarios/EntregaAlmacenRuta.aspx
@@ -150,6 +150,18 @@
+
+
diff --git a/Inventarios/EntregaAlmacenRuta.aspx.cs b/Inventarios/EntregaAlmacenRuta.aspx.cs
index 444e648f6..65f560cc6 100644
--- a/Inventarios/EntregaAlmacenRuta.aspx.cs
+++ b/Inventarios/EntregaAlmacenRuta.aspx.cs
@@ -154,7 +154,11 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
break;
}
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", "", "", "1900-01-01".ToDate(), Orden, 0, 1);
+ int CveRemolque1 = -1, CveRemolque2 = -1; ;
+ if (DdlRemolque1.SelectedValue.ToEntero() > 0) CveRemolque1 = DdlRemolque1.SelectedValue.ToEntero();
+ if (DdlRemolque2.SelectedValue.ToEntero() > 0) CveRemolque2 = DdlRemolque2.SelectedValue.ToEntero();
+
+ 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", "", "", "1900-01-01".ToDate(), Orden, 0, TxtDistancia.Text.ToEntero(), CveCamionRemolque1: CveRemolque1,CveCamionRemolque2: CveRemolque2);
CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero();
if (CveEntregaAlmacen > 0)
@@ -407,10 +411,10 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
private void CargaCombos()
{
- DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
+ DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa,CveCamion:-1,CveTipoCamion:1);
DdlUnidadCamion.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUnidadCamion.DataBind();
- DdlUnidadRec.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
+ DdlUnidadRec.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveCamion: -1, CveTipoCamion: 1);
DdlUnidadRec.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUnidadRec.DataBind();
@@ -565,6 +569,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
DVDatosEntrega4.Visible = mostrar;
//DVDatosEntrega5.Visible = mostrar;
DVDatosEntrega6.Visible = mostrar;
+ DvRemolque1.Visible = mostrar;
+ DvRemolque2.Visible = mostrar;
+ DivDistancia.Visible = mostrar;
//if (mostrar)
//{
@@ -823,7 +830,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
if (CveEntregaAlmacen == -1)
{
DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate();
- CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, -1, DdlChoferRec.SelectedValue.ToEntero(), DdlUnidadRec.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "R", TxtFolioReferencia.Text, TxtReferencia.Text, TxtFechaLimite.Text.ToDate(), 1, 0, 1);
+ CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, -1, DdlChoferRec.SelectedValue.ToEntero(), DdlUnidadRec.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "R", TxtFolioReferencia.Text, TxtReferencia.Text, TxtFechaLimite.Text.ToDate(), 1, 0, TxtDistancia.Text.ToEntero());
if (CveEntregaAlmacen > 0)
{
//CveTimbrenuevo = ObjGenerales.AddGralTimbre("Rec", "-1", -1, "-1", TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, -1);
@@ -1051,17 +1058,40 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
int i = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa, DdlUnidadCamion.SelectedValue.ToEntero()).FiltroPrimeroValor("CveConfigAutoTransporte").ToEntero();
if (i > 0)
{
- //string Remolque = get_GlobalDTGralCartaPorteConfigAutoTransportes().FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{i}'");
- //if (Remolque == "1")
- //{
- // DvRemolque1.Visible = true;
- //}
+ DataTable dtt=null;
+ ClsGenerales ObjG = new ClsGenerales();
+ if (ObjG.GetCartaPorteConfigAutoTransportes())
+ {
+ dtt = ObjG.DtResultados;
+ }
+ ObjG.Dispose();
+
+ string Remolque = dtt.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{i}'");
+ if (Remolque == "1")
+ {
+ DvRemolque1.Visible = true;
+ DdlRemolque1.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa,-1,CveTipoCamion:2);
+ DdlRemolque1.Items.Insert(0, new ListItem("-", "-1"));
+ DdlRemolque1.DataBind();
+ DvRemolque2.Visible = true;
+ DdlRemolque2.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa, -1, CveTipoCamion: 2);
+ DdlRemolque2.Items.Insert(0, new ListItem("-", "-1"));
+ DdlRemolque2.DataBind();
+ }
- //if (Remolque == "0, 1")
- //{
- // RequiereRemolque = false;
- // MostrarRemolques = true;
- //}
+ if (Remolque == "0, 1")
+ {
+ DvRemolque1.Visible = true;
+ DdlRemolque1.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa, -1, CveTipoCamion: 2);
+ DdlRemolque1.Items.Insert(0, new ListItem("-", "-1"));
+ DdlRemolque1.DataBind();
+ DvRemolque2.Visible = true;
+ DdlRemolque2.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa, -1, CveTipoCamion: 2);
+ DdlRemolque2.Items.Insert(0, new ListItem("-", "-1"));
+ DdlRemolque2.DataBind();
+ //RequiereRemolque = false;
+ //MostrarRemolques = true;
+ }
//if (Remolque == "0")
//{