Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2521,76 +2521,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpCreditos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="romCreditosTabla" visible="false" style="max-height: 250px!important">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-6" style="text-align: right"></div>
|
||||
|
||||
<div class="col-md-6" style="text-align: left">
|
||||
<asp:Label runat="server" Font-Bold="true" ID="LblImporteCreditos" Text="Total:"> </asp:Label>
|
||||
</div>
|
||||
<br />
|
||||
<asp:UpdatePanel runat="server" ID="UpGvCreditos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="row" style="height: 200px!important">
|
||||
<div class="col-md-12" style="height: 200px!important">
|
||||
|
||||
<asp:GridView ID="GvCreditos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveCredito,CveCreditoDetalle,FondoGarantia,Periodo,Periodos,Marcador,ProximoPeriodo,TipoPago,Fecha,CveMoneda,Referencia,CveTipoCredito,SeparadorLiquido,Estatus,CveCompra,CveCompraInteres,Mensualidad"
|
||||
EmptyDataText="No se encontraron Créditos registrados"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true" data-height="200" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Sel" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkSel" CssClass="ChkSelCreditos" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="Referencia" HeaderText="Crédito" HeaderStyle-CssClass="rompe" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ProximoPeriodo" HeaderText="Pago" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" />
|
||||
|
||||
<asp:TemplateField HeaderText="Capital" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtCapital" Width="60px" Style="text-align: right;" ToolTip="Incluye IVA"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Interes" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtInteres" Width="60px" Style="text-align: right;" ToolTip="Incluye IVA"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtAmbos" Width="60px" Style="text-align: right;" ToolTip="Incluye IVA"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<asp:GridView ID="GvCreditosRelacionados" runat="server" AutoGenerateColumns="False" Visible="false"
|
||||
EmptyDataText="No se encontraron Créditos registrados"
|
||||
CssClass=" chequesie2 Widthall ScrollAD mysmallbtn" data-sort="false" data-height="200" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="Referencia" ItemStyle-HorizontalAlign="Left" HeaderText="Referencia" DataNavigateUrlFields="CveCredito" DataNavigateUrlFormatString='/Bancos/Creditos.aspx?CveCredito={0}' ControlStyle-CssClass="rompe" />
|
||||
<asp:BoundField DataField="PeriodoTexto" HeaderText="Periodo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" />
|
||||
<asp:BoundField DataField="Tipo" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<%--<%--Reembolsos--%>
|
||||
<br />
|
||||
@@ -4292,6 +4223,141 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DivCreditoFinacieroModal" align="center" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 1000px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpdatePanel3" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal3" runat="server" Text="Créditos Financieros" />
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpCreditos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<%--<div class="row" runat="server" id="romCreditosTabla" visible="false" style="max-height: 250px!important">--%>
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-6" style="text-align: right"></div>
|
||||
|
||||
<div class="col-md-6" style="text-align: left">
|
||||
<asp:Label runat="server" Font-Bold="true" ID="LblImporteCreditos" Text="Acumulado:"> </asp:Label>
|
||||
</div>
|
||||
<br />
|
||||
<asp:UpdatePanel runat="server" ID="UpGvCreditos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="row" >
|
||||
<div class="col-md-12" >
|
||||
|
||||
<asp:GridView ID="GvCreditos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveCredito,CveCreditoDetalle,FondoGarantia,Periodo,Periodos,Marcador,ProximoPeriodo,TipoPago,Fecha,CveMoneda,Referencia,CveTipoCredito,SeparadorLiquido,Estatus,CveCompra,CveCompraInteres,Mensualidad,CveIE,Total,ImporteIE"
|
||||
EmptyDataText="No se encontraron Créditos registrados"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true" data-height="200" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Sel" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkSel" CssClass="ChkSelCreditos" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="Referencia" HeaderText="Crédito" HeaderStyle-CssClass="rompe" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="300px" />
|
||||
<asp:BoundField DataField="ProximoPeriodo" HeaderText="Pago" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" />
|
||||
|
||||
<asp:BoundField DataField="Total" HeaderText="Mensualidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="ImporteIE" HeaderText="Pagado" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
|
||||
<asp:TemplateField HeaderText="Capital" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtCapital" Width="60px" Style="text-align: right;" ToolTip="Incluye IVA"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Interes" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtInteres" Width="60px" Style="text-align: right;" ToolTip="Incluye IVA"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Amortizar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtAmbos" Width="60px" Style="text-align: right;" ToolTip="Incluye IVA"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Redondeo" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtComision" runat="server" MaxLength="12" Width="76px" Style="text-align: right;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtComision" runat="server" TargetControlID="TxtComision" ValidChars="-." FilterType="Custom, Numbers" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Doc. Por Pagar" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblDocPorPagar" Style="text-align: right;" Text="0" ></asp:Label>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<asp:GridView ID="GvCreditosRelacionados" runat="server" AutoGenerateColumns="False" Visible="false"
|
||||
EmptyDataText="No se encontraron Créditos registrados"
|
||||
CssClass=" chequesie2 Widthall ScrollAD mysmallbtn" data-sort="false" data-height="200" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="Referencia" ItemStyle-HorizontalAlign="Left" HeaderText="Referencia" DataNavigateUrlFields="CveCredito" DataNavigateUrlFormatString='/Bancos/Creditos.aspx?CveCredito={0}' ControlStyle-CssClass="rompe" />
|
||||
<asp:BoundField DataField="PeriodoTexto" HeaderText="Periodo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" />
|
||||
<asp:BoundField DataField="Tipo" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<%--</div>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button id="BtnGuardarmodalCreditosFiancieros" runat="server" type="button" class="btn btn-success" data-dismiss="modal">Guardar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%--MODAL AGREGAR/EDITAR PS--%>
|
||||
<div id="divAddProducto" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
@@ -6545,59 +6611,111 @@
|
||||
|
||||
|
||||
|
||||
function ValidaCredito(objTxt, event, CveCreditoDetalle, Tipo) {
|
||||
|
||||
var ValorInicialTFloat = objTxt.value.toString().replace(/,/g, '').length = 0 ? 0 : parseFloat(objTxt.value.toString().replace(/,/g, ''));
|
||||
|
||||
function ValidaCredito( event, CveCreditoDetalle, Tipo, ImporteIE ) {
|
||||
|
||||
var char = event.which || event.keyCode;
|
||||
|
||||
if (char == 9) {//Evita que se ejecute la rutina cuando se presiona Tap (cuando se salta de interes a ambas si se ejecuta se limpian los valores de capital e interes)
|
||||
return;
|
||||
}
|
||||
if (char == 9) {
|
||||
return;//Evita que se ejecute la rutina cuando se presiona Tap (cuando se salta de interes a ambas si se ejecuta se limpian los valores de capital e interes)
|
||||
}
|
||||
|
||||
debugger;
|
||||
|
||||
if (ValorInicialTFloat == 0) {
|
||||
objTxt.value = '0';
|
||||
//return;
|
||||
}
|
||||
let TotalCompra = 0;
|
||||
let ImporteAmortizado = 0;
|
||||
let ImporteComision = 0;
|
||||
let ImporteDocPorPagar = 0;
|
||||
let TotalAmortizaciones = 0;
|
||||
let TotalComisiones = 0;
|
||||
|
||||
let Total = 0;
|
||||
let TotalString = '';
|
||||
TotalCompra = parseFloat($('#<%= TxtTotal.ClientID %>').val().replace(/,/g, '')).toFixed(2);
|
||||
ImporteAmortizado = $(`.CsSelAmbos${CveCreditoDetalle}`).val().replace(/,/g, '').length == 0 ? 0 : parseFloat($(`.CsSelAmbos${CveCreditoDetalle}`).val().replace(/,/g, ''));
|
||||
ImporteComision = $(`.CsSelComision${CveCreditoDetalle}`).val().replace(/,/g, '').length == 0 ? 0 : parseFloat($(`.CsSelComision${CveCreditoDetalle}`).val().replace(/,/g, ''));
|
||||
ImporteDocPorPagar = (ImporteIE - ImporteAmortizado - ImporteComision).toFixed(2);
|
||||
|
||||
if (Tipo == 1) {
|
||||
$(`.CsSelAmbos${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
$(`.CsSelAmbos${CveCreditoDetalle}`).each(function () {
|
||||
$(this).val("");
|
||||
});
|
||||
|
||||
$(`.CsSelCapital${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
$(`.CsSelInteres${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$(`.CsSelAmbos${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
$(`.CsSelCapital${CveCreditoDetalle}`).each(function () {
|
||||
$(this).val("");
|
||||
});
|
||||
|
||||
$(`.CsSelInteres${CveCreditoDetalle}`).each(function () {
|
||||
$(this).val("");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var TotalCompra = parseFloat($('#<%= TxtTotal.ClientID %>').val().replace(/,/g, '')).toFixed(2);
|
||||
$(`.CsSelComision${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
$(`.CsCreGlobal`).each(function () {
|
||||
let stringTemp = $(this).val().replace(/,/g, '');
|
||||
let tempValor = parseFloat(stringTemp);
|
||||
|
||||
if (!isNaN(tempValor)) {
|
||||
TotalAmortizaciones += tempValor
|
||||
}
|
||||
});
|
||||
|
||||
$(`.CsComGlobal`).each(function () {
|
||||
let stringTemp = $(this).val().replace(/,/g, '');
|
||||
let tempValor = parseFloat(stringTemp);
|
||||
|
||||
if (!isNaN(tempValor)) {
|
||||
TotalComisiones += tempValor
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (((TotalAmortizaciones + TotalComisiones) > TotalCompra) || ((ImporteAmortizado + ImporteComision) > ImporteIE)) {
|
||||
|
||||
TotalAmortizaciones = 0;
|
||||
TotalComisiones = 0;
|
||||
|
||||
if (Tipo == 1) {
|
||||
$(`.CsSelAmbos${CveCreditoDetalle}`).val(``);
|
||||
} else if (Tipo == 2) {
|
||||
$(`.CsSelComision${CveCreditoDetalle}`).val(``);
|
||||
}
|
||||
|
||||
|
||||
TotalCompra = parseFloat($('#<%= TxtTotal.ClientID %>').val().replace(/,/g, '')).toFixed(2);
|
||||
ImporteAmortizado = $(`.CsSelAmbos${CveCreditoDetalle}`).val().replace(/,/g, '').length == 0 ? 0 : parseFloat($(`.CsSelAmbos${CveCreditoDetalle}`).val().replace(/,/g, ''));
|
||||
ImporteComision = $(`.CsSelComision${CveCreditoDetalle}`).val().replace(/,/g, '').length == 0 ? 0 : parseFloat($(`.CsSelComision${CveCreditoDetalle}`).val().replace(/,/g, ''));
|
||||
ImporteDocPorPagar = (ImporteIE - ImporteAmortizado - ImporteComision).toFixed(2);
|
||||
|
||||
$(`.CsSelAmbos${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
$(`.CsSelComision${CveCreditoDetalle}`).each(function () {
|
||||
FormatoMoneda3($(this));
|
||||
});
|
||||
|
||||
$(`.CsCreGlobal`).each(function () {
|
||||
|
||||
let stringTemp = $(this).val().replace(/,/g, '');
|
||||
let tempValor = parseFloat(stringTemp);
|
||||
|
||||
if (!isNaN(tempValor)) {
|
||||
TotalAmortizaciones += tempValor
|
||||
}
|
||||
});
|
||||
|
||||
$(`.CsComGlobal`).each(function () {
|
||||
|
||||
let stringTemp = $(this).val().replace(/,/g, '');
|
||||
let tempValor = parseFloat(stringTemp);
|
||||
|
||||
if (!isNaN(tempValor)) {
|
||||
TotalComisiones += tempValor
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (ImporteAmortizado == 0 & ImporteComision == 0) {
|
||||
ImporteDocPorPagar = 0;
|
||||
}
|
||||
|
||||
$('#<%= LblImporteCreditos.ClientID %>').text('Acumulado: ' + FormatoNumero((TotalAmortizaciones + TotalComisiones), 2));
|
||||
$(`.CsSelLblDocPorPagar${CveCreditoDetalle}`).text(FormatoNumero(ImporteDocPorPagar, 2));
|
||||
|
||||
|
||||
|
||||
/* $(`.CsCreGlobal`).each(function () {
|
||||
|
||||
let stringTemp = $(this).val().replace(/,/g, '');
|
||||
let tempValor = parseFloat(stringTemp);
|
||||
@@ -6605,11 +6723,11 @@
|
||||
if (!isNaN(tempValor)) {
|
||||
Total += tempValor
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
if (Total > TotalCompra) {
|
||||
/*if (Total > TotalCompra) {
|
||||
|
||||
let TmpObtTxtValor = TotalCompra - (Total - ValorInicialTFloat);
|
||||
let TmpObtTxtValor = TotalCompra - (Total - ImporteAmortizado);
|
||||
|
||||
if (TmpObtTxtValor > 0) {
|
||||
objTxt.value = '' + FormatoNumero(TmpObtTxtValor, 2);
|
||||
@@ -6618,13 +6736,13 @@
|
||||
}
|
||||
|
||||
Total = TotalCompra;
|
||||
}
|
||||
}*/
|
||||
|
||||
$('#<%= LblImporteCreditos.ClientID %>').text('Total ' + FormatoMonedaL(Total));
|
||||
//$('#<%= LblImporteCreditos.ClientID %>').text('Acumulado: ' + FormatoMonedaL(Total));
|
||||
|
||||
if (ValorInicialTFloat == 0) {
|
||||
/*if (ImporteAmortizado == 0) {
|
||||
objTxt.value = '';
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2559,7 +2559,7 @@ Partial Class Compras_Compras
|
||||
GvCreditosRelacionados.DataSource = ObjBancos.DtResultados
|
||||
GvCreditosRelacionados.Visible = True
|
||||
GvCreditosRelacionados.DataBind()
|
||||
romCreditosTabla.Visible = True
|
||||
'romCreditosTabla.Visible = True
|
||||
GvCreditos.Visible = False
|
||||
GvCreditosRelacionados.Visible = True
|
||||
|
||||
@@ -4187,7 +4187,7 @@ Partial Class Compras_Compras
|
||||
Dim DifCreCompra As Decimal = 0
|
||||
Dim TotalCreditos As Decimal = 0
|
||||
Dim MensualidadMultipleTotal As Decimal = 0
|
||||
Dim CveUltimoCreditoDetalleInterno As Integer
|
||||
' Dim CveUltimoCreditoDetalleInterno As Integer
|
||||
|
||||
For Each GvRow As GridViewRow In GvCreditos.Rows
|
||||
|
||||
@@ -4201,22 +4201,22 @@ Partial Class Compras_Compras
|
||||
|
||||
TotalCreditos = TotalCreditos + CapitalMiltiple + InteresMiltiple
|
||||
MensualidadMultipleTotal = MensualidadMultipleTotal + MensualidadMultiple
|
||||
CveUltimoCreditoDetalleInterno = GvRow.DataKey("CveCreditoDetalle").ToEntero
|
||||
'CveUltimoCreditoDetalleInterno = GvRow.DataKey("CveCreditoDetalle").ToEntero
|
||||
|
||||
ElseIf AmbosMiltiple > 0 Then
|
||||
|
||||
TotalCreditos = TotalCreditos + AmbosMiltiple
|
||||
MensualidadMultipleTotal = MensualidadMultipleTotal + MensualidadMultiple
|
||||
CveUltimoCreditoDetalleInterno = GvRow.DataKey("CveCreditoDetalle").ToEntero
|
||||
'CveUltimoCreditoDetalleInterno = GvRow.DataKey("CveCreditoDetalle").ToEntero
|
||||
EstatusCredito = GvRow.DataKey("Estatus").ToEntero
|
||||
End If
|
||||
Next
|
||||
|
||||
If TotalCreditos <> TxtTotal.Text.ToDecimal Then
|
||||
Alert($"El importe de La factura no concide con el total de los creditos, diferencia: { (TotalCreditos - TxtTotal.Text.ToDecimal).FormatoNumero(2)}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
'If TotalCreditos <> TxtTotal.Text.ToDecimal Then
|
||||
' Alert($"El importe de La factura no concide con el total de los creditos, diferencia: { (TotalCreditos - TxtTotal.Text.ToDecimal).FormatoNumero(2)}", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
''VERIFICA SI LOS PRODUCTOS/SERVICIOS EXISTEN EN EL CATALOGO DEL SAT
|
||||
@@ -4833,9 +4833,9 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(1, 101) Then
|
||||
CveEstatusFactura = 6
|
||||
End If
|
||||
'If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(1, 101) Then
|
||||
' CveEstatusFactura = 6
|
||||
'End If
|
||||
|
||||
|
||||
'Compra
|
||||
@@ -5996,6 +5996,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(2, 102) Then 'SI ES CRÉDITO Y ESTA PAGADO
|
||||
|
||||
'aqui meter for, con validaciones de estatus de creditos
|
||||
For Each Row2 As DataRow In TmpDT.Rows
|
||||
|
||||
importeMovimiento = TxtTotal.Text.ToDecimal 'TmpDT.SUM("Total", String.Format("ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And CveClasificacion = {0} And CveSubProyecto = {1} And ISNULL(CveTipoGasto, 0) = {2} Then", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
|
||||
@@ -6041,20 +6042,67 @@ Partial Class Compras_Compras
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, importeMN, 41, Referencia, Concepto, CtaProveedorAcreedores, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=CveClasificacionDT, CveSubProyecto:=CveSubProyectoDT, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=CveTipoGastoDT, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'daskldaskldmaskldanmlksd
|
||||
If importeMovimiento <> 0 Then
|
||||
Dim Pago As New CompraPago
|
||||
Pago.ImportePago = importeMovimiento
|
||||
Pago.CveIE = CveIE
|
||||
Pago.CveMonedaPago = 1
|
||||
Pago.CveCompraAmortizacion = -1
|
||||
Pago.CveCreditoDetalle = CveCreditoDetalle
|
||||
'Pago.OtroGastoIngreso = OtrosGastosIngresos
|
||||
For Each gvRowCredito As GridViewRow In GvCreditos.Rows
|
||||
|
||||
Dim ImportePagoCredito As Decimal = If(gvRowCredito.FCTextBox("TxtAmbos").Text.ToDecimal > 0, gvRowCredito.FCTextBox("TxtAmbos").Text.ToDecimal, (gvRowCredito.FCTextBox("TxtCapital").Text.ToDecimal + gvRowCredito.FCTextBox("TxtInteres").Text.ToDecimal))
|
||||
Dim ImporteIEAnticipo As Decimal = gvRowCredito.DataKey("ImporteIE").ToDecimal '' Lo que se pago desde el movimiento Bancario
|
||||
|
||||
Dim CveMonedaCredito As Integer = gvRowCredito.DataKey("CveMoneda").ToEntero
|
||||
|
||||
Dim OtrosGastosIngresosCredito As Decimal = gvRowCredito.FCTextBox("TxtComision").Text.ToDecimal
|
||||
Dim CveIECredito As Integer = gvRowCredito.DataKey("CveIE").ToEntero
|
||||
Dim CveCreditoDetalleTemp As Integer = gvRowCredito.DataKey("CveCreditoDetalle").ToEntero
|
||||
|
||||
If ImportePagoCredito > 0 Then
|
||||
Dim Pago As New CompraPago
|
||||
Pago.ImportePago = ImportePagoCredito
|
||||
Pago.CveIE = CveIECredito
|
||||
Pago.CveMonedaPago = 1
|
||||
Pago.CveCompraAmortizacion = -1
|
||||
Pago.CveProveedor = CveProveedor
|
||||
Pago.CveCreditoDetalle = CveCreditoDetalleTemp
|
||||
Pago.TipoPago = "Egsc"
|
||||
|
||||
If OtrosGastosIngresosCredito <> 0 Then
|
||||
Pago.OtroGastoIngreso = OtrosGastosIngresosCredito
|
||||
End If
|
||||
|
||||
ErrorCreditosCompra = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
If ErrorCreditosCompra Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim ImporteDifCredito As Decimal = ImporteIEAnticipo - ImportePagoCredito ' CompraActual.Total
|
||||
|
||||
If ImporteDifCredito > 0 Then
|
||||
|
||||
' Dim ImportePagoCreditoMN As Decimal = ImportePagoCredito * tipoCambioActual
|
||||
Dim ImporteDifCreditoMN As Decimal = ImporteDifCredito * tipoCambioActual
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDifCredito, ImporteDifCreditoMN, 59, Referencia, Concepto, IdCtaContable, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIECredito, CveCreditoDetalle:=CveCreditoDetalleTemp, CveClasificacion:=CveClasificacionDT, CveSubProyecto:=CveSubProyectoDT, ImporteME:=If(tipoCambioActual = 1, 0, ImporteDifCredito), CveTipoGasto:=CveTipoGastoDT, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDifCredito, ImporteDifCreditoMN, 21, Referencia, Concepto, CtaProveedorAcreedores, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIECredito, CveCreditoDetalle:=CveCreditoDetalleTemp, CveClasificacion:=CveClasificacionDT, CveSubProyecto:=CveSubProyectoDT, ImporteME:=If(tipoCambioActual = 1, 0, ImporteDifCredito), CveTipoGasto:=CveTipoGastoDT, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Next
|
||||
|
||||
|
||||
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
End If
|
||||
|
||||
@@ -6094,6 +6142,10 @@ Partial Class Compras_Compras
|
||||
IdCtaContable = CtaProveedorExtranjera
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Case 30 'Bancos
|
||||
importeMovimiento = importeBanco + importeCajaChica 'Uno de los dos debe ser 0
|
||||
If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
@@ -6747,40 +6799,33 @@ Partial Class Compras_Compras
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
|
||||
|
||||
|
||||
If TotalRealDevolucion <> 0 Then
|
||||
|
||||
If Math.Abs(DiferenciaDevolucion) > 0 Then
|
||||
|
||||
|
||||
Dim CveSubProyecto69 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero
|
||||
Dim CveClasificacion69 As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero
|
||||
|
||||
|
||||
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacion69}").ToString.ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaDevolucion.RoundSQL(), Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then
|
||||
Dim tMovto As Boolean = False
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
tMovto = True
|
||||
Else
|
||||
DiferenciaDevolucion = -DiferenciaDevolucion
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, DiferenciaDevolucion.RoundSQL(), Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion.RoundSQL(), Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=(TotalRealDevolucion * tipoCambioActual).RoundSQL(), ImporteME:=If(tipoCambioActual = 1, 0, TotalRealDevolucion).RoundSQL(), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento.RoundSQL, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -11794,7 +11839,7 @@ Partial Class Compras_Compras
|
||||
tdNumeroReembolso.Visible = False
|
||||
End If
|
||||
EsContado = False
|
||||
romCreditosTabla.Visible = False
|
||||
'romCreditosTabla.Visible = False
|
||||
Case "2" 'Contado
|
||||
PnlContado.Visible = True
|
||||
TxtNumeroReembolso.Text = ""
|
||||
@@ -11817,7 +11862,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
EsContado = True
|
||||
romCreditosTabla.Visible = False
|
||||
'romCreditosTabla.Visible = False
|
||||
Case "3" 'Reembolso/Comprobacion
|
||||
PnlContado.Visible = True
|
||||
|
||||
@@ -11874,7 +11919,7 @@ Partial Class Compras_Compras
|
||||
Case "6"
|
||||
DdlCuentaCajaChicaReembolso.Visible = True
|
||||
End Select
|
||||
romCreditosTabla.Visible = False
|
||||
'romCreditosTabla.Visible = False
|
||||
Case "4"
|
||||
EsContado = False
|
||||
CargaCreditosDisponibles()
|
||||
@@ -11886,6 +11931,11 @@ Partial Class Compras_Compras
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivContadoModal"))
|
||||
End If
|
||||
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero = 4 Then ' Créditos Financieros
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivCreditoFinacieroModal"))
|
||||
End If
|
||||
|
||||
LtlTituloPago.Text = If(EsContado, "Contado", "Reembolso")
|
||||
|
||||
DivContado.Visible = EsContado
|
||||
@@ -11949,20 +11999,20 @@ Partial Class Compras_Compras
|
||||
Case "1" ' Bancos
|
||||
PnlContadoBancos.Visible = True
|
||||
TxtDocumentoImporte.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero
|
||||
ChkCreditoMultiple.Visible = False
|
||||
'ChkCreditoMultiple.Visible = False
|
||||
RfvTxtNumeroReembolso.Enabled = False
|
||||
TxtNumeroReembolso.Text = ""
|
||||
TxtRembolsoNumero.Text = ""
|
||||
Case "2" ' F y E
|
||||
PnlContadoFyE.Visible = True
|
||||
CargaFuncionariosEmpleados()
|
||||
ChkCreditoMultiple.Visible = False
|
||||
'ChkCreditoMultiple.Visible = False
|
||||
RfvTxtNumeroReembolso.Enabled = True
|
||||
TxtRembolsoNumero.Text = ""
|
||||
TxtNumeroReembolso.Text = ""
|
||||
Case "3" ' Creditos
|
||||
PnlContadoCreditos.Visible = True
|
||||
ChkCreditoMultiple.Visible = True
|
||||
'ChkCreditoMultiple.Visible = True
|
||||
CargaCreditos()
|
||||
RfvTxtNumeroReembolso.Enabled = False
|
||||
RfvTxtNumeroReembolso.Text = ""
|
||||
@@ -11970,13 +12020,13 @@ Partial Class Compras_Compras
|
||||
Case "4" ' Deudores
|
||||
PnlContadoDeudores.Visible = True
|
||||
CargaDeudores()
|
||||
ChkCreditoMultiple.Visible = False
|
||||
'ChkCreditoMultiple.Visible = False
|
||||
RfvTxtNumeroReembolso.Enabled = False
|
||||
TxtNumeroReembolso.Text = ""
|
||||
TxtRembolsoNumero.Text = ""
|
||||
Case "5" ' ACREEDORES
|
||||
PnlContadoAcreedores.Visible = True
|
||||
ChkCreditoMultiple.Visible = True
|
||||
'ChkCreditoMultiple.Visible = True
|
||||
CargaAcreedores()
|
||||
RfvTxtNumeroReembolso.Enabled = False
|
||||
TxtNumeroReembolso.Text = ""
|
||||
@@ -11984,7 +12034,7 @@ Partial Class Compras_Compras
|
||||
Case "6" ' Caja Chica
|
||||
PnlContadoCajaChica.Visible = True
|
||||
TxtDocumentoImporteCaja.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero
|
||||
ChkCreditoMultiple.Visible = False
|
||||
'ChkCreditoMultiple.Visible = False
|
||||
RfvTxtNumeroReembolso.Enabled = True
|
||||
TxtNumeroReembolso.Text = ""
|
||||
TxtRembolsoNumero.Text = ""
|
||||
@@ -18806,7 +18856,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If ChkCreditoMultiple.Checked Then
|
||||
|
||||
romCreditosTabla.Visible = True
|
||||
'romCreditosTabla.Visible = True
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
If ObjBancos.GetCreditosDetalleCompras(UsuarioActual.CveEmpresa, CveProveedor, -1, -1, -1) Then
|
||||
@@ -18829,10 +18879,15 @@ Partial Class Compras_Compras
|
||||
Dim TxtInteres As TextBox = e.Row.FCTextBox("TxtInteres")
|
||||
Dim TxtAmbos As TextBox = e.Row.FCTextBox("TxtAmbos")
|
||||
Dim CveCreditoDetalle As Integer = e.Row.DataKey("CveCreditoDetalle").ToEntero
|
||||
Dim TxtComision As TextBox = e.Row.FCTextBox("TxtComision")
|
||||
Dim LblDocPorPagar As Label = e.Row.FCLabel("LblDocPorPagar")
|
||||
|
||||
Dim CveCompraCapital As Integer = e.Row.DataKey("CveCompra").ToEntero
|
||||
Dim CveCompraInteres As Integer = e.Row.DataKey("CveCompraInteres").ToEntero
|
||||
|
||||
|
||||
Dim ImporteIE As Decimal = e.Row.DataKey("ImporteIE").ToDecimal
|
||||
|
||||
If CveCompraCapital > 0 Then
|
||||
TxtCapital.Enabled = False
|
||||
TxtAmbos.Enabled = False
|
||||
@@ -18843,18 +18898,22 @@ Partial Class Compras_Compras
|
||||
TxtAmbos.Enabled = False
|
||||
End If
|
||||
|
||||
TxtCapital.Attributes.Add("class", $"CsCreGlobal CsSelCapital{CveCreditoDetalle}")
|
||||
TxtCapital.Attributes.Add("onkeyup", $"ValidaCredito(this,event,{CveCreditoDetalle},1)")
|
||||
'TxtCapital.Attributes.Add("data-CD", CveCreditoDetalle.ToString)
|
||||
'TxtCapital.Attributes.Add("class", $"CsCreGlobal CsSelCapital{CveCreditoDetalle}")
|
||||
'TxtCapital.Attributes.Add("onkeyup", $"ValidaCredito(this,event,{CveCreditoDetalle},1,{ImporteIE})")
|
||||
''TxtCapital.Attributes.Add("data-CD", CveCreditoDetalle.ToString)
|
||||
|
||||
TxtInteres.Attributes.Add("class", $"CsCreGlobal CsSelInteres{CveCreditoDetalle}")
|
||||
TxtInteres.Attributes.Add("onkeyup", $"ValidaCredito(this,event,{CveCreditoDetalle},1)")
|
||||
'TxtInteres.Attributes.Add("class", $"CsCreGlobal CsSelInteres{CveCreditoDetalle}")
|
||||
'TxtInteres.Attributes.Add("onkeyup", $"ValidaCredito(this,event,{CveCreditoDetalle},1,{ImporteIE})")
|
||||
'TxtInteres.Attributes.Add("data-CD", CveCreditoDetalle.ToString)
|
||||
|
||||
TxtAmbos.Attributes.Add("class", $"CsCreGlobal CsSelAmbos{CveCreditoDetalle}")
|
||||
TxtAmbos.Attributes.Add("onkeyup", $"ValidaCredito(this,event,{CveCreditoDetalle},2)")
|
||||
TxtAmbos.Attributes.Add("onkeyup", $"ValidaCredito(event,{CveCreditoDetalle},1,{ImporteIE})")
|
||||
'TxtAmbos.Attributes.Add("data-CD", CveCreditoDetalle.ToString)
|
||||
|
||||
TxtComision.Attributes.Add("class", $"CsComGlobal CsSelComision{CveCreditoDetalle}")
|
||||
TxtComision.Attributes.Add("onkeyup", $"ValidaCredito(event,{CveCreditoDetalle},2,{ImporteIE})")
|
||||
|
||||
LblDocPorPagar.Attributes.Add("class", $"CsSelLblDocPorPagar{CveCreditoDetalle}")
|
||||
|
||||
|
||||
End If
|
||||
@@ -18863,7 +18922,7 @@ Partial Class Compras_Compras
|
||||
Private Sub CargaCreditosDisponibles()
|
||||
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero = 4 Then
|
||||
If RBLPago.SelectedValue.ToEntero = 4 And CveProveedor > 0 Then
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetCreditosDetalleCompras(UsuarioActual.CveEmpresa, CveProveedor, -1, -1, -1) Then
|
||||
@@ -18873,11 +18932,11 @@ Partial Class Compras_Compras
|
||||
GvCreditos.DataSource = Nothing
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
romCreditosTabla.Visible = True
|
||||
'romCreditosTabla.Visible = True
|
||||
GvCreditos.DataBind()
|
||||
|
||||
Else
|
||||
romCreditosTabla.Visible = False
|
||||
'romCreditosTabla.Visible = False
|
||||
End If
|
||||
|
||||
UpGvCreditos.Update()
|
||||
|
||||
@@ -3407,8 +3407,10 @@ Partial Class Compras_eFacturas
|
||||
|
||||
MontoPago = Monto
|
||||
|
||||
Dim NodosPagosString As String = Regex.Replace(nodePagos2.InnerXml, $"{Prefijo}:", "", RegexOptions.IgnoreCase)
|
||||
|
||||
Dim ObjCompraFolios As New ClsCompras
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace($"{Prefijo}:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, NodosPagosString, UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
'
|
||||
'.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||
If ObjCompraFolios.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user