This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-07-24 20:37:03 -07:00
2 changed files with 497 additions and 166 deletions

View File

@@ -1300,14 +1300,14 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivOCRelacionadas" class="col-md-3" runat="server" visible="false">
<asp:GridView runat="server" ID="GvOCRelacionadas" Caption="OC Relacionadas:" AutoGenerateColumns="False" DataKeyNames="CveOrdenCompra,Folio"
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:HyperLinkField DataTextField="Folio" DataNavigateUrlFields="CveOrdenCompra" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" HeaderText="Orden Compra" />
</Columns>
</asp:GridView>
</div>
<div id="DivOCRelacionadas" class="col-md-3" runat="server" visible="false">
<asp:GridView runat="server" ID="GvOCRelacionadas" Caption="OC Relacionadas:" AutoGenerateColumns="False" DataKeyNames="CveOrdenCompra,Folio"
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:HyperLinkField DataTextField="Folio" DataNavigateUrlFields="CveOrdenCompra" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" HeaderText="Orden Compra" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="col-md-6 ">
@@ -2879,6 +2879,192 @@
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabAuxiliarConta" runat="server" HeaderText="Saldo" Visible="false">
<ContentTemplate>
<asp:Literal ID="LtlTipo1" runat="server"></asp:Literal>
<table border="0" class="contenido Widthall">
<tr>
<td align="left">
<%--<div class="note note-success">
<label class="title">Auxiliar contable de:</label>
<label>
<asp:Literal ID="LtlTipo2" runat="server"></asp:Literal>:&nbsp;</label><asp:Literal ID="LtlFolio" runat="server"></asp:Literal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<asp:Literal ID="LtlTipo3" runat="server"></asp:Literal>:&nbsp;</label><asp:Literal ID="LtlFechaVenta" runat="server"></asp:Literal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<asp:Literal runat="server" Text="Importe"></asp:Literal>:&nbsp;</label><asp:Literal ID="LtlImporte" runat="server"></asp:Literal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<asp:Literal runat="server" Text="Saldo"></asp:Literal>:&nbsp;</label><asp:Literal ID="LtlSaldo" runat="server"></asp:Literal>
</div>--%>
</td>
</tr>
<tr>
<td>
<div class="portlet light xspadding bordered">
<%--<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-th-list font-green"></i>
<span class="caption-subject bold uppercase">Movimientos</span>
</div>
<div class="actions">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpRepClientesPagosBancos">
<ContentTemplate>
<asp:LinkButton ID="LnkPagosClientesBancosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkPagosClientesBancosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPagosClientesBancosPDF" />
<asp:PostBackTrigger ControlID="LnkPagosClientesBancosExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>--%>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<table border="0">
<tr>
<td>
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpDatos">
<ContentTemplate>
<asp:GridView ID="GVAuxiliar" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePrePoliza, Cargo, Abono, CveReferencia, IdPoliza,CvePrePolizaOriginal" EmptyDataText="No se encontraron Movimientos de Auxiliar" ToolTip="Listado de Auxiliar Contable" CssClass="table table-striped table-advance table-hover mysmallbtn Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaMovto" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Concepto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlConcepto" runat="server" Text='<%# Eval("ConceptoContable") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Cargo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCargo" runat="server" Text='<%# If(CDbl(Eval("Cargo")) = 0, "", Eval("Cargo", "{0:N2}")) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Abono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbono" runat="server" Text='<%# If(CDbl(Eval("Abono")) = 0, "", Eval("Abono", "{0:N2}")) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Folio (Ref.)</HeaderTemplate>
<ItemTemplate>
&nbsp;<asp:HyperLink ID="HplReferencia" runat="server" Text='<%# Eval("Referencia", "{0}") %>' Target="_blank"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Contabilizado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlContabilizado" runat="server" Text='<%# Eval("Contabilizado") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Num. Póliza</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPoliza" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fecha Conta.</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaConta" runat="server" Text='<%# Eval("FechaConta", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="8000px">
<HeaderTemplate>Referencia</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="LtlConceptoInfo" runat="server" Text='<%# Eval("Concepto") %>' NavigateUrl='<%# Eval("CvePrePoliza", "/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Usuario</HeaderTemplate>
<ItemTemplate>
<asp:Label ToolTip='<%# Eval("Usuario") %>' runat="server">
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# If(Eval("Usuario").ToString.Length > 15, Eval("Usuario").ToString.Substring(0, 15), Eval("Usuario")) %>'></asp:Literal>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</div>
<div>
</div>
</td>
</tr>
</table>
<div id="DivCancelar" class="modal fade">
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
<asp:UpdatePanel ID="UpEliminarCotizacion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h3 class="modal-title">Cancelar Movimiento</h3>
</div>
<div class="modal-body">
<div class="row" style="align-items: center; vertical-align: middle;">
<label class="col-md-4" style="max-width: 155px;">Concepto:</label>
<asp:TextBox ID="TxtConceptoCancelacion" runat="server" CssClass="form-control input-sm" Width="90%" CausesValidation="true" MaxLength="100" ValidationGroup="GrpCancelarPrepoliza"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoCancelacion" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpCancelarPrepoliza"></asp:RequiredFieldValidator>
</div>
<div class="row" style="align-items: center; vertical-align: middle;">
<label class="col-md-4" style="max-width: 155px;">Fecha de Cancelación:</label>
<div class="col-md-3">
<div class="input-group date date-picker" data-date-format="dd/mm/yyyy" style="width: 85px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaCancelacion" runat="server" CssClass="form-control input-sm" Width="80px" CausesValidation="true" MaxLength="10" ValidationGroup="GrpCancelarPrepoliza"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default input-sm" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaCancelacion" runat="server" TargetControlID="TxtFechaCancelacion" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioCancelacion" runat="server" TargetControlID="TxtFechaCancelacion" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaCancelacion" runat="server" ControlToValidate="TxtFechaCancelacion" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpCancelarPrepoliza" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Cancelación''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha2Cancelacion" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCancelacion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtFechaCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpCancelarPrepoliza"></asp:RequiredFieldValidator>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="Button2" OnClick="BtnCancelarAux_Click" runat="server" CssClass="btn btn-success" Text="Cancelar Movimiento" ValidationGroup="GrpCancelarPrepoliza" />
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
@@ -3304,7 +3490,7 @@
<tr align="left" id="trCorreoNotif2" runat="server" visible="false">
<td>
<asp:TextBox ID="TxtCorreoNotificaciones" runat="server" Width="100%" CssClass="form-control"></asp:TextBox></td>
</tr>
</tr>
<tr align="left" id="trPaqueteriOpcionesLabel" runat="server" visible="false">
<td id="Td2" runat="server">Tipo de Entrega:&nbsp;</td>
</tr>
@@ -3689,7 +3875,7 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="ModalOtrosConceptos" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
@@ -5348,13 +5534,13 @@
<asp:UpdatePanel ID="UPPProyecto" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright" id="divProyectoPyME" runat="server">
<asp:Label id="LblProyectoPyME" runat="server" for="<%= DdlProyectoPyME.ClientID.ToString()%>">Proyecto:</asp:Label>
<asp:Label ID="LblProyectoPyME" runat="server" for="<%= DdlProyectoPyME.ClientID.ToString()%>">Proyecto:</asp:Label>
<asp:DropDownList ID="DdlProyectoPyME" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="50%">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label id="LblSubProyectoPyME" runat="server" for="<%= DdlSubProyectoPyME.ClientID.ToString()%>">SubProyecto:</asp:Label>
<asp:Label ID="LblSubProyectoPyME" runat="server" for="<%= DdlSubProyectoPyME.ClientID.ToString()%>">SubProyecto:</asp:Label>
<asp:DropDownList ID="DdlSubProyectoPyME" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="50%">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -6397,24 +6583,24 @@
</div>
</div>
<div id="DivEstadoPaisCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:DropDownList ID="DdlSATPais" runat="server" CssClass="form-control input-sm select2me" OnSelectedIndexChanged="DdlSATPais_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Value="MEX" Text="México" Selected="True"></asp:ListItem>
<asp:ListItem Value="USA" Text="USA"></asp:ListItem>
<asp:ListItem Value="CAN" Text="Canada"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSATPais" runat="server" InitialValue="-1" ControlToValidate="DdlSATPais" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pais''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= DdlSATPais.ClientID.ToString()%>">Pais:</label>
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:DropDownList ID="DdlSATPais" runat="server" CssClass="form-control input-sm select2me" OnSelectedIndexChanged="DdlSATPais_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Value="MEX" Text="México" Selected="True"></asp:ListItem>
<asp:ListItem Value="USA" Text="USA"></asp:ListItem>
<asp:ListItem Value="CAN" Text="Canada"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSATPais" runat="server" InitialValue="-1" ControlToValidate="DdlSATPais" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pais''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= DdlSATPais.ClientID.ToString()%>">Pais:</label>
</div>
<div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:DropDownList ID="DdlEstadoSAT" DataTextField="NombreEstado" DataValueField="CveSATEstado" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlEstadoSAT" runat="server" InitialValue="-1" ControlToValidate="DdlEstadoSAT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estado''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= DdlEstadoSAT.ClientID.ToString()%>">Estado:</label>
<asp:DropDownList ID="DdlEstadoSAT" DataTextField="NombreEstado" DataValueField="CveSATEstado" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlEstadoSAT" runat="server" InitialValue="-1" ControlToValidate="DdlEstadoSAT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estado''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= DdlEstadoSAT.ClientID.ToString()%>">Estado:</label>
</div>
</div>
<div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
@@ -7141,121 +7327,121 @@
var ValorTxt = Obj.value;
var suma = 0;
var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
function ValidarCantidad(t, c) {
t.value = (t.value > c ? c : t.value)
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
function ValidarCantidad(t, c) {
t.value = (t.value > c ? c : t.value)
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C
function ValidarCantidadMenor(t, c) {
t.value = (t.value > c ? t.value : c)
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C
function ValidarCantidadMenor(t, c) {
t.value = (t.value > c ? t.value : c)
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function SeriePSBlur(b, txt, hdn) {
;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
function SeriePSBlur(b, txt, hdn) {
;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
$('#BtnVinculaAFEdit').click();
}
}
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
}
}
//Suma Totales
function FnSuma() {
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
debugger;
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
//Suma Totales
function FnSuma() {
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
debugger;
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
if ($(this).attr("class") == '5') // cuando es traslado de impuesto local, se suma
totalVenta += ToDouble($(this).val().toString());
@@ -7325,60 +7511,60 @@
var Total = ToDouble($get('TxtSubTotal').value);
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
let importeTxt = parseFloat(txt.value.replace(/,/g, ''));
let importeTxt = parseFloat(txt.value.replace(/,/g, ''));
if (isNaN(importeTxt)) {
importeTxt = 0;
} else {
if (importeTxt <= 0) {
importeTxt = 0;
chk.checked = false;
return;
}
}
if (isNaN(importeTxt)) {
importeTxt = 0;
} else {
if (importeTxt <= 0) {
importeTxt = 0;
chk.checked = false;
return;
}
}
saldo = (importeTxt > saldo) ? saldo : importeTxt;
saldo = (importeTxt > saldo) ? saldo : importeTxt;
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
function FnSumaValoresAnt() {
debugger;
var totalPoints = 0;
var t = '';
function FnSumaValoresAnt() {
debugger;
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
}
return Math.round(totalPoints * 100) / 100;
}
function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val('');
function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val('');
$('#<%= TxtColonia.ClientID %>').val('');
$('#<%= TxtCiudad.ClientID %>').val('');
$('#<%= TxtEstado.ClientID %>').val('');

View File

@@ -1710,6 +1710,31 @@ Partial Class Ventas
#End Region
#Region "AuxiliarConta"
Property CvePrePolizaNegativa As Integer
Get
If ViewState("CvePrePolizaNegativa") Is Nothing Then
Return -1
Else
Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CvePrePolizaNegativa") = value
End Set
End Property
Private Property DTDatos As DataTable
Get
Return CType(ViewState("DTDatos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTDatos") = value
End Set
End Property
#End Region
#Region " A C U M U L A D O R E S"
Private Property ClienteEsDistribuidor As Boolean
@@ -3642,7 +3667,8 @@ Partial Class Ventas
HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675"
HlCuentaTerminal.Visible = True
End If
CargarSaldoAuxiliar(CveCliente)
TabAuxiliarConta.Visible = True
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then ' si tiene acceso en el subproyecto
'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175)
@@ -26096,4 +26122,123 @@ Partial Class Ventas
End If
ObjVentas.Dispose()
End Sub
#Region "Auxiliar"
Private Sub CargarSaldoAuxiliar(CveCliente As Integer)
CargaAuxiliarClienteCxC(CveCliente, CveVenta)
End Sub
Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveVenta As Integer)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveVenta) Then
DtDatos = ObjMovtos.DtResultados
GVAuxiliar.DataSource = ObjMovtos.DtResultados
Else
GVAuxiliar.DataSource = Nothing
End If
ObjMovtos.Dispose()
GVAuxiliar.DataBind()
End Sub
Protected Sub BtnCancelarAux_Click(sender As Object, e As EventArgs)
AgregaPolizaNegativo(CvePrePolizaNegativa)
End Sub
Private Sub AgregaPolizaNegativo(CvePrePoliza As Integer)
Dim ObjContabilidad As New ClsContabilidad
Dim TieneError As Boolean = False
ObjContabilidad.IniciaTransacSQL()
Dim CvePrePolizaNueva As Integer = ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate)
If Not CvePrePolizaNueva > 0 Then
TieneError = True
End If
If Not TieneError Then
ObjContabilidad.Commit()
Dim Str As New StringBuilder
Str.Append("Se agrego la póliza de cancelación correctamente.<br/>")
RegistraScript(" $('#DivCancelar').modal('hide'); ")
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If ObjContabilidad.ContabilizarPrePoliza(CvePrePolizaNueva, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
Str.AppendFormat("<a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", ObjContabilidad.ContaIdPoliza)
End If
End If
Alert(Str.ToString)
Else
ObjContabilidad.RollBack()
End If
ObjContabilidad.Dispose()
CargarSaldoAuxiliar(CveCliente)
End Sub
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAuxiliar.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.BackColor = Drawing.Color.LightGray
e.Row.FCLiteral("LtlFechaMovto").Text = "Totales:&nbsp;"
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(0).ColumnSpan = 2
e.Row.Cells(1).Visible = False
e.Row.Cells(4).ColumnSpan = 3
e.Row.Cells(5).Visible = False
e.Row.Cells(6).Visible = False
e.Row.Cells(7).Visible = False
e.Row.Cells(8).Visible = False
ElseIf e.Row.RowIndex = 1 Then
e.Row.Cells(0).Width = Unit.Pixel(95)
e.Row.Cells(1).Width = Unit.Pixel(180)
e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(83)
e.Row.Cells(5).Width = Unit.Pixel(93)
e.Row.Cells(6).Width = Unit.Pixel(85)
e.Row.Cells(7).Width = Unit.Pixel(95)
e.Row.Cells(8).Width = Unit.Pixel(70)
End If
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
If e.Row.FCLiteral("LtlContabilizado").Text = "Si" Then
Dim Liga As String = String.Format("<a class=""Texto"" href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">", e.Row.DBCampo("IdPoliza"))
e.Row.FCLiteral("LtlPoliza").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("Poliza"))
End If
If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(2) AndAlso e.Row.DBCampo("CvePersonal").ToEntero > 0 Then
Dim Liga As String = String.Format("<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal={0}"">", e.Row.DBCampo("CvePersonal"))
e.Row.FCLiteral("LtlConcepto").Text = String.Format("{0}{1}</a>", Liga, e.Row.DBCampo("ConceptoContable"))
End If
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DBCampo("CveReferencia").ToEntero}"
ElseIf e.Row.DBCampo("TipoReferencia").ToEntero = 2 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveReferencia").ToEntero}"
End If
If e.Row.DBCampo("CveConceptoContable").ToEntero.Contiene(275) AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta").ToEntero}"
End If
End If
End Sub
#End Region
End Class