diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx
index 266060f25..9fd8b00cc 100644
--- a/Ventas/PV.aspx
+++ b/Ventas/PV.aspx
@@ -2729,7 +2729,16 @@
-
+
+
@@ -3115,15 +3124,27 @@
var Descuento = parseFloat($get("TxtPorDescP").value);
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
- $get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
+ $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
- $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
+ $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
+ $get("TxtDescuento").value = formato_numero(Total, 2, '.', ',');
+ $get("TxtDescP").value = formato_numero(0, 2, '.', ',');
$get("HdnDescuento").value = Total;
if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
}
}
- else if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) {
+ else {
+ $get("LblPrecioFinal").innerText = "0.00";
+ $get("LblDescuento").innerText = "0.00";
+ $get("HdnDescuento").value = "0.00";
+ }
+
+ }
+
+ function CalculaDescuentoMonto() {
+
+ if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) {
var Monto = 0;
var TipoDescuento = $get("HdnTipoDescuento").value;
@@ -3141,11 +3162,12 @@
}
var Descuento = parseFloat($get("TxtDescP").value);
- $get("TxtPorDescP").value = Descuento * 100 / Monto * 10
+ $get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ',');
$get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
- $get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
+ $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
- $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
+ $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
+ $get("TxtDescuento").value = formato_numero(Total, 2, '.', ',');
$get("HdnDescuento").value = Total;
if (TipoDescuento == 2) {
Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
@@ -3156,7 +3178,6 @@
$get("LblDescuento").innerText = "0.00";
$get("HdnDescuento").value = "0.00";
}
-
}
function BorraDescuentos() {
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 326d6100a..a76ce216c 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -1062,7 +1062,7 @@ Partial Class PV
'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();")
'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
- TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
+ TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
CreaDTmpC()
@@ -2771,6 +2771,9 @@ Partial Class PV
Exit Sub
End If
+ TxtDescuento.Text = FormatoNumero(0, 2)
+ TxtPrecio.Text = ""
+
If CvePSParametro > 0 Then
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
@@ -5102,7 +5105,7 @@ Partial Class PV
Dim NoMesesTrascurridos2 = DateDiff(DateInterval.Month, FechaI, FechaF)
'TxtMesesUso.Text = If(Diff > 0.5, NoMesesTrascurridos, NoMesesTrascurridos2).ToString()
- TxtMesesUso.Text = NoMesesTrascurridos2
+ TxtMesesUso.Text = NoMesesTrascurridos2.ToString
CalculaPorcentajeAjuste()
End Sub