Version: 5.03.20.MV

Se agregaron las promociones de 3 niveles, se corrigieron problemas al momento de borrar pedido en nota, al finalizar el pedido y al borrar por completo desde nota.
This commit is contained in:
IsR0d
2025-03-25 11:10:51 -06:00
parent 05acf1f855
commit 783e4a8053
6 changed files with 816 additions and 501 deletions

View File

@@ -664,12 +664,13 @@ End Sub
'Regresa el almacen actual de la base de datos.
Sub traeAlmacen As String 'ignore
Private c As Cursor
Private c2 As Cursor
Private a As String
c=B4XPages.MainPage.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
c.Position = 0
a = C.GetString("ID_ALMACEN")
c.Close
c2=B4XPages.MainPage.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
c2.Position = 0
a = c2.GetString("ID_ALMACEN")
Return a
End Sub
@@ -1121,6 +1122,29 @@ Sub traeMaxPromos(pm As Map) As Int
Return maxPromos.Get(0) - vendidas 'Regresamos el numero mas pequeño de las opciones.
End Sub
Sub MaxPromQuery(promo As String) As Int
Private cMaxPromo As Cursor
Private minValue As Int
cMaxPromo = B4XPages.MainPage.skmt.ExecQuery($"SELECT CAT_PA_ID, CAT_PA_MAXPROM, CAT_PA_MAXPROMREC, CAT_PA_MAXPROMCLIE FROM PROMOS_COMP where CAT_PA_ID = '${promo}'"$)
If cMaxPromo.RowCount > 0 Then
cMaxPromo.Position = 0
Dim val1 As Int = cMaxPromo.GetInt("CAT_PA_MAXPROM")
Dim val2 As Int = cMaxPromo.GetInt("CAT_PA_MAXPROMREC")
Dim val3 As Int = cMaxPromo.GetInt("CAT_PA_MAXPROMCLIE")
minValue = val1
If val2 < minValue Then minValue = val2
If val3 < minValue Then minValue = val3
Else
minValue = 0
End If
Return minValue
End Sub
'Regresa la cantidad de promos que se le han vendido al cliente.
Sub traePromosVendidas(promo As String, cliente As String) As Int
Private c As Cursor