This commit is contained in:
2025-01-21 05:37:07 -07:00
4 changed files with 56 additions and 16 deletions

View File

@@ -3641,7 +3641,7 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If
InicializaDevolucionAlmacen()
@@ -5489,7 +5489,7 @@ Partial Class Ventas
End If
If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
Else
ImgAntiPend.Visible = True
End If
@@ -5602,7 +5602,7 @@ Partial Class Ventas
If DbRowVenta("Saldo").ToString().ToDouble < 0.01 Then
If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
Else
ImgAntiPend.Visible = True
End If
@@ -9020,6 +9020,14 @@ Partial Class Ventas
If e.Row.DBCampo("TipoDocto").Contiene("Cot", "Rem") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then
e.Row.FCLinkButton("imgClone").Visible = False
End If
If e.Row.DBCampo("CvePromocionDetalle").ToEntero() > 0 Then
If DtPromociones IsNot Nothing Then
Dim NombrePromo As String = DtPromociones.FiltroPrimeroValor("NombrePromocion", $"CvePromocionDetalle={e.Row.DBCampo("CvePromocionDetalle")}")
e.Row.FCHtmlGenericControl("TagPromocion").Attributes.Add("title", NombrePromo)
End If
End If
End If
If CveVenta <= 0 Then
@@ -17219,7 +17227,7 @@ Partial Class Ventas
Private Sub CargaAnticipos(CveCliente As Integer)
Dim CargaAnticipos As Boolean = True
If UsuarioActual.CveEmpresa = 189 Then
CargaAnticipos = False
CargaAnticipos = UsuarioActual.TienePermisoProceso(406)
End If
HdnTieneAnticipos.Value = "0"
If CveCliente > 0 AndAlso CargaAnticipos Then
@@ -17287,7 +17295,7 @@ Partial Class Ventas
End If
If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If
Else
GVAnticipos.DataSource = Nothing
@@ -17463,11 +17471,11 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
If e.Row.DBCampo("Tipo").ToString().Contiene("Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado"
e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True
End If
'If e.Row.DBCampo("Tipo").ToString().Contiene("Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
' e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False
' e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado"
' e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True
'End If
End If
If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then
@@ -18570,6 +18578,12 @@ Partial Class Ventas
If ObjDescuentoGral.CvePromocionDetalle > 0 Then
TagPromocion.Visible = True
If UsuarioActual.CveEmpresa = 189 Then
If DtPromociones IsNot Nothing Then
Dim NombrePromo As String = DtPromociones.FiltroPrimeroValor("NombrePromocion", $"CvePromocionDetalle={ObjDescuentoGral.CvePromocionDetalle}")
TagPromocion.Attributes.Add("title", NombrePromo)
End If
End If
End If
If Me.ObjDescuentoGral.EsPUModificado Then
@@ -19037,7 +19051,7 @@ Partial Class Ventas
End If
If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If
If ImgAntiPend.Visible Then
@@ -19085,7 +19099,7 @@ Partial Class Ventas
End If
If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If
If ImgAntiPend.Visible Then
@@ -33098,7 +33112,7 @@ Partial Class Ventas
If DtMovtos.Rows.Count > 0 Then ImgAntiPend.Visible = True
If UsuarioActual.CveEmpresa = 189 Then
ImgAntiPend.Visible = False
ImgAntiPend.Visible = UsuarioActual.TienePermisoProceso(406)
End If
Else
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
@@ -40467,6 +40481,17 @@ Partial Class Ventas
Next
End If
Dim CveVenta As Integer = gvr.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
Dim Saldo As Decimal = gvr.DataKey("Saldo").ToDecimal()
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), Saldo, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
Dim msgAlert = "La autorización se agregó correctamente."
Alert(msgAlert, TipoMensaje.ToastInformacionB)
End If
ObjVta.Dispose()
End Sub
#End Region