-- mejora CCP 3.0

This commit is contained in:
2024-04-24 12:52:30 -07:00
parent f1c1a8a7fa
commit 75f69a2089
2 changed files with 56 additions and 14 deletions

View File

@@ -150,6 +150,18 @@
<asp:DropDownList runat="server" ID="DdlRemolque1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" ></asp:DropDownList>
</div>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="DvRemolque2" visible="false">
<label class="col-md-3">Remolque 2:</label>
<div class="col-md-9">
<asp:DropDownList runat="server" ID="DdlRemolque2" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" ></asp:DropDownList>
</div>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="DivDistancia" visible="false">
<label class="col-md-3">Distancia:</label>
<div class="col-md-9">
<asp:TextBox runat="server" ID="TxtDistancia" Width="75px" Text="1" ></asp:TextBox>
</div>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="DVDatosEntrega6" visible="false">

View File

@@ -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")
//{