Descuento Adicional en PV.aspx

This commit is contained in:
2021-09-06 15:41:39 -07:00
parent 7baa146c1d
commit 9941f213e7
2 changed files with 180 additions and 4 deletions

View File

@@ -1062,7 +1062,7 @@ Partial Class PV
ViewState("ClienteRetIVA") = 0
ViewState("ClienteRetISR") = 0
ViewState("EnviarCorreoCliente") = False
HdnPorcentajeDescuentoMaximo.Value = UsuarioActual.DescuentoAutorizado.ToString()
HdnPorcentajeDescuentoMaximo.Value = If(UsuarioActual.DescuentoAutorizado > 0, UsuarioActual.DescuentoAutorizado, 15).ToString()
CveVentaDetalle = -1
EstablecioFolio = False
EstatusCliente = False
@@ -1113,7 +1113,19 @@ Partial Class PV
LblUsuario.Text = UsuarioActual.Usuario
TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();")
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
ImgDescPU.Attributes.Add("onclick", "javascript:AbrirModalDescuentoAdicional();")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuentoAdicional();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMontoAdicional();")
TrDescuentoIncluido.Visible = True
TrDescuentoAdicional.Visible = True
Else
ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
End If
'ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
'ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
ImgOtrosConceptos.Attributes.Add("onclick", "javascript:$('#ModalOtrosConceptos').modal();")
@@ -1131,8 +1143,8 @@ Partial Class PV
'ImgCerrarTerminoCorte.Attributes.Add("OnClick", "$('#DivTerminarCorte').hide();")
'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();")
'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();")
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();")
'TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();")
CreaDTmpC()
@@ -4049,6 +4061,14 @@ Partial Class PV
TxtDescuento.Text = (PrecioSugerido * ClasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2")
End If
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
If PrecioSugerido > 0 AndAlso TxtDescuento.Text.ToDecimal() > 0 Then
TxtPrecio.Text = PrecioSugerido.FormatoNumero()
RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString() + ", 2, '.', ',');", "A1")
End If
If ChkAjuste.Checked Then
CalculaMesesUso()
UpAjuste.Update()
@@ -4072,6 +4092,7 @@ Partial Class PV
UpPS.Update()
UpUnidadMedida.Update()
UpAddVenta.Update()
UPPDescuento.Update()
End Sub
Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero, DdlPS)