Files
Durakelo/B4A - Copy/C_NoVenta.bas
Jose Alberto Guerra Ugalde eb76cd60b7 Merge branch 'master' of https://github.com/KeymonSoft/Durakelo
# Conflicts:
#	B4A/B4XMainPage.bas
#	B4A/C_Cliente.bas
#	B4A/C_Clientes.bas
#	B4A/C_Historico.bas
#	B4A/C_NoVenta.bas
#	B4A/C_Nota.bas
#	B4A/C_Principal.bas
#	B4A/C_Productos.bas
#	B4A/C_TicketsDia.bas
#	B4A/CameraExClass.bas
#	B4A/DBRequestManager.bas
#	B4A/Durakelo.b4a
#	B4A/Durakelo.b4a.meta
#	B4A/Files/cliente.bal
#	B4A/Files/clientes.bal
#	B4A/Files/detalle_promo.bal
#	B4A/Files/foto.bal
#	B4A/Files/guardagestion.bal
#	B4A/Files/historico.bal
#	B4A/Files/kelloggs.png
#	B4A/Files/kmt.db
#	B4A/Files/login.bal
#	B4A/Files/mapa.bal
#	B4A/Files/mapa_rutas.bal
#	B4A/Files/noventa.bal
#	B4A/Files/nuevocliente.bal
#	B4A/Files/palomita_verde.png
#	B4A/Files/pedido.bal
#	B4A/Files/principal.bal
#	B4A/Files/productos.bal
#	B4A/Files/tache_rojo.png
#	B4A/Starter.bas
#	B4A/Tracker.bas
2023-10-16 19:04:22 -06:00

95 lines
2.9 KiB
QBasic

B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=11.5
@EndOfDesignText@
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim g As GPS
Dim ruta As String
Dim skmt As SQL
Dim c As Cursor
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim CANCELA As Button
Dim GUARDA As Button
Dim r_1 As RadioButton
Dim r_2 As RadioButton
Dim r_3 As RadioButton
Dim e_comm As EditText
Dim motivo As String
Dim cuenta As String
Dim usuario As String
Dim sDate,sTime As String
' Dim lat_gps, lon_gps As String
Dim r_4 As RadioButton
End Sub
Sub initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("NoVenta")
g.Initialize("gps")
End Sub
Sub B4XPage_Appear
e_comm.Text = ""
If g.GPSEnabled = False Then
ToastMessageShow("Habilitar el GPS", True)
StartActivity(g.LocationSettingsIntent)
Else
g.Start(0,0)
End If
End Sub
Sub GPS_LocationChanged (Location1 As Location)
'lat_gps=Location1.ConvertToSeconds(Location1.Latitude)
'lon_gps=Location1.ConvertToSeconds(Location1.Longitude)
End Sub
Sub CANCELA_Click
' StartActivity(fila)
B4XPages.ShowPage("Cliente")
End Sub
Sub GUARDA_Click
If r_1.Checked Then
motivo = "CERRADO"
Else If r_2.Checked Then
motivo = "NO COMPRA"
Else If r_3.Checked Then
motivo = "CON PRODUCTO"
Else
motivo = "NO ESTA EL ENCARGADO"
End If
DateTime.DateFormat = "MM/dd/yyyy"
sDate=DateTime.Date(DateTime.Now)
sTime=DateTime.Time(DateTime.Now)
c=Starter.skmt.ExecQuery("select CUENTA from cuentaa")
c.Position = 0
cuenta = c.GetString("CUENTA")
c=Starter.skmt.ExecQuery("select usuario from usuarioa")
c.Position = 0
usuario = c.GetString("USUARIO")
c=Starter.skmt.ExecQuery("select PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) ")
If c.RowCount>0 Then
For i=0 To c.RowCount -1
c.Position=i
Starter.skmt.ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID")))
Next
End If
Starter.skmt.ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)")
Starter.skmt.ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)")
Starter.skmt.ExecNonQuery2("INSERT INTO NOVENTA (NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON) VALUES(?,?,?,?,?,?,?) ", Array As Object (cuenta,sDate & sTime, usuario, motivo,e_comm.text,Starter.lat_gps,Starter.lon_gps))
Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 3 where CAT_CL_CODIGO In (select cuenta from cuentaa)")
' StartActivity(seleccion)
B4XPages.ShowPage("Principal")
End Sub