Cambios OS, Compras anticipos comisiones
This commit is contained in:
@@ -881,10 +881,7 @@
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
@@ -909,19 +906,13 @@
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Anticipo/NC</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Importe", "{0:N2}") %>'></asp:Literal>
|
||||
|
||||
|
||||
|
||||
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Importe", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Mon</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Moneda") %>'></asp:Literal>
|
||||
|
||||
|
||||
|
||||
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Moneda") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="False">
|
||||
@@ -2842,18 +2833,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-3">
|
||||
<label class="col-md-6"><b>Saldo Factura: </b></label>
|
||||
<div class="col-md-6">
|
||||
<asp:Label ID="LblSaldoFactura" ClientIDMode="Static" runat="server"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-3">
|
||||
<label class="col-md-6"><b>Aplicado: </b></label>
|
||||
<div class="col-md-6">
|
||||
<asp:Label ID="LblAplicadoCompraAnt" ClientIDMode="Static" Text="0.00" runat="server"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" runat="server" id="DVAntComiciones" visible="false">
|
||||
<label class="col-md-6"><b>Comisión: </b></label>
|
||||
<div class="col-md-6">
|
||||
<asp:Label ID="LblAplicadoCompraAntComision" ClientIDMode="Static" Text="0.00" runat="server"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -2912,6 +2909,13 @@
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtAnticipo" ValidChars="." FilterType="Custom, Numbers" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Comisión" ItemStyle-HorizontalAlign="Right" Visible="false">
|
||||
<ItemTemplate>
|
||||
<%--<asp:Label ID="LblTotalAnticipos" runat="server" ClientIDMode="Static" Width="80px" Text="0.00" Visible="false"></asp:Label>--%>
|
||||
<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>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -5891,23 +5895,47 @@
|
||||
}
|
||||
|
||||
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
|
||||
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
|
||||
$("#LblSaldoFactura").text(FormatoNumero(Total - FnSumaValoresAnt(), 2));
|
||||
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
|
||||
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
|
||||
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal) {
|
||||
function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, txtComision) {
|
||||
|
||||
var Total = ToDouble($get('TxtTotal').value);
|
||||
let txtComisionImporte = 0;
|
||||
|
||||
if (txtComision != null) {
|
||||
if (!isNaN(txtComision.value)) {
|
||||
txtComisionImporte = ToDouble(txtComision.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var txtvalue = ToDouble(txt.value);
|
||||
if (CveMonedaAnticipo = 1 && CveMonedaOriginal == 2) {
|
||||
|
||||
|
||||
if (txtComisionImporte != 0 && txtComisionImporte > txtvalue) {
|
||||
|
||||
if (txtComision != null) {
|
||||
txtComision.value = txtvalue;
|
||||
alert('La comisión no debe de exder la amortización.')
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
|
||||
txtvalue = ToDouble(txtvalue / TCAnticipo);
|
||||
} else if (CveMonedaAnticipo = 2 && CveMonedaOriginal == 1) {
|
||||
} else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) {
|
||||
txtvalue = ToDouble(txtvalue * TCAnticipo);
|
||||
}
|
||||
|
||||
var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
|
||||
|
||||
if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue;
|
||||
//minimo entre saldocompra y el saldoanticipo
|
||||
if (SaldoCompra < saldo) saldo = SaldoCompra;
|
||||
@@ -5919,12 +5947,13 @@
|
||||
}
|
||||
|
||||
if (ToDouble(txtvalue) > saldo) {
|
||||
txt.value = saldo;
|
||||
txt.value = saldo;
|
||||
alert("El Importe no debe de exceder a el saldo");
|
||||
}
|
||||
|
||||
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
|
||||
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
|
||||
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
|
||||
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2));
|
||||
|
||||
}
|
||||
@@ -5941,8 +5970,21 @@
|
||||
// totalPoints += ToDouble($(this).val());
|
||||
//});
|
||||
|
||||
let respuesta = Math.round(totalPoints * 100) / 100;
|
||||
return respuesta
|
||||
}
|
||||
|
||||
return Math.round(totalPoints * 100) / 100;
|
||||
function FnSumaValoresAntComisiones() {
|
||||
var totalPoints = 0;
|
||||
var t = '';
|
||||
|
||||
|
||||
$('input[name*=TxtComision]').each(function () {
|
||||
totalPoints += ToDouble($(this).val());
|
||||
});
|
||||
|
||||
let respuesta = Math.round(totalPoints * 100) / 100;
|
||||
return respuesta
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5668,7 +5668,8 @@ Partial Class PopUpVerFactura
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim CveFolio = ""
|
||||
CreaDT()
|
||||
Dim ReporteEmpresa As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
Dim RutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If ObjOS.GetOrdenesServicios(CveOS, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjOS.DtResultados.Rows.Count > 0 Then
|
||||
@@ -5688,7 +5689,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("ClienteEstado", dr("Estado").ToString))
|
||||
CveFolio = dr("Folio").ToString
|
||||
|
||||
If ReporteEmpresa.Exists Then
|
||||
If RutaReporte.Exists Then
|
||||
params.Add(New ReportParameter("NoDeCliente", dr("CveCliente").ToString))
|
||||
params.Add(New ReportParameter("RFC", dr("RFC").ToString))
|
||||
params.Add(New ReportParameter("Vendedor", " "))
|
||||
@@ -5706,7 +5707,10 @@ Partial Class PopUpVerFactura
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If Not ReporteEmpresa.Exists Then
|
||||
If Not RutaReporte.Exists Then
|
||||
|
||||
RutaReporte = New System.IO.FileInfo(String.Format("{0}Empresas\Grales\Formatos\OrdenServicio.rdlc", ModExtensiones.DirectorioBaseEmpresas))
|
||||
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
@@ -5734,7 +5738,7 @@ Partial Class PopUpVerFactura
|
||||
lrds.Add(rds2)
|
||||
ObjOS.Dispose()
|
||||
|
||||
ImprimirPDF(String.Format("Empresas/{0}/Formatos/OrdenServicio.rdlc", UsuarioActual.CveEmpresa), lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio))
|
||||
ImprimirPDF(RutaReporte.FullName, lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio))
|
||||
End Sub
|
||||
Private Sub CreaDT()
|
||||
TmpDTOS = New DataTable
|
||||
|
||||
Reference in New Issue
Block a user