--FIX. Facturacion con pagos, correcion de asignacion de usuario.
--FIX. Cambio de tipo docto de cotizaciones a remison cuando cambia de cliente. --FIX. Mensaje de cliente bloqueado cuando es publico general y es cotizacion.
This commit is contained in:
@@ -7195,8 +7195,13 @@ Partial Class Ventas
|
|||||||
HabilitarRemisionesPublicoGeneral()
|
HabilitarRemisionesPublicoGeneral()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
If Not String.IsNullOrEmpty(UsuarioActual.CveTipoDocumento) Then
|
If Opcion = "Cot" Then
|
||||||
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
|
DdlTipoComprobante.SelectedValueExist("Cot")
|
||||||
|
Else
|
||||||
|
If Not String.IsNullOrEmpty(UsuarioActual.CveTipoDocumento) Then
|
||||||
|
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
|
||||||
|
DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, Nothing)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -7207,8 +7212,6 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
|
'If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
|
||||||
' Using ObjVentas As New ClsVentas
|
' Using ObjVentas As New ClsVentas
|
||||||
' If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, DdlMoneda.SelectedValue.ToEntero(), MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa) Then
|
' If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, DdlMoneda.SelectedValue.ToEntero(), MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa) Then
|
||||||
@@ -7771,44 +7774,52 @@ Partial Class Ventas
|
|||||||
'VERIFICAR RESTRICCIONES DEL CLIENTE
|
'VERIFICAR RESTRICCIONES DEL CLIENTE
|
||||||
If Not UsuarioActual.Empresa.Funcionalidad(702).ToEntero() > 0 Then
|
If Not UsuarioActual.Empresa.Funcionalidad(702).ToEntero() > 0 Then
|
||||||
If (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2") Then
|
If (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2") Then
|
||||||
Dim Vta As New ClsVentas
|
Dim Valida As Boolean = True
|
||||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (Me.CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() OrElse Me.PermiteCredito) Then
|
||||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
Valida = False
|
||||||
Vta.Dispose()
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If Valida Then
|
||||||
Dim Autorizacion As Integer = 0
|
Dim Vta As New ClsVentas
|
||||||
|
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||||
|
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||||
|
Vta.Dispose()
|
||||||
|
|
||||||
Dim ObjVentas As New ClsVentas
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
Dim Autorizacion As Integer = 0
|
||||||
Dim RowAutorizacion As DataRow = Nothing
|
|
||||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
Dim ObjVentas As New ClsVentas
|
||||||
If TieneDiasVencidos Then
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
Dim RowAutorizacion As DataRow = Nothing
|
||||||
Else
|
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
If TieneDiasVencidos Then
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
Else
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If RowAutorizacion IsNot Nothing Then
|
||||||
|
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||||
|
If Opcion > 0 AndAlso Autorizacion <= 0 Then
|
||||||
|
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnGenerarRemision.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If RowAutorizacion IsNot Nothing Then
|
Else
|
||||||
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
If Opcion > 0 Then
|
||||||
|
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnGenerarRemision.Visible = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
|
||||||
|
|
||||||
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
|
||||||
If Opcion > 0 AndAlso Autorizacion <= 0 Then
|
|
||||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
|
||||||
BtnsFacturar.Visible = False
|
|
||||||
BtnGenerarRemision.Visible = False
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
If Opcion > 0 Then
|
|
||||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
|
||||||
BtnsFacturar.Visible = False
|
|
||||||
BtnGenerarRemision.Visible = False
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -15567,7 +15578,13 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'TRASPASO DE PAGOS DE REMISIONES A FACTURA GLOBAL
|
'TRASPASO DE PAGOS DE REMISIONES A FACTURA GLOBAL
|
||||||
If ObjFactura.DtPagosFacturaGlobal IsNot Nothing Then
|
If ObjFactura.DtPagosFacturaGlobal IsNot Nothing Then
|
||||||
|
If ObjFactura.UsuarioActual Is Nothing Then
|
||||||
|
ObjFactura.UsuarioActual = UsuarioActual
|
||||||
|
Else
|
||||||
|
If ObjFactura.UsuarioActual.Empresa Is Nothing Then
|
||||||
|
ObjFactura.UsuarioActual.Empresa = UsuarioActual.Empresa
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Dim VentaActual As New ClsPaginas.Venta(ObjFactura, UsuarioActual)
|
Dim VentaActual As New ClsPaginas.Venta(ObjFactura, UsuarioActual)
|
||||||
|
|
||||||
For Each DrPago As DataRow In ObjFactura.DtPagosFacturaGlobal.Rows
|
For Each DrPago As DataRow In ObjFactura.DtPagosFacturaGlobal.Rows
|
||||||
|
|||||||
Reference in New Issue
Block a user