mirror of
https://github.com/KeymonSoft/Intmex_Reparto_Vieja.git
synced 2026-04-17 21:06:13 +00:00
Commit inicial, cambio de puerto al 1781
This commit is contained in:
135
nopago.bas
Normal file
135
nopago.bas
Normal file
@@ -0,0 +1,135 @@
|
||||
B4A=true
|
||||
Group=Default Group
|
||||
ModulesStructureVersion=1
|
||||
Type=Activity
|
||||
Version=7.01
|
||||
@EndOfDesignText@
|
||||
#Region Activity Attributes
|
||||
#FullScreen: False
|
||||
#IncludeTitle: True
|
||||
#End Region
|
||||
|
||||
Sub Process_Globals
|
||||
'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
|
||||
Dim COMENTARIO As String
|
||||
Dim reprogramar As Int = 0
|
||||
End Sub
|
||||
|
||||
Sub Globals
|
||||
'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
|
||||
Private p_principal As Panel
|
||||
Private cb_reprogramar As CheckBox
|
||||
End Sub
|
||||
|
||||
Sub Activity_Create(FirstTime As Boolean)
|
||||
'Do not forget to load the layout file created with the visual designer. For example:
|
||||
' If(FirstTime) Then
|
||||
' g.Initialize("GPS")
|
||||
' End If
|
||||
Activity.LoadLayout("nopago")
|
||||
' valido donde escribo el archivo de la base de datos de kmt
|
||||
' ruta = Main.ruta
|
||||
' If File.Exists(Starter.ruta, "kmt.db") = False Then
|
||||
' File.Copy(File.DirAssets, "kmt.db", Starter.ruta, "kmt.db")
|
||||
' End If
|
||||
' skmt.Initialize(Starter.ruta,"kmt.db", True)
|
||||
End Sub
|
||||
|
||||
Sub Activity_Resume
|
||||
e_comm.Text=""
|
||||
' If g.GPSEnabled=False Then
|
||||
' ToastMessageShow("Habilitar el GPS", True)
|
||||
' StartActivity(g.LocationSettingsIntent)
|
||||
' Else
|
||||
' g.Start(0,0)
|
||||
' End If
|
||||
Subs.SetButtonTintList(r_1, Colors.red, Colors.RGB(210, 105, 30))
|
||||
Subs.SetButtonTintList(r_2, Colors.red, Colors.RGB(210, 105, 30))
|
||||
Subs.SetButtonTintList(r_3, Colors.red, Colors.RGB(210, 105, 30))
|
||||
Subs.SetButtonTintList(r_4, Colors.red, Colors.RGB(210, 105, 30))
|
||||
Subs.SetButtonTintList(cb_reprogramar, Colors.red, Colors.red)
|
||||
End Sub
|
||||
|
||||
Sub Activity_Pause (UserClosed As Boolean)
|
||||
' g.Start(0,0)
|
||||
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)
|
||||
End Sub
|
||||
|
||||
Sub GUARDA_Click
|
||||
If r_1.Checked Then
|
||||
motivo = "CERRADO"
|
||||
Else If r_2.Checked Then
|
||||
motivo = "NO PIDIO"
|
||||
Else If r_3.Checked Then
|
||||
motivo = "CANCELA"
|
||||
Else
|
||||
motivo = "NO ESTA EL ENCARGADO"
|
||||
End If
|
||||
If motivo <> "CERRADO" Then
|
||||
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.Close
|
||||
Starter.skmt.ExecNonQuery("DELETE FROM NOVENTA WHERE NV_CLIENTE IN (select cuenta from cuentaa)")
|
||||
c=Starter.skmt.ExecQuery("select HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT, HVD_FECHA from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) order by HVD_PRONOMBRE asc")
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Starter.skmt.ExecNonQuery2("insert into reparto(REP_CLIENTE, REP_PRONOMBRE, REP_CANT, REP_COSTO_TOT,REP_FECHA) VALUES (?,?,?,?,?) ", Array As String(c.GetString("HVD_CLIENTE"),c.GetString("HVD_PRONOMBRE"),c.GetString("HVD_CANT"),c.GetString("HVD_COSTO_TOT"),c.GetString("HVD_FECHA")))
|
||||
Starter.skmt.ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_nombre = ?", Array As Object(c.GetString("HVD_CANT"),c.GetString("HVD_PRONOMBRE")))
|
||||
' ANTES DE MODIFCAR
|
||||
'skmt.ExecNonQuery2("delete FROM HIST_VENTAS WHERE HVD_PRONOMBRE = ? and HVD_cliente in (Select CUENTA from cuentaa) ", Array As String(c.GetString("HVD_PRONOMBRE")))
|
||||
'skmt.ExecNonQuery2("update HIST_VENTAS set HVD_EXISTE = ? WHERE HVD_PRONOMBRE = ? and HVD_cliente in (Select CUENTA from cuentaa) ", Array As String(motivo, c.GetString("HVD_PRONOMBRE")))
|
||||
Next
|
||||
End If
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO NOVENTA (NV_CLIENTE, NV_FECHA, NV_USER, NV_MOTIVO, NV_COMM, NV_LAT, NV_LON, NV_REPROGRAMAR) VALUES(?,?,?,?,?,?,?,?) ", Array As Object (cuenta, sDate & sTime, usuario, motivo, e_comm.text, Main.lat_gps, Main.lon_gps, reprogramar))
|
||||
Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 3 where CAT_CL_CODIGO In (select cuenta from cuentaa)")
|
||||
Starter.skmt.ExecNonQuery("update HIST_VENTAS SET HVD_RECHAZO = 1 WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||
StartActivity(seleccion)
|
||||
Else
|
||||
COMENTARIO = e_comm.Text
|
||||
StartActivity(foto)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub cb_reprogramar_CheckedChange(Checked As Boolean)
|
||||
If Checked Then
|
||||
reprogramar = 1
|
||||
Else
|
||||
reprogramar = 0
|
||||
End If
|
||||
End Sub
|
||||
Reference in New Issue
Block a user