--FIX
This commit is contained in:
@@ -240,49 +240,52 @@ Partial Class Ventas_CatAutorizacionLimites
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
|
Dim Importe As Decimal = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
|
||||||
'AUTORIZACION DE IMPORTE,
|
|
||||||
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
|
|
||||||
If TipoAutorizacion = 1 Then
|
|
||||||
|
|
||||||
Dim SaldoCliente As Decimal = gvRow.DataKey("Saldo").ToDecimal()
|
If UsuarioActual.Empresa.Funcionalidad(595).Contiene("1", "2") Then
|
||||||
Dim LimiteCredito As Decimal = gvRow.DataKey("LimiteCredito").ToDecimal()
|
'AUTORIZACION DE IMPORTE,
|
||||||
'SI EL LIMITE ES 0, PERMITE AUTORIZAR
|
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
|
||||||
If LimiteCredito > 0 Then
|
If TipoAutorizacion = 1 Then
|
||||||
Dim PorcentajeMaximoAutorizar As Decimal = 0.1D
|
|
||||||
|
|
||||||
If UsuarioActual.PorcentajeMaximoAutorizacion > 0 Then
|
Dim SaldoCliente As Decimal = gvRow.DataKey("Saldo").ToDecimal()
|
||||||
PorcentajeMaximoAutorizar = (UsuarioActual.PorcentajeMaximoAutorizacion / 100)
|
Dim LimiteCredito As Decimal = gvRow.DataKey("LimiteCredito").ToDecimal()
|
||||||
|
'SI EL LIMITE ES 0, PERMITE AUTORIZAR
|
||||||
|
If LimiteCredito > 0 Then
|
||||||
|
Dim PorcentajeMaximoAutorizar As Decimal = 0.1D
|
||||||
|
|
||||||
|
If UsuarioActual.PorcentajeMaximoAutorizacion > 0 Then
|
||||||
|
PorcentajeMaximoAutorizar = (UsuarioActual.PorcentajeMaximoAutorizacion / 100)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim ImporteMaximoAutorizar As Decimal = ((LimiteCredito * (1D + PorcentajeMaximoAutorizar)) - SaldoCliente).RoundSQL(2)
|
||||||
|
|
||||||
|
If Importe > ImporteMaximoAutorizar Then
|
||||||
|
Alert($"No se puede autorizar, el importe máximo a autorizar es de {ImporteMaximoAutorizar:N2}", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ImporteMaximoAutorizar As Decimal = ((LimiteCredito * (1D + PorcentajeMaximoAutorizar)) - SaldoCliente).RoundSQL(2)
|
|
||||||
|
|
||||||
If Importe > ImporteMaximoAutorizar Then
|
'AUTORIZACION POR DIAS VENCIDOS
|
||||||
Alert($"No se puede autorizar, el importe máximo a autorizar es de {ImporteMaximoAutorizar:N2}", TipoMensaje.MsgAdvertencia)
|
ElseIf TipoAutorizacion = 2 Then
|
||||||
Exit Sub
|
Dim DiasVencidos As Integer = gvRow.DataKey("DiasVencidos").ToEntero()
|
||||||
End If
|
If DiasVencidos > 0 Then
|
||||||
End If
|
Dim DiasVencidosPermitidos As Integer = 5
|
||||||
|
|
||||||
|
Dim DiasVencidosAutorizacion As Integer = gvRow.DataKey("DiasVencidosAutorizacion").ToEntero()
|
||||||
|
|
||||||
'AUTORIZACION POR DIAS VENCIDOS
|
If DiasVencidos > DiasVencidosAutorizacion Then
|
||||||
ElseIf TipoAutorizacion = 2 Then
|
Alert($"No se puede autorizar, los días vencidos del cliente son mayores a la autorización. <br/> Dias Vencidos: {DiasVencidos:N0} . Dias autorizados. {DiasVencidosAutorizacion:N0}", TipoMensaje.MsgAdvertencia)
|
||||||
Dim DiasVencidos As Integer = gvRow.DataKey("DiasVencidos").ToEntero()
|
Exit Sub
|
||||||
If DiasVencidos > 0 Then
|
End If
|
||||||
Dim DiasVencidosPermitidos As Integer = 5
|
|
||||||
|
|
||||||
Dim DiasVencidosAutorizacion As Integer = gvRow.DataKey("DiasVencidosAutorizacion").ToEntero()
|
If UsuarioActual.DiasMaximoAutorizacion > 0 Then
|
||||||
|
DiasVencidosPermitidos = UsuarioActual.DiasMaximoAutorizacion
|
||||||
|
End If
|
||||||
|
|
||||||
If DiasVencidos > DiasVencidosAutorizacion Then
|
If DiasVencidosAutorizacion > DiasVencidosPermitidos Then
|
||||||
Alert($"No se puede autorizar, los días vencidos del cliente son mayores a la autorización. <br/> Dias Vencidos: {DiasVencidos:N0} . Dias autorizados. {DiasVencidosAutorizacion:N0}", TipoMensaje.MsgAdvertencia)
|
Alert($"No se puede autorizar, la cantidad máxima de días vencidos permitidas es de {DiasVencidosPermitidos:N0}", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.DiasMaximoAutorizacion > 0 Then
|
|
||||||
DiasVencidosPermitidos = UsuarioActual.DiasMaximoAutorizacion
|
|
||||||
End If
|
|
||||||
|
|
||||||
If DiasVencidosAutorizacion > DiasVencidosPermitidos Then
|
|
||||||
Alert($"No se puede autorizar, la cantidad máxima de días vencidos permitidas es de {DiasVencidosPermitidos:N0}", TipoMensaje.MsgAdvertencia)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1493,6 +1493,7 @@ Partial Class Ventas_PVCobranza
|
|||||||
ObjNC.CalculaTotales()
|
ObjNC.CalculaTotales()
|
||||||
|
|
||||||
Dim CveIE As Integer = -1
|
Dim CveIE As Integer = -1
|
||||||
|
Dim UUIDFactura As String = "" 'VACIO PORQUE AUN NO SE HA GENERADO
|
||||||
If GvRowAnticipo IsNot Nothing Then
|
If GvRowAnticipo IsNot Nothing Then
|
||||||
CveIE = GvRowAnticipo.DataKey("CveIE").ToEntero()
|
CveIE = GvRowAnticipo.DataKey("CveIE").ToEntero()
|
||||||
End If
|
End If
|
||||||
@@ -1501,13 +1502,13 @@ Partial Class Ventas_PVCobranza
|
|||||||
DtVentasNC.Columns.Add("CveVenta", GetType(Integer))
|
DtVentasNC.Columns.Add("CveVenta", GetType(Integer))
|
||||||
DtVentasNC.Columns.Add("Importe", GetType(Decimal))
|
DtVentasNC.Columns.Add("Importe", GetType(Decimal))
|
||||||
DtVentasNC.Columns.Add("FolioFiscal", GetType(String))
|
DtVentasNC.Columns.Add("FolioFiscal", GetType(String))
|
||||||
'DtVentasNC.Columns.Add("CveIE", GetType(Integer))
|
DtVentasNC.Columns.Add("CveIE", GetType(Integer))
|
||||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TC", .DataType = GetType(Decimal), .DefaultValue = 1})
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TC", .DataType = GetType(Decimal), .DefaultValue = 1})
|
||||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TCCambioValuacion", .DataType = GetType(Decimal), .DefaultValue = 1})
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "TCCambioValuacion", .DataType = GetType(Decimal), .DefaultValue = 1})
|
||||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "CveEstatusFactura", .DataType = GetType(Integer), .DefaultValue = -1})
|
||||||
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
|
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
|
||||||
|
|
||||||
'DtVentasNC.Rows.Add(Venta.CveVenta, CveIE, Total, "")
|
DtVentasNC.Rows.Add(Venta.CveVenta, Total, UUIDFactura, CveIE)
|
||||||
|
|
||||||
ObjNC.DtVentasNC = DtVentasNC
|
ObjNC.DtVentasNC = DtVentasNC
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user