FIX. Modal de aplicacion de Anticipos/NC

This commit is contained in:
2024-01-17 14:36:32 -07:00
parent 1a77ec0e57
commit b26b5167a6

View File

@@ -4306,154 +4306,152 @@
</div>
</div>
</div>
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<ContentTemplate>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
</div>
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label runat="server">Anticipos/NC del Cliente:&nbsp;<asp:Literal ID="LtlCliente" runat="server"></asp:Literal></asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:HiddenField ID="HdnAnticipos" runat="server" ClientIDMode="Static" Value="0" />
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<ContentTemplate>
<div class="row" runat="server" id="divAmortizacionTipo" visible="false">
<div class="col-md-4">
Tipo Amortización:
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label runat="server">Anticipos/NC del Cliente:&nbsp;<asp:Literal ID="LtlCliente" runat="server"></asp:Literal></asp:Label>
</h4>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoAmortizacionAnticipo" runat="server" AutoPostBack="true" Width="250px" CssClass="select2me" CausesValidation="true">
<asp:ListItem Text="Seleccionar" Value="-1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo en descuento" Value="1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo con nota de crédito" Value="2"></asp:ListItem>
</asp:DropDownList>
<div class="modal-body">
<asp:HiddenField ID="HdnAnticipos" runat="server" ClientIDMode="Static" Value="0" />
</div>
<asp:RequiredFieldValidator ID="RfvDdlTipoAmortizacionAnticipo" runat="server" Display="None" ControlToValidate="DdlTipoAmortizacionAnticipo" InitialValue="-1" ErrorMessage="Debe Seleccionarse un tipo" ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlTipoAmortizacionAnticipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoAmortizacionAnticipo" Width="300px"></ajax:ValidatorCalloutExtender>
<div class="row" style="text-align: center;" runat="server" id="divAnticipoMsg" visible="false">
<asp:Label ID="Label1" runat="server" Text="Se aplicará descuento por el total de las amortizaciones en los productos" CssClass="alert alert-warning" Style="padding: 5px; margin-bottom: 5px; padding-right: 25px;"></asp:Label>
</div>
</div>
<div class="row" runat="server" id="divAmortizacionTipo" visible="false">
<div class="col-md-4">
Tipo Amortización:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoAmortizacionAnticipo" runat="server" AutoPostBack="true" Width="250px" CssClass="select2me" CausesValidation="true">
<asp:ListItem Text="Seleccionar" Value="-1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo en descuento" Value="1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo con nota de crédito" Value="2"></asp:ListItem>
</asp:DropDownList>
<div class="row" id="divAmortizacionTipoRelacion" runat="server" visible="false">
<div class="col-md-4">
Tipo Relación:
</div>
</div>
<asp:RequiredFieldValidator ID="RfvDdlTipoAmortizacionAnticipo" runat="server" Display="None" ControlToValidate="DdlTipoAmortizacionAnticipo" InitialValue="-1" ErrorMessage="Debe Seleccionarse un tipo" ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlTipoAmortizacionAnticipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoAmortizacionAnticipo" Width="300px"></ajax:ValidatorCalloutExtender>
<div class="row" style="text-align: center;" runat="server" id="divAnticipoMsg" visible="false">
<asp:Label ID="Label1" runat="server" Text="Se aplicará descuento por el total de las amortizaciones en los productos" CssClass="alert alert-warning" Style="padding: 5px; margin-bottom: 5px; padding-right: 25px;"></asp:Label>
</div>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacionAnticipo" runat="server" Width="250px" CssClass="select2me">
<asp:ListItem Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="07 - CFDI por aplicación de anticipo" Value="7"></asp:ListItem>
</asp:DropDownList>
<div class="row" id="divAmortizacionTipoRelacion" runat="server" visible="false">
<div class="col-md-4">
Tipo Relación:
</div>
</div>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacionAnticipo" runat="server" Width="250px" CssClass="select2me">
<asp:ListItem Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="07 - CFDI por aplicación de anticipo" Value="7"></asp:ListItem>
</asp:DropDownList>
<div class="row" id="DivConceptoNC" runat="server" visible="false">
<div class="col-md-4">
Concepto:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlNCPSAnt" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" Width="250px" CssClass="select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVNCPSAnt" runat="server" InitialValue="-1" ControlToValidate="DdlNCPSAnt" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVNCPSAnt" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPSAnt" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="row" id="DivConceptoNC" runat="server" visible="false">
<div class="col-md-4">
Concepto:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlNCPSAnt" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" Width="250px" CssClass="select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVNCPSAnt" runat="server" InitialValue="-1" ControlToValidate="DdlNCPSAnt" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVNCPSAnt" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPSAnt" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="row" id="DivFechaAnticipoCliente" runat="server" visible="false">
<b>
<label class="col-md-2">Fecha:</label></b>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10" AutoPostBack="true" OnTextChanged="TxtFechaAnticipoCliente_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaAnticipoCliente" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAnticipoCliente" runat="server" TargetControlID="TxtFechaAnticipoCliente" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaAnticipoCliente" TargetControlID="TxtFechaAnticipoCliente" PopupButtonID="ImgFechaAnticipoCliente" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaAnticipoCliente" runat="server" ControlToValidate="TxtFechaAnticipoCliente" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="VGAnticiposClientes" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaAnticipoCliente" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaAnticipoCliente" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="row" id="DivFechaAnticipoCliente" runat="server" visible="false">
<b>
<label class="col-md-2">Fecha:</label></b>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10" AutoPostBack="true" OnTextChanged="TxtFechaAnticipoCliente_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaAnticipoCliente" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAnticipoCliente" runat="server" TargetControlID="TxtFechaAnticipoCliente" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaAnticipoCliente" TargetControlID="TxtFechaAnticipoCliente" PopupButtonID="ImgFechaAnticipoCliente" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaAnticipoCliente" runat="server" ControlToValidate="TxtFechaAnticipoCliente" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="VGAnticiposClientes" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaAnticipoCliente" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaAnticipoCliente" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<br />
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Folio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="MonedaVenta" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbreviatura" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Amort. Ant.</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblTotalAnticipos" runat="server" ClientIDMode="Static" Text="0.00" Visible="false"></asp:Label>
<asp:TextBox ID="TxtAnticipo" CssClass="CSGATxtAnticipo" runat="server" CausesValidation="true" MaxLength="12" Width="76px"></asp:TextBox>
<asp:CompareValidator ID="CVAmortAnti" runat="server" ControlToValidate="TxtAnticipo" Display="None" ErrorMessage="El campo <b>''Amortización de Anticipos''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="VGAnticiposClientes"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOAmortAnti" runat="server" HighlightCssClass="vco" TargetControlID="CVAmortAnti" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="T.C." Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtTC" runat="server" Width="50px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<br />
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Folio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="MonedaVenta" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbreviatura" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Amort. Ant.</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblTotalAnticipos" runat="server" ClientIDMode="Static" Text="0.00" Visible="false"></asp:Label>
<asp:TextBox ID="TxtAnticipo" CssClass="CSGATxtAnticipo" runat="server" CausesValidation="true" MaxLength="12" Width="76px"></asp:TextBox>
<asp:CompareValidator ID="CVAmortAnti" runat="server" ControlToValidate="TxtAnticipo" Display="None" ErrorMessage="El campo <b>''Amortización de Anticipos''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="VGAnticiposClientes"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOAmortAnti" runat="server" HighlightCssClass="vco" TargetControlID="CVAmortAnti" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="T.C." Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtTC" runat="server" Width="50px" Enabled="false"></asp:TextBox>
<%--<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtTC" FilterType="Custom, Numbers" ValidChars="." />--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<div class="modal-footer">
<asp:Button ID="BtnAceptarAnticipos" runat="server" Text="Aceptar" class="btn btn-primary" ValidationGroup="VGAnticiposClientes" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
<asp:HiddenField ID="HdnTieneAnticipos" ClientIDMode="Static" Value="0" runat="server" />
<asp:HiddenField ID="HdnTieneAnticiposVinculados" ClientIDMode="Static" Value="0" runat="server" />
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAceptarAnticipos" runat="server" Text="Aceptar" class="btn btn-primary" ValidationGroup="VGAnticiposClientes" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
<asp:HiddenField ID="HdnTieneAnticipos" ClientIDMode="Static" Value="0" runat="server" />
<asp:HiddenField ID="HdnTieneAnticiposVinculados" ClientIDMode="Static" Value="0" runat="server" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="DivRelacionarFacturasNC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UPRelacionarNC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">