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

@@ -170,7 +170,7 @@
<asp:GridView ID="GvEntregas" runat="server" AutoGenerateColumns="False"
DataKeyNames="SerieFolio,FechaIng,Nombre,CveVenta,CveCliente,NombreComercial,TipoDocto,CorreoNotificacion,CveVendedor,Orden,CveMovimiento,CveDireccionEnvio,CveSubProyectoOrigen"
DataKeyNames="SerieFolio,Nombre,CveVenta,CveCliente,NombreComercial,TipoDocto,CorreoNotificacion,CveVendedor,Orden,CveMovimiento,CveDireccionEnvio,CveSubProyectoOrigen"
EmptyDataText="No se encontraron registros" ToolTip="Listado de entregas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true"
@@ -289,10 +289,53 @@
<ajax:TabPanel ID="TabRecoleccion" runat="server" HeaderText="Recolección">
<ContentTemplate>
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGeneraRecoleccion" OnClick="LnkGeneraRecoleccion_Click">Recoleccion</asp:LinkButton>
<asp:UpdatePanel ID="UpDatosRecoleccion" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div1" >
<asp:DropDownList ID="DdlChoferRec" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVChoferRec" runat="server" Enabled="false" ControlToValidate="DdlChoferRec" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEChoferRec" runat="server" HighlightCssClass="vco" TargetControlID="RFVChoferRec" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlChoferRec.ClientID.ToString()%>">Chofer:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div2" >
<asp:DropDownList runat="server" ID="DdlUnidadRec" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" CausesValidation="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVUnidadRec" runat="server" Enabled="false" ControlToValidate="DdlUnidadRec" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEUnidadRec" runat="server" HighlightCssClass="vco" TargetControlID="RFVUnidadRec" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlUnidadRec.ClientID.ToString()%>"> Unidad:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div3" >
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
<asp:TextBox ID="TxtFechaRec" 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="ImgFechaEntregaRec" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaRec" runat="server" TargetControlID="TxtFechaRec" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaRec" TargetControlID="TxtFechaRec" PopupButtonID="ImgFechaEntregaRec" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaRec" runat="server" ControlToValidate="TxtFechaRec" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaRec" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaRec" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtFechaRec.ClientID.ToString()%>"> F. Entrega:</label>
<i></i>
</div>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div4" >
<asp:CheckBox ID="ChkEmitirPorteRec" runat="server" Text="Carta Porte" />
<label for="<%= ChkEmitirPorteRec.ClientID.ToString()%>"> Emitir:</label>
<i></i>
</div>
<div class="col-md-1" runat="server" id="Div5">
</div>
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGeneraRecoleccion" OnClick="LnkGeneraRecoleccion_Click">Recoleccion</asp:LinkButton>
</div>
<div class="row">
<div class="col-md-12">
@@ -314,7 +357,12 @@
<%--<asp:BoundField HeaderText="SerieFolio" DataField="Serie Folio" HeaderStyle-Width="150px" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
<ItemTemplate>
&nbsp;<asp:Literal ID="LblFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yyyy}") %>'></asp:Literal>
&nbsp;<asp:Literal ID="LblFechaEntrega" runat="server" Text='<%# Eval("FechaEntrega", "{0:dd/MM/yyyy}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
<ItemTemplate>
&nbsp;<asp:Literal ID="LblFolio" runat="server" Text='<%# Eval("FolioReferencia") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" HeaderStyle-HorizontalAlign="Left">
@@ -441,6 +489,44 @@
<asp:Label runat="server" ID="LblSubProyectoRecoleccion" AssociatedControlID="DdlSubProyectoRecoleccion"></asp:Label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaLimite" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaLimite" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaLimite" runat="server" TargetControlID="TxtFechaLimite" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaLimite" TargetControlID="TxtFechaLimite" PopupButtonID="ImgFechaLimite" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaLimite" runat="server" ControlToValidate="TxtFechaLimite" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaLimite" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaLimite" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVFechaLimite" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaLimite" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" ID="Label3" AssociatedControlID="TxtFechaLimite" Text="Fecha Límite"></asp:Label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtFolioReferencia" CssClass="form-control" Width="100%" ></asp:TextBox>
<asp:Label runat="server" ID="Label1" AssociatedControlID="TxtFolioReferencia" Text="Folio"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtReferencia" CssClass="form-control" Width="100%" ></asp:TextBox>
<asp:Label runat="server" ID="Label2" AssociatedControlID="TxtReferencia" Text="Referencia"></asp:Label>
</div>
</div>
</div>
<div class="row">

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);