carta porte

This commit is contained in:
2021-12-17 22:15:31 -07:00
parent 233bde3528
commit 614650296b
4 changed files with 233 additions and 106 deletions

View File

@@ -155,7 +155,7 @@ 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",Orden,0,1);
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);
CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero();
if (CveEntregaAlmacen > 0)
@@ -249,13 +249,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
{
if (DdlChofer.SelectedValue.ToEntero() <= 0)
if (DdlChoferRec.SelectedValue.ToEntero() <= 0)
{
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
if (DdlUnidadRec.SelectedValue.ToEntero() <= 0)
{
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
@@ -284,22 +284,32 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
if (CveEntregaAlmacen > 0)
{
int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyecto").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:CveEntregaAlmacen , AplicaCP: ChkEmitirCartaPorte.Checked);
if (CveTimbre <= 0)
// se actualizan los datos de unidad, chofer, fechas y Carta porte
if (ObjGeneral.AsignaEntregaAlmacenRuta(DdlUnidadRec.SelectedValue.ToEntero(), DdlChoferRec.SelectedValue.ToEntero(), TxtFechaRec.Text.ToDate(), CveEntregaAlmacen, UsuarioActual.CveEmpresa))
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
TieneError = true;
break;
int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyecto").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: ChkEmitirPorteRec.Checked);
if (CveTimbre <= 0)
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
TieneError = true;
break;
}
else
{
ListaTimbres.Add(CveTimbre);
}
}
else
{
ListaTimbres.Add(CveTimbre);
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al aplicar condiciones de entrega. ");
TieneError = true;
break;
}
}
else
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. ");
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega almacen. ");
TieneError = true;
break;
}
@@ -405,10 +415,12 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
private void CargaCombos()
{
DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
DdlUnidadCamion.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUnidadCamion.DataBind();
DdlUnidadRec.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
DdlUnidadRec.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUnidadRec.DataBind();
TxtFechaI.Text = DateTime.Now.AddDays(-1).ToShortDateString();
TxtFechaF.Text = DateTime.Now.ToShortDateString();
@@ -416,6 +428,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
DdlChofer.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa);
DdlChofer.DataBind();
DdlChofer.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlChoferRec.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa);
DdlChoferRec.DataBind();
DdlChoferRec.Items.Insert(0, new ListItem("Seleccione", "-1"));
TxtFechaEntrega.Text = DateTime.Now.ToShortDateString();
@@ -799,7 +814,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, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada , "R", 1,0,1);
CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "R",TxtFolioReferencia.Text, TxtReferencia.Text, TxtFechaLimite.Text.ToDate(), 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);