diff --git a/.gitignore b/.gitignore index af94e9d..44a1d70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/Objects -**/AutoBackups \ No newline at end of file +**/AutoBackups +*/AutoBackups \ No newline at end of file diff --git a/B4A - Copy/B4XMainPage.bas b/B4A - Copy/B4XMainPage.bas deleted file mode 100644 index ec19c44..0000000 --- a/B4A - Copy/B4XMainPage.bas +++ /dev/null @@ -1,530 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=9.85 -@EndOfDesignText@ -#Region Shared Files - 'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True - 'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip - '########################################################################################################### - '###################### PULL ############################################################# - 'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=git&Args=pull - '########################################################################################################### - '###################### PUSH ############################################################# - 'Ctrl + click ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=github&Args=..\..\ - '########################################################################################################### - '###################### PUSH TORTOISE GIT ######################################################### - 'Ctrl + click ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=TortoiseGitProc&Args=/command:commit&Args=/path:"./../../"&Args=/closeonend:2 - '########################################################################################################### -#End Region - -Sub Class_Globals - Private Root As B4XView - Private xui As XUI - Public login As B4XMainPage - Dim rp As RuntimePermissions - Public principal As C_Principal 'Antes seleccion - Public clientes As C_Clientes 'Antes Colonia - Public cliente As C_Cliente 'Antes fila -' Public productos As C_Productos 'Antes colonia2 -' Public updateAvailable As C_updateAvailable -'' Public mapas As C_Mapas -'' Public nuevoCliente As C_NuevoCliente -' Public ticketsDia As C_TicketsDia 'Antes buscar - Public noVenta As C_NoVenta 'Antes nopago - Public nota As C_Nota 'Antes tarjeta -' Public promos As C_Promos - Public historico As C_Historico 'Antes historico - - Dim reqManager As DBRequestManager - Dim ultimaActualizacionGPS As String = 235959 - Dim almacen, ruta As String - Dim user As EditText - Dim pass As EditText - Dim c As Cursor - Dim D As Cursor - Dim existe As String - Dim paso1 As String - Dim IMEI As String - Dim alterno As String - Private b_menu As Button -' Dim PopupMenu As RSPopupMenu - Dim cmd As DBCommand - - Private IMEN As EditText - Private Entrar As Button - Private Panel1 As Panel - Private ImageView4 As ImageView - Private E_SERVER As EditText - Private B_SERVER As Button - Private B_MACIMP As Button - Private CUANTOS As String - Private foto_g () As Byte - - Private ListView1 As ListView - Private ImageView1 As ImageView - Private Label1 As Label - Private B_BorrarFinDia As Button - Private b_fdCancelar As Button - Private b_findiaOk As Button - Private p_finDia As Panel - Private et_autSup As EditText - - 'prueba downloadfile - Dim ProgressBar1 As ProgressBar - Dim Label1 As Label - Dim btnDownload As Button - Dim btnCancel As Button - Private p_download As Panel - Private Label6 As Label - Dim logger As Boolean = True - - Dim lat_gps, lon_gps As String - Dim tipo_venta As String - Dim bTerminarClicked As Boolean = False - Private lv_server As ListView - Private l_server As Label - Public rutaBDBackup As String = "" - Private b_envioBD As Button - Dim kh As kms_helperSubs - Private p_login As Panel - Private l_version As Label -End Sub - -Public Sub Initialize - B4XPages.GetManager.LogEvents = True - #if not(DEBUG) - Starter.logger = False - #end if -End Sub - -'This event will be called once, before the page becomes visible. -Private Sub B4XPage_Created (Root1 As B4XView) - If Not(Starter.Logger) Then logger = False - Root = Root1 -' Root.LoadLayout("MainPage") - Root.LoadLayout("login") - B4XPages.SetTitle(Me, "Durakelo") - login.Initialize - B4XPages.AddPage("Login", login) - principal.Initialize - B4XPages.AddPage("Principal", principal) - clientes.Initialize - B4XPages.AddPage("Clientes", clientes) - cliente.Initialize - B4XPages.AddPageAndCreate("Cliente", cliente) -' productos.Initialize -' B4XPages.AddPage("Productos", productos) -' updateAvailable.Initialize -' B4XPages.AddPage("updateAvailable", updateAvailable) -' mapas.Initialize -' B4XPages.AddPage("Mapas", mapas) -' nuevoCliente.Initialize -' B4XPages.AddPageAndCreate("NuevoCliente", nuevoCliente) -' ticketsDia.Initialize -' B4XPages.AddPage("TicketsDia", ticketsDia) - noVenta.Initialize - B4XPages.AddPage("NoVenta", noVenta) - nota.Initialize - B4XPages.AddPage("Nota", nota) -' pedidos.Initialize -' B4XPages.AddPage("Pedidos", pedidos) -' promos.Initialize -' B4XPages.AddPage("Promos", promos) - historico.Initialize - B4XPages.AddPage("Historico", historico) -' checklist.Initialize -' B4XPages.AddPage("CheckList", checklist) -' ruta = Starter.ruta - ruta = File.DirInternal - kh.Initialize(Me, "kh") -' If(FirstTime) Then -' g.Initialize("GPS") -' End If - ' se crea o no el archivo de la base de ddatos de kmt - 'NOTAS SI SE MODIFICA LA ESTRUCTURA SE QUITA EL IF Y SE VA DIRECTO A LA SENTENCIA FILE.COPY PARA QUE - 'TOME LA NUEVA ESTRUCTURA ES MUY IMPORTANTE TENER EL IF DE LO CONTRARIO SOLO LO ESCRIBE UNA VEZ Y LO BORRA - 'SI SE REGRESA A ESTE ACTIVIDAD. -' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE) -' Wait For Activity_PermissionResult (Permission As String, Result As Boolean) - kh.guardaAppInfo(Starter.skmt) - Dim sDate, sTime As String - DateTime.DateFormat = "yyyyMMdd" - sDate=DateTime.Date(DateTime.Now) - - Starter.skmt.ExecNonQuery("DROP TABLE IF EXISTS PEDIDO3") -' skmt.ExecNonQuery("DROP VIEW TOTAL_MARCAS") - - Starter.skmt.ExecNonQuery("CREATE VIEW IF NOT EXISTS CATALOGO AS Select CAT_GP_CLASIF, CAT_GP_ID FROM CAT_GUNAPROD UNION Select CAT_GP_CLASIF, CAT_GP_ID FROM CAT_GUNAPROD2 GROUP BY CAT_GP_CLASIF, CAT_GP_ID") - Starter.skmt.ExecNonQuery("create view IF NOT EXISTS total_marcas AS Select cat_gp_clasif, sum(pe_costo_tot) As total from CATALOGO, pedido where pe_proid = cat_gp_id And pe_cliente <> 0 group by cat_gp_clasif") - Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_EXHIBIDORES (CAT_EX_ID TEXT, CAT_EX_TIPO TEXT, CAT_EX_VALOR TEXT)") - Starter.skmt.ExecNonQuery("CREATE TABLE PEDIDO3 (PE_PRECIO2 TEXT,PE_TIPO TEXT,PE_FOLIO NUMERIC,PE_DESC NUMERIC,PE_COSTO_SIN TEXT,PE_RUTA TEXT,PE_CEDIS TEXT,PE_COSTO_TOT NUMERIC,PE_COSTOU NUMERIC,PE_CANT NUMERIC,PE_PRONOMBRE TEXT,PE_PROID TEXT,PE_CLIENTE TEXT,PE_FECHA TEXT,PE_USUARIO TEXT)") - Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)") - If sDate = "20190523" Then - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER")) - - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",Starter.skmt)) - End If - Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_ENCUESTA (HE_CLIE TEXT, HE_RES TEXT, HE_FECHA TEXT, HE_TIPO TEXT)") - - Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_ENCUESTA2 (HE_CLIE TEXT, HE_RES TEXT, HE_FECHA TEXT, HE_TIPO TEXT, HE_PRECIO TEXT)") - - Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_ENCUESTA_PREGUNTA (CAT_EP_ID TEXT,CAT_EP_IDTIPOPREGUNTA TEXT,CAT_CE_DESCRIPCION TEXT,CAT_EP_PREGUNTA TEXT,CAT_EP_RES1_PRED TEXT,CAT_EP_RES2_PRED TEXT,CAT_EP_RES3_PRED TEXT,CAT_EP_ORDEN_PREGUNTA TEXT)") - - Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_ENCUESTA_PREGUNTA5P (CAT_EP_ID TEXT,CAT_EP_IDTIPOPREGUNTA TEXT,CAT_CE_DESCRIPCION TEXT,CAT_EP_PREGUNTA TEXT,CAT_EP_RES1_PRED TEXT,CAT_EP_RES2_PRED TEXT,CAT_EP_RES3_PRED TEXT,CAT_EP_ORDEN_PREGUNTA TEXT)") - - c=Starter.skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER")) - c.Position =0 - If c.GetString("CUANTOS") = 0 Then - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",Starter.DBReqServer)) - Else - c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER")) - c.Position =0 - Starter.DBReqServer = c.GetString("CAT_VA_VALOR") - End If - Dim P As PhoneId - 'user.Text = P.GetDeviceId - Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_PHONE_STATE) - Wait For Activity_PermissionResult (Permission As String, Result As Boolean) - If Result Then - Dim P As PhoneId - 'user.Text = P.GetDeviceId - IMEI = P.GetDeviceId - IMEI = "" - Else - If logger Then Log("Sin permisos para leer los datos del celular") - End If - - Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION) - Wait For Activity_PermissionResult (Permission As String, Result As Boolean) - If Result Then - StartService(Tracker) - Log("Start Tracker") - End If - p_login.Height = Root.Height - p_login.Width = Root.Width - -End Sub - -Sub B4XPage_Appear - l_version.Text = Application.VersionName -' copiaDB -' server = "http://10.0.0.205:1782" - - reqManager.Initialize(Me, Starter.DBReqServer) - Log(Starter.DBReqServer) -' If g.GPSEnabled=False Then - ' ToastMessageShow("Habilitar el GPS", True) - ' StartActivity(g.LocationSettingsIntent) - ' Else - ' g.Start(0,0) - ' End If -' user.Text ="GPS" - c = Starter.skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA")) - c.Position =0 - If c.GetString("CUANTOS") = 0 Then - cmd.Initialize - cmd.Name = "select_fechat" - reqManager.ExecuteQuery(cmd , 0, "fecha") - - 'Msgbox("AJUSTAR FECHA","AVISO") - B4XPage_Appear - Else - c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA")) - c.Position =0 - Dim sDate,sTime As String - - DateTime.dateFormat = "yyyyMMddHHmm" - sDate=DateTime.Date(DateTime.Now) - - 'Msgbox("aaa"& sDate,"aviso") - If c.GetString("CAT_VA_VALOR") > sDate & sTime Then -' Msgbox("AJUSTAR LA FECHA YA QUE ES MENOR AL SISTEMA " & " "& c.GetString("CAT_VA_VALOR") & " " & sDate & sTime ,"AVISO") - DateTime.TimeFormat = "MM/dd/yyyyHH:mm:ss" - B4XPage_Appear - End If - DateTime.TimeFormat = "MM/dd/yyyyHH:mm:ss" - End If - c.Close - c = Starter.skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("CODIGO")) - c.Position =0 - CUANTOS = c.GetString("CUANTOS") - c.Close - If CUANTOS > 0 Then - c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("CODIGO")) - c.Position =0 - If c.GetString("CAT_VA_VALOR") = "743" Then - Entrar.Visible = True - End If - c.Close - Else - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("CODIGO","0")) - End If - - c=Starter.skmt.ExecQuery2("select COUNT(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP")) - c.Position =0 - If c.GetString("CUANTOS") = 0 Then - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MACIMP","0")) - End If - - c=Starter.skmt.ExecQuery("select COUNT(*) AS CUANTOS FROM VERSION") - c.Position= 0 - - If c.GetString("CUANTOS") = 0 Then - Starter.skmt.ExecNonQuery("delete from VERSION") - Starter.skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object ("2.6")) - End If - c.Close - - c=Starter.skmt.ExecQuery("select NOVERSION FROM VERSION") - c.Position = 0 - - If c.GetString("NOVERSION") <> "2.6" Then -' Msgbox("VERSION INCORRECTA SOLICITAR O DESCARGAR LA NUEVA","ALERTA") - B4XPage_Appear - End If - Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION) - Wait For Activity_PermissionResult (Permission As String, Result As Boolean) - If Result Then - StartService(Tracker) - If logger Then Log("Start Tracker") - Else - ToastMessageShow("No permission", True) - End If - Starter.usuario = kh.traeUsuarioDeDB(Starter.skmt) -' dameUsuario 'Obtenemos el usuario registrado - CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") -End Sub - -'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. - -Sub Entrar_Click - If user.Text = "ROOT" Then - Starter.skmt.ExecNonQuery("delete from usuarioa") - Starter.skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)", Array As Object(user.Text, pass.Text)) - - Starter.skmt.ExecNonQuery("delete from cat_almacen") - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)", Array As Object (pass.Text)) - B4XPages.ShowPage("Principal") - End If - - c=Starter.skmt.ExecQuery2("select count(*) as EXISTE1 from usuarioa where usuario = ?", Array As String(user.Text)) - c.Position=0 - existe = c.GetString("EXISTE1") - - 'existe = 1 - If existe = 0 Then - 'skmt.ExecNonQuery("delete from usuarioa") - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "select_usuario_guna_DUR" - cmd.Parameters = Array As Object(user.Text, pass.Text) - reqManager.ExecuteQuery(cmd , 0, "usuario") - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "select_version_DUR" - reqManager.ExecuteQuery(cmd , 0, "version") - Else - B4XPages.ShowPage("Principal") - End If - -End Sub - -Sub JobDone(Job As HttpJob) - If Job.Success = False Then - ToastMessageShow("Error: " & Job.ErrorMessage, True) - Else - If Job.JobName = "DBRequest" Then - Dim result As DBResult = reqManager.HandleJob(Job) - If result.Tag = "version" Then 'query tag - For Each records() As Object In result.Rows - Starter.skmt.ExecNonQuery("delete from VERSION") - Dim CAT_VE_VERSION As String = records(result.Columns.Get("CAT_VE_VERSION")) - Starter.skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object (CAT_VE_VERSION)) - If CAT_VE_VERSION <> "2.6" Then - Msgbox("VERSION INCORRECTA SOLICITAR O DESCARGAR LA NUEVA","ALERTA") - B4XPage_Appear - End If - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim result As DBResult = reqManager.HandleJob(Job) - If result.Tag = "agencia" Then 'query tag - For Each records() As Object In result.Rows - Dim ID_ALMACEN As String = records(result.Columns.Get("ID_ALMACEN")) - Next - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim result As DBResult = reqManager.HandleJob(Job) - If result.Tag = "fecha" Then 'query tag - For Each records() As Object In result.Rows - Dim FECHA_HOY As String = records(result.Columns.Get("FECHA")) - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FECHA")) - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("FECHA",FECHA_HOY)) - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim result As DBResult = reqManager.HandleJob(Job) - If result.Tag = "usuario" Then 'query tag - For Each records() As Object In result.Rows - Dim name As String = records(result.Columns.Get("USUARIO")) - Dim ID_ALMACEN As String = records(result.Columns.Get("CAT_LO_AGENCIA")) -' Dim IMEI_BASE As String = records(result.Columns.Get("CAT_LO_IDTELEFONO")) - Next - paso1 = 1 - End If - End If - Job.Release - End If - - If paso1 =1 Then - If name = "OKActivo" & IMEI Then - Starter.skmt.ExecNonQuery("delete from usuarioa") - Starter.skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)", Array As Object(user.Text, pass.Text)) - Starter.skmt.ExecNonQuery("delete from cat_almacen") - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)", Array As Object (ID_ALMACEN)) - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("NUMERO_PEDIDO")) - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("NUMERO_PEDIDO",0)) - B4XPages.ShowPage("Principal") - Else If name = "OKExpirado"& IMEI Then - Msgbox("Usuario Expirado llamar al administrador","") - Else If name = "OKCancelado"& IMEI Then - Msgbox("Usuario Cancelado llamar al administrador","") - Else - Msgbox("Usuario o password No validos","") - End If - paso1 = 0 - End If -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' I want to capture the key here so I return True - 'StartActivity(Main) - ExitApplication - 'Return True - End If - ' Returning False signals the system to handle the key - Return False -End Sub - -Sub GPS_LocationChanged (Location1 As Location) - If user.text = "GPS" Then - 'user.Text=Location1.ConvertToMinutes(Location1.Latitude) - 'pass.text=Location1.ConvertToMinutes(Location1.Longitude) - user.Text=Location1.Latitude - pass.text=Location1.Longitude - 'btnTakePicture.Enabled = True - 's.ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE,HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, lat_gps, lon_gps)) - End If -End Sub - -Sub PopupMenu_MenuItemClick (ItemId As Int) As Boolean - ToastMessageShow("Item " & ItemId & " clicked.", False) - Return False -End Sub - -Sub PDF_Click - -End Sub - -Sub user_EnterPressed - If user.Text = "CODIGO" Then - IMEN.Visible = True - user.Text = "" - End If -End Sub - -Sub ImageView4_Click - Entrar.Visible = False - ListView1.Clear - Dim Label1 As Label - Label1 = ListView1.SingleLineLayout.Label - Label1.TextSize = 20 - Label1.TextColor = Colors.Black - ListView1.AddSingleLine(Starter.DBReqServer) - - c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER")) - c.Position =0 - E_SERVER.text = c.GetString("CAT_VA_VALOR") -' Panel1.Visible = True - kh.panelVisible(Panel1, 0, 0) -End Sub - -Sub B_SERVER_Click - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER")) - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",E_SERVER.text)) - reqManager.Initialize(Me, E_SERVER.text.trim) - Starter.DBReqServer = E_SERVER.text.trim - Panel1.Visible = False - Entrar.Visible = True -End Sub - -Sub B_FECHA_Click - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FECHA")) - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("MACIMP")) - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MACIMP","0")) - Panel1.Visible = False -End Sub - -Sub ListView1_ItemClick (Position As Int, Value As Object) - E_SERVER.text = Value -End Sub - -Sub B_IMPRESORA_Click - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("MACIMP")) - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MACIMP","0")) - Panel1.Visible = False -End Sub - -Sub dameUsuario - c=Starter.skmt.ExecQuery("select count(*) as EXISTE1 from usuarioa") - c.Position=0 - existe = c.GetString("EXISTE1") - c.Close - If existe > 0 Then - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - Starter.usuario = c.GetString("USUARIO") - Else - Starter.usuario = "SINUSUARIO" - End If -End Sub - -'Copia la base de datos del almacenamiento interno al externo en el directorio kmts -Sub copiaDB - Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE) - Wait For Activity_PermissionResult (Permission As String, Result As Boolean) - If Result Then - Dim theDir As String - Try - File.MakeDir(File.DirRootExternal,"kmts") - theDir = "/kmts" - Catch - theDir = "" - End Try - Try - File.Copy(File.DirInternal,"kmt.db",File.DirRootExternal&theDir,"dura_kmt.db") - ToastMessageShow("Listo, copiada a " & File.DirRootExternal&theDir & "/dura_kmt.db", False) - LogColor("copiado", Colors.red) - Catch - ToastMessageShow("No se pudo hacer la copia: "&LastException, True) - LogColor("no copiado", Colors.red) - End Try -' Log("rootExternal="&p) -' Log("File.DirInternal="&File.DirInternal) -' Log("File.DirRootExternal="&File.DirRootExternal) - Else - ToastMessageShow("Sin permisos", True) - End If -End Sub diff --git a/B4A - Copy/BatteryUtilities.bas b/B4A - Copy/BatteryUtilities.bas deleted file mode 100644 index ebb4448..0000000 --- a/B4A - Copy/BatteryUtilities.bas +++ /dev/null @@ -1,126 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=10.2 -@EndOfDesignText@ -'Class module -Sub Class_Globals - Private nativeMe As JavaObject - -End Sub -'Initializes the object. -Public Sub Initialize - nativeMe = Me -End Sub -'Return information about the battery status. It returns the following 11 values in an integer Array: -'EXTRA_LEVEL = current battery level, from 0 To EXTRA_SCALE. -'EXTRA_SCALE = the maximum battery level possible. -'EXTRA_HEALTH = the current health constant. -'EXTRA_ICON_SMALL = the resource ID of a small status bar icon indicating the current battery state. -'EXTRA_PLUGGED = whether the device is plugged into a Power source; 0 means it is on battery, other constants are different types of Power sources. -'EXTRA_STATUS = the current status constant. -'EXTRA_TEMPERATURE = the current battery temperature. -'EXTRA_VOLTAGE = the current battery voltage level. -'A value indicating if the battery is being charged or fully charged (If neither it returns 0 Else it returns 1) -'A value indicating if it is charging via USB (0 = Not USB, 2 = USB) -'A value indicating if it is charging via AC (0 = Not AC, 1 = AC) -Public Sub getBatteryInformation () As Int() - - Dim batteryInfo(11) As Int - batteryInfo = nativeMe.RunMethod("getBatteryInformation",Null) - Return batteryInfo - -End Sub - -Public Sub getBatteryTechnolgy() As String - - Dim batterytech As String - batterytech = nativeMe.RunMethod("getBatteryTechnology",Null) - Return batterytech - -End Sub - - - -#If Java - -import android.os.BatteryManager; -import android.os.Bundle; -import android.app.Activity; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; - - public int[] getBatteryInformation() { - - int[] mybat = new int[11]; - - Intent batteryIntent = ba.context.getApplicationContext().registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); - - int level = batteryIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); - mybat[0] = level; - int scale = batteryIntent.getIntExtra(BatteryManager.EXTRA_SCALE, -1); - mybat[1] = scale; - int health = batteryIntent.getIntExtra(BatteryManager.EXTRA_HEALTH,-1); - mybat[2] = health; - int icon_small = batteryIntent.getIntExtra(BatteryManager.EXTRA_ICON_SMALL,-1); - mybat[3] = icon_small; - int plugged = batteryIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED,-1); - mybat[4] = plugged; -// boolean present = batteryIntent.getExtras().getBoolean(BatteryManager.EXTRA_PRESENT); - int status = batteryIntent.getIntExtra(BatteryManager.EXTRA_STATUS,-1); - mybat[5] = status; -// String technology = batteryIntent.getExtras().getString(BatteryManager.EXTRA_TECHNOLOGY); -// BA.Log("Technology = " + technology); - int temperature = batteryIntent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE,-1); - mybat[6] = temperature; - int voltage = batteryIntent.getIntExtra(BatteryManager.EXTRA_VOLTAGE,-1); - mybat[7] = voltage; -// int ac = batteryIntent.getIntExtra("plugged",BatteryManager.BATTERY_PLUGGED_AC); -// mybat[8] = ac; -// int usb = batteryIntent.getIntExtra("plugged",BatteryManager.BATTERY_PLUGGED_USB); -// mybat[9] = usb; - - boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || - status == BatteryManager.BATTERY_STATUS_FULL; - mybat[8] = 0; - if (isCharging == true) { - mybat[8] = 1; - } - - // How are we charging? - mybat[9] = 0; - mybat[10] = 0; - int chargePlug = batteryIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); - boolean usbCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_USB; - if (usbCharge == true) { - mybat[9] = 2; - } - - boolean acCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_AC; - if (acCharge == true) { - mybat[10] = 1; - } - - return mybat; - } - - - public String getBatteryTechnology() { - - Intent batteryIntent = ba.context.getApplicationContext().registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); - - String technology = batteryIntent.getExtras().getString(BatteryManager.EXTRA_TECHNOLOGY); - - return technology; - } - - - - - - - -#End If \ No newline at end of file diff --git a/B4A - Copy/C_Cliente.bas b/B4A - Copy/C_Cliente.bas deleted file mode 100644 index f1f93f2..0000000 --- a/B4A - Copy/C_Cliente.bas +++ /dev/null @@ -1,1202 +0,0 @@ -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 clie_id As String - Dim sDate,sTime As String - Dim usuario As String - Dim total_cliente As String - Dim m_lat As String - Dim m_lon As String - Dim btAdmin As BluetoothAdmin - Dim cmp20 As Serial - 'Dim printer As TextWriter - Dim PairedDevices As Map - Dim L As List - Dim TAMANO As Int - Dim ESPACIO As Int - Dim BLANCO As String - Dim cuenta As String -' Dim tipov As String - Dim Printer1 As EscPosPrinter -' Dim MAC_IMPRESORA As String - 'These global variables will be redeclared each time the activity is created. - 'These variables can only be accessed from this module. - - Dim c As Cursor - Dim s As Cursor - Dim c2 As Cursor - Dim E1 As Cursor - Dim ListView1 As ListView - Dim la_cuenta As Label - Dim La_nombre As Label - Dim la_Calle As Label - Dim la_numero As Label - Dim la_nint As Label - Dim la_edo As Label - Dim la_pob As Label - Dim la_col As Label - Dim la_cp As Label - Dim la_zona As Label - Dim gest As Button - Dim la_saldotot As Label - Dim la_saldooper As Label - - Dim Tels As Button - Dim Label10 As Label - Dim Label11 As Label - - Dim Tar As Button - - Dim la_comm As Label - Dim la_actdte As Label - Dim la_usuario As Label - Dim la_resultado As Label - Dim l_entre1 As Label - Dim l_entre2 As Label - Dim l_atiende As Label - Dim l_atiende2 As Label - Dim DATOS As Button - Dim Guardar As Button - Dim NUEVO As Button - ' Dim lat_gps, lon_gps As String - - Dim l_total As Label - Dim c2 As Cursor - Dim S2 As Cursor - Private s As Cursor - Dim res As String - Private HIST As Button - Private MONTO_COMPRA As String - Private META As String - Private META2 As String - Private VERIFICA As String - Private L_QR As Label - Private BT_QR As Button - Private qr As QRCode - Dim sc As Zxing_scanner - Dim CODIGO As String - - Private b_mapa As Button - Dim CUANTOS As String - Private B_IMP As Button -' Dim Toggla As Toggle - Private B_VENTA As Button - Dim PASA_IMP As String - Dim sucursal As String - Dim FACTURA As String - Dim CREDITO As String - Private b_factura As Button - Dim perfil As String - Private CH_TA As CheckBox - Private CH_TC As CheckBox - Private CH_TB As CheckBox - Private CH_TD As CheckBox - Private E_CUANTOS_E As EditText - Private B_GUARDAR As Button - Private TIPOEX As String - Private B_EXIBI As Button - Private Panel1 As Panel - - Dim t3 As Timer - Private B_INV As Button - Private B_IMP2 As Button - - Dim id_encuesta As String - Dim LLAMAR_FOTO As String - Dim CURSOR_FOTO As Int - Dim TOMAR_FOTO As String - Private Panel10 As Panel - Private l_chk_e As Label - Private Chk_1 As CheckBox - Private chk_2 As CheckBox - Private chk_3 As CheckBox - Private b_chk_e As Button - - Private chk_1_valor As String - Private chk_2_valor As String - Private chk_3_valor As String - Private t_tenc As Label - Private E_RES_E As EditText - Private B_E_NEXT As Button - Private Panel9 As Panel - Private Label26 As Label - Dim impresoraConectada As Boolean = False - Dim printer As TextWriter -End Sub - -Sub initialize - -End Sub - -Private Sub B4XPage_Created (Root1 As B4XView) - 'Do not forget to load the layout file created with the visual designer. For example: - 'Activity.LoadLayout("Layout1") - Root = Root1 - Root.RemoveAllViews - Root.LoadLayout("Cliente") - c=Starter.skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA,CAT_CL_BFACTURA,CAT_CL_BCREDITO from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - s=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - If c.RowCount > 0 Then - c.Position = 0 - la_cuenta.Text = c.GetString("CAT_CL_CODIGO") - cuenta = c.GetString("CAT_CL_CODIGO") - La_nombre.Text = c.GetString("CAT_CL_NOMBRE") - la_Calle.Text = c.GetString("CAT_CL_CALLE") & c.GetString("CAT_CL_NOEXT") - la_col.Text = c.GetString("CAT_CL_COLONIA") - la_edo.Text = c.GetString("CAT_CL_EDO") - la_cp.Text = c.GetString("CAT_CL_CP") - l_entre1.Text = c.GetString("CAT_CL_CALLE1") - l_entre2.Text = c.GetString("CAT_CL_CALLE2") - l_atiende.Text = c.GetString("CAT_CL_ATIENDE1") - l_atiende2.Text = c.GetString("CAT_CL_ATIENTE2") - la_saldotot.Text = c.GetString("CAT_CL_TELEFONO") - la_saldooper.Text = c.GetString("CAT_CL_EMAIL") - MONTO_COMPRA = c.GetString("CAT_CL_MTOCOMPRA") - FACTURA = c.GetString("CAT_CL_BFACTURA") - CREDITO = c.GetString("CAT_CL_BCREDITO") - End If - If s.RowCount > 0 Then - s.Position = 0 - l_total.Text = s.GetString("TOTAL_CLIE") - total_cliente = s.GetString("TOTAL_CLIE") - End If - c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP")) - If c.RowCount > 0 Then - c.Position = 0 - Starter.MAC_IMPRESORA = c.GetString("CAT_VA_VALOR") - End If - If Starter.MAC_IMPRESORA = "" Then Starter.MAC_IMPRESORA = "0" - Log("|" & Starter.MAC_IMPRESORA & "|") - Printer1.Initialize(Me, "Printer1") - - TOMAR_FOTO = 0 - g.Initialize("GPS") - Panel1.Top = La_nombre.Top + La_nombre.Height + 5 : Panel1.left = 0 - Panel9.Top = La_nombre.Top + La_nombre.Height + 5 : Panel9.left = 0 - Panel10.Top = La_nombre.Top + La_nombre.Height + 5 : Panel10.left = 0 -End Sub - -Sub B4XPage_Appear - BT_QR.Enabled = False - b_factura.Visible = False - FACTURA =0 - If g.GPSEnabled=False Then - ToastMessageShow("Habilitar el GPS", True) - StartActivity(g.LocationSettingsIntent) - Else - g.Start(0,0) - End If - c=Starter.skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO,CAT_CL_BFACTURA,CAT_CL_BCREDITO from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - s=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - s.Position=0 - - c.Position=0 - la_cuenta.Text = c.GetString("CAT_CL_CODIGO") - La_nombre.Text = c.GetString("CAT_CL_NOMBRE") - la_Calle.Text = c.GetString("CAT_CL_CALLE") & " " & c.GetString("CAT_CL_NOEXT") - la_col.Text = c.GetString("CAT_CL_COLONIA") - la_edo.Text = c.GetString("CAT_CL_EDO") - la_cp.Text = c.GetString("CAT_CL_CP") - l_entre1.Text = c.GetString("CAT_CL_CALLE1") - l_entre2.Text = c.GetString("CAT_CL_CALLE2") - l_atiende.Text = c.GetString("CAT_CL_ATIENDE1") - l_atiende2.Text = c.GetString("CAT_CL_ATIENTE2") - 'la_saldotot.Text = c.GetString("CAT_CL_TELEFONO") - 'la_saldooper.Text = c.GetString("CAT_CL_EMAIL") - l_total.Text = s.GetString("TOTAL_CLIE") - total_cliente = s.GetString("TOTAL_CLIE") - m_lat =c.GetString("CAT_CL_LAT") - m_lon =c.GetString("CAT_CL_LONG") - FACTURA = c.GetString("CAT_CL_BFACTURA") - CREDITO = c.GetString("CAT_CL_BCREDITO") - - If l_total.Text <> Null Then - - If la_cuenta.Text.Contains("N") = True Then - FACTURA = 0 - End If - - If FACTURA = "1" Then - b_factura.Visible = True - - End If - End If - - If CREDITO = "1" Then - Msgbox("ALTO","Este cliente no se le puede vender ya que tienen adeudo en su crédito") - B_VENTA.Visible = False - gest.Visible = False - Else - B_VENTA.Visible = True - gest.Visible = True - - End If - - If c.GetString("CAT_CL_NUM_SERIEFISICO") = "0" Then - L_QR.Visible = True - Else - L_QR.Visible = False - End If - S2=Starter.skmt.ExecQuery("select count(*) AS CUANTOS from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)") - S2.Position =0 - CUANTOS = S2.GetString("CUANTOS") - S2.Close - If CUANTOS > 0 Then - c2=Starter.skmt.ExecQuery("select sum(HVD_COSTO_TOT) AS TOTAL from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)") - c2.Position =0 - MONTO_COMPRA = c2.GetString("TOTAL") - c2.Close - Else - MONTO_COMPRA = "0" - End If - - la_saldotot.Text = MONTO_COMPRA - If MONTO_COMPRA <> "0" Then - META2 = 300 - MONTO_COMPRA - Else - META2 = 300 - End If - If META2 < 1 Then - META2 = "CUBIERTO" - End If - la_saldooper.Text = META2 - - If Printer1.IsConnected = False Then - Printer1.Connect - Else - Printer1.DisConnect - Printer1.Connect - End If - If PASA_IMP = "1" Then - B_IMP.Enabled = True - End If - '''''''''Agregar la parte de si tiene credito o no tiene credito - If la_cuenta.Text="0" Then - B_VENTA.Visible = False - gest.Visible = False - Else - B_VENTA.Visible = True - gest.Visible = True - End If -End Sub - -Sub GPS_LocationChanged (Location1 As Location) - 'lat_gps=Location1.Latitude - 'lon_gps=Location1.Longitude -' BT_QR.Enabled = True - Dim sDate,sTime As String - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - Starter.skmt.ExecNonQuery("DELETE FROM HIST_GPS") - Starter.skmt.ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, Starter.lat_gps, Starter.lon_gps)) -End Sub - -Sub ListView1_ItemLongClick (Position As Int, Value As Object) - -End Sub - -Sub gest_Click - Starter.tipov = "PREVENTA" - ' StartActivity(colonia2) - cuestionario -End Sub - -Sub Tels_Click - ' skmt.ExecNonQuery("delete from PEDIDO") -' StartActivity(nopago) - B4XPages.ShowPage("NoVenta") -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' I want to capture the key here so I return True -' StartActivity(colonia) - 'Return True - End If - ' Returning False signals the system to handle the key - Return False -End Sub - -Sub Tar_Click -' StartActivity(tarjeta) - B4XPages.ShowPage("Nota") -End Sub - -Sub DATOS_Click -' StartActivity(telefonos) -End Sub - -Sub Guardar_Click - 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 - clie_id = c.GetString("CUENTA") - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - - c=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, COUNT(*) AS CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - If c.GetString("CUANTOS") > 0 Then - Starter.skmt.ExecNonQuery("delete from NOVENTA where NV_CLIENTE In (select cuenta from cuentaa)") - Starter.skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - Starter.skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) VALUES (?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Starter.lon_gps, Starter.lat_gps)) - Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - End If - c.Close - - Starter.skmt.ExecNonQuery("delete from pedido3") - Starter.skmt.ExecNonQuery("INSERT INTO PEDIDO3 SELECT PE_PRECIO2, PE_TIPO, PE_FOLIO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, SUM(PE_COSTO_TOT) AS PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, 1 As PE_FECHA, PE_USUARIO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_FOLIO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE ") - c=Starter.skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE, PE_FECHA,PE_USUARIO 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 PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ?", Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - Next - End If - Starter.skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - Starter.skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") - - B4XPages.ShowPage("Principal") -' StartActivity(seleccion) -End Sub - -Sub NUEVO_Click -' StartActivity(nuevocliente) -End Sub - -Sub HIST_Click -' StartActivity(Historico) - B4XPages.ShowPage("Historico") -End Sub - -Sub BT_QR_Click - 'StartActivity(QR_MODULE) - Dim scan_width As Int - Dim scan_height As Int - scan_width = 400 - scan_height = 400 - sc.BeginScan("sc","CODIGO CLIENTE",scan_width,scan_height) -End Sub - -Sub sc_result(atype As String,Values As String) - CODIGO = Values - Starter.skmt.ExecNonQuery2("UPDATE kmt_info set CAT_CL_NUM_SERIEFISICO = ?, CAT_CL_LONG = ?, CAT_CL_LAT =? where CAT_CL_CODIGO In (select cuenta from cuentaa)", Array As Object(CODIGO, Starter.lon_gps, Starter.lat_gps)) -End Sub - -Sub sc_noScan - Log("nothing returned from the scan !!!!!") -End Sub - -Sub calc_ean_checksum(number As String) As String 'this has now become redundant as I am only interested in QR Codes - Dim i As Int - Dim cO As Char - Dim soma As Int - Dim n As Int - Dim digit As Float - - soma = 0 - For i=0 To number.Length - 1 - digit = number.SubString2(i,i+1) - n= digit * ((i Mod 2) * 2 + 1) - soma=soma+n - Next - Return number & ( ( 10 - ( soma Mod 10 )) Mod 10 ) -End Sub - -Sub b_mapa_Click -' StartActivity(mapas) -End Sub - -Sub B_IMP_Click - c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - perfil = c.GetString("CUANTOS") - c.Close - - If perfil > 0 Then - c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - perfil = c.GetString("CAT_VA_VALOR") - c.Close - End If - - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c.Close - c=Starter.skmt.ExecQuery2("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION =?", Array As String ("SUCURSAL")) - c.Position = 0 - sucursal = c.GetString("CAT_VA_VALOR") - c.Close - ProgressDialogShow("Imprimiendo, un momento ...") - Printer1.DisConnect - If Not(Printer1.IsConnected) Then - Log("Conectando a impresora ...") - Printer1.Connect - Private cont As Int = 0 - Do While Not(impresoraConectada) - Sleep(1000) - Log("++++++ " & cont) - cont = cont + 1 - If cont = 7 Then Printer1.Connect 'Tratamos de reconectar - If cont > 15 Then impresoraConectada = True - Loop - Sleep(500) - impresoraConectada = False - Else - Log("conectando 2") - Printer1.Connect - Private cont As Int = 0 - Do While Not(impresoraConectada) Or Not(Printer1.IsConnected) - Sleep(1000) - Log("****** " & cont) - cont = cont + 1 - If cont = 2 Then Printer1.Connect - If cont > 4 Then impresoraConectada = True - Loop - Sleep(500) - impresoraConectada = False - End If - - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - Dim bmp As Bitmap - bmp.InitializeResize(File.DirAssets, "durakelo1.png", 376, 129, True) 'ignore - Dim myimage As AnImage = Printer1.ImageToBWIMage(bmp) - - myimage = Printer1.DitherImage2D(myimage, 128) - - myimage= Printer1.PackImage(myimage) - Printer1.WriteString(CRLF) ' nudge the printer to show the user something is happening - Printer1.WriteString(Printer1.REVERSE) - - Printer1.PrintImage(myimage) - Printer1.WriteString(Printer1.UNREVERSE) - - 'Printer1.Justify = 1 - 'printer.Initialize(cmp20.OutputStream) - Printer1.WriteString("DURAKELO S.A. de C.V." & CRLF) - Printer1.WriteString("RFC: DUR-011025-T12" & CRLF) - Printer1.WriteString(sucursal & CRLF) - Printer1.WriteString(sDate & CRLF) - Printer1.WriteString(sTime & CRLF) - Printer1.WriteString("Vendedor:" & usuario & CRLF) - Printer1.WriteString("Tienda: " & La_nombre.Text & CRLF) - Printer1.WriteString("ID.Cliente: " & la_cuenta.Text & CRLF) - Printer1.WriteString("Calle: " & la_Calle.Text & CRLF) - Printer1.WriteString("Colonia: " & la_col.Text & CRLF) - Printer1.WriteString("C.P.: " & la_cp.Text & CRLF) - Printer1.WriteString("Entre calle1: " & l_entre1.Text & CRLF) - Printer1.WriteString("Entre Calle2: " & l_entre2.Text & CRLF) - - If perfil = "V-ESPECIAL" Then 'Or perfil = "V-SUPER" - Printer1.WriteString("-----------PREVENTA-----------" & CRLF) - ' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show. - s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_PRECIO2 as PE_COSTOU, length(PE_PRECIO2) as L_COSTOU,PE_CANT * PE_PRECIO2 AS PE_COSTO_TOT, length(PE_CANT * PE_PRECIO2) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PROID ", Array As String("PREVENTA")) - If S.RowCount>0 Then - For i=0 To S.RowCount -1 - S.Position=i - If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then - Printer1.WriteString(s.GetString("PE_PRONOMBRE") & CRLF) - - Else - - Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & CRLF) - TAMANO = s.GetLong("L_CANT") + TAMANO - TAMANO = s.GetLong("L_COSTOU") + TAMANO - TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO - - ESPACIO = ESPACIO - TAMANO - - For E=0 To ESPACIO -1 - BLANCO = " " & BLANCO - Next - Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF ) - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - End If - Next - End If - s.Close - s=Starter.skmt.ExecQuery2("select SUM(PE_COSTO_TOT) AS TOTAL, SUM(PE_PRECIO2 * PE_CANT) AS TOTAL2 FROM PEDIDO WHERE PE_TIPO = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("PREVENTA")) - s.Position =0 - If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then - Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")) & CRLF) - End If - Printer1.WriteString("Total Preventa: $" & s.GetString("TOTAL") & CRLF) - s.Close - - Else - Printer1.WriteString("-----------PREVENTA-----------" & CRLF) - ' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show. - s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? AND LENGTH(PE_CEDIS) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PROID", Array As String("PREVENTA")) - If S.RowCount>0 Then - For i=0 To S.RowCount -1 - S.Position=i - If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then - Printer1.WriteString(s.GetString("PE_PRONOMBRE") & CRLF) - - Else - - Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & CRLF) - TAMANO = s.GetLong("L_CANT") + TAMANO - TAMANO = s.GetLong("L_COSTOU") + TAMANO - TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO - - ESPACIO = ESPACIO - TAMANO - - For E=0 To ESPACIO -1 - BLANCO = " " & BLANCO - Next - Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF ) - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - End If - Next - End If - s.Close - s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? and LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_COSTOU", Array As String("PREVENTA")) - If S.RowCount>0 Then - Printer1.WriteString("----PROMOS----" & CRLF) - For i=0 To S.RowCount -1 - S.Position=i - If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then - Printer1.WriteString(s.GetString("PE_PRONOMBRE") & CRLF) - - Else - - Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & CRLF) - TAMANO = s.GetLong("L_CANT") + TAMANO - TAMANO = s.GetLong("L_COSTOU") + TAMANO - TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO - - ESPACIO = ESPACIO - TAMANO - - For E=0 To ESPACIO -1 - BLANCO = " " & BLANCO - Next - Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF ) - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - End If - Next - Printer1.WriteString("--FIN PROMOS----" & CRLF) - End If - s.Close - - s=Starter.skmt.ExecQuery2("select SUM(PE_COSTO_TOT) AS TOTAL, SUM(PE_PRECIO2 * PE_CANT) AS TOTAL2 FROM PEDIDO WHERE PE_TIPO = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("PREVENTA")) - s.Position =0 - ' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then - ' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL"))) - ' End If - Printer1.WriteString("Total Preventa: $" & s.GetString("TOTAL") & CRLF) - s.Close - - End If - Printer1.WriteString(" " & CRLF) - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString("ENTREGA EN :" & CRLF) - Printer1.WriteString(la_Calle.Text & CRLF) - Printer1.WriteString("----ESTE TICKET NO ES UN -----" & CRLF) - Printer1.WriteString("--COMPROBANTE FISCAL, SOLO ES-" & CRLF) - Printer1.WriteString("--------INFORMATIVO-----------" & CRLF) - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString(" " & CRLF) - - Sleep(1000) - Printer1.DisConnect - - ProgressDialogHide -' printer.Flush - ' printer.Close - -End Sub - -Sub B_IMP2_Click - c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - perfil = c.GetString("CUANTOS") - c.Close - - If perfil > 0 Then - c=Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - perfil = c.GetString("CAT_VA_VALOR") - c.Close - End If - - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c.Close - c=Starter.skmt.ExecQuery2("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION =?", Array As String ("SUCURSAL")) - c.Position = 0 - sucursal = c.GetString("CAT_VA_VALOR") - c.Close - - ProgressDialogShow("Imprimiendo, un momento ...") -' Printer1.DisConnect - If Not(Printer1.IsConnected) Then - Log("conectando 1") - Printer1.Connect - Private cont As Int = 0 - Do While Not(impresoraConectada) -' Log("conectando ...") - Sleep(1000) - cont = cont + 1 - If cont = 3 Then Printer1.Connect 'Tratamos de reconectar - If cont > 15 Then impresoraConectada = True - Loop - Sleep(500) - impresoraConectada = False - Else - Log("conectando 2") - Printer1.Connect - Private cont As Int = 0 - Do While Not(impresoraConectada) Or Not(Printer1.IsConnected) -' Log("conectando ...") - Sleep(1000) - cont = cont + 1 - If cont = 2 Then Printer1.Connect - If cont > 4 Then impresoraConectada = True - Loop - Sleep(500) - impresoraConectada = False - End If - Log("Iniciamos ...") - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - Dim bmp As Bitmap - bmp.InitializeResize(File.DirAssets, "durakelo1.png", 376, 129, True) 'ignore - Dim myimage As AnImage = Printer1.ImageToBWIMage(bmp) - - myimage = Printer1.DitherImage2D(myimage, 128) - - myimage= Printer1.PackImage(myimage) - Log("Iniciamos 2 ...") - Printer1.WriteString(CRLF) ' nudge the printer to show the user something is happening - Printer1.WriteString(Printer1.REVERSE) - - Printer1.PrintImage(myimage) - Printer1.WriteString(Printer1.UNREVERSE) - -' printer.Initialize(cmp20.OutputStream) - Printer1.WriteString("DURAKELO S.A. de C.V." & CRLF) - Printer1.WriteString("RFC: DUR-011025-T12" & CRLF) - Printer1.WriteString(sucursal & CRLF) - Printer1.WriteString(sDate & CRLF) - Printer1.WriteString(sTime & CRLF) - Printer1.WriteString("Vendedor:" & usuario & CRLF) - Printer1.WriteString("Tienda: " & La_nombre.Text & CRLF) - Printer1.WriteString("ID.Cliente: " & la_cuenta.Text & CRLF) - Printer1.WriteString("Calle: " & la_Calle.Text & CRLF) - Printer1.WriteString("Colonia: " & la_col.Text & CRLF) - Printer1.WriteString("C.P.: " & la_cp.Text & CRLF) - Printer1.WriteString("Entre calle1: " & l_entre1.Text & CRLF) - Printer1.WriteString("Entre Calle2: " & l_entre2.Text & CRLF) - - Printer1.WriteString("-----------ENTREGA------------" & CRLF) - - s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_COSTO_TOT) as L_COSTO_TOT, PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? AND LENGTH(PE_CEDIS) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PRONOMBRE", Array As String("VENTA")) - If S.RowCount>0 Then - For i=0 To S.RowCount -1 - S.Position=i - If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then - Printer1.WriteString(s.GetString("PE_PRONOMBRE") & CRLF) - - Else - - Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & CRLF) - TAMANO = s.GetLong("L_CANT") + TAMANO - TAMANO = s.GetLong("L_COSTOU") + TAMANO - TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO - - ESPACIO = ESPACIO - TAMANO - - For E=0 To ESPACIO -1 - BLANCO = " " & BLANCO - Next - Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF ) - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - End If - Next - End If - s.Close - - s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_COSTO_TOT) as L_COSTO_TOT, PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? AND LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_COSTOU", Array As String("VENTA")) - If S.RowCount>0 Then - Printer1.WriteString("----PROMOS----" & CRLF) - - For i=0 To S.RowCount -1 - S.Position=i - If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then - Printer1.WriteString(s.GetString("PE_PRONOMBRE") & CRLF) - - Else - - Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & CRLF) - TAMANO = s.GetLong("L_CANT") + TAMANO - TAMANO = s.GetLong("L_COSTOU") + TAMANO - TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO - - ESPACIO = ESPACIO - TAMANO - - For E=0 To ESPACIO -1 - BLANCO = " " & BLANCO - Next - Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF ) - TAMANO = 0 - ESPACIO = 21 - BLANCO = " " - End If - - Next - Printer1.WriteString("--FIN PROMOS----" & CRLF) - - End If - s.Close - - Printer1.WriteString(" " & CRLF) - s=Starter.skmt.ExecQuery2("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_TIPO = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("VENTA")) - s.Position =0 - Printer1.WriteString("Total entrega: $" & s.GetString("TOTAL") & CRLF) - s.Close -' Printer1.WriteString("------------VENTA-------------") -' Printer1.WriteString("TOTAL COMPRA: $:" & total_cliente) - Printer1.WriteString(" " & CRLF) - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString("ENTREGA EN :" & CRLF) - Printer1.WriteString(la_Calle.Text & CRLF) - Printer1.WriteString("----ESTE TICKET NO ES UN -----" & CRLF) - Printer1.WriteString("--COMPROBANTE FISCAL, SOLO ES-" & CRLF) - Printer1.WriteString("--------INFORMATIVO-----------" & CRLF) - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString(" " & CRLF) - - Sleep(1000) - Printer1.DisConnect - ProgressDialogHide - 'printer.Flush -' printer.Close -End Sub - -Sub B_INV_Click - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c.Close - - TAMANO = 5 - ESPACIO = 21 - BLANCO = " " -' printer.Initialize(cmp20.OutputStream) - Printer1.WriteString("DURAKELO S.A. de C.V." & CRLF) - Printer1.WriteString("RESUMEN DIA A LA HORA" & CRLF) - Printer1.WriteString(sDate & " " & sTime & CRLF) - Printer1.WriteString("Vendedor:" & usuario & CRLF ) - Printer1.WriteString("-------------VENTA-------------" & CRLF) - - E1=Starter.skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("VENTA")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - c=Starter.skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("VENTA")) - c.Position = 0 - Printer1.WriteString("VENTA: " & c.GetString("MONTO_DIA") & CRLF) - c.Close - Else - Printer1.WriteString("VENTA: " & "0" & CRLF) - End If - E1.Close - - E1=Starter.skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("PREVENTA")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - c=Starter.skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("PREVENTA")) - c.Position = 0 - Printer1.WriteString("PREVENTA: " & c.GetString("MONTO_DIA") & CRLF) - c.Close - Else - Printer1.WriteString("PREVENTA: " & "0" & CRLF) - End If - E1.Close - - E1=Starter.skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("ABORDO")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - c=Starter.skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("ABORDO")) - c.Position = 0 - Printer1.WriteString("ABORDO: " & c.GetString("MONTO_DIA") & CRLF) - c.Close - Else - Printer1.WriteString("ABORDO: " & "0" & CRLF) - End If - E1.Close - - Printer1.WriteString("-----------INVENTARIO-----------" & CRLF) - ' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show. - s=Starter.skmt.ExecQuery2 ("select CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_ALMACEN from cat_gunaprod2 where CAT_GP_CLASIF <> ? ORDER BY CAT_GP_NOMBRE ", Array As String("PROMOS")) - - If S.RowCount>0 Then - For i=0 To S.RowCount -1 - S.Position=i - Printer1.WriteString(s.GetString("CAT_GP_NOMBRE") & CRLF) - Printer1.WriteString("CANTIDAD: " & s.GetString("CAT_GP_ALMACEN") & CRLF) - TAMANO = TAMANO + 1 - If TAMANO > 40 Then - t3.Initialize("T3", 4000) ' 1000 = 1 second - t3.Enabled = True - Wait For t3_tick - TAMANO = 0 - End If - Next - End If - s.Close - - Printer1.WriteString(" " & CRLF) - Printer1.WriteString("-----------RMI----------------" & CRLF) - Printer1.WriteString(" " & CRLF) - 'c=Starter.skmt.ExecQuery2("select count(*) as CUANTOS from pedido where substr(pe_pronombre,1,6) = ? GROUP BY PE_PRONOMBRE", Array As String("CAMBIO")) - 'c.Position =0 - 'Cuantos = c.GETSTRING("CUANTOS") - 'c.Close - 'If Cuantos >0 Then - c=Starter.skmt.ExecQuery2("select SUM(PE_CANT) AS CANTIDAD,PE_PRONOMBRE from pedido where substr(pe_pronombre,1,6) = ? GROUP BY PE_PRONOMBRE", Array As String("CAMBIO")) - If C.RowCount>0 Then - For i=0 To C.RowCount -1 - C.Position=i - Printer1.WriteString(C.GetString("CANTIDAD") & " " & C.GetString("PE_PRONOMBRE") & CRLF ) - Next - End If - c.Close - 'End If - - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString("Nombre y Firma" & CRLF) - Printer1.WriteString(" " & CRLF) - Printer1.WriteString(" " & CRLF) - Printer1.WriteString(" " & CRLF) - Printer1.WriteString("______________________________" & CRLF ) - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString(" " & CRLF) - Printer1.WriteString(" " & CRLF) - Printer1.WriteString("------------------------------" & CRLF) - Printer1.WriteString(" " & CRLF) -' printer.Flush -End Sub - -Sub B_VENTA_Click - Starter.tipov = "VENTA" - 'StartActivity(colonia2) - cuestionario -End Sub - -Sub b_factura_Click - -End Sub - -Sub CH_TA_CheckedChange(Checked As Boolean) - -End Sub - -Sub CH_TC_CheckedChange(Checked As Boolean) - -End Sub - -Sub CH_TB_CheckedChange(Checked As Boolean) - -End Sub - -Sub CH_TD_CheckedChange(Checked As Boolean) - -End Sub - -Sub B_GUARDAR_Click - If CH_TA.Checked = True Then - TIPOEX = CH_TA.Text - ELSE If CH_TB.Checked = True Then - TIPOEX = CH_TB.Text - ELSE If CH_TC.Checked = True Then - TIPOEX = CH_TC.Text - ELSE If CH_TD.Checked = True Then - TIPOEX = CH_TD.Text - End If - - Panel1.Visible = False - B_EXIBI.Visible = True - b_factura.Visible = True - HIST.Visible = True - Tar.VISIBLE = True - B_IMP.Visible = True - Tels.Visible = True - B_VENTA.Visible = True - B_IMP2.Visible = True - gest.Visible = True - Guardar.Visible = True - B_INV.Visible = True - - c=Starter.skmt.ExecQuery("select CUENTA from cuentaa") - c.Position = 0 - cuenta = c.GetString("CUENTA") - - Starter.skmt.ExecNonQuery2("INSERT INTO HIST_EXIBIDORES(CAT_CL_CLIENTE,CAT_CL_EXHIBIDOR,CAT_CL_BEXHIBIDOR) VALUES(?,?,?)", Array As Object(cuenta,TIPOEX,E_CUANTOS_E.Text)) - -End Sub - -Sub B_EXIBI_Click - s=Starter.skmt.ExecQuery("select CAT_EX_ID, CAT_EX_TIPO, CAT_EX_VALOR FROM CAT_EXHIBIDORES") - - If s.RowCount>0 Then - For i=0 To s.RowCount -1 - s.Position=i - If s.GetString("CAT_EX_ID") = "1" Then - CH_TA.Text = s.GetString("CAT_EX_VALOR") - End If - If s.GetString("CAT_EX_ID") = "2" Then - CH_TB.Text = s.GetString("CAT_EX_VALOR") - End If - If s.GetString("CAT_EX_ID") = "3" Then - CH_TC.Text = s.GetString("CAT_EX_VALOR") - End If - If s.GetString("CAT_EX_ID") = "4" Then - CH_TD.Text = s.GetString("CAT_EX_VALOR") - End If - - Next - End If - - E_CUANTOS_E.Text = "" - CH_TA.Checked = False - CH_TB.Checked = False - CH_TC.Checked = False - CH_TD.Checked = False - Panel1.Visible = True - B_EXIBI.Visible = False - b_factura.Visible = False - HIST.Visible = False - Tar.VISIBLE = False - B_IMP.Visible = False - Tels.Visible = False - B_VENTA.Visible = False - B_IMP2.Visible = False - gest.Visible = False - Guardar.Visible = False - B_INV.Visible = False - -End Sub - -Sub Printer1_Connected (Success As Boolean) - Log("Impresora conectada.") - If Success Then - ToastMessageShow("Connected successfully", False) - Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("MACIMP")) - Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MACIMP", Starter.mac_impresora)) - B_IMP.Enabled = True - impresoraConectada = True - Else -' Msgbox(Printer1.ConnectedErrorMsg, "Error connecting.") -' If Msgbox2("", "Printer Error","Reprint","Cancel","",Null) = DialogResponse.POSITIVE Then 'ignore -' StartPrinter -' End If - End If -End Sub - -Sub StartPrinter - Dim PairedDevices As Map - Dim L As List - Dim resimp As Int - ToastMessageShow("Printing.....",True) - PairedDevices.Initialize - Try - PairedDevices = cmp20.GetPairedDevices - Catch - Msgbox("Getting Paired Devices","Printer Error") 'ignore - printer.Close - cmp20.Disconnect - End Try - - If PairedDevices.Size = 0 Then - Msgbox("Error Connecting to Printer - Printer Not Found","") 'ignore - Return - End If - - If PairedDevices.Size = 1 Then - Try - cmp20.Connect(PairedDevices.Get(PairedDevices.GetKeyAt(0))) - Catch - Msgbox("Connecting","Printer Error") 'ignore - printer.Close - cmp20.Disconnect - End Try - Else - L.Initialize - For i = 0 To PairedDevices.Size - 1 - L.Add(PairedDevices.GetKeyAt(i)) - Next - resimp = InputList(L, "Choose device", -1) 'ignore - If resimp <> DialogResponse.CANCEL Then - cmp20.Connect(PairedDevices.Get(L.Get(resimp))) - End If - End If -End Sub - -Sub cuestionario - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - - If TOMAR_FOTO = 0 Then - s=Starter.skmt.ExecQuery("select COUNT(*) AS CUANTOS from HIST_ENCUESTA where HE_CLIE In (Select cuenta from cuentaa)") - s.Position= 0 - CUANTOS = s.GetString("CUANTOS") - Else - CUANTOS = 0 - End If - If CUANTOS = 0 Then - c=Starter.skmt.ExecQuery("SELECT CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA FROM CAT_ENCUESTA_PREGUNTA ORDER BY CAT_CE_DESCRIPCION, CAST(CAT_EP_ORDEN_PREGUNTA AS DECIMAL)") - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - If TOMAR_FOTO = 1 Then - If CURSOR_FOTO + 1 > c.RowCount -1 Then - TOMAR_FOTO = 0 - Exit - Else - i = CURSOR_FOTO +1 - End If - 'Msgbox(i,"a") - TOMAR_FOTO = 0 - End If - c.Position=i - ' Msgbox("paso1","a") - If c.GetString("CAT_EP_IDTIPOPREGUNTA") = 5 Then - id_encuesta = c.GetString("CAT_EP_ID") - TOMAR_FOTO = 1 - CURSOR_FOTO = i -' StartActivity(foto) - ' Msgbox("paso2","a") - Exit - ELSE IF c.GetString("CAT_EP_IDTIPOPREGUNTA") = 3 Then - res = Msgbox2(c.GetString("CAT_EP_PREGUNTA"),c.GetString("CAT_CE_DESCRIPCION"), "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) - If res = DialogResponse.POSITIVE Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, "SI",sDate & sTime,c.GetString("CAT_EP_ID"))) - Else IF res = DialogResponse.NEGATIVE Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, "NO",sDate & sTime,c.GetString("CAT_EP_ID"))) - Else IF res = DialogResponse.CANCEL Then - i = i -1 - End If - ELSE IF c.GetString("CAT_EP_IDTIPOPREGUNTA") = 4 Then - res = Msgbox2(c.GetString("CAT_EP_PREGUNTA"),c.GetString("CAT_CE_DESCRIPCION"), "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) - If res = DialogResponse.POSITIVE Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, "SI",sDate & sTime,c.GetString("CAT_EP_ID"))) - 'i = c.GetString("CAT_EP_RES1_PRED") -1 - Else IF res = DialogResponse.NEGATIVE Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, "NO",sDate & sTime,c.GetString("CAT_EP_ID"))) - i = c.GetInt("CAT_EP_RES2_PRED") -2 - Else IF res = DialogResponse.CANCEL Then - i = i -1 - End If - ' Msgbox("paso3","a") - ELSE If c.GetString("CAT_EP_IDTIPOPREGUNTA") = 2 Then - res = Msgbox2(c.GetString("CAT_EP_PREGUNTA"),c.GetString("CAT_CE_DESCRIPCION"), c.GetString("CAT_EP_RES1_PRED"), c.GetString("CAT_EP_RES2_PRED"),c.GetString("CAT_EP_RES3_PRED"),LoadBitmap(File.DirAssets,"alert2.png")) - If res = DialogResponse.POSITIVE Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, c.GetString("CAT_EP_RES1_PRED"),sDate & sTime,c.GetString("CAT_EP_ID"))) - Else IF res = DialogResponse.NEGATIVE Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, c.GetString("CAT_EP_RES3_PRED"),sDate & sTime,c.GetString("CAT_EP_ID"))) - Else IF res = DialogResponse.CANCEL Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, c.GetString("CAT_EP_RES2_PRED"),sDate & sTime,c.GetString("CAT_EP_ID"))) - End If - ' Msgbox("paso4","a") - ELSE If c.GetString("CAT_EP_IDTIPOPREGUNTA") = 6 Then - Panel10.Visible = True - l_chk_e.Text = c.GetString("CAT_EP_PREGUNTA") - Chk_1.Checked = False - chk_2.Checked = False - chk_3.Checked = False - Chk_1.Text = c.GetString("CAT_EP_RES1_PRED") - chk_2.Text = c.GetString("CAT_EP_RES2_PRED") - chk_3.Text = c.GetString("CAT_EP_RES3_PRED") - chk_1_valor = c.GetString("CAT_EP_RES1_PRED") - chk_2_valor = c.GetString("CAT_EP_RES2_PRED") - chk_3_valor = c.GetString("CAT_EP_RES3_PRED") - TOMAR_FOTO = 1 - CURSOR_FOTO = i - ' Msgbox("paso5","a") - Exit - ELSE If c.GetString("CAT_EP_IDTIPOPREGUNTA") = 1 Then - Panel9.Visible = True - t_tenc.Text = c.GetString("CAT_EP_PREGUNTA") - Label26.Text = c.GetString("CAT_CE_DESCRIPCION") - E_RES_E.Text = "" - TOMAR_FOTO = 1 - CURSOR_FOTO = i - Exit - Else - ' Main.tipov = "VENTA" -' StartActivity(colonia2) - End If - Next - Else - ' Main.tipov = "VENTA" -' StartActivity(colonia2) - End If - Else - ' Main.tipov = "VENTA" -' StartActivity(colonia2) - End If -End Sub - -Sub B_E_NEXT_Click - Panel9.Visible = False - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, E_RES_E.Text ,sDate & sTime,c.GetString("CAT_EP_ID"))) - Starter.tipov = "VENTA" - 'TOMAR_FOTO = 1 - cuestionario - 'StartActivity(colonia2) - -End Sub - -Sub b_chk_e_Click - Panel10.Visible = False - - If Chk_1.Checked = True Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, chk_1_valor,sDate & sTime,c.GetString("CAT_EP_ID"))) - else if chk_2.Checked = True Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, chk_2_valor,sDate & sTime,c.GetString("CAT_EP_ID"))) - else if chk_3.Checked = True Then - Starter.skmt.ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)", Array As Object(la_cuenta.Text, chk_3_valor,sDate & sTime,c.GetString("CAT_EP_ID"))) - End If - Starter.tipov = "VENTA" - 'TOMAR_FOTO = 1 - cuestionario -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_Clientes.bas b/B4A - Copy/C_Clientes.bas deleted file mode 100644 index c35f70c..0000000 --- a/B4A - Copy/C_Clientes.bas +++ /dev/null @@ -1,213 +0,0 @@ -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 - '//Process Globals - Dim ruta As String - Dim q_buscar As String - 'These global variables will be redeclared each time the activity is created. - 'These variables can only be accessed from this module. - Dim skmt As SQL - Dim c As Cursor - Dim c2 As Cursor - Dim s As Cursor - Dim ListView1 As ListView - Dim entro As String - Dim gest As Button - Dim lfila As Label - Dim busca As EditText - Dim colonia As String - Private b_qr As Button - Private qr As QRCode -' Dim sc As Zxing_scanner - Dim CODIGO As String -End Sub - -Sub initialize - -End Sub - -Private Sub B4XPage_Created (Root1 As B4XView) - 'Do not forget to load the layout file created with the visual designer. For example: - 'Activity.LoadLayout("Layout1") - Root = Root1 - Root.LoadLayout("Clientes") - entro ="2" - ' valido donde escribo el archivo de la base de datos de kmt - ruta = File.DirInternal - If File.Exists(ruta, "kmt.db") = False Then - File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db") - End If -' qr.initialize -End Sub - -Sub B4XPage_Appear - b_qr.Visible = False ' No usamos el lector QR en esta app - CHV - busca.Text = "" - skmt.Initialize(ruta,"kmt.db", True) - entro ="2" - colonia = 0 - ' esto es para rutas se quito por colonia c=skmt.ExecQuery("select CAT_CL_RUTA, count(*) as cuantos from kmt_info where gestion = 0 group by CAT_CL_RUTA order by CAT_CL_RUTA asc") - 'SE COMENTA EL SIGUIENTE CODIGO PARA QUE TODAS LAS TIENDAS APARESCAN. - - ' c=skmt.ExecQuery("select CAT_CL_COLONIA, count(*) as cuantos from kmt_info where gestion = 0 group by CAT_CL_COLONIA order by CAT_CL_COLONIA asc") - c=skmt.ExecQuery("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO,CAT_CL_NUM_SERIEFISICO from kmt_info where gestion = 0 and cat_cl_codigo <> 0 ORDER BY CAST(CAT_CL_NUM_SERIEFISICO AS DECIMAL)") - ListView1.Clear - lfila.Text = "NOMBRE" - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 10 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Black - ListView1.AddTwoLines(c.GetString("CAT_CL_CODIGO"), c.GetString("CAT_CL_NUM_SERIEFISICO") & " " & c.GetString("CAT_CL_NOMBRE")) - Next - End If - entro = "4" - ' ESTE FUE EL FIN DEL CODIGO COMENTADO - -End Sub - -Sub ListView1_ItemClick (Position As Int, Value As Object) - If colonia = 0 Then - colonia = Value - End If - If entro = "2" Then - c2=skmt.ExecQuery2("select CAT_CL_CALLE, CAT_CL_COLONIA, count(*) as cuantos from kmt_info where gestion = 0 and CAT_CL_COLONIA = ? GROUP BY CAT_CL_CALLE, CAT_CL_COLONIA order by CAT_CL_CALLE ", Array As String(Value)) - ListView1.Clear - lfila.text = "Calle" - If c2.RowCount>0 Then - For i=0 To c2.RowCount -1 - c2.Position=i - ListView1.AddTwoLines(c2.GetString("CAT_CL_CALLE"),c2.GetString("cuantos") ) - Next - End If - entro = "3" - Else If entro = "3" Then - c2=skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where gestion = 0 and CAT_CL_CALLE = ? AND CAT_CL_COLONIA = ? order by CAT_CL_NOMBRE ", Array As String(Value, colonia)) - ListView1.Clear - lfila.text = "Nombre" - If c2.RowCount>0 Then - For i=0 To c2.RowCount -1 - c2.Position=i - ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE")) - Next - End If - entro = "4" - Else If entro = "4" Then - skmt.ExecNonQuery("delete from CUENTAA") - skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(Value)) -' StartActivity(fila) - B4XPages.ShowPage("Cliente") - End If -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' If entro = "3" Then - 'entro = "2" - 'B4XPage_Appear - 'Return True - 'Else If entro = "2" Then - 'entro = "1" - 'B4XPage_Appear - 'Return True - 'Else If entro = "1" Then - - ' I want to capture the key here so I return True - -' StartActivity(seleccion) - B4XPages.ShowPage("Principal") - Return False - 'End If - End If - ' Returning False signals the system to handle the key - -End Sub - -Sub BUSCA_TextChanged (Old As String, New As String) - q_buscar = "%" & busca.Text & "%" - skmt.Initialize(ruta,"kmt.db", True) - - c2=skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where (CAT_CL_NOMBRE like ? OR CAT_CL_CODIGO LIKE ?)and gestion = 0 order by CAT_CL_NOMBRE ", Array As String(q_buscar,q_buscar)) - ListView1.Clear - lfila.text = "Nombre y Calle" - - If c2.RowCount>0 Then - For i=0 To c2.RowCount -1 - c2.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 10 - label1.TextColor = Colors.White - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.White - ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE")) - Next - End If - entro = "4" - - c2.Close -End Sub - -Sub b_qr_Click - 'StartActivity(QR_MODULE) - Dim scan_width As Int - Dim scan_height As Int - scan_width = 400 - scan_height = 400 -' sc.BeginScan("sc","CODIGO CLIENTE",scan_width,scan_height) - -End Sub - - -Sub sc_result(atype As String,Values As String) - 'Log("Type : " & atype) - 'Log("Value : " & Values) - CODIGO = Values - - c2=skmt.ExecQuery2("select COUNT(*) AS ENCONTRADO from kmt_info where CAT_CL_NUM_SERIEFISICO = ? order by CAT_CL_NOMBRE ", Array As String(CODIGO)) - c2.Position =0 - If c2.GetString("ENCONTRADO") > 0 Then - s=skmt.ExecQuery2("select CAT_CL_CODIGO from kmt_info where CAT_CL_NUM_SERIEFISICO = ? order by CAT_CL_NOMBRE ", Array As String(CODIGO)) - s.Position =0 - skmt.ExecNonQuery("delete from CUENTAA") - skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(s.GetString("CAT_CL_CODIGO"))) - s.Close - b_qr.Visible = False -' StartActivity(fila) - Else - Msgbox("CODIGO " & CODIGO & " NO ENCONTRADO","AVISO") - End If -End Sub -Sub sc_noScan - Log("nothing returned from the scan !!!!!") -End Sub -Sub calc_ean_checksum(number As String) As String 'this has now become redundant as I am only interested in QR Codes - Dim i As Int - Dim cO As Char - Dim soma As Int - Dim n As Int - Dim digit As Float - - soma = 0 - For i=0 To number.Length - 1 - digit = number.SubString2(i,i+1) - n= digit * ((i Mod 2) * 2 + 1) - soma=soma+n - Next - Return number & ( ( 10 - ( soma Mod 10 )) Mod 10 ) -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_Historico.bas b/B4A - Copy/C_Historico.bas deleted file mode 100644 index f036d4f..0000000 --- a/B4A - Copy/C_Historico.bas +++ /dev/null @@ -1,148 +0,0 @@ -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 skmt As SQL - Dim g As GPS - Dim clie_id As String - Dim sDate,sTime As String - Dim usuario As String - - 'These global variables will be redeclared each time the activity is created. - 'These variables can only be accessed from this module. - Dim c As Cursor - Dim ruta As String - Dim Regresar As Button - Dim ListView1 As ListView - Dim L_CANT As Label - Dim L_TOTAL As Label - Dim borra As Button - Dim Existe As String - Dim result As String - ' Dim lat_gps, lon_gps As String - - Private Titulo As Label - Private b_desc As Button - Private ListView2 As ListView - Private B_RMI As Button -End Sub - -Sub initialize - -End Sub - -Private Sub B4XPage_Created (Root1 As B4XView) - Root = Root1 - Root.LoadLayout("Historico") - borra.Visible = False - Titulo.Text = "Acumulado" - b_desc.Visible = False - g.Initialize("gps") -End Sub - -Sub B4XPage_Appear - B_RMI.Visible = True - If g.GPSEnabled=False Then - ToastMessageShow("Habilitar el GPS", True) - StartActivity(g.LocationSettingsIntent) - Else - g.Start(0,0) - End If - L_CANT.Text ="" - L_TOTAL.Text="" - c=Starter.skmt.ExecQuery("select count(*) as EXISTE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)") - C.Position=0 - Existe = C.GetString("EXISTE") - C.Close - 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_FECHA asc") - ListView1.Clear - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("HVD_PRONOMBRE"),"Cantidad #"& c.GetString("HVD_CANT")& " SubTotal $"& c.GetString("HVD_COSTO_TOT")& " FECHA " &c.GetString("HVD_FECHA") ) - Next - End If - If Existe <> 0 Then - c=Starter.skmt.ExecQuery("select SUM(HVD_CANT) AS PC_NOART, SUM(HVD_COSTO_TOT) AS PC_MONTO from HIST_VENTAS where HVD_CLIENTE in (Select CUENTA from cuentaa)") - C.Position=0 - L_CANT.Text = c.GetString("PC_NOART") - L_TOTAL.Text = c.GetString("PC_MONTO") - End If - 'la_no_ird.Text = c.GetString("PR_CF_SALDO_ACORT") - - -End Sub - -Sub GPS_LocationChanged (Location1 As Location) - 'lat_gps=Location1.ConvertToSeconds(Location1.Latitude) - 'lon_gps=Location1.ConvertToSeconds(Location1.Longitude) -End Sub - -Sub Regresar_Click - B_RMI.Visible = False -' StartActivity(fila) - B4XPages.ShowPage("Cliente") -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' I want to capture the key here so I return True -' StartActivity(seleccion) - 'Return True - End If - ' Returning False signals the system to handle the key - Return False -End Sub - -Sub ListView2_ItemClick (Position As Int, Value As Object) - ListView2.Visible = False - ListView1.Visible = True -End Sub - -Sub ListView1_ItemClick (Position As Int, Value As Object) - ListView2.Visible = True - ListView1.Visible = False - Dim label1 As Label - ListView2.Clear - For i=0 To 20 - label1 = ListView2.SingleLineLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - ListView2.AddSingleLine(i) - Next -End Sub - -Sub B_RMI_Click - c=Starter.skmt.ExecQuery("select HR_CLIENTE,HR_PRONOMBRE,HR_CANT from HIST_RMI WHERE HR_CLIENTE IN (Select CUENTA from cuentaa)") - ListView1.Clear - If c.RowCount > 0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("HR_PRONOMBRE"),"Cantidad #"& c.GetString("HR_CANT") ) - Next - End If -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_Mapas.bas b/B4A - Copy/C_Mapas.bas deleted file mode 100644 index 0172bfa..0000000 --- a/B4A - Copy/C_Mapas.bas +++ /dev/null @@ -1,6 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=11.5 -@EndOfDesignText@ diff --git a/B4A - Copy/C_NoVenta.bas b/B4A - Copy/C_NoVenta.bas deleted file mode 100644 index 6945449..0000000 --- a/B4A - Copy/C_NoVenta.bas +++ /dev/null @@ -1,95 +0,0 @@ -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 \ No newline at end of file diff --git a/B4A - Copy/C_Nota.bas b/B4A - Copy/C_Nota.bas deleted file mode 100644 index 4acaa62..0000000 --- a/B4A - Copy/C_Nota.bas +++ /dev/null @@ -1,319 +0,0 @@ -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 skmt As SQL - Dim g As GPS - Dim clie_id As String - Dim sDate,sTime As String - Dim usuario As String - 'These global variables will be redeclared each time the activity is created. - 'These variables can only be accessed from this module. - Dim c As Cursor - Dim d As Cursor - Dim ruta As String - Dim Regresar As Button - - Dim ListView1 As ListView - Dim L_CANT As Label - Dim L_TOTAL As Label - Dim borra As Button - Dim Existe As String - Dim result As String - ' Dim lat_gps, lon_gps As String - Dim DESC As String - - Private Titulo As Label - Private b_desc As Button - Dim DESCUENTO As String - Dim folio As String - Dim TIPO As String -End Sub - -Sub initialize - -End Sub - -Private Sub B4XPage_Created (Root1 As B4XView) - 'Do not forget to load the layout file created with the visual designer. For example: - 'Activity.LoadLayout("Layout1") - Root = Root1 - g.Initialize("GPS") - ruta = File.DirInternal - Root.LoadLayout("historico") - borra.Visible = True - Titulo.Text = "Pedido Actual" - Starter.skmt.ExecNonQuery("update pedido set pe_folio = 0 where pe_folio is null") - c=Starter.skmt.ExecQuery("select count(*) as EXISTE from pedido_cliente WHERE pc_cliente IN (Select CUENTA from cuentaa)") - C.Position=0 - Existe = C.GetString("EXISTE") - C.Close - c=Starter.skmt.ExecQuery("select PE_PRONOMBRE,PE_COSTO_TOT, PE_CANT, PE_FOLIO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PRONOMBRE asc") - ListView1.Clear - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("PE_PRONOMBRE"),"Cantidad #"& c.GetString("PE_CANT")& " SubTotal $"& c.GetString("PE_COSTO_TOT")& " Folio "& c.GetString("PE_FOLIO")) - folio = c.GetString("PE_FOLIO") - Next - End If - If Existe <> 0 Then - c=Starter.skmt.ExecQuery("select pc_noart, pc_monto from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)") - C.Position=0 - L_CANT.Text = c.GetString("PC_NOART") - L_TOTAL.Text = c.GetString("PC_MONTO") - End If -End Sub - -Sub B4XPage_Appear - If g.GPSEnabled=False Then - ToastMessageShow("Habilitar el GPS", True) - StartActivity(g.LocationSettingsIntent) - Else - g.Start(0,0) - End If - - L_CANT.Text ="" - L_TOTAL.Text="" - Starter.skmt.ExecNonQuery("update pedido set pe_folio = 0 where pe_folio is null") - - c=Starter.skmt.ExecQuery("select count(*) as EXISTE from pedido_cliente WHERE pc_cliente IN (Select CUENTA from cuentaa)") - C.Position=0 - Existe = C.GetString("EXISTE") - C.Close - c=Starter.skmt.ExecQuery("select PE_PRONOMBRE,PE_COSTO_TOT, PE_CANT, PE_FOLIO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PRONOMBRE asc") - ListView1.Clear - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("PE_PRONOMBRE"),"Cantidad #"& c.GetString("PE_CANT")& " SubTotal $"& c.GetString("PE_COSTO_TOT")& " Folio "& c.GetString("PE_FOLIO")) - folio = c.GetString("PE_FOLIO") - Next - End If - If Existe <> 0 Then - c=Starter.skmt.ExecQuery("select pc_noart, pc_monto from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)") - C.Position=0 - L_CANT.Text = c.GetString("PC_NOART") - L_TOTAL.Text = c.GetString("PC_MONTO") - c.Close - c=Starter.skmt.ExecQuery("select SUM(IFNULL(PE_DESC,0)) AS DESCUENTO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - DESC = c.GetString("DESCUENTO") - 'If L_TOTAL.Text > 1000 And DESC = 0 Then - - 'b_desc.Visible = True - 'b_desc.Text = "- 5% DESC" - 'DESCUENTO = "MENOS" - 'Else if L_TOTAL.Text > 1000 Then - 'b_desc.Visible = True - 'b_desc.Text = "Cancela Desc" - 'DESCUENTO = "MAS" - 'Else - b_desc.Visible = False - - 'End If - End If - 'la_no_ird.Text = c.GetString("PR_CF_SALDO_ACORT") - - -End Sub - -Sub Activity_Pause (UserClosed As Boolean) - -End Sub - -Sub GPS_LocationChanged (Location1 As Location) - 'lat_gps=Location1.ConvertToSeconds(Location1.Latitude) - 'lon_gps=Location1.ConvertToSeconds(Location1.Longitude) -End Sub - -Sub Regresar_Click -' StartActivity(fila) - B4XPages.ShowPage("Cliente") -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' I want to capture the key here so I return True -' StartActivity(seleccion) - 'Return True - End If - ' Returning False signals the system to handle the key - Return False -End Sub - -Sub borra_Click - If folio <> "" Then - result = Msgbox2("Seguro que desa borrar el pedido?","Cancelar pedido", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) 'ignore - If result = DialogResponse.POSITIVE Then - - c=Starter.skmt.ExecQuery("select PE_PROID,PE_CANT, PE_TIPO 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 - - TIPO = c.GetString("PE_TIPO") - If c.GetString("PE_TIPO") = "VENTA" Then - Starter.skmt.ExecNonQuery2("update cat_gunaprod2 set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID"))) - Else - 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"))) - End If - 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.ExecNonQuery("UPDATE kmt_info set gestion = 0 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - B4XPage_Appear - End If - Else - Msgbox("CLIENTE YA SE TRANSMITIO, FAVOR DE LLAMAR A SOPORTE PARA ASISTENCIA","AVISO") 'ignore - End If -End Sub - -Sub ListView1_ItemLongClick (Position As Int, Value As Object) - result = Msgbox2("Seguro que desa borrar este articulo?","Borrar Articulo", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) 'ignore - If result = DialogResponse.POSITIVE Then - -' If TIPO = "VENTA" Then -' c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from cat_gunaprod2 where CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'", Array As String(Value)) -' Else -' c=Starter.skmt.ExecQuery2("select count(*) AS CUANTOS from cat_gunaprod where CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'", Array As String(Value)) -' End If - c=Starter.skmt.ExecQuery2("SELECT COUNT(*) as CUANTOS FROM PEDIDO WHERE pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) and length(pe_cedis) > 3 ", Array As String(Value)) - c.Position=0 - If c.GetString("CUANTOS") > 0 Then - - d=Starter.skmt.ExecQuery2("select PE_PROID,PE_CANT, PE_TIPO FROM PEDIDO where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) and length(pe_cedis) > 3", Array As String(Value)) - - If d.RowCount>0 Then - For i=0 To d.RowCount -1 - d.Position=i - TIPO = d.GetString("PE_TIPO") - If d.GetString("PE_TIPO") = "VENTA" Then - Starter.skmt.ExecNonQuery2("update cat_gunaprod2 set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(d.GetString("PE_CANT"),d.GetString("PE_PROID"))) - Else - Starter.skmt.ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(d.GetString("PE_CANT"),d.GetString("PE_PROID"))) - End If - Next - End If - d.Close - - - Starter.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa)", Array As Object(Value)) - Else - d=Starter.skmt.ExecQuery2("select PE_PROID,PE_CANT, PE_TIPO FROM PEDIDO where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) ", Array As String(Value)) - d.Position = 0 - - TIPO = d.GetString("PE_TIPO") - If d.GetString("PE_TIPO") = "VENTA" Then - Starter.skmt.ExecNonQuery2("update cat_gunaprod2 set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(d.GetString("PE_CANT"),d.GetString("PE_PROID"))) - Else - Starter.skmt.ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(d.GetString("PE_CANT"),d.GetString("PE_PROID"))) - End If - d.Close - - - Starter.skmt.ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)", Array As Object(Value)) - 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 - clie_id = c.GetString("CUENTA") - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - - c=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - If c.GetString("CUANTOS") > 0 Then - Starter.skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - Starter.skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) VALUES (?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Starter.lon_gps, Starter.lat_gps)) - Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - Else - Starter.skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 0 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - End If - B4XPage_Appear - End If -End Sub - -Sub b_desc_Click - If DESCUENTO = "MENOS" 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 - clie_id = c.GetString("CUENTA") - c.Close - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - c.Close - result = Msgbox2("Seguro que desa dar descuento del 5%?","Dar descuento", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) 'ignore - If result = DialogResponse.POSITIVE Then - Starter.skmt.ExecNonQuery("UPDATE pedido SET PE_COSTO_TOT = PE_COSTO_TOT * .95, PE_DESC = 5 WHERE PE_CLIENTE In (select cuenta from cuentaa)") - c=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - Starter.skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - Starter.skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) VALUES (?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Starter.lon_gps, Starter.lat_gps)) - c.Close - B4XPage_Appear - End If - ELSE IF DESCUENTO = "MAS" 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 - clie_id = c.GetString("CUENTA") - c.Close - c=Starter.skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - c.Close - result = Msgbox2("Seguro que desa CANCELAR el descuento?","Cancelar descuento", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) 'ignore - If result = DialogResponse.POSITIVE Then - Starter.skmt.ExecNonQuery("UPDATE pedido SET PE_COSTO_TOT = PE_COSTO_TOT / .95, PE_DESC = 0 WHERE PE_CLIENTE In (select cuenta from cuentaa)") - c=Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - Starter.skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - Starter.skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) VALUES (?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"),Starter.lon_gps, Starter.lat_gps)) - c.Close - B4XPage_Appear - End If - End If -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_Principal.bas b/B4A - Copy/C_Principal.bas deleted file mode 100644 index fecd550..0000000 --- a/B4A - Copy/C_Principal.bas +++ /dev/null @@ -1,2726 +0,0 @@ -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 - '//Process Globals - 'These global variables will be declared once when the application starts. - 'These variables can be accessed from all modules. - Dim reqManager As DBRequestManager - Dim conectado As String - Dim skmt As SQL - Dim t1 As Timer - Dim Timer_GIF1 As Timer - Dim Frame1 As Int - Dim Awake As PhoneWakeState - Dim sb As StringBuilder - Dim PHONE As Phone - Timer_GIF1.Initialize("Timer1",0) -' Dim g As GPS - Dim trabajar As Button - Dim T3 As Timer - Dim c As Cursor - Dim d As Cursor - Dim d3 As Cursor - Dim b As Cursor - Dim e As Cursor - Dim f As Cursor - Dim D2 As Cursor - Dim E1 As Cursor - Dim lv As ListView - Dim cargar As Button - Dim pendiente As Button - Dim foto1() As Byte - Dim usuario As String - Dim connecta As Button - Dim conn As String - Dim Subir As Button - Dim cmd As DBCommand - Dim TOPE As Int - Dim COUNT_CLIE As Int - Dim fecha As String - Dim drop As Double - Dim efectiva As Double - Dim HORAINGRESO As String - Dim L_MONTOD As Label - Dim l_cuantosc As Label - Dim l_drop As Label - Dim l_efectiva As Label - Dim l_ctast As Label - Dim BUSCA As Button - Dim Cuantos As String - Dim l_cuantosn As Label - Dim e_ruta As EditText - Dim l_porvisitar As Label - Dim b_mapa As Button - Dim l_ruta As Label - Dim ALMACEN As String - Private img2 As ImageView - Dim Listo1 As String - Dim Listo2 As String - Dim Listo3 As String - Dim Listo4 As String - Dim Listo5 As String - Dim EJECUTANDO As String - Dim RES As String - Dim inve As String - Dim cuantos_pedidosc As String - Dim cuantos_pedido As String - Dim cuantos_noventa As String - Dim datos_iguales As String - Dim p As PhoneId - Dim imei As String - Dim SERVER As String -' Dim lat_gps, lon_gps As String - - Private inv As Button - Private P1 As Panel - Private CLAVE As EditText - Private B_OK_PAS As Button - Dim PASO As String - Private USUARIO1 As EditText - Dim connecta1 As Double - Dim armafolio As String - Private NUEVO As Button - Private S_CC As Label - Private S_CP As Label - Private S_CH As Label - Private PB2 As ProgressBar - Private PB1 As ProgressBar - Private L_P_1 As Label - Private L_P_2 As Label - Private L_P_3 As Label - Private CARGA As String - Private PORCENTAJE As String - Private P_RESUMEN As Panel - Private B_OK_RES As Button - Private Resumen As Button - Private L_CUANTOST As Label - Private img3 As ImageView - - Private ImageView3 As ImageView - Private ImageView5 As ImageView - Private L_TICKPROM As Label - Private MARCASQ As String - Private B_PROXIMA As Button - Private l_monto_a As Label - Private ImageView9 As ImageView - Private L_MONTO_R As Label - Dim PERFIL As String - Dim NUMERO_PEDIDO As String - Private l_cambios As Label - Private l_monto_ks As Label - Private l_monto_kp As Label - Private l_monto_k As Label - Private Cuantos As String - Private TIEMPO As String - Private i_gif As ImageView - Dim gif1 As GifDecoder - Dim ruta As String - - Private L_VENTA As Label - Private L_PREVENTA As Label - Private L_ABORDO As Label - - Dim cuantos_ped As String - Dim conteo As String - Private PASO_info As String - - Private bpv1 As BatteryProgressView - Dim batterystatus(11) As Int - Private bu As BatteryUtilities - - - Private ImageView12 As ImageView - - Private TitleHeight As Int = 50dip - Private Title2Height As Int = 100dip - - Private DividerHeight As Int = 5dip - Private CLV1 As CustomListView - Private pnlTitle As B4XView - Private xui As XUI - Type TitleData (Title As String) - - Private B_MARCAS As Button - Private Panel5 As Panel - Private lblTitle As Label - Private B_OK_PANEL5 As Button - Private Btn_UbicarR As Button - Private SUBIR_P As Button - Private b_e_resumen As Button - Private cuantos_exib As String - Dim ime As IME - Private l_monto_kc As Label - Private l_version As Label -End Sub - -Sub initialize - -End Sub - - -Private Sub B4XPage_Created (Root1 As B4XView) - EJECUTANDO=1 - SERVER = Starter.DBReqServer - reqManager.Initialize(Me, SERVER) - Log(SERVER) - Root = Root1 - Root.LoadLayout("principal") - img2.Visible =False - - ' valido donde escribo el archivo de la base de datos de kmt - ruta = File.DirInternal - Log(SERVER) - ' se crea o no el archivo de la base de ddatos de kmt - 'NOTAS SI SE MODIFICA LA ESTRUCTURA SE QUITA EL IF Y SE VA DIRECTO A LA SENTENCIA FILE.COPY PARA QUE - 'TOME LA NUEVA ESTRUCTURA ES MUY IMPORTANTE TENER EL IF DE LO CONTRARIO SOLO LO ESCRIBE UNA VEZ Y LO BORRA - 'SI SE REGRESA A ESTE ACTIVIDAD. - If File.Exists(ruta, "kmt.db") = False Then - File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db") - End If - DateTime.DateFormat = "MM/dd/yyyy" - fecha=DateTime.Date(DateTime.Now) - skmt.Initialize(ruta,"kmt.db", True) - - b=skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente") - b.Position=0 - Cuantos = b.GetString("CUANTOS") - d=skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0") - D.Position=0 - b.Close - e=skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info") - e.Position=0 - f=skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info") - f.Position=0 - l_ruta.Text = f.GetString("CAT_CL_RUTA") - f.Close - If l_ruta.Text = 0 Then - l_ruta.Text =0 - Else - f=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info") - f.Position=0 - l_ruta.Text = f.GetString("CAT_CL_RUTA") - f.Close - End If - If Cuantos = 0 Then - L_MONTOD.Text =0 - l_cuantosc.Text = 0 - l_cuantosn.Text = 0 - drop = 0 - l_drop.Text = 0 - efectiva = 0 - l_efectiva.text =0 - l_ctast.Text = d.GetString("TOTAL_VISITAR") - l_porvisitar.Text = e.GetString("POR_VISITAR") - Else - c=skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente ") - b=skmt.ExecQuery("select count(*) as CUANTOS from noventa") - 'where pc_fecha = ?", Array As String(fecha) - C.Position=0 - b.Position=0 - L_MONTOD.Text = c.GetString("MONTO_DIA") - l_cuantosc.Text = c.GetString("CLIENTES_DIA") - l_cuantosn.Text = b.GetString("CUANTOS") - drop = c.GetString("MONTO_DIA") / c.GetString("CLIENTES_DIA") - l_drop.Text = Round2(drop,2) - efectiva = c.GetString("CLIENTES_DIA") / e.GetString("POR_VISITAR") - l_efectiva.text = Round2(efectiva*100,2) - l_ctast.Text = d.GetString("TOTAL_VISITAR") - l_porvisitar.Text = e.GetString("POR_VISITAR") - End If - - c = skmt.ExecQuery2("select count(CAT_VA_DESCRIPCION) as HoraIngreso from cat_variables where CAT_VA_DESCRIPCION = ? ", Array As String("HoraIngreso")) - c.Position = 0 - DateTime.TimeFormat = "HHmmss" - - 'Valida si ya se cuenta con hora actualiza el valor si no lo inserta----------- - If c.GetString("HoraIngreso") > 0 Then - skmt.ExecNonQuery2("Update cat_variables set CAT_VA_VALOR = ? WHERE CAT_VA_DESCRIPCION = ?" , Array As String(DateTime.Time(DateTime.Now),"HoraIngreso")) - Else - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_VALOR,CAT_VA_DESCRIPCION) VALUES (?,?)" , Array As String(DateTime.Time(DateTime.Now),"HoraIngreso")) - End If - DateTime.TimeFormat = "HH:mm:ss" - P1.Top = 0 : P1.left = 0 - P_RESUMEN.Top = 0 : P_RESUMEN.left = 0 - P_RESUMEN.Width = Root.Width -End Sub - -Sub IsConnectedToInternet As Boolean - Dim r As Reflector - r.Target = r.GetContext - r.Target = r.RunMethod2("getSystemService", "connectivity", "java.lang.String") - r.Target = r.RunMethod("getActiveNetworkInfo") - If r.Target <> Null Then - Return r.RunMethod("isConnectedOrConnecting") - End If - Return False -End Sub - -Sub B4XPage_Appear - SERVER = Starter.DBReqServer - HORAINGRESO ="000000" - NUEVO.Visible = True - c=skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER")) - c.Position =0 - If c.GetString("CUANTOS") = 0 Then - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",SERVER)) - Else - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER")) - c.Position =0 - SERVER = c.GetString("CAT_VA_VALOR") - End If - - reqManager.Initialize(Me, SERVER) - Log(SERVER) - - If PASO = 2 Then - Dim result As Int - result = Msgbox2("El proceso de enviar información no a terminado, Continuar", "", "Si", "", "No", LoadBitmap(File.DirAssets, "alert2.png")) - If result = DialogResponse.POSITIVE Then - VALIDA_INFO - Else - PASO = 0 - End If - Else - PASO =0 - End If - - f=skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info") - f.Position=0 - l_ruta.Text = f.GetString("CAT_CL_RUTA") - f.Close - If l_ruta.Text = 0 Then - l_ruta.Text =0 - Else - f=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info") - f.Position=0 - l_ruta.Text = f.GetString("CAT_CL_RUTA") - f.Close - End If - - c=skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA")) - c.Position =0 - If c.GetString("CUANTOS") = 0 Then - cmd.Initialize - cmd.Name = "select_fechat" - reqManager.ExecuteQuery(cmd , 0, "fecha") - - Msgbox("AJUSTAR FECHA","AVISO") - B4XPage_Appear - Else - - - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA")) - c.Position =0 - Dim sDate,sTime As String - DateTime.DateFormat = "yyyyMMddHHmm" - sDate=DateTime.Date(DateTime.Now) -' Msgbox("AaaaA " & " "& c.GetString("CAT_VA_VALOR") & " " & sDate & sTime ,"AVISO") - - If c.GetString("CAT_VA_VALOR") > sDate & sTime Then - Msgbox("AJUSTAR LA FECHA YA QUE ES MENOR AL SISTEMA" ,"AVISO") - DateTime.TimeFormat = "HH:mm:ss" - B4XPage_Appear - End If - DateTime.TimeFormat = "MM/dd/yyyyHH:mm:ss" - - End If - - - L_CUANTOST.Text = l_cuantosc.Text + l_cuantosn.Text - If EJECUTANDO =0 Then - Listo1 = 0 - Listo2 = 0 - Listo3 = 0 - Listo4 = 0 - Listo5 = 0 - inve = 0 - img2.Visible =False - End If -' DateTime.DateFormat = "MM/dd/yyyy" - fecha=DateTime.Date(DateTime.Now) - c=skmt.ExecQuery("select usuario from usuarioa") - c.Position = 0 - usuario = c.GetString("USUARIO") - c.Close - - c=skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN") - C.Position =0 - ALMACEN = C.GetString("ID_ALMACEN") - C.Close - 'ALMACEN = 1 - - b=skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente where pc_cliente <> 0") - b.Position=0 - Cuantos = b.GetString("CUANTOS") - - If Cuantos = 0 Then - L_MONTOD.Text =0 - l_cuantosc.Text = 0 - l_cuantosn.Text = 0 - drop = 0 - l_drop.Text = 0 - efectiva = 0 - l_efectiva.text =0 - l_ctast.Text = d.GetString("TOTAL_VISITAR") - l_porvisitar.Text = e.GetString("POR_VISITAR") - - Else - c=skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente where pc_cliente <> 0") - b=skmt.ExecQuery("select count(*) as CUANTOS from noventa") - 'where pc_fecha = ?", Array As String(fecha) - C.Position=0 - b.Position=0 - L_MONTOD.Text = c.GetString("MONTO_DIA") - l_cuantosc.Text = c.GetString("CLIENTES_DIA") - l_cuantosn.Text = b.GetString("CUANTOS") - - L_CUANTOST.Text = l_cuantosc.Text + l_cuantosn.Text - - End If - - -' Main.montoActual = L_MONTOD.Text -' Main.clientestotal = L_CUANTOST.Text -' Main.clientesventa = l_cuantosc.Text -' Main.clientesvisitados = l_porvisitar.TEXT -' Main.ALMACEN = ALMACEN -' Main.rutapreventa = l_ruta.text - - DateTime.TimeFormat = "HH:mm:ss" - - c=skmt.ExecQuery("select NOVERSION FROM VERSION") - c.Position = 0 - - If c.GetString("NOVERSION") <> "2.6" Then - Msgbox("VERSION INCORRECTA SOLICITAR O DESCARGAR LA NUEVA","ALERTA") - B4XPage_Appear - End If - CallSub(Starter,"ENVIA_ULTIMA_GPS") -End Sub - -'Sub Activity_Pause (UserClosed As Boolean) -' cargar.Visible = False -' Subir.Visible = False -' SUBIR_P.Visible = False -' -' connecta.Visible = True -' inv.Visible = False -' If PASO = 1 Then -' PASO = 2 -' End If -'End Sub - -Sub trabajar_Click - 'CallSubDelayed(gestion,"gestion") - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MARCAS")) - c.Position =0 - MARCASQ = c.GetString("CAT_VA_VALOR") - c.Close - skmt.ExecNonQuery("delete from CAT_GUNAPROD WHERE CAT_GP_CLASIF NOT IN (" & MARCASQ &")" ) - skmt.ExecNonQuery("delete from CAT_GUNAPROD WHERE CAT_GP_ID IN (SELECT CAT_DP_ID FROM CAT_DETALLES_PAQ WHERE CAT_DP_IDPROD NOT IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD))") - -' StartActivity(colonia) - B4XPages.ShowPage("Clientes") - -End Sub - - - -Sub Subir_Click - Awake.KeepAlive(True) - CARGA = "SUBIR" - P1.Visible = True - trabajar.Visible = False - B_PROXIMA.Visible =False - Btn_UbicarR.Visible=False - - NUEVO.Visible =False - BUSCA.Visible=False - connecta.Visible=False - Subir.Visible=False - SUBIR_P.Visible = False - - cargar.Visible=False - L_P_1.Visible = False - S_CC.Visible = False - L_P_3.Visible = False - S_CH.Visible = False - PB1.Visible = False - Resumen.Visible= False - PORCENTAJE = 0 - - L_P_2.Text = "Envio de Pedidos" - L_P_3.Text = "Envio de Pedidos" - S_CH.Text = "EN PROCESO" - S_CP.Text = "EN PROCESO" - PB1.Progress = 0 - PB2.Progress = 0 - PB2.Visible = True - conteo = 0 - 'i_gif.Visible = True -' load_gif - - PASO = 1 - 'End If - If PASO =1 Then - E1=skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("ABORDO")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - - c=skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("ABORDO")) - c.Position = 0 - L_ABORDO.Text = c.GetString("MONTO_DIA") - c.Close - Else - L_ABORDO.Text = 0 - End If - E1.Close - - - - c=skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - PERFIL = c.GetString("CUANTOS") - c.Close - - If PERFIL > 0 Then - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - PERFIL = c.GetString("CAT_VA_VALOR") - c.Close - End If - - c=skmt.ExecQuery2("select count(*) AS CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("NUMERO_PEDIDO")) - c.Position =0 - Cuantos = c.GetString("CUANTOS") - c.Close - If Cuantos > 0 Then - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("NUMERO_PEDIDO")) - c.Position =0 - NUMERO_PEDIDO = c.GetString("CAT_VA_VALOR") - c.Close - Else - NUMERO_PEDIDO = 0 - End If - skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE not In (select PE_CLIENTE from pedido)") - - c=skmt.ExecQuery("select usuario from usuarioa") - c.Position = 0 - usuario = c.GetString("USUARIO") - c.Close - d3=skmt.ExecQuery("SELECT SUM(PE_COSTO_TOT) as MONTO FROM PEDIDO") - d3.Position = 0 - Dim cmd As DBCommand - cmd.Initialize - cmd.Name ="UPDATE_INFO_E_DURK" - cmd.Parameters = Array As Object(d3.GetDouble("MONTO")- L_ABORDO.text, L_ABORDO.Text, d3.GetDouble("MONTO"),l_ruta.TEXT, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - Dim cmd As DBCommand - cmd.Initialize - cmd.Name ="insert_drop2_DUR" - cmd.Parameters = Array As Object(usuario,l_ruta.Text,fecha, l_porvisitar.Text,l_drop.Text,l_efectiva.Text,l_cuantosc.Text,l_cuantosn.Text, L_MONTOD.Text,"ENVIO", ALMACEN, L_VENTA.Text, L_PREVENTA.Text, L_ABORDO.Text, l_cambios.TEXT) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - d3.Close - ' PEDIO_CLIENTE - c=skmt.ExecQuery("SELECT PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT, PC_COSTO_SIN, PC_RUTA, PC_ALMACEN FROM PEDIDO_CLIENTE ") - d=skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDOSC FROM PEDIDO_CLIENTE ") - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_pedidos_DUR" - cmd.Parameters = Array As Object(C.GetString("PC_CLIENTE"),C.GetString("PC_FECHA"),C.GetString("PC_USER"),C.GetString("PC_NOART"),C.GetString("PC_MONTO"),C.GetString("PC_LON"),C.GetString("PC_LAT"),ALMACEN,l_ruta.text,C.GetString("PC_COSTO_SIN") ) - reqManager.ExecuteQuery(cmd , 0,"ins_pedidos") - - Next - c.Close - End If - d.Position=0 - cuantos_pedidosc = D.GetString("CUANTOS_PEDIDOSC") - d.Close - - c=skmt.ExecQuery("SELECT CAT_CL_NUM_SERIEFISICO,CAT_CL_CODIGO ,CAT_CL_LONG,CAT_CL_LAT FROM kmt_info") - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_QR_DUR" - cmd.Parameters = Array As Object(C.GetString("CAT_CL_NUM_SERIEFISICO"),C.GetString("CAT_CL_CODIGO"),C.GetString("CAT_CL_LONG"),C.GetString("CAT_CL_LAT"),ALMACEN,l_ruta.text ) - reqManager.ExecuteQuery(cmd , 0,"ins_QR") - - Next - c.Close - End If - - c=skmt.ExecQuery("SELECT HE_CLIE, HE_RES, HE_FECHA, HE_TIPO FROM HIST_ENCUESTA") - ' S_CP.Text = "Envio Encuesta" - ' PB2.Progress = 1 - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_encuesta_DUR" - cmd.Parameters = Array As Object(C.GetString("HE_CLIE"),C.GetString("HE_RES"),C.GetString("HE_FECHA"), c.GetString("HE_TIPO"),l_ruta.Text ) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - - - Next - - End If - c.Close - ' PEDIO - - skmt.ExecNonQuery("update PEDIDO set PE_FOLIO = rowid ") - - ' -' c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FOLIO")) -' c.Position =0 - ' armafolio = l_ruta.text * 1000000 -' armafolio = armafolio + c.GetString("CAT_VA_VALOR") -' c.Close -' c=skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC,PE_TIPO FROM PEDIDO WHERE PE_FOLIO IS NULL") -' -' -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' skmt.ExecNonQuery2("update PEDIDO set PE_FOLIO = ? where PE_PROID = ? AND PE_CLIENTE =? AND PE_FECHA =? AND PE_FOLIO IS NULL ", Array As Object(armafolio, c.GetString("PE_PROID"), c.GetString("PE_CLIENTE"),c.GetString("PE_FECHA"))) - ' -' armafolio = armafolio + 1 -' -' Next -' c.Close -' End If - ' armafolio = armafolio - (l_ruta.Text * 1000000) - ' skmt.ExecNonQuery2("update CAT_VARIABLES set CAT_VA_VALOR = ? where CAT_VA_DESCRIPCION = ? ", Array As Object(armafolio,"FOLIO")) -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "update_folio" -' cmd.Parameters = Array As Object(armafolio,l_ruta.Text , "1") -' reqManager.ExecuteQuery(cmd , 0, "folio") - - - If PERFIL = "V-ESPECIAL" Then - - - c=skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC, PE_FOLIO,PE_TIPO FROM PEDIDO ORDER BY PE_CLIENTE") - d=skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDO FROM PEDIDO") - d.Position=0 - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_pedido_esp_DUR" - cmd.Parameters = Array As Object(C.GetString("PE_CEDIS"),ALMACEN,C.GetString("PE_COSTO_TOT"),C.GetString("PE_COSTOU"),C.GetString("PE_CANT"),C.GetString("PE_PRONOMBRE"),C.GetString("PE_PROID"),C.GetString("PE_CLIENTE"),C.GetString("PE_FECHA"),C.GetString("PE_USUARIO"),C.GetString("PE_RUTA"), C.GetString("PE_COSTO_SIN"),C.GetString("PE_DESC"),c.GetString("PE_FOLIO"), c.GetString("PE_TIPO"),NUMERO_PEDIDO ) - reqManager.ExecuteQuery(cmd , 0, "ins_pedido") - Next - c.Close - End If - Else - c=skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC, PE_FOLIO,PE_TIPO FROM PEDIDO") - d=skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDO FROM PEDIDO") - d.Position=0 - TIEMPO = 0 - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - TIEMPO = TIEMPO + 1 - - If TIEMPO > 20 Then - If L_P_2.Text = "Envio de Pedidos" Then - L_P_2.Text = "Envio de Pedidos --" - else if L_P_2.Text = "Envio de Pedidos --" Then - L_P_2.Text = "Envio de Pedidos \" - else if L_P_2.Text = "Envio de Pedidos \" Then - L_P_2.Text = "Envio de Pedidos |" - else if L_P_2.Text = "Envio de Pedidos |" Then - L_P_2.Text = "Envio de Pedidos /" - else if L_P_2.Text = "Envio de Pedidos /" Then - L_P_2.Text = "Envio de Pedidos --" - End If - T3.Initialize("T3", 2000) ' 1000 = 1 second - T3.Enabled = True - Wait For t3_tick - TIEMPO = 0 - - End If - conteo = conteo + 1 - cuantos_ped = D.GetString("CUANTOS_PEDIDO") - PORCENTAJE = 2 'Round(100/ (D.GetString("CUANTOS_PEDIDO") + 1)) - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_pedido_DUR" - cmd.Parameters = Array As Object(C.GetString("PE_CEDIS"),ALMACEN,C.GetString("PE_COSTO_TOT"),C.GetString("PE_COSTOU"),C.GetString("PE_CANT"),C.GetString("PE_PRONOMBRE"),C.GetString("PE_PROID"),C.GetString("PE_CLIENTE"),C.GetString("PE_FECHA"),C.GetString("PE_USUARIO"),C.GetString("PE_RUTA"), C.GetString("PE_COSTO_SIN"),C.GetString("PE_DESC"),c.GetString("PE_FOLIO"), c.GetString("PE_TIPO")) - reqManager.ExecuteQuery(cmd , 0, "ins_pedido") - - Next - c.Close - End If - - End If - - cuantos_pedido = D.GetString("CUANTOS_PEDIDO") - d.Close - - ' NOVENTA - c=skmt.ExecQuery("SELECT NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON FROM NOVENTA") - D=skmt.ExecQuery("SELECT COUNT(*) AS CUANTOS_NOVENTA FROM NOVENTA") - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_noventa_DUR" - cmd.Parameters = Array As Object(C.GetString("NV_CLIENTE"),C.GetString("NV_FECHA"),C.GetString("NV_USER"),C.GetString("NV_MOTIVO"),C.GetString("NV_COMM"),C.GetString("NV_LAT"),C.GetString("NV_LON"), ALMACEN, l_ruta.Text) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - - Next - c.Close - End If - d.Position=0 - cuantos_noventa = D.GetString("CUANTOS_NOVENTA") - d.Close - - ' NOVENTA HIST_EXIBIDORES(CAT_CL_CLIENTE,CAT_CL_EXHIBIDOR,CAT_CL_BEXHIBIDOR) - c=skmt.ExecQuery("SELECT CAT_CL_CLIENTE,CAT_CL_EXHIBIDOR,CAT_CL_BEXHIBIDOR from HIST_EXIBIDORES") - D=skmt.ExecQuery("SELECT COUNT(*) AS CUANTOS_NOVENTA FROM HIST_EXIBIDORES") - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_HIST_EXIBIDORES_DUR" - cmd.Parameters = Array As Object(C.GetString("CAT_CL_CLIENTE"),C.GetString("CAT_CL_EXHIBIDOR"),C.GetString("CAT_CL_BEXHIBIDOR"),l_ruta.TEXT) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - - Next - c.Close - End If - d.Position=0 - cuantos_exib = D.GetString("CUANTOS_NOVENTA") - d.Close - - ' VERIFICACION -' c=skmt.ExecQuery("SELECT HVE_CLIENTE, HVE_IDPROD, HVE_EXISTENCIA FROM HIST_VERIFICACION") - -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "insert_verificacion_DUR" -' cmd.Parameters = Array As Object(C.GetString("HVE_CLIENTE"),C.GetString("HVE_IDPROD"),C.GetString("HVE_EXISTENCIA")) -' reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - ' -' Next - ' c.Close - ' End If - ' - -' c=skmt.ExecQuery("select HGDATE, HGLAT, HGLON from HIST_GPS") -' -' -' '' HACER ESTO PARA EL FORANEO -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' 's=skmt.ExecQuery2("SELECT HIST_VI_IMAGEN FROM HIST_VISITAS WHERE HIST_VI_CREDITO =?", Array As String (c.GetString("HIST_VI_CREDITO"))) -' 's.Position =0 -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "insert_gps_actual_DUR" -' cmd.Parameters = Array As Object(c.GetString("hgdate"),c.GetString("hglat"),c.GetString("hglon"),usuario ) -' 'cmd.Parameters = Array As Object(C.GetString("HGDATE"),C.GetString("HGLAT"),C.GetString("HGLON") ) -' -' reqManager.ExecuteQuery(cmd , 0, "") -' -' - ' -' ' Dim cmd As DBCommand -' ' cmd.Initialize -' ' cmd.Name = "update_gps_actual_TKM" -' ' cmd.Parameters = Array As Object(C.GetString("HGLAT"),C.GetString("HGLON"),usuario ) -' ' reqManager.ExecuteQuery(cmd , 0, "inst_visitas") -' 'lv.AddTwoLines(c.GetString("HIST_VI_CREDITO"),c.GetString("HIST_VI_RESULTADO")) -' Next -' End If -' c.Close - ' DROP - - t1.Initialize("T1", 20000) ' 1000 = 1 second - t1.Enabled = True - - img2.Visible =True - ' ToastMessageShow("Se Actualizaran los datos, Este proceso podria tardar hasta un minuto, gracias "& l_ruta.text , True) - If S_CP.Text = "SUBIENDO" Then - S_CP.Text = "VALIDANDO" - End If - End If -End Sub - -Sub cargar_Click - Log(SERVER) - CARGA = "CARGAR" - img2.Visible =True - L_P_1.Visible = True - S_CC.Visible = True - - P1.Visible = True - trabajar.Visible = False - B_PROXIMA.Visible =False - Btn_UbicarR.Visible=False - - NUEVO.Visible =False - BUSCA.Visible=False - connecta.Visible=False - L_P_3.Visible = True - S_CH.Visible = True - PB1.Visible = True - Resumen.Visible= False - - L_P_1.Text = "Catalogo de Clientes" - L_P_2.Text = "Catalogos de Productos" - L_P_3.Text = "Catalogos Historicos" - S_CC.Text = "EN PROCESO" - S_CH.Text = "EN PROCESO" - S_CP.Text = "EN PROCESO" - PB1.Progress = 0 - PB2.Progress = 0 - EJECUTANDO = 1 - - 'c=skmt.ExecQuery("CREATE TABLE kmt_info (pr_cd_credito NUMERIC,pr_cd_nombre TEXT,pr_cd_calle TEXT,pr_cd_numero TEXT,pr_cd_num_int TEXT,pr_cd_entrecalle1 TEXT,pr_cd_entrecalle2 TEXT,pr_cd_colonia TEXT,pr_cd_poblacion TEXT,pr_cd_edo TEXT,pr_cd_cp TEXT,pr_cd_zona TEXT,pr_cf_credito NUMERIC,pr_cf_saldotot NUMERIC,pr_cf_saldooper NUMERIC,pr_cf_saldof1 NUMERIC, pr_cf_penalizacion NUMERIC)") - TOPE = 0 - ' NUEVOS CLIENTE - - skmt.ExecNonQuery2("delete from kmt_info where substr(CAT_CL_CODIGO,1,1) <> ?", Array As Object ("N")) - skmt.ExecNonQuery("delete from cod_result") - skmt.ExecNonQuery("delete from hist_gest") - skmt.ExecNonQuery("delete from cat_gunaprod") - skmt.ExecNonQuery("delete from cat_gunaprod2") - - skmt.ExecNonQuery("delete from CAT_DETALLES_PAQ") - skmt.ExecNonQuery("delete from telefonos") - skmt.ExecNonQuery("delete from HIST_VENTAS") - skmt.ExecNonQuery("delete from HIST_PROMOS") - skmt.ExecNonQuery("delete from HIST_CLIENTE_CANT_PROMOS") - skmt.ExecNonQuery("delete from PROMOS_COMP") - skmt.ExecNonQuery("delete from CAT_VERIFICACION") - skmt.ExecNonQuery("delete from LISTA_PRECIOS") - skmt.ExecNonQuery("delete from CAT_PRECIOS") - skmt.ExecNonQuery("delete from HIST_RMI") - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("NUMERO_PEDIDO")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("NUMERO_PEDIDO",0)) - skmt.ExecNonQuery("delete from HIST_EXIBIDORES") - skmt.ExecNonQuery("delete from CAT_EXHIBIDORES") - skmt.ExecNonQuery("delete from CAT_ENCUESTA_PREGUNTA") - - c=skmt.ExecQuery("select usuario from usuarioa") - c.Position = 0 - usuario = c.GetString("USUARIO") - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name ="insert_drop2_DUR" - 'cmd.Name = "UPDATE_DUR_ACTUALR2_GPS" - cmd.Parameters = Array As Object(usuario, e_ruta.Text,fecha, l_porvisitar.Text,l_drop.Text,l_efectiva.Text,l_cuantosc.Text,l_cuantosn.Text, L_MONTOD.Text,"CARGO", ALMACEN, L_VENTA.Text, L_PREVENTA.Text, L_ABORDO.Text, l_cambios.TEXT) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - 'sql.UPDATE_DUR_ACTUALR2_GPS=UPDATE DURAKELO.CAT_RUTAS_REPARTO SET CAT_RR_MONTO_ACT = (?),CAT_RR_MRECH_ACT =(?),CAT_RR_VISIT_ACT =(?), CAT_RR_DEV_ACT =(?), CAT_RR_LAT_ACT =(?), CAT_RR_LONG_ACT =(?), CAT_RR_BAT_ACT =(?), CAT_RR_TT = (?), CAT_RR_MONTO = (?), CAT_RR_FECHA_ACT = SYSDATE WHERE CAT_RR_IDALMACEN = (?) And CAT_RR_RUTA = (?) - - 'cmd.Initialize - 'cmd.Name = "Select_count_clie" - 'reqManager.ExecuteQuery(cmd,0,"count_cli") - - cmd.Initialize - cmd.Name = "select_codigo_exhibidor" - 'cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "catalogo_exhibidor") - - cmd.Initialize - cmd.Name = "select_cat_gunaprod_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "gunaprod") - - cmd.Initialize - cmd.Name = "select_cat_gunaprod2_DUR" - cmd.Parameters = Array As Object(ALMACEN, e_ruta.Text) - reqManager.ExecuteQuery(cmd , 0, "gunaprod2") - - cmd.Initialize - cmd.Name = "select_cat_paquetes_abordo_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "gunaprodpa") - - cmd.Initialize - cmd.Name = "select_cat_paquetes_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "gunaprodp") - - cmd.Initialize - cmd.Name = "select_cat_paquetess_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "gunaprodps") - - cmd.Initialize - cmd.Name = "select_cat_detallepa_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "detallepaq") - - cmd.Initialize - cmd.Name = "select_cat_clientes_guna_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "kmt_datos") - - cmd.Initialize - cmd.Name = "select_hist_datos_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN,e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_datos") - - cmd.Initialize - cmd.Name = "select_hist_promos_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_promos") - - cmd.Initialize - cmd.Name = "select_hist_cliente_promos_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_cliente_promos") - - cmd.Initialize - cmd.Name = "select_promo_comp_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_comp_promos") - - ''' validar para que sirve esto ya que no esta en la base de datos. - - cmd.Initialize - cmd.Name = "select_verificacion_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "cat_verificacion") - - cmd.Initialize - cmd.Name = "select_fecha" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "fecha") - - cmd.Initialize - cmd.Name = "select_folio_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "folio") - - ' esto es para sacar el perfil y marcas del usuario - cmd.Initialize - cmd.Name = "select_perfil_DUR" - cmd.Parameters = Array As Object(usuario) - reqManager.ExecuteQuery(cmd , 0, "perfil") - - cmd.Initialize - cmd.Name = "select_marcas_DUR" - cmd.Parameters = Array As Object(usuario) - reqManager.ExecuteQuery(cmd , 0, "marcas") - - cmd.Initialize - cmd.Name = "select_precios_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "precios") - - cmd.Initialize - cmd.Name = "select_hist_rmi1_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN,e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_rmi") - - cmd.Initialize - cmd.Name = "select_hist_rmi2_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN,e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_rmi") - - cmd.Initialize - cmd.Name = "select_hist_rmi3_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN,e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_rmi") - - cmd.Initialize - cmd.Name = "select_hist_rmi4_DUR" - cmd.Parameters = Array As Object(e_ruta.text, ALMACEN,e_ruta.text, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "hist_rmi") - - cmd.Initialize - cmd.Name = "select_CAMBIOS_DUR" - 'cmd.Parameters = Array As Object( ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "cat_cambios") - - cmd.Initialize - cmd.Name = "select_SUCURSAL_DUR" - cmd.Parameters = Array As Object( ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "sucursal") - - cmd.Initialize - cmd.Name = "select_cat_encuesta_p_DUR" - cmd.Parameters = Array As Object( ALMACEN,e_ruta.text ) - reqManager.ExecuteQuery(cmd , 0, "carga_encuesta") - - ' c=skmt.ExecQuery("select HIST_VI_CREDITO, HIST_VI_PRODUCTO,HIST_VI_VISITADOR, HIST_VI_RESULTADO, HIST_VI_CODIGO, HIST_VI_PARENTESCO, HIST_VI_COMENTARIO, HIST_VI_DTEVISITA, HIST_VI_LONGITUD, HIST_VI_LATITUD, hist_vi_imagen, hist_vi_dprom, hist_vi_mprom from HIST_VISITAS") - ' If c.RowCount>0 Then - ' For i=0 To c.RowCount -1 - ' c.Position=i - ' foto1 = c.GetBlob("HIST_VI_IMAGEN") - ' - ' Dim cmd As DBCommand - ' cmd.Initialize - ' cmd.Name = "insert_gestion_plan" - ' cmd.Parameters = Array As Object(C.GetString("HIST_VI_CREDITO"),C.GetString("HIST_VI_PRODUCTO"),C.GetString("HIST_VI_VISITADOR"),C.GetString("HIST_VI_DTEVISITA"),C.GetString("HIST_VI_RESULTADO"),C.GetString("HIST_VI_CODIGO"),C.GetString("HIST_VI_COMENTARIO"),C.GetString("HIST_VI_PARENTESCO"),C.GetString("HIST_VI_LONGITUD"), C.GetString("HIST_VI_LATITUD"), foto1, c.GetString("HIST_VI_DPROM"),C.GetString("HIST_VI_MPROM")) - ' reqManager.ExecuteQuery(cmd , 0, "inst_visitas") - - 'lv.AddTwoLines(c.GetString("HIST_VI_CREDITO"),c.GetString("HIST_VI_RESULTADO")) - ' Next - ' End If - 'skmt.ExecNonQuery("DELETE FROM HIST_VISITAS") - - cargar.Visible = False - Subir.Visible = False - SUBIR_P.Visible = False - -' connecta.Visible = True - inv.Visible = False - - 'Dim cmd As DBCommand - 'cmd.Initialize - 'cmd.Name = "select_telefonos_riva" - 'cmd.Parameters = Array As Object(usuario) - 'reqManager.ExecuteQuery(cmd , 0, "telefonos") - - ToastMessageShow("Se Actualizaran los datos, Este proceso podria tardar hasta un minuto, gracias" , True) -End Sub -Sub JobDone(Job As HttpJob) - If Job.Success = False Then - 'If Job.ErrorMessage <> "STREAM" Then - ' ToastMessageShow("Error: " & Job.ErrorMessage, True) - 'End If - If Job.ErrorMessage = "STREAM" Then - If CARGA = "SUBIR" Then - PB2.Progress = PB2.Progress + PORCENTAJE - - If S_CP.Text = "EN PROCESO" Then - S_CP.Text = "SUBIENDO" - End If - ' If PB2.Progress > 99 Then - ' S_CP.Text = "VALIDANDO" - ' End If - - If cuantos_ped = conteo Then - S_CP.Text = "VALIDANDO" - End If - End If - End If - Else - LogColor("JobDone: '" & reqManager.HandleJob(Job).tag & "' - Registros: " & reqManager.HandleJob(Job).Rows.Size, Colors.Green) 'Mod por CHV - 211027 - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "kmt_datos" Then 'query tag - skmt.BeginTransaction - Try - S_CC.TEXT = "CARGANDO" - For Each records() As Object In RESULT.Rows - Dim CAT_CL_CODIGO As String = records(RESULT.Columns.Get("CAT_CL_CODIGO")) - Dim CAT_CL_RUTA As String = records(RESULT.Columns.Get("CAT_CL_RUTA")) - Dim CAT_CL_NOMBRE As String = records(RESULT.Columns.Get("CAT_CL_NOMBRE")) - Dim CAT_CL_ATIENDE1 As String = records(RESULT.Columns.Get("CAT_CL_ATIENDE1")) - Dim CAT_CL_ATIENTE2 As String = records(RESULT.Columns.Get("CAT_CL_ATIENTE2")) - Dim CAT_CL_TELEFONO As String = records(RESULT.Columns.Get("CAT_CL_TELEFONO")) - Dim CAT_CL_EMAIL As String = records(RESULT.Columns.Get("CAT_CL_EMAIL")) - Dim CAT_CL_CALLE As String = records(RESULT.Columns.Get("CAT_CL_CALLE")) - Dim CAT_CL_NOEXT As String = records(RESULT.Columns.Get("CAT_CL_NOEXT")) - Dim CAT_CL_NOINT As String = records(RESULT.Columns.Get("CAT_CL_NOINT")) - Dim CAT_CL_CALLE1 As String = records(RESULT.Columns.Get("CAT_CL_CALLE1")) - Dim CAT_CL_CALLE2 As String = records(RESULT.Columns.Get("CAT_CL_CALLE2")) - Dim CAT_CL_COLONIA As String = records(RESULT.Columns.Get("CAT_CL_COLONIA")) - Dim CAT_CL_MUNI As String = records(RESULT.Columns.Get("CAT_CL_MUNI")) - Dim CAT_CL_EDO As String = records(RESULT.Columns.Get("CAT_CL_EDO")) - Dim CAT_CL_CP As String = records(RESULT.Columns.Get("CAT_CL_CP")) - Dim CAT_CL_LONG As String = records(RESULT.Columns.Get("CAT_CL_LONG")) - Dim CAT_CL_LAT As String = records(RESULT.Columns.Get("CAT_CL_LAT")) - Dim CAT_CL_MTOCOMPRA As String = records(RESULT.Columns.Get("CAT_CL_MTOCOMPRA")) - Dim CAT_CL_NUM_SERIEFISICO As String = records(RESULT.Columns.Get("CAT_CL_NUM_SERIEFISICO")) - Dim CAT_CL_BFACTURA As String = records(RESULT.Columns.Get("CAT_CL_BFACTURA")) - Dim CAT_CL_BCREDITO As String = records(RESULT.Columns.Get("CAT_CL_BBLOQUEOCRED")) - - skmt.ExecNonQuery2("INSERT INTO kmt_info(CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO,CAT_CL_BFACTURA,CAT_CL_BCREDITO, gestion) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0)", Array As Object (CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO,CAT_CL_BFACTURA,CAT_CL_BCREDITO)) - Next - skmt.TransactionSuccessful - Catch - Log(LastException) - ToastMessageShow(LastException, True) - End Try - skmt.EndTransaction - skmt.ExecNonQuery2("INSERT INTO kmt_info(CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_BFACTURA,CAT_CL_BCREDITO,CAT_CL_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO, gestion) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,0) ",Array As Object ("0",e_ruta.TEXT, "VENTA ABORDO","null","null","null","null","null","null","null","null","null","null","null","null","null","null","null","NULL","NULL")) - Listo1 = 1 - S_CC.Text = "LISTO" - ' ToastMessageShow("Catalogo Clientes Actualizados." , True) - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - End If - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "hist_promos" Then 'query tag - skmt.BeginTransaction - Try - For Each records() As Object In RESULT.Rows - Dim HP_CLIENTE As String = records(RESULT.Columns.Get("HP_CLIENTE")) - Dim HP_CODIGO_PROMOCION As String = records(RESULT.Columns.Get("HP_CODIGO_PROMOCION")) - - skmt.ExecNonQuery2("INSERT INTO HIST_PROMOS(HP_CLIENTE, HP_CODIGO_PROMOCION) VALUES (?,?)", Array As Object (HP_CLIENTE, HP_CODIGO_PROMOCION)) - Next - 'ToastMessageShow("Historico Promociones Actualizado." , True) - If PB1.Progress = 0 Then - PB1.Progress = 30 - S_CH.Text = "CARGANDO" - ELSE If PB1.Progress = 30 Then - PB1.Progress = 50 - ELSE IF PB1.Progress = 50 Then - PB1.Progress = 80 - ELSE If PB1.Progress = 80 Then - PB1.Progress = 100 - S_CH.Text = "LISTO" - End If - Catch - Log(LastException) - ToastMessageShow(LastException, True) - End Try - skmt.EndTransaction - End If - End If - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "catalogo_exhibidor" Then 'query tag - skmt.BeginTransaction - Try - For Each records() As Object In RESULT.Rows - Dim CAT_EX_ID As String = records(RESULT.Columns.Get("CAT_EX_ID")) - Dim CAT_EX_TIPO As String = records(RESULT.Columns.Get("CAT_EX_TIPO")) - Dim CAT_EX_VALOR As String = records(RESULT.Columns.Get("CAT_EX_VALOR")) - - skmt.ExecNonQuery2("INSERT INTO CAT_EXHIBIDORES(CAT_EX_ID, CAT_EX_TIPO, CAT_EX_VALOR) VALUES (?,?,?)", Array As Object (CAT_EX_ID, CAT_EX_TIPO, CAT_EX_VALOR)) - Next - ' ToastMessageShow(" Historico Clientes Promociones Actualizado." , True) - Catch - Log(LastException) - ToastMessageShow(LastException, True) - End Try - skmt.EndTransaction - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "hist_cliente_promos" Then 'query tag - For Each records() As Object In RESULT.Rows - Dim HCCP_CLIENTE As String = records(RESULT.Columns.Get("HCCP_CLIENTE")) - Dim HCCP_PROMO As String = records(RESULT.Columns.Get("HCCP_PROMO")) - Dim HCCP_CANT As String = records(RESULT.Columns.Get("HCCP_CANT")) - - skmt.ExecNonQuery2("INSERT INTO HIST_CLIENTE_CANT_PROMOS(HCCP_CLIENTE, HCCP_PROMO, HCCP_CANT) VALUES (?,?,?)", Array As Object (HCCP_CLIENTE, HCCP_PROMO,HCCP_CANT)) - Next - ' ToastMessageShow(" Historico Clientes Promociones Actualizado." , True) - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "hist_comp_promos" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CAT_PA_ID As String = records(RESULT.Columns.Get("CAT_PA_ID")) - Dim CAT_PA_MAXPROM As String = records(RESULT.Columns.Get("CAT_PA_MAXPROM")) - Dim CAT_PA_MAXPROMREC As String = records(RESULT.Columns.Get("CAT_PA_MAXPROMREC")) - Dim CAT_PA_MAXPROMCLIE As String = records(RESULT.Columns.Get("CAT_PA_MAXPROMCLIE")) - - skmt.ExecNonQuery2("INSERT INTO PROMOS_COMP(CAT_PA_ID, CAT_PA_MAXPROM, CAT_PA_MAXPROMREC, CAT_PA_MAXPROMCLIE) VALUES (?,?,?,?)", Array As Object (CAT_PA_ID, CAT_PA_MAXPROM,CAT_PA_MAXPROMREC,CAT_PA_MAXPROMCLIE)) - Next - - If PB1.Progress = 0 Then - PB1.Progress = 30 - S_CH.Text = "CARGANDO" - ELSE If PB1.Progress = 30 Then - PB1.Progress = 50 - ELSE IF PB1.Progress = 50 Then - PB1.Progress = 80 - ELSE If PB1.Progress = 80 Then - PB1.Progress = 100 - S_CH.Text = "LISTO" - End If - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "cat_verificacion" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CAT_VE_IDPROD As String = records(RESULT.Columns.Get("CAT_VE_IDPROD")) - Dim CAT_VE_NOMBRE As String = records(RESULT.Columns.Get("CAT_VE_NOMBRE")) - Dim CAT_VE_ORDEN As String = records(RESULT.Columns.Get("CAT_VE_ORDEN")) - - skmt.ExecNonQuery2("INSERT INTO CAT_VERIFICACION(CAT_VE_IDPROD, CAT_VE_NOMBRE,CAT_VE_ORDEN) VALUES (?,?,?)", Array As Object (CAT_VE_IDPROD, CAT_VE_NOMBRE,CAT_VE_ORDEN)) - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "gunaprod" Then 'query tag - S_CP.Text = "CARGANDO" - For Each records() As Object In RESULT.Rows - - Dim CAT_GP_ID As String = records(RESULT.Columns.Get("CAT_GP_ID")) - Dim CAT_GP_NOMBRE As String = records(RESULT.Columns.Get("CAT_GP_NOMBRE")) - Dim CAT_GP_IMP1 As String = records(RESULT.Columns.Get("CAT_GP_IMP1")) - Dim CAT_GP_IMP2 As String = records(RESULT.Columns.Get("CAT_GP_IMP2")) - Dim CAT_GP_PRECIO As String = records(RESULT.Columns.Get("CAT_GP_PRECIO")) - Dim CAT_GP_CLASIF As String = records(RESULT.Columns.Get("CAT_GP_CLASIF")) - Dim CAT_GP_STS As String = records(RESULT.Columns.Get("CAT_GP_STS")) - Dim CAT_GP_TIPO As String = records(RESULT.Columns.Get("CAT_GP_TIPO")) - Dim CAT_GP_SUBTIPO As String = records(RESULT.Columns.Get("CAT_GP_SUBTIPO")) - Dim CAT_GP_IMG() As Byte = records(RESULT.Columns.Get("CAT_GP_IMG")) - Dim CAT_GP_ALMACEN As Int = records(RESULT.Columns.Get("CAT_GP_ALMACEN")) - Dim CAT_GP_DEV As String = records(RESULT.Columns.Get("CAT_GP_DEV")) - Dim CAT_GP_TIPOPROD As Int = records(RESULT.Columns.Get("CAT_GP_TIPOPROD")) - Dim CAT_GP_INICIATIVA As Int = records(RESULT.Columns.Get("CAT_GP_INICIATIVA")) - 'CAT_GP_INICIATIVA = 5 - ' - ' skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_DEV) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_DEV)) - skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_GP_INICIATIVA,CAT_GP_DEV,CAT_GP_CODPROMO) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD, CAT_GP_INICIATIVA,CAT_GP_DEV)) - - Next - ' c=skmt.ExecQuery("select CAT_GP_CLASIF, COUNT(*) AS CUANTOS from CAT_GUNAPROD GROUP BY CAT_GP_CLASIF order by CAT_GP_CLASIF asc") - ' c.Position=0 - ' skmt.ExecNonQuery("DELETE FROM COUNT_GUNAPROD") - ' skmt.ExecNonQuery2("INSERT INTO COUNT_GUNAPROD(CAT_GP_CLASIF, CUANTOS) VALUES (?,?)", Array As Object (c.GetString("CAT_GP_CLASIF"), c.GetString("CUANTOS"))) - ' c.Close - - Listo2=1 - If PB2.Progress = 0 Then - PB2.Progress = 30 - S_CP.Text = "CARGANDO" - ELSE If PB2.Progress = 30 Then - PB2.Progress = 60 - ELSE IF PB2.Progress = 60 Then - PB2.Progress = 80 - ELSE IF PB2.Progress = 80 Then - PB2.Progress = 100 - S_CP.Text = "LISTO" - End If - - - ' ToastMessageShow("Productos Actualizados." , True) - - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - - End If - - End If - End If - - ' CARGA DEL CATALOGO ABORDO - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "gunaprod2" Then 'query tag - For Each records() As Object In RESULT.Rows - Dim CAT_GP_ID As String = records(RESULT.Columns.Get("CAT_GP_ID")) - Dim CAT_GP_NOMBRE As String = records(RESULT.Columns.Get("CAT_GP_NOMBRE")) - Dim CAT_GP_IMP1 As String = records(RESULT.Columns.Get("CAT_GP_IMP1")) - Dim CAT_GP_IMP2 As String = records(RESULT.Columns.Get("CAT_GP_IMP2")) - Dim CAT_GP_PRECIO As String = records(RESULT.Columns.Get("CAT_GP_PRECIO")) - Dim CAT_GP_CLASIF As String = records(RESULT.Columns.Get("CAT_GP_CLASIF")) - Dim CAT_GP_STS As String = records(RESULT.Columns.Get("CAT_GP_STS")) - Dim CAT_GP_TIPO As String = records(RESULT.Columns.Get("CAT_GP_TIPO")) - Dim CAT_GP_SUBTIPO As String = records(RESULT.Columns.Get("CAT_GP_SUBTIPO")) - Dim CAT_GP_IMG() As Byte = records(RESULT.Columns.Get("CAT_GP_IMG")) - Dim CAT_GP_ALMACEN As Int = records(RESULT.Columns.Get("CAT_GP_ALMACEN")) - Dim CAT_GP_DEV As String = records(RESULT.Columns.Get("CAT_GP_DEV")) - Dim CAT_GP_TIPOPROD As Int = records(RESULT.Columns.Get("CAT_GP_TIPOPROD")) - Dim CAT_GP_INICIATIVA As Int = records(RESULT.Columns.Get("CAT_GP_INICIATIVA")) - Dim CAT_GP_CODPROMO As String = records(RESULT.Columns.Get("CAT_GP_CODPROMO")) - 'CAT_GP_INICIATIVA = 5 - ' skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_DEV) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_DEV)) - skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD2(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_GP_INICIATIVA,CAT_GP_DEV,CAT_GP_CODPROMO) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD, CAT_GP_INICIATIVA,CAT_GP_DEV,CAT_GP_CODPROMO)) - Next - c=skmt.ExecQUERY2("SELECT COUNT(*) AS CUANTOS FROM PEDIDO WHERE PE_TIPO = ?", Array As String ("VENTA")) - c.Position = 0 - cuantos_pedidosc = c.GetString("CUANTOS") - c.Close - If cuantos_pedidosc > 0 Then - c=skmt.ExecQUERY2("SELECT PE_PROID, PE_CANT FROM PEDIDO WHERE PE_TIPO = ?", Array As String ("VENTA")) - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - skmt.ExecNonQuery2("update CAT_GUNAPROD2 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 - End If - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "gunaprodpa" Then 'query tag - For Each records() As Object In RESULT.Rows - Dim CAT_GP_ID As String = records(RESULT.Columns.Get("CAT_GP_ID")) - Dim CAT_GP_NOMBRE As String = records(RESULT.Columns.Get("CAT_GP_NOMBRE")) - Dim CAT_GP_IMP1 As String = records(RESULT.Columns.Get("CAT_GP_IMP1")) - Dim CAT_GP_IMP2 As String = records(RESULT.Columns.Get("CAT_GP_IMP2")) - Dim CAT_GP_PRECIO As String = records(RESULT.Columns.Get("CAT_GP_PRECIO")) - Dim CAT_GP_CLASIF As String = records(RESULT.Columns.Get("CAT_GP_CLASIF")) - Dim CAT_GP_STS As String = records(RESULT.Columns.Get("CAT_GP_STS")) - Dim CAT_GP_TIPO As String = records(RESULT.Columns.Get("CAT_GP_TIPO")) - Dim CAT_GP_SUBTIPO As String = records(RESULT.Columns.Get("CAT_GP_SUBTIPO")) - Dim CAT_GP_IMG() As Byte = records(RESULT.Columns.Get("CAT_GP_IMG")) - Dim CAT_GP_ALMACEN As Int = records(RESULT.Columns.Get("CAT_GP_ALMACEN")) - Dim CAT_GP_TIPOPROD As Int = records(RESULT.Columns.Get("CAT_GP_TIPOPROD")) -' Dim CAT_GP_DEV As String = records(RESULT.Columns.Get("CAT_GP_DEV")) - skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD2(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_GP_DEV,CAT_GP_CODPROMO) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,0)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD,"0")) - Next - If PB2.Progress = 0 Then - PB2.Progress = 30 - S_CP.Text = "CARGANDO" - ELSE If PB2.Progress = 30 Then - PB2.Progress = 60 - ELSE IF PB2.Progress = 60 Then - PB2.Progress = 80 - ELSE IF PB2.Progress = 80 Then - PB2.Progress = 100 - S_CP.Text = "LISTO" - End If - ' ToastMessageShow("Promociones Actualizados." , True) - Listo4=1 - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - End If - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "gunaprodp" Then 'query tag - For Each records() As Object In RESULT.Rows - Dim CAT_GP_ID As String = records(RESULT.Columns.Get("CAT_GP_ID")) - Dim CAT_GP_NOMBRE As String = records(RESULT.Columns.Get("CAT_GP_NOMBRE")) - Dim CAT_GP_IMP1 As String = records(RESULT.Columns.Get("CAT_GP_IMP1")) - Dim CAT_GP_IMP2 As String = records(RESULT.Columns.Get("CAT_GP_IMP2")) - Dim CAT_GP_PRECIO As String = records(RESULT.Columns.Get("CAT_GP_PRECIO")) - Dim CAT_GP_CLASIF As String = records(RESULT.Columns.Get("CAT_GP_CLASIF")) - Dim CAT_GP_STS As String = records(RESULT.Columns.Get("CAT_GP_STS")) - Dim CAT_GP_TIPO As String = records(RESULT.Columns.Get("CAT_GP_TIPO")) - Dim CAT_GP_SUBTIPO As String = records(RESULT.Columns.Get("CAT_GP_SUBTIPO")) - Dim CAT_GP_IMG() As Byte = records(RESULT.Columns.Get("CAT_GP_IMG")) - Dim CAT_GP_ALMACEN As Int = records(RESULT.Columns.Get("CAT_GP_ALMACEN")) - Dim CAT_GP_TIPOPROD As Int = records(RESULT.Columns.Get("CAT_GP_TIPOPROD")) -' Dim CAT_GP_DEV As String = records(RESULT.Columns.Get("CAT_GP_DEV")) - skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_GP_DEV,CAT_GP_CODPROMO) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,0)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD,"0")) - Next - If PB2.Progress = 0 Then - PB2.Progress = 30 - S_CP.Text = "CARGANDO" - ELSE If PB2.Progress = 30 Then - PB2.Progress = 60 - ELSE IF PB2.Progress = 60 Then - PB2.Progress = 80 - ELSE IF PB2.Progress = 80 Then - PB2.Progress = 100 - S_CP.Text = "LISTO" - End If - ' ToastMessageShow("Promociones Actualizados." , True) - Listo4=1 - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - End If - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "gunaprodps" Then 'query tag - For Each records() As Object In RESULT.Rows - Dim CAT_GP_ID As String = records(RESULT.Columns.Get("CAT_GP_ID")) - Dim CAT_GP_NOMBRE As String = records(RESULT.Columns.Get("CAT_GP_NOMBRE")) - Dim CAT_GP_IMP1 As String = records(RESULT.Columns.Get("CAT_GP_IMP1")) - Dim CAT_GP_IMP2 As String = records(RESULT.Columns.Get("CAT_GP_IMP2")) - Dim CAT_GP_PRECIO As String = records(RESULT.Columns.Get("CAT_GP_PRECIO")) - Dim CAT_GP_CLASIF As String = records(RESULT.Columns.Get("CAT_GP_CLASIF")) - Dim CAT_GP_STS As String = records(RESULT.Columns.Get("CAT_GP_STS")) - Dim CAT_GP_TIPO As String = records(RESULT.Columns.Get("CAT_GP_TIPO")) - Dim CAT_GP_SUBTIPO As String = records(RESULT.Columns.Get("CAT_GP_SUBTIPO")) - Dim CAT_GP_IMG() As Byte = records(RESULT.Columns.Get("CAT_GP_IMG")) - Dim CAT_GP_ALMACEN As Int = records(RESULT.Columns.Get("CAT_GP_ALMACEN")) - Dim CAT_GP_TIPOPROD As Int = records(RESULT.Columns.Get("CAT_GP_TIPOPROD")) - skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD)) - Next - If PB2.Progress = 0 Then - PB2.Progress = 30 - S_CP.Text = "CARGANDO" - ELSE If PB2.Progress = 30 Then - PB2.Progress = 60 - ELSE IF PB2.Progress = 60 Then - PB2.Progress = 80 - ELSE IF PB2.Progress = 80 Then - PB2.Progress = 100 - S_CP.Text = "LISTO" - End If - 'ToastMessageShow("Promociones especiales Actualizados." , True) - Listo4=1 - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - End If - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "fechat" Then 'query tag - For Each records() As Object In RESULT.Rows - Dim FECHA_HOY As String = records(RESULT.Columns.Get("FECHA")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FECHA")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("FECHA",FECHA_HOY)) - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "detallepaq" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CAT_DP_ALMACEN As String = records(RESULT.Columns.Get("CAT_DP_ALMACEN")) - Dim CAT_DP_ID As String = records(RESULT.Columns.Get("CAT_DP_ID")) - Dim CAT_DP_IDPROD As String = records(RESULT.Columns.Get("CAT_DP_IDPROD")) - Dim CAT_DP_TIPO As String = records(RESULT.Columns.Get("CAT_DP_TIPO")) - Dim CAT_DP_PZAS As String = records(RESULT.Columns.Get("CAT_DP_PZAS")) - Dim CAT_DP_USUARIO As String = records(RESULT.Columns.Get("CAT_DP_USUARIO")) - Dim CAT_DP_FECHA As String = records(RESULT.Columns.Get("CAT_DP_FECHA")) - Dim CAT_DP_REGALO As String = records(RESULT.Columns.Get("CAT_DP_REGALO")) - Dim CAT_DP_CLASIF As String = records(RESULT.Columns.Get("CAT_DP_CLASIF")) - Dim CAT_DP_PRECIO As String = records(RESULT.Columns.Get("CAT_DP_PRECIO")) - Dim CAT_DP_PRECIO_SIMPTOS As String = records(RESULT.Columns.Get("CAT_DP_PRECIO_SIMPTOS")) - - - - - skmt.ExecNonQuery2("INSERT INTO CAT_DETALLES_PAQ(CAT_DP_ALMACEN,CAT_DP_ID,CAT_DP_IDPROD,CAT_DP_TIPO,CAT_DP_PZAS,CAT_DP_USUARIO,CAT_DP_FECHA,CAT_DP_REGALO,CAT_DP_CLASIF,CAT_DP_PRECIO,CAT_DP_PRECIO_SIMPTOS) VALUES (?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_DP_ALMACEN,CAT_DP_ID,CAT_DP_IDPROD,CAT_DP_TIPO,CAT_DP_PZAS,CAT_DP_USUARIO,CAT_DP_FECHA,CAT_DP_REGALO,CAT_DP_CLASIF,CAT_DP_PRECIO,CAT_DP_PRECIO_SIMPTOS)) - - - Next - - If PB2.Progress = 0 Then - PB2.Progress = 30 - S_CP.Text = "CARGANDO" - ELSE If PB2.Progress = 30 Then - PB2.Progress = 60 - ELSE IF PB2.Progress = 60 Then - PB2.Progress = 80 - ELSE IF PB2.Progress = 80 Then - PB2.Progress = 100 - S_CP.Text = "LISTO" - End If - Listo3 =1 - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - End If - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "hist_datos" Then 'query tag - - For Each records() As Object In RESULT.Rows - - Dim HVD_CLIENTE As String = records(RESULT.Columns.Get("HVD_CLIENTE")) - Dim HVD_PRONOMBRE As String = records(RESULT.Columns.Get("HVD_PRONOMBRE")) - Dim HVD_CANT As String = records(RESULT.Columns.Get("HVD_CANT")) - Dim HVD_COSTO_TOT As String = records(RESULT.Columns.Get("HVD_COSTO_TOT")) - Dim HVD_FECHA As String = records(RESULT.Columns.Get("HVD_FECHA")) - skmt.ExecNonQuery2("INSERT INTO HIST_VENTAS(HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT, HVD_FECHA) VALUES (?,?,?,?,?)", Array As Object (HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT,HVD_FECHA)) - - - Next - Listo3 =1 - - If PB1.Progress = 0 Then - PB1.Progress = 30 - S_CH.Text = "CARGANDO" - ELSE If PB1.Progress = 30 Then - PB1.Progress = 50 - ELSE IF PB1.Progress = 50 Then - PB1.Progress = 80 - ELSE If PB1.Progress = 80 Then - - PB1.Progress = 100 - S_CH.Text = "LISTO" - End If - - ' ToastMessageShow("Venta historico Actualizado." , True) - - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - - End If - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "carga_encuesta" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CAT_EP_ID As String = records(RESULT.COLUMNS.GET("CAT_EP_ID")) - Dim CAT_EP_IDTIPOPREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_IDTIPOPREGUNTA")) - Dim CAT_CE_DESCRIPCION As String = records(RESULT.COLUMNS.GET("CAT_CE_DESCRIPCION")) - Dim CAT_EP_PREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_PREGUNTA")) - Dim CAT_EP_RES1_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES1_PRED")) - Dim CAT_EP_RES2_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES2_PRED")) - Dim CAT_EP_RES3_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES3_PRED")) - Dim CAT_EP_ORDEN_PREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_ORDEN_PREGUNTA")) - - - skmt.ExecNonQuery2("INSERT INTO CAT_ENCUESTA_PREGUNTA (CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA ) VALUES (?,?,?,?,?,?,?,?)", Array As Object (CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA)) - - - - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "hist_rmi" Then 'query tag - - For Each records() As Object In RESULT.Rows - - Dim HVD_CLIENTE As String = records(RESULT.Columns.Get("HVD_CLIENTE")) - Dim HVD_PRONOMBRE As String = records(RESULT.Columns.Get("HVD_PRONOMBRE")) - Dim HVD_CANT As String = records(RESULT.Columns.Get("HVD_CANT")) - Dim HVD_PROID As String = records(RESULT.Columns.Get("HVD_PROID")) - skmt.ExecNonQuery2("INSERT INTO HIST_RMI(HR_CLIENTE,HR_PRONOMBRE,HR_PROID, HR_CANT) VALUES (?,?,?,?)", Array As Object (HVD_CLIENTE,HVD_PRONOMBRE,HVD_PROID, HVD_CANT)) - - - Next - Listo3 =1 - - If PB1.Progress = 0 Then - PB1.Progress = 30 - S_CH.Text = "CARGANDO" - ELSE If PB1.Progress = 30 Then - PB1.Progress = 50 - ELSE IF PB1.Progress = 50 Then - PB1.Progress = 80 - ELSE If PB1.Progress = 80 Then - - PB1.Progress = 100 - S_CH.Text = "LISTO" - End If - - 'ToastMessageShow("Venta historico Actualizado." , True) - - If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then - B4XPage_Appear - img2.Visible=False - EJECUTANDO=0 - - End If - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "variables" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim Cat_Va_Descripcion As String = records(RESULT.Columns.Get("CAT_VA_DESCRIPCION")) - Dim Cat_Va_Valor As String = records(RESULT.Columns.Get("CAT_VA_VALOR")) - - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object (Cat_Va_Descripcion, Cat_Va_Valor)) - - - Next - End If - End If - - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "valida_pedido" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CUANTOSP As Int = records(RESULT.Columns.Get("CUANTOSP")) - - If cuantos_pedido < = CUANTOSP Then - ' ToastMessageShow("rojo val ok 1 cuantosp." , True) - datos_iguales = "ok" - S_CP.Text = "INFO OK" - i_gif.Visible = False - Else - ToastMessageShow("No se cargo bien la info P. Sync Nuevamente" & CUANTOSP & " " & cuantos_pedido, True) - S_CP.Text = "ENVIAR DATOS (K-2)" - End If - - - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "valida_pedidoc" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CUANTOSC As Int = records(RESULT.Columns.Get("CUANTOSC")) - - If cuantos_pedidosc = CUANTOSC Then - ' ToastMessageShow("rojo val ok 1 cuantosp." , True) - datos_iguales = "ok" - Else - ToastMessageShow("No se cargo bien la info C. Sync Nuevamente" & CUANTOSC & " " & cuantos_pedidosc, True) - - End If - - - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "valida_noventa" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CUANTOSN As Int = records(RESULT.Columns.Get("CUANTOSN")) - - If cuantos_noventa = CUANTOSN Then - ' ToastMessageShow("rojo val ok 1 cuantosp." , True) - datos_iguales = "ok" - Else - ToastMessageShow("No se cargo bien la info N. Sync Nuevamente" & CUANTOSN & " " & cuantos_noventa, True) - - End If - - - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "ins_pedido" Then 'query tag - For Each records() As Object In RESULT.Rows - PB2.Progress = PB2.Progress + 5 - '' S_CP.Text = "SUBIENDO" - Next - PB2.Progress = 100 - S_CP.Text = "LISTO" - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "version" Then 'query tag - For Each records() As Object In RESULT.Rows - skmt.ExecNonQuery("delete from VERSION") - Dim CAT_VE_VERSION As String = records(RESULT.Columns.Get("CAT_VE_VERSION")) - - skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object (CAT_VE_VERSION)) - - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "count_cli" Then 'query tag - For Each records() As Object In RESULT.Rows - COUNT_CLIE = records(RESULT.Columns.Get("COUNT_CLIE")) - Next - End If - End If - '' PEDIDO - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "pedido_env" Then 'query tag - skmt.ExecNonQuery("delete from telefonos") - - For Each records() As Object In RESULT.Rows - Dim FOLIO_PE As String = records(RESULT.Columns.Get("FOLIO")) - skmt.ExecNonQuery2("INSERT INTO telefonos (PR_CD_CREDITO) VALUES (?)", Array As Object (FOLIO_PE)) - Next - PASO_info = 1 - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "ruta" Then 'query tag - -' cargar.Visible = True -' Subir.Visible = True -' SUBIR_P.Visible = True -' inv.Visible = True -' connecta.Visible = False -' If conn = "1" Then -' ToastMessageShow("Existe Conexión con el Servidor." , True) -' End If - - For Each records() As Object In RESULT.Rows - Dim VALIDO As String = records(RESULT.Columns.Get("VALIDO")) - If VALIDO = "OK" Then - cargar.Visible = True - Subir.Visible = True - SUBIR_P.Visible = True - inv.Visible = True - connecta.Visible = False - If conn = "1" Then - ToastMessageShow("Existe Conexión con el Servidor." , True) - End If - Else - cargar.Visible = False - Subir.Visible = False - SUBIR_P.Visible = False - inv.Visible = False - connecta.Visible = False - End If - Next - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "usuario" Then 'query tag - - For Each records() As Object In RESULT.Rows - Dim name2 As String = records(RESULT.Columns.Get("VALIDO")) - - - Next - If name2 = "OK" Then - PASO = 1 - End If - P1.Visible = False - End If - End If - - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "fecha" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim FECHA_HOY As String = records(RESULT.Columns.Get("FECHA")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FECHA")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("FECHA",FECHA_HOY)) - - Next - - End If - End If - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "folio" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim FOLIO As String = records(RESULT.Columns.Get("FOLIO")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FOLIO")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("FOLIO",FOLIO)) - - Next - - End If - End If - 'perfil - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "perfil" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim PERFIL As String = records(RESULT.Columns.Get("PERFIL")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("PERFIL")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("PERFIL",PERFIL)) - - Next - - End If - End If - ' marcas - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "marcas" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim MARCAS As String = records(RESULT.Columns.Get("MARCAS")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("MARCAS")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MARCAS",MARCAS)) - - Next - - End If - End If - ' SUCURSAL - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "sucursal" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim SUCURSAL As String = records(RESULT.Columns.Get("SUCURSAL")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SUCURSAL")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SUCURSAL",SUCURSAL)) - - Next - - End If - End If - ' cambios - - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "cat_cambios" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CAMBIOS As String = records(RESULT.Columns.Get("CAT_VA_VALOR")) - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("CAMBIOS")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("CAMBIOS",CAMBIOS)) - - Next - - End If - End If - - ' precios - If Job.JobName = "DBRequest" Then - Dim RESULT As DBResult = reqManager.HandleJob(Job) - If RESULT.Tag = "precios" Then 'query tag - For Each records() As Object In RESULT.Rows - - Dim CAT_GP_ID As String = records(RESULT.Columns.Get("CAT_GP_ID")) - Dim CAT_GP_PRECIO As String = records(RESULT.Columns.Get("CAT_GP_PRECIO")) - Dim CAT_GP_PRECIO1 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO1")) - Dim CAT_GP_PRECIO2 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO2")) - Dim CAT_GP_PRECIO3 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO3")) - Dim CAT_GP_PRECIO4 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO4")) - Dim CAT_GP_PRECIO5 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO5")) - Dim CAT_GP_PRECIO6 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO6")) - Dim CAT_GP_PRECIO7 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO7")) - Dim CAT_GP_PRECIO8 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO8")) - Dim CAT_GP_PRECIO9 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO9")) - Dim CAT_GP_PRECIO10 As String = records(RESULT.Columns.Get("CAT_GP_PRECIO10")) - - - skmt.ExecNonQuery2("INSERT INTO CAT_PRECIOS(CAT_GP_ID,CAT_GP_PRECIO, CAT_GP_PRECIO1,CAT_GP_PRECIO2,CAT_GP_PRECIO3,CAT_GP_PRECIO4,CAT_GP_PRECIO5,CAT_GP_PRECIO6,CAT_GP_PRECIO7,CAT_GP_PRECIO8,CAT_GP_PRECIO9, CAT_GP_PRECIO10) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_PRECIO, CAT_GP_PRECIO1,CAT_GP_PRECIO2,CAT_GP_PRECIO3,CAT_GP_PRECIO4,CAT_GP_PRECIO5,CAT_GP_PRECIO6,CAT_GP_PRECIO7,CAT_GP_PRECIO8,CAT_GP_PRECIO9,CAT_GP_PRECIO10)) - - Next - skmt.ExecNonQuery("delete from LISTA_PRECIOS") - skmt.ExecNonQuery(" insert into LISTA_PRECIOS(PRECIO, CAT_GP_ID, NLISTA) select cat_gp_precio as precio, cat_gp_id, '1' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO1 As precio, CAT_GP_ID, '2' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO2 As precio, CAT_GP_ID, '3' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO3 As precio, CAT_GP_ID, '4' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO4 As precio, CAT_GP_ID, '5' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO5 As precio, CAT_GP_ID, '6' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO6 As precio, CAT_GP_ID, '7' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO7 As precio, CAT_GP_ID, '8' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO8 As precio, CAT_GP_ID, '9' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO9 As precio, CAT_GP_ID, '10' as NLISTA from CAT_PRECIOS union Select CAT_GP_PRECIO10 As precio, CAT_GP_ID, '11' as NLISTA from CAT_PRECIOS") - - ' ToastMessageShow("LISTA DE PRECIOS OK LISTA DE PRECIOS OK", True) - End If - End If - - Job.Release - - End If - -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' I want to capture the key here so I return True - StartActivity(Main) - 'Return True - End If - ' Returning False signals the system to handle the key - Return False -End Sub - -Sub GPS_LocationChanged (Location1 As Location) -' lat_gps=Location1.ConvertToSeconds(Location1.Latitude) -' lon_gps=Location1.ConvertToSeconds(Location1.Longitude) -End Sub - -Sub connecta_Click - ime.HideKeyboard - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "UPDATE_DURK_ACTUAL2_GPS" -' cmd.Parameters = Array As Object(L_MONTOD.Text, L_CUANTOST.Text, l_cuantosc.Text,l_porvisitar.TEXT,Main.lat_gps,Main.lon_gps,batterystatus(0),0, 0, 0,ALMACEN,l_ruta.Text ) -' reqManager.ExecuteCommand(cmd,"inst_visitas") - - connecta1 = connecta1 + 1 - imei = "" - conn = "1" - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "select_version_DUR" - reqManager.ExecuteQuery(cmd , 0, "version") - - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "select_ruta_DUR2" - cmd.Parameters = Array As Object(ALMACEN,e_ruta.text,imei) - Log($"${ALMACEN},${e_ruta.text},${imei}"$) - reqManager.ExecuteQuery(cmd , 0, "ruta") - - If e_ruta.Text = "ROOT" Then - cargar.Visible = True - Subir.Visible = True - SUBIR_P.Visible = True - e_ruta.Text = "" - End If - ToastMessageShow("Validando Conexión." , True) -End Sub - -Sub BUSCA_Click -' StartActivity(BUSCAR) -End Sub - -Sub b_mapa_Click -' StartActivity(mapas) -End Sub - -Sub e_ruta_EnterPressed - If e_ruta.Text = "FIN DIA" Then - RES = Msgbox2("Seguro que desa hacer el cierre todos los datos se borraran?","Cierre", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) - If RES = DialogResponse.POSITIVE Then - - e_ruta.Text = "" - skmt.ExecNonQuery("delete from pedido_cliente") - skmt.ExecNonQuery("delete from pedido") - skmt.ExecNonQuery("delete from noventa") - skmt.ExecNonQuery("delete from clie_act") - skmt.ExecNonQuery("delete from kmt_info") - skmt.ExecNonQuery("delete from cat_gunaprod") - skmt.ExecNonQuery("delete from cat_gunaprod2") - - skmt.ExecNonQuery("delete from CAT_DETALLES_PAQ") - skmt.ExecNonQuery("delete from HIST_VENTAS") - skmt.ExecNonQuery("delete from HIST_VERIFICACION") - skmt.ExecNonQuery("delete from HIST_ENCUESTA") - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("NUMERO_PEDIDO")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("NUMERO_PEDIDO",0)) - - - - B4XPage_Appear - End If - End If - If e_ruta.Text = "HUGO" Then - trabajar.Visible = False - B_PROXIMA.Visible =False - Btn_UbicarR.Visible=False - - NUEVO.Visible =False - BUSCA.Visible=False - connecta.Visible=False - img3.Visible =True - Resumen.Visible= False - - End If - -End Sub -Sub inv_Click - img2.Visible =True - EJECUTANDO = 1 - inve = 1 - skmt.ExecNonQuery("delete from cat_gunaprod") - skmt.ExecNonQuery("delete from CAT_DETALLES_PAQ") - - c=skmt.ExecQuery("select usuario from usuarioa") - c.Position = 0 - usuario = c.GetString("USUARIO") - - cmd.Initialize - cmd.Name = "select_cat_gunaprod_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "gunaprod") - - cmd.Initialize - cmd.Name = "select_cat_paquetes_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "gunaprodp") - - cmd.Initialize - cmd.Name = "select_cat_detallepa_DUR" - cmd.Parameters = Array As Object(ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "detallepaq") - - cargar.Visible = False - Subir.Visible = False - SUBIR_P.Visible = False - connecta.Visible = True - inv.Visible = False - ToastMessageShow("Se Actualizaran los datos, Este proceso podria tardar hasta un minuto, gracias" , True) - -End Sub -Sub t1_tick - - cmd.Initialize - cmd.Name = "select_cuantos_pedido_DUR" - cmd.Parameters = Array As Object(ALMACEN,l_ruta.text) - reqManager.ExecuteQuery(cmd , 0, "valida_pedido") - - T3.Initialize("T3", 5000) ' 1000 = 1 second - T3.Enabled = True - Wait For t3_tick - '' -' -' cmd.Initialize -' cmd.Name = "select_cuantos_noventa_DUR" -' cmd.Parameters = Array As Object(ALMACEN,l_ruta.text) -' reqManager.ExecuteQuery(cmd , 0, "valida_noventa") -' -' cmd.Initialize -' cmd.Name = "select_cuantos_pedidoc_DUR" -' cmd.Parameters = Array As Object(ALMACEN,l_ruta.text) -' reqManager.ExecuteQuery(cmd , 0, "valida_pedidoc") -' - If PB2.Progress = 0 Then - S_CP.Text = "ENVIAR DATOS (K-1)" - End If - img2.Visible=False - t1.Enabled = False -End Sub -Sub B_OK_PAS_Click - - If CARGA = "SUBIR" And S_CP.Text = "INFO OK" Then - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - PERFIL = c.GetString("CAT_VA_VALOR") - c.Close - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("NUMERO_PEDIDO")) - c.Position =0 - NUMERO_PEDIDO = c.GetString("CAT_VA_VALOR") - c.Close - - If PERFIL = "V-ESPECIAL" Then - skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("NUMERO_PEDIDO")) - skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("NUMERO_PEDIDO",NUMERO_PEDIDO + 1)) - End If - P1.Visible = False - trabajar.Visible = True - B_PROXIMA.Visible =True - Btn_UbicarR.Visible=True - - NUEVO.Visible =True - BUSCA.Visible=True - connecta.Visible=True - Resumen.Visible= True - img2.Visible=False - Else If CARGA = "SUBIR" And S_CP.Text = "ERROR" Then - Msgbox("Tiene que subir de nuevo la información","Atención") - P1.Visible = False - trabajar.Visible = True - NUEVO.Visible =True - BUSCA.Visible=True - connecta.Visible=True - Resumen.Visible= True - img2.Visible=False - - Else if CARGA = "SUBIR" And S_CP.Text <> "INFO OK" Then - RES = Msgbox2("Seguro que desa abortar el proceso","Cierre", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) - If RES = DialogResponse.POSITIVE Then - P1.Visible = False - trabajar.Visible = True - B_PROXIMA.Visible =True - Btn_UbicarR.Visible=True - - NUEVO.Visible =True - BUSCA.Visible=True - connecta.Visible=True - Resumen.Visible= True - img2.Visible=False - ExitApplication - End If - - End If - - If CARGA = "CARGAR" And S_CP.Text = "LISTO" And S_CC.Text = "LISTO" And S_CH.Text = "LISTO" Then - - P1.Visible = False - trabajar.Visible = True - B_PROXIMA.Visible =True - Btn_UbicarR.Visible=True - - - NUEVO.Visible =True - BUSCA.Visible=True - connecta.Visible=True - Resumen.Visible= True - img2.Visible=False - B4XPage_Appear - Else if CARGA = "CARGAR" And (S_CP.Text <> "LISTO" Or S_CC.Text <> "LISTO" Or S_CH.Text <> "LISTO") Then - RES = Msgbox2("Seguro que desa abortar el proceso","Cierre", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) - If RES = DialogResponse.POSITIVE Then - P1.Visible = False - trabajar.Visible = True - B_PROXIMA.Visible =True - Btn_UbicarR.Visible=True - - NUEVO.Visible =True - BUSCA.Visible=True - connecta.Visible=True - Resumen.Visible= True - img2.Visible=False - skmt.ExecNonQuery("delete from kmt_info") - skmt.ExecNonQuery("delete from cod_result") - skmt.ExecNonQuery("delete from hist_gest") - skmt.ExecNonQuery("delete from cat_gunaprod") - skmt.ExecNonQuery("delete from CAT_DETALLES_PAQ") - skmt.ExecNonQuery("delete from telefonos") - skmt.ExecNonQuery("delete from HIST_VENTAS") - skmt.ExecNonQuery("delete from HIST_PROMOS") - skmt.ExecNonQuery("delete from HIST_CLIENTE_CANT_PROMOS") - skmt.ExecNonQuery("delete from PROMOS_COMP") - skmt.ExecNonQuery("delete from CAT_VERIFICACION") - ExitApplication - End If - - End If - - - '------------- - '------------- TODO ESTE CODIGO ES PARA CUANDO APLICAN DESUCENTOS. - ' - ' Dim cmd As DBCommand' -' cmd.Initialize -' cmd.Name = "select_usuario_guna_super_DUR" -' cmd.Parameters = Array As Object(USUARIO1.Text, CLAVE.Text) -' reqManager.ExecuteQuery(cmd , 0, "usuario") - 'If PASO = 1 Then - 'c=skmt.ExecQuery("select usuario from usuarioa") - '' c.Position = 0 -' usuario = c.GetString("USUARIO") -' c.Close - ' PEDIO_CLIENTE -' c=skmt.ExecQuery("SELECT PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT, PC_COSTO_SIN, PC_RUTA, PC_ALMACEN FROM PEDIDO_CLIENTE ") -' d=skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDOSC FROM PEDIDO_CLIENTE ") -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "insert_pedidos_DUR" -' cmd.Parameters = Array As Object(C.GetString("PC_CLIENTE"),C.GetString("PC_FECHA"),C.GetString("PC_USER"),C.GetString("PC_NOART"),C.GetString("PC_MONTO"),C.GetString("PC_LON"),C.GetString("PC_LAT"),ALMACEN,l_ruta.text,C.GetString("PC_COSTO_SIN") ) -' reqManager.ExecuteQuery(cmd , 0,"inst_pedidos") - ' -' Next -' c.Close -' End If -' d.Position=0 -' cuantos_pedidosc = D.GetString("CUANTOS_PEDIDOSC") -' d.Close -' -' ' PEDIO -' c=skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC FROM PEDIDO") -' d=skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDO FROM PEDIDO") -' -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "insert_pedido_DUR" -' cmd.Parameters = Array As Object(C.GetString("PE_CEDIS"),ALMACEN,C.GetString("PE_COSTO_TOT"),C.GetString("PE_COSTOU"),C.GetString("PE_CANT"),C.GetString("PE_PRONOMBRE"),C.GetString("PE_PROID"),C.GetString("PE_CLIENTE"),C.GetString("PE_FECHA"),C.GetString("PE_USUARIO"),C.GetString("PE_RUTA"), C.GetString("PE_COSTO_SIN"),C.GetString("PE_DESC")) -' reqManager.ExecuteQuery(cmd , 0, "ins_pedido") - ' -' Next -' c.Close -' End If -' d.Position=0 -' cuantos_pedido = D.GetString("CUANTOS_PEDIDO") -' d.Close -' -' ' NOVENTA -' c=skmt.ExecQuery("SELECT NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON FROM NOVENTA") -' D=skmt.ExecQuery("SELECT COUNT(*) AS CUANTOS_NOVENTA FROM NOVENTA") -' -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "insert_noventa_DUR" -' cmd.Parameters = Array As Object(C.GetString("NV_CLIENTE"),C.GetString("NV_FECHA"),C.GetString("NV_USER"),C.GetString("NV_MOTIVO"),C.GetString("NV_COMM"),C.GetString("NV_LAT"),C.GetString("NV_LON"), ALMACEN, l_ruta.Text) -' reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - ' -' Next -' c.Close -' End If -' d.Position=0 -' cuantos_noventa = D.GetString("CUANTOS_NOVENTA") -' d.Close -' -' ' DROP - ' - ' t1.Initialize("T1", 60000) ' 1000 = 1 second - ' t1.Enabled = True - 'Dim cmd As DBCommand - 'cmd.Initialize -' cmd.Name ="insert_drop_DUR" -' cmd.Parameters = Array As Object(usuario,l_ruta.Text,fecha, l_porvisitar.Text,l_drop.Text,l_efectiva.Text,l_cuantosc.Text,l_cuantosn.Text, L_MONTOD.Text) -' reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - ' img2.Visible =True -' -' -' -' ToastMessageShow("Se Actualizaran los datos, Este proceso podria tardar hasta un minuto, gracias "& l_ruta.text , True) - ' - 'USUARIO1.Text = "" - 'CLAVE.Text = "" - ' End If - ' -' Awake.KeepAlive(False) -End Sub - -Sub NUEVO_Click -' StartActivity(nuevocliente) -End Sub - -Sub B_OK_RES_Click - trabajar.Visible = True - B_PROXIMA.Visible =True - Btn_UbicarR.Visible=True - - NUEVO.Visible =True - BUSCA.Visible=True - connecta.Visible=True - Resumen.Visible= True - P_RESUMEN.Visible=False -End Sub - -Sub Resumen_Click - P_RESUMEN.Visible = True - trabajar.Visible = False - B_PROXIMA.Visible =False - Btn_UbicarR.Visible=False - - NUEVO.Visible =False - BUSCA.Visible=False - connecta.Visible=False - Subir.Visible=False - SUBIR_P.Visible = False - cargar.Visible=False - Resumen.Visible= False - - b=skmt.ExecQuery("Select count(*) as CUANTOS from pedido_cliente where pc_cliente <> 0") - b.Position=0 - Cuantos = b.GetString("CUANTOS") - ToastMessageShow(Cuantos , True) - - d=skmt.ExecQuery("select count(*) as TOTAL_VISITAR from kmt_info where gestion = 0 and cat_cl_codigo <> 0") - D.Position=0 - b.Close - e=skmt.ExecQuery("select count(*) as POR_VISITAR from kmt_info where cat_cl_codigo <> 0") - e.Position=0 - f=skmt.ExecQuery("select count(*) as CAT_CL_RUTA from kmt_info where cat_cl_codigo <> 0") - f.Position=0 - l_ruta.Text = f.GetString("CAT_CL_RUTA") - f.Close - If l_ruta.Text = 0 Then - l_ruta.Text =0 - Else - f=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info") - f.Position=0 - l_ruta.Text = f.GetString("CAT_CL_RUTA") - f.Close - End If - If Cuantos = 0 Then - L_MONTOD.Text =0 - l_cuantosc.Text = 0 - l_cuantosn.Text = 0 - drop = 0 - l_drop.Text = 0 - efectiva = 0 - l_efectiva.text =0 - l_ctast.Text = d.GetString("TOTAL_VISITAR") - l_porvisitar.Text = e.GetString("POR_VISITAR") - d.Close - e.Close - Else - C=skmt.ExecQuery2("select count(*) as CUANTOS FROM CAT_GUNAPROD WHERE CAT_GP_CLASIF = ? ", Array As String ("KELLOGGS")) - c.Position = 0 - Log("Cuantos=" & Cuantos) - If c.GetString("CUANTOS") > 0 Then - Log("Entramos") - ImageView12.Bitmap = LoadBitmap(File.DirAssets, "k.png") - c=skmt.ExecQuery2("select sum(pe_cant) as CAMBIOS from pedido where substr(pe_pronombre,1,6) = ?", Array As String("CAMBIO")) - c.Position = 0 - l_cambios.Text = c.GetString("CAMBIOS") - c.Close - c=skmt.ExecQuery("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_CLIENTE <> 0 and pe_proid in (Select CAT_GP_ID from cat_gunaprod where CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2' union Select CAT_GP_ID from cat_gunaprod2 where CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2')") - c.Position = 0 - l_monto_k.Text = c.GetString("MONTO_DIA") - c.Close - c=skmt.ExecQuery("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_CLIENTE <> 0 and pe_proid in (Select CAT_GP_ID from cat_gunaprod where (CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2') And CAT_GP_TIPO = 'PRINGLES' union Select CAT_GP_ID from cat_gunaprod2 where (CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2') And CAT_GP_TIPO = 'PRINGLES')") - c.Position = 0 - l_monto_kp.Text = c.GetString("MONTO_DIA") - Log("Pringles=" & l_monto_kp.text) - If l_monto_kp.Text = "null" Then - l_monto_kp.Text = "0" - End If - c.Close - c=skmt.ExecQuery("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_CLIENTE <> 0 and pe_proid in (Select CAT_GP_ID from cat_gunaprod where (CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2') And CAT_GP_TIPO = 'SNACK' union Select CAT_GP_ID from cat_gunaprod2 where (CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2') And CAT_GP_TIPO = 'SNACK')") - c.Position = 0 - l_monto_ks.Text = c.GetString("MONTO_DIA") - c.Close - Log("Snacks=" & l_monto_ks.text) - c=skmt.ExecQuery("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_CLIENTE <> 0 and pe_proid in (Select CAT_GP_ID from cat_gunaprod where (CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2') And CAT_GP_TIPO = 'CEREAL' union Select CAT_GP_ID from cat_gunaprod2 where (CAT_GP_CLASIF = 'KELLOGGS' Or CAT_GP_CLASIF = 'KELLOGGS 2') And CAT_GP_TIPO = 'CEREAL')") - c.Position = 0 - l_monto_kc.Text = c.GetString("MONTO_DIA") - c.Close - Log("Cereal=" & l_monto_kc.text) - - Else - ImageView12.Bitmap = LoadBitmap(File.DirAssets, "unilever.jpg") - c=skmt.ExecQuery2("select sum(pe_cant) as CAMBIOS from pedido where substr(pe_pronombre,1,6) = ?", Array As String("CAMBIO")) - c.Position = 0 - l_cambios.Text = c.GetString("CAMBIOS") - c.Close - - c=skmt.ExecQuery("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_CLIENTE <> 0 and pe_proid in (Select CAT_GP_ID from cat_gunaprod where CAT_GP_CLASIF = 'UNILEVER' union Select CAT_GP_ID from cat_gunaprod2 where CAT_GP_CLASIF = 'UNILEVER')") - c.Position = 0 - l_monto_k.Text = c.GetString("MONTO_DIA") - c.Close - - l_monto_kp.Text = "0" - l_monto_ks.Text = "0" - End If - - Log($"${l_monto_k.text}, ${l_monto_kp.text}, ${l_monto_ks.text}"$) - - E1=skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("VENTA")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - - c=skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("VENTA")) - c.Position = 0 - L_VENTA.Text = c.GetString("MONTO_DIA") - c.Close - Else - L_VENTA.Text = 0 - End If - E1.Close - - - E1=skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("PREVENTA")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - - c=skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("PREVENTA")) - c.Position = 0 - L_PREVENTA.Text = c.GetString("MONTO_DIA") - c.Close - Else - L_PREVENTA.Text = 0 - End If - E1.Close - - - E1=skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("ABORDO")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - - c=skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("ABORDO")) - c.Position = 0 - L_ABORDO.Text = c.GetString("MONTO_DIA") - c.Close - Else - L_ABORDO.Text = 0 - End If - E1.Close - -' c=skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_CLIENTE <> 0 and pe_proid in (Select CAT_GP_ID from cat_gunaprod where (CAT_GP_CLASIF = ? Or CAT_GP_CLASIF = ?) And CAT_GP_TIPO = ?)", Array As String("KELLOGGS", "KELLOGGS 2","SNACK")) -' c.Position = 0 -' l_monto_ks.Text = c.GetString("MONTO_DIA") -' c.Close - - c=skmt.ExecQuery("select sum(pc_monto) as MONTO_DIA, count(pc_cliente) AS CLIENTES_DIA from pedido_cliente where pc_cliente <> 0") - b=skmt.ExecQuery("select count(*) as CUANTOS from noventa") - 'where pc_fecha = ?", Array As String(fecha) - C.Position=0 - b.Position=0 - L_MONTOD.Text = c.GetString("MONTO_DIA") - l_cuantosc.Text = c.GetString("CLIENTES_DIA") - l_cuantosn.Text = b.GetString("CUANTOS") - efectiva = c.GetString("CLIENTES_DIA") / e.GetString("POR_VISITAR") - l_efectiva.text = Round2(efectiva*100,2) - l_ctast.Text = d.GetString("TOTAL_VISITAR") - l_porvisitar.Text = e.GetString("POR_VISITAR") - L_CUANTOST.Text = l_cuantosc.Text + l_cuantosn.Text - drop = (c.GetString("CLIENTES_DIA") + b.GetString("CUANTOS"))/ d.GetString("TOTAL_VISITAR") - l_drop.Text = Round(drop * 100) - If l_drop.Text + l_efectiva.Text < 100 Then - ImageView3.Bitmap = LoadBitmap(File.DirAssets, "tache_rojo.png") - Else If l_drop.Text + l_efectiva.Text > = 100 And l_drop.Text + l_efectiva.Text < 130 Then - ImageView3.bitmap = LoadBitmap(File.DirAssets, "alerta_amarilla.png") - Else - ImageView3.Bitmap = LoadBitmap(File.DirAssets, "palomita_verde.png") - End If - L_TICKPROM.Text = Round2((c.GetString("MONTO_DIA") / c.GetString("CLIENTES_DIA")),2) - If c.GetString("MONTO_DIA") < 2500 Then - ImageView5.Bitmap = LoadBitmap(File.DirAssets, "tache_rojo.png") - Else if c.GetString("MONTO_DIA") > = 2500 And c.GetString("MONTO_DIA") < 4000 Then - ImageView5.bitmap = LoadBitmap(File.DirAssets, "alerta_amarilla.png") - Else - ImageView5.Bitmap = LoadBitmap(File.DirAssets, "palomita_verde.png") - End If - - c.Close - b.Close - End If - - -End Sub - -Sub B_PROXIMA_Click -' skmt.ExecNonQuery("delete from CUENTAA") -' skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object("0")) -' Main.tipov = "ABORDO" -'' StartActivity(colonia2) -End Sub - - - -Sub Timer_GIF1_Tick - Timer_GIF1.Enabled = False - Frame1 = Frame1 + 1 - If Frame1 >= gif1.FrameCount Then - Frame1 = 0 - End If - Timer_GIF1.Interval = gif1.Delay(Frame1) - i_gif.Bitmap = gif1.Frame(Frame1) - Timer_GIF1.Enabled = True -End Sub - -Sub load_gif - - gif1.DisposeFrames - - - gif1.Load(ruta, "espera.gif") - Frame1 = 0 - - - Timer_GIF1.Interval = gif1.Delay(Frame1) - i_gif.Bitmap = gif1.Frame(Frame1) - - Timer_GIF1.Initialize("TG", 40) ' 1000 = 1 second - - Timer_GIF1.Enabled = True - - - - gif1.SaveFrame(0, ruta, "frame1.png", "P", 85) - gif1.SaveFrame(0, ruta, "frame1.jpg", "J", 85) - -End Sub - -Sub VALIDA_INFO - - cmd.Initialize - cmd.Name = "select_datos_enviados_pe" - cmd.Parameters = Array As Object(ALMACEN, e_ruta.Text) - reqManager.ExecuteQuery(cmd , 0, "pedido_env") - PASO_info = 0 - - For I = 0 To 2 - T3.Initialize("T3", 8000) ' 1000 = 1 second - T3.Enabled = True - Wait For t3_tick - If PASO_info = 0 Then - I = 0 - End If - Next - -End Sub - - -Sub B_MARCAS_Click - Panel5.Visible = True - - pnlTitle.Visible = False - pnlTitle.SetLayoutAnimated(0, 0, 0, CLV1.AsView.Width, TitleHeight + DividerHeight) - pnlTitle.LoadLayout("CellTitle") - c=skmt.ExecQuery("Select CAT_GP_CLASIF, SUM(TOTAL) AS TOTAL FROM TOTAL_MARCAS GROUP BY CAT_GP_CLASIF") - CLV1.Clear - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - AddTitle(c.GetString("CAT_GP_CLASIF")) - CLV1.AddTextItem("TOTAL VENTA Y PREVENTA = $" & c.GetString("TOTAL"),"1") - - Next - End If -End Sub -Sub AddTitle (Title As String) - Dim p_MARCAS As B4XView = xui.CreatePanel("") - p_MARCAS.SetLayoutAnimated(0, 0, 0, CLV1.AsView.Width, TitleHeight) - p_MARCAS.LoadLayout("CellTitle") - lblTitle.Text = Title - Dim td As TitleData - td.Title = Title - CLV1.Add(p_MARCAS, td) -End Sub - - -Sub B_OK_PANEL5_Click - Panel5.Visible = False - -End Sub - -Sub e_ruta_TextChanged (Old As String, New As String) - Dim validChars As String ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 " - Try - If validChars.Contains(New.SubString(New.Length-1)) = False Then - e_ruta.Text = New.SubString2(0, New.Length-1) - e_ruta.SelectionStart = e_ruta.Text.Length - End If - Catch - Log(LastException) - End Try -End Sub - -Sub Btn_UbicarR_Click - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MARCAS")) - c.Position =0 - MARCASQ = c.GetString("CAT_VA_VALOR") - c.Close - skmt.ExecNonQuery("delete from CAT_GUNAPROD WHERE CAT_GP_CLASIF NOT IN (" & MARCASQ &")" ) - skmt.ExecNonQuery("delete from CAT_GUNAPROD WHERE CAT_GP_ID IN (SELECT CAT_DP_ID FROM CAT_DETALLES_PAQ WHERE CAT_DP_IDPROD NOT IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD))") -' StartActivity(MAPA_RUTAS) -End Sub - -Sub SUBIR_P_Click - Awake.KeepAlive(True) - CARGA = "SUBIR" - P1.Visible = True - trabajar.Visible = False - B_PROXIMA.Visible =False - Btn_UbicarR.Visible=False - - NUEVO.Visible =False - BUSCA.Visible=False - connecta.Visible=False - Subir.Visible=False - SUBIR_P.Visible = False - - cargar.Visible=False - L_P_1.Visible = False - S_CC.Visible = False - L_P_3.Visible = False - S_CH.Visible = False - PB1.Visible = False - Resumen.Visible= False - - L_P_2.Text = "Envio de Pedidos" - L_P_3.Text = "Envio de Pedidos" - S_CH.Text = "EN PROCESO" - S_CP.Text = "EN PROCESO" - PB1.Progress = 0 - PB2.Progress = 0 - PB2.Visible = True - conteo = 0 - 'i_gif.Visible = True -' load_gif - - PASO = 1 - 'End If - If PASO =1 Then - E1=skmt.ExecQuery2("Select count(*) As CUANTOS from pedido where PE_TIPO = ?", Array As String("ABORDO")) - E1.Position = 0 - If E1.GetString("CUANTOS") > 0 Then - - c=skmt.ExecQuery2("Select sum(PE_COSTO_TOT) As MONTO_DIA from pedido where PE_TIPO = ?", Array As String("ABORDO")) - c.Position = 0 - L_ABORDO.Text = c.GetString("MONTO_DIA") - c.Close - Else - L_ABORDO.Text = 0 - End If - E1.Close - - - skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE not In (select PE_CLIENTE from pedido)") - - c=skmt.ExecQuery("select usuario from usuarioa") - c.Position = 0 - usuario = c.GetString("USUARIO") - c.Close - d3=skmt.ExecQuery("SELECT SUM(PE_COSTO_TOT) as MONTO FROM PEDIDO") - d3.Position = 0 - Dim cmd As DBCommand - cmd.Initialize - cmd.Name ="UPDATE_INFO_E_DURK" - cmd.Parameters = Array As Object(d3.GetDouble("MONTO")- L_ABORDO.text, L_ABORDO.Text, d3.GetDouble("MONTO"),l_ruta.TEXT, ALMACEN) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - Dim cmd As DBCommand - cmd.Initialize - cmd.Name ="insert_drop2_DUR" - cmd.Parameters = Array As Object(usuario,l_ruta.Text,fecha, l_porvisitar.Text,l_drop.Text,l_efectiva.Text,l_cuantosc.Text,l_cuantosn.Text, L_MONTOD.Text,"ENVIO", ALMACEN, L_VENTA.Text, L_PREVENTA.Text, L_ABORDO.Text, l_cambios.TEXT) - reqManager.ExecuteQuery(cmd , 0, "inst_noventa") - d3.Close - cuantos_pedidosc = 0 - - - ' PEDIO - - skmt.ExecNonQuery("update PEDIDO set PE_FOLIO = rowid ") - - ' -' c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FOLIO")) -' c.Position =0 - ' armafolio = l_ruta.text * 1000000 -' armafolio = armafolio + c.GetString("CAT_VA_VALOR") -' c.Close -' c=skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC,PE_TIPO FROM PEDIDO WHERE PE_FOLIO IS NULL") -' -' -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' skmt.ExecNonQuery2("update PEDIDO set PE_FOLIO = ? where PE_PROID = ? AND PE_CLIENTE =? AND PE_FECHA =? AND PE_FOLIO IS NULL ", Array As Object(armafolio, c.GetString("PE_PROID"), c.GetString("PE_CLIENTE"),c.GetString("PE_FECHA"))) - ' -' armafolio = armafolio + 1 -' -' Next -' c.Close -' End If - ' armafolio = armafolio - (l_ruta.Text * 1000000) - ' skmt.ExecNonQuery2("update CAT_VARIABLES set CAT_VA_VALOR = ? where CAT_VA_DESCRIPCION = ? ", Array As Object(armafolio,"FOLIO")) -' -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "update_folio" -' cmd.Parameters = Array As Object(armafolio,l_ruta.Text , "1") -' reqManager.ExecuteQuery(cmd , 0, "folio") - - - - c=skmt.ExecQuery("SELECT PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC, PE_FOLIO,PE_TIPO FROM PEDIDO WHERE PE_CLIENTE = 0") - d=skmt.ExecQuery("SELECT COUNT(*) as CUANTOS_PEDIDO FROM PEDIDO WHERE PE_CLIENTE = 0") - d.Position=0 - TIEMPO = 0 - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - TIEMPO = TIEMPO + 1 - - If TIEMPO > 20 Then - If L_P_2.Text = "Envio de Pedidos" Then - L_P_2.Text = "Envio de Pedidos --" - else if L_P_2.Text = "Envio de Pedidos --" Then - L_P_2.Text = "Envio de Pedidos \" - else if L_P_2.Text = "Envio de Pedidos \" Then - L_P_2.Text = "Envio de Pedidos |" - else if L_P_2.Text = "Envio de Pedidos |" Then - L_P_2.Text = "Envio de Pedidos /" - else if L_P_2.Text = "Envio de Pedidos /" Then - L_P_2.Text = "Envio de Pedidos --" - End If - T3.Initialize("T3", 2000) ' 1000 = 1 second - T3.Enabled = True - Wait For t3_tick - TIEMPO = 0 - - End If - conteo = conteo + 1 - cuantos_ped = D.GetString("CUANTOS_PEDIDO") - PORCENTAJE = 2 'Round(100/ (D.GetString("CUANTOS_PEDIDO") + 1)) - Dim cmd As DBCommand - cmd.Initialize - cmd.Name = "insert_pedido_DUR" - cmd.Parameters = Array As Object(C.GetString("PE_CEDIS"),ALMACEN,C.GetString("PE_COSTO_TOT"),C.GetString("PE_COSTOU"),C.GetString("PE_CANT"),C.GetString("PE_PRONOMBRE"),C.GetString("PE_PROID"),C.GetString("PE_CLIENTE"),C.GetString("PE_FECHA"),C.GetString("PE_USUARIO"),C.GetString("PE_RUTA"), C.GetString("PE_COSTO_SIN"),C.GetString("PE_DESC"),c.GetString("PE_FOLIO"), c.GetString("PE_TIPO")) - reqManager.ExecuteQuery(cmd , 0, "ins_pedido") - - Next - c.Close - End If - cuantos_pedido = D.GetString("CUANTOS_PEDIDO") - d.Close - t1.Initialize("T1", 20000) ' 1000 = 1 second - t1.Enabled = True - img2.Visible =True - ' ToastMessageShow("Se Actualizaran los datos, Este proceso podria tardar hasta un minuto, gracias "& l_ruta.text , True) - If S_CP.Text = "SUBIENDO" Then - S_CP.Text = "VALIDANDO" - End If - End If -End Sub - -Sub b_e_resumen_Click -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "UPDATE_DURK_ACTUAL2_GPS" -' cmd.Parameters = Array As Object(L_MONTOD.Text, L_CUANTOST.Text, l_cuantosc.Text,l_porvisitar.TEXT,Main.lat_gps,Main.lon_gps,batterystatus(0),0, 0, 0,ALMACEN,l_ruta.Text ) -' reqManager.ExecuteCommand(cmd,"inst_visitas") -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_Productos.bas b/B4A - Copy/C_Productos.bas deleted file mode 100644 index ef40fbe..0000000 --- a/B4A - Copy/C_Productos.bas +++ /dev/null @@ -1,1113 +0,0 @@ -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 - '//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 q_buscar As String - Dim skmt As SQL - 'These global variables will be redeclared each time the activity is created. - 'These variables can only be accessed from this module. - Dim c As Cursor - Dim c2 As Cursor - Dim ListView1 As ListView - Dim entro As String - Dim lfila As Label - Dim marca As String - Dim tipo As String - Private BUSCA As EditText - Dim ya_entro As String - Dim bmp As Bitmap - - Dim c As Cursor - Dim e As Cursor - Dim f As Cursor - Dim h As Cursor - Dim CC As Cursor - Dim DD As Cursor - Dim l_tipo As Label - Dim l_sub As Label - Dim l_marca As Label - Dim l_desc As Label - Dim l_precio As Label - Dim l_bodega As Label - Dim cantidad As EditText - Dim guardar As Button - Dim Terminar As Button - Dim img_prod As ImageView - Dim IMG_PASO() As Byte - Dim L_PROID As Label - Dim clie_id As String - Dim sDate,sTime As String - Dim usuario As String -' Dim lat_gps, lon_gps As String - Dim t_venta As Label - Dim PROMO_C As String - Dim i_fotol As ImageView - Private DESC_PROMO As Button - Private nopromo As Button - Dim TOT_ART_PROMO As String - Dim cambio As String - Dim COSTO_TOT As String - Dim ALMACEN As String - Dim preciosin As String - Dim cl_ruta As String - Dim d As Cursor - Dim TOT_ART_PROMOR As String - Dim PROMO_CR As String - Dim TOTAL_PROMO As String - Dim HCCP_CANT As String - Private Panel1 As Panel - Dim query As String - Private t_precio As Label - Private LV_PRECIOS As ListView - Private PERFIL As String - Private EXISTE_CAMBIO As String - Private QUERY2 As String - Dim CAMBIOS As String - Dim precio2 As String - Dim PROMOS_VENTAS As String - -End Sub - -Private Sub B4XPage_Created (Root1 As B4XView) - Root = Root1 - 'Do not forget to load the layout file created with the visual designer. For example: - 'Activity.LoadLayout("Layout1") - Root.RemoveAllViews - Root.LoadLayout("PRODUCTOS") - 'Dim ruta As String - ' valido donde escribo el archivo de la base de datos de kmt - ruta = File.DirInternal - Panel1.Visible= False - ' se crea o no el archivo de la base de ddatos de kmt - 'NOTAS SI SE MODIFICA LA ESTRUCTURA SE QUITA EL IF Y SE VA DIRECTO A LA SENTENCIA FILE.COPY PARA QUE - 'TOME LA NUEVA ESTRUCTURA ES MUY IMPORTANTE TENER EL IF DE LO CONTRARIO SOLO LO ESCRIBE UNA VEZ Y LO BORRA - 'SI SE REGRESA A ESTE ACTIVIDAD. - If File.Exists(ruta, "kmt.db") = False Then - File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db") - End If - skmt.Initialize(ruta,"kmt.db", True) -End Sub - -Sub B4XPage_Appear - If Main.tipov = "PREVENTA" Then - query = "cat_gunaprod" - QUERY2 = "COUNT_GUNAPROD" - Else IF Main.tipov = "VENTA" Then - query = "cat_gunaprod2" - QUERY2= " COUNT_GUNAPROD2" - ELSE IF Main.tipov = "ABORDO" Then - query = "cat_gunaprod" - QUERY2 = "COUNT_GUNAPROD" - Else - query = "cat_gunaprod" - QUERY2 = "COUNT_GUNAPROD" - ya_entro = 0 - End If - Log(Main.tipov) - If ya_entro <> "1" Then - 'BUSCA.Text ="" - 'SE COMENTO LA LINEA DE ARRIBA YA QUE DISPARA EL EVENTO DEL TEXTCHANGE Y PUEDE HACER LENTO EL SISTEMA - skmt.Initialize(ruta,"kmt.db", True) - entro ="1" - ya_entro ="1" - c=skmt.ExecQuery("select CAT_GP_CLASIF, COUNT(*) AS CUANTOS from " & query & " where (length(CAT_GP_CODPROMO) = 1 OR CAT_GP_CODPROMO = CAT_GP_ID) GROUP BY CAT_GP_CLASIF order by CAT_GP_CLASIF asc") - - 'ESTO ES PARA NO VER PROCTER - 'c=skmt.ExecQuery2("select CAT_GP_CLASIF, count(*) as cuantos from cat_gunaprod where CAT_GP_ALMACEN > 0 and cat_gp_clasif NOT IN (?,?,?,?,?,?,?,?,?,?) group by CAT_GP_CLASIF order by CAT_GP_CLASIF asc", Array As String("PROCTER","PROMOS","TRES MONTES","CAMPARI","CAMPARI-PRO","CLOROX DE MEXICO","MARS","CONAGRA","VERDE VALLE","MEAD JOHNSON")) - ListView1.Clear - lfila.Text = "MARCA" - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 10 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Black - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - ListView1.AddTwoLines(c.GetString("CAT_GP_CLASIF"),c.GetString("CUANTOS")) - Next - End If - End If - - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("PERFIL")) - c.Position =0 - If c.RowCount > 0 Then - PERFIL = c.GetString("CAT_VA_VALOR") - Else - PERFIL = 0 - End If - c.Close - - If PERFIL = "V-COSTO" Then - skmt.ExecNonQuery("DELETE FROM CAT_GUNAPROD WHERE CAT_GP_ID IN (SELECT CAT_GP_ID FROM LISTA_PRECIOS WHERE NLISTA = '9' AND PRECIO = '0')") - End If -End Sub - -Sub ListView1_ItemClick (Position As Int, Value As Object) - 'Sub ListView1_ItemLongClick (Position As Int, Value As Object) - 'que_colonia = Value - 'StartActivity(fila) - - -' If Value = "PROMOS" And fila.cuenta <> "N" Then -' entro = "3" -' marca = "PROMOS" -' tipo = "PROMOS" -' Else if Value = "PROMOS" And fila.cuenta = "N" Then -' entro = "5" -'' StartActivity(fila) -' End If - If entro = "1" Then - marca = Value - skmt.Initialize(ruta,"kmt.db", True) - c2=skmt.ExecQuery2("select COUNT(*) AS CUANTOS, CAT_GP_TIPO from " & query & " where CAT_GP_ALMACEN > 0 and CAT_GP_CLASIF = ? and (length(CAT_GP_CODPROMO) = 1 OR CAT_GP_CODPROMO = CAT_GP_ID) GROUP BY CAT_GP_TIPO ORDER BY CAT_GP_TIPO ASC", Array As String(Value)) - ListView1.Clear - lfila.text = "TIPO" - If c2.RowCount>0 Then - For i=0 To c2.RowCount -1 - c2.Position=i - ListView1.AddTwoLines(c2.GetString("CAT_GP_TIPO"),c2.GetString("CUANTOS")) - Next - End If - entro = "3" - Else If entro = "2" Then - tipo = Value - skmt.Initialize(ruta,"kmt.db", True) - c2=skmt.ExecQuery2("select COUNT(*) AS CUANTOS, CAT_GP_SUBTIPO from " & query & " where CAT_GP_ALMACEN > 0 and CAT_GP_CLASIF = ? and CAT_GP_TIPO = ? and (length(CAT_GP_CODPROMO) = 1 OR CAT_GP_CODPROMO = CAT_GP_ID) GROUP BY CAT_GP_SUBTIPO ORDER BY CAT_GP_SUBTIPO ASC ", Array As String(marca, Value)) - ListView1.Clear - lfila.text = "SUB-TIPO" - If c2.RowCount>0 Then - For i=0 To c2.RowCount -1 - c2.Position=i - ListView1.AddTwoLines(c2.GetString("CAT_GP_SUBTIPO"),c2.GetString("CUANTOS")) - Next - End If - entro = "3" - - Else If entro = "3" Then - skmt.Initialize(ruta,"kmt.db", True) - c2=skmt.ExecQuery2("select CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG from " & query & " where CAT_GP_ALMACEN > 0 and CAT_GP_CLASIF = ? AND CAT_GP_TIPO = ? and (length(CAT_GP_CODPROMO) = 1 OR CAT_GP_CODPROMO = CAT_GP_ID) ", Array As String(marca, Value)) - ListView1.Clear - lfila.text = "PRODUCTO" - Dim ins As InputStream - Dim bmp As Bitmap - Dim jpeg() As Byte - If c2.RowCount>0 Then - For i=0 To c2.RowCount -1 - c2.Position=i - jpeg = c2.GetBlob("CAT_GP_IMG") - ins.InitializeFromBytesArray(jpeg, 0, jpeg.Length) - bmp.Initialize2(ins) - - ListView1.AddTwoLines(c2.GetString("CAT_GP_NOMBRE"),"# " & c2.GetString("CAT_GP_ALMACEN") & " $ " & c2.GetString("CAT_GP_PRECIO")) - Next - End If - entro = "4" - Else If entro = "4" Then - - skmt.ExecNonQuery("delete from PROID") - skmt.ExecNonQuery2("INSERT INTO PROID VALUES (?)", Array As Object(Value)) - 'StartActivity(pedidos) - HACER_PEDIDO - End If -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ya_entro ="0" - - If entro = "4" Then - entro = "3" - B4XPage_Appear - Return True - Else If entro = "3" Then - ' entro = "2" - ' B4XPage_Appear - ' Return True - ' Else If entro = "2" Then - ' entro = "1" - ' B4XPage_Appear - ' Return True - 'Else If entro = "1" Then - - ' I want to capture the key here so I return True - -' StartActivity(fila) - Return False - End If - End If - ' Returning False signals the system to handle the key -End Sub - -Sub BUSCA_TextChanged (Old As String, New As String) - q_buscar = "%" & BUSCA.Text & "%" - skmt.Initialize(ruta,"kmt.db", True) - ' c=skmt.ExecQuery2("select CAT_GP_NOMBRE from cat_gunaprod where CAT_GP_ALMACEN > 0 and CAT_GP_NOMBRE like ? AND cat_gp_clasif NOT IN (?,?,?,?,?,?,?,?,?,?) order by CAT_GP_NOMBRE asc", Array As String(q_buscar, "PROCTER","PROMOS","TRES MONTES","CAMPARI","CAMPARI-PRO","CLOROX DE MEXICO","MARS","CONAGRA","VERDE VALLE","MEAD JOHNSON")) - c=skmt.ExecQuery2("select CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO,CAT_GP_IMG from " & query & " where CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_NOMBRE like ? and CAT_GP_CLASIF <> ? and (length(CAT_GP_CODPROMO) = 1 OR CAT_GP_CODPROMO = CAT_GP_ID) order by CAT_GP_NOMBRE asc", Array As String(q_buscar,"PROMOS")) - 'and CAT_GP_CLASIF <> ? group by CAT_GP_CLASIF order by CAT_GP_CLASIF asc", Array As String("PROMOS") ) - ListView1.Clear - Dim ins As InputStream - Dim bmp As Bitmap - Dim jpeg() As Byte - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - jpeg = c.GetBlob("CAT_GP_IMG") - ins.InitializeFromBytesArray(jpeg, 0, jpeg.Length) - bmp.Initialize2(ins) - - ListView1.AddTwoLines(c.GetString("CAT_GP_NOMBRE"),"Existencia " & c.GetString("CAT_GP_ALMACEN") & " Precio $" & c.GetString("CAT_GP_PRECIO")) - Next - End If - c.Close - entro= "4" -End Sub - -Sub HACER_PEDIDO - c=skmt.ExecQuery("Select SUBSTR(CUENTA,1,1) AS CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - c.Close - Panel1.Visible= True - cambio = "0" - cantidad.Text = "" - c=skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN") - C.Position =0 - ALMACEN = C.GetString("ID_ALMACEN") - C.Close - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - i_fotol.Visible = False - - skmt.Initialize(ruta,"kmt.db", True) - c=skmt.ExecQuery("select CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_DEV from " & query & " where CAT_GP_NOMBRE In (Select PDESC from PROID)") - - c.Position=0 - L_PROID.Text = c.GetString("CAT_GP_ID") - l_tipo.Text = c.GetString("CAT_GP_TIPO") - l_sub.Text = c.GetString("CAT_GP_SUBTIPO") - l_marca.Text = c.GetString("CAT_GP_CLASIF") - l_desc.Text = c.GetString("CAT_GP_NOMBRE") - - If PERFIL = "V-SUPER" Then - c2=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA = '10' AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - c2.Position=0 - l_precio.Text = c2.GetString("PRECIO") - c2.Close - - Else IF ALMACEN = "6" And cl_ruta = "16" Then - c2=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA = '11' AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - c2.Position=0 - l_precio.Text = c2.GetString("PRECIO") - c2.Close - Else - l_precio.Text = c.GetDouble("CAT_GP_PRECIO") - End If - l_bodega.Text = c.GetString("CAT_GP_ALMACEN") - PROMOS_VENTAS = c.GetString("CAT_GP_ALMACEN") - IMG_PASO = c.GetBlob("CAT_GP_IMG") - PROMO_C = c.GetString("CAT_GP_STS") - cambio = c.GetString("CAT_GP_DEV") - preciosin = c.GetString("CAT_GP_IMP2") - PROMO_CR = c.GetString("CAT_GP_IMP1") - precio2 = l_precio.Text - - If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" Then - DESC_PROMO.Visible = True - CC=skmt.ExecQuery2("select count(*) as CUANTOS FROM PROMOS_COMP WHERE CAT_PA_ID = ?", Array As String(c.GetString("CAT_GP_ID"))) - CC.Position =0 - If CC.GetString("CUANTOS") = 0 Then - l_bodega.Text = "4" - Else - CC.Close - CC=skmt.ExecQuery2("select CAT_PA_MAXPROM, CAT_PA_MAXPROMREC, CAT_PA_MAXPROMCLIE FROM PROMOS_COMP WHERE CAT_PA_ID = ?", Array As String(c.GetString("CAT_GP_ID"))) - CC.Position =0 - - DD=skmt.ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM HIST_CLIENTE_CANT_PROMOS WHERE HCCP_CLIENTE IN (Select cuenta from cuentaa) AND HCCP_PROMO =?", Array As String(c.GetString("CAT_GP_ID"))) - DD.Position =0 - If DD.GetString("CUANTOS") = 0 Then - HCCP_CANT = 0 - Else - DD.Close - - DD=skmt.ExecQuery2("SELECT HCCP_CANT FROM HIST_CLIENTE_CANT_PROMOS WHERE HCCP_CLIENTE IN (Select cuenta from cuentaa) AND HCCP_PROMO =?", Array As String(c.GetString("CAT_GP_ID"))) - DD.Position =0 - HCCP_CANT = DD.GetString("HCCP_CANT") - DD.Close - End If - TOTAL_PROMO = CC.GetString("CAT_PA_MAXPROMCLIE") - HCCP_CANT - If HCCP_CANT = 0 Then - - l_bodega.Text = CC.GetString("CAT_PA_MAXPROM") - Else IF TOTAL_PROMO > CC.GetString("CAT_PA_MAXPROMREC") Then - l_bodega.Text = CC.GetString("CAT_PA_MAXPROMREC") - Else - l_bodega.Text = TOTAL_PROMO - End If - End If - Else - DESC_PROMO.Visible = False - End If - - c.Close - c=skmt.ExecQuery("select CASE WHEN pe_costo_tot is null then 0 else sum( pe_costo_tot ) end as TOTAL_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - t_venta.Text = c.GetString("TOTAL_CLIE") - c.Close - Terminar.Visible = True - guardar.Visible = True - cantidad.Visible = True - If cambio = "1" Then - nopromo.Visible = True - If clie_id = "N" Then - nopromo.Visible = False - End If - Else - nopromo.Visible = False - End If - Dim out As OutputStream - out = File.OpenOutput(ruta, "1.jpg", False) - out.WriteBytes(IMG_PASO, 0, IMG_PASO.Length) - out.Close - img_prod.Bitmap = LoadBitmap(ruta,"1.jpg") - TOT_ART_PROMO = "0" - TOT_ART_PROMOR = "0" - If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" And l_bodega.Text = "0" Then - Msgbox("ALERTA","EL CLIENTE YA NO PUEDE TENER ESTA PROMOCION") - Panel1.Visible= False - End If - - If marca <> "PROMOS" Then - If PERFIL = "PREVENTA" Then - t_precio.Visible = False - LV_PRECIOS.Visible = False - ELSE IF PERFIL = "V-ESPECIAL" Then - c=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA IN ('5','6','7','8','10') AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - LV_PRECIOS.Clear - Dim label1 As Label - label1 = LV_PRECIOS.TwoLinesLayout.Label - label1.TextSize = 10 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = LV_PRECIOS.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Black - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - LV_PRECIOS.AddTwoLines(c.GetString("NLISTA"),c.GetString("PRECIO")) - Next - End If - ELSE IF PERFIL = "V-MINI" Then - t_precio.Visible = False - LV_PRECIOS.Visible = False - - c=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA = '2' AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - c.Position=0 - l_precio.Text = c.GetString("PRECIO") - c.Close - ELSE IF PERFIL = "V-COSTO" Then - - t_precio.Visible = False - LV_PRECIOS.Visible = False - - c=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA = '9' AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - c.Position=0 - l_precio.Text = c.GetString("PRECIO") - c.Close - ELSE IF PERFIL = "V-SUPER" Then - t_precio.Visible = False - LV_PRECIOS.Visible = False - - c=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA ='9' AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - c.Position=0 - l_precio.Text = c.GetString("PRECIO") - c.Close - End If - End If - '' ESTO ES PARA NO PASAR DE LAS PROMOS ABORDO Y MANDARLAS AL MINIMO INICIO - If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" Then - If query = "cat_gunaprod2" Then - l_bodega.Text = PROMOS_VENTAS - e=skmt.ExecQuery2("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID = ? ", Array As String(L_PROID.Text) ) - e.Position = 0 - If e.GetString("CUANTOS") > 0 Then - F=skmt.ExecQuery2("select CAT_DP_IDPROD, CAT_DP_PZAS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID = ? ", Array As String(L_PROID.Text) ) - 'se coloco el if por la mala promocion. - - For i=0 To F.RowCount -1 - F.Position=i - c=skmt.ExecQuery2("select count(*) as CUANTOS from cat_gunaprod2 where CAT_GP_ID = ? ", Array As String(f.GetString("CAT_DP_IDPROD"))) - c.Position=0 - If c.GetString("CUANTOS") > 0 Then - h=skmt.ExecQuery2("select CAT_GP_NOMBRE, CAT_GP_ALMACEN from cat_gunaprod2 where CAT_GP_ID = ? ", Array As String(f.GetString("CAT_DP_IDPROD"))) - h.Position=0 - If h.GetString("CAT_GP_ALMACEN") < l_bodega.Text * f.GetString("CAT_DP_PZAS") Then - l_bodega.Text = "1" - End If - 'skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, f.GetString("CAT_DP_PZAS") * cantidad.text, h.GetString("CAT_GP_NOMBRE"), f.GetString("CAT_DP_IDPROD"),clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - h.Close - else if c.GetString("CUANTOS") = 0 Then - l_bodega.Text = "0" - End If - c.Close - Next - f.Close - End If - e.Close - End If - '' ESTO ES PARA NO PASAR DE LAS PROMOS ABORDO Y MANDARLAS AL MINIMO FIN - End If - If clie_id="0" Then - nopromo.Visible = False - End If -End Sub - -Sub guardar_Click - If cantidad.Text = "" Then - Panel1.Visible= False - ELSE If cantidad.Text > l_bodega.Text Then - Msgbox("Exede la existencia", "ADVERTENCIA") - Else If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" And PROMO_C > 0 And cantidad.Text > 0 Then - skmt.ExecNonQuery("delete from PROIDID") - skmt.ExecNonQuery2("INSERT INTO PROIDID VALUES (?)", Array As Object(L_PROID.text)) - c=skmt.ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 0)") - c.Position =0 - If c.GetString("CUANTOSD") = 0 Then - Msgbox("No tiene venta el cliente para la promo", "ADVERTENCIA") - Else - c=skmt.ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 0)") - C.Position =0 - TOT_ART_PROMO = C.GetString("TOT_ART_PROMO") - COSTO_TOT = C.GetString("COSTO_TOT") - C.Close - - c=skmt.ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO = 0 AND CAT_DP_TIPO = 1)") - c.Position =0 - If c.GetString("CUANTOSD") = 0 Then - TOT_ART_PROMOR = "0" 'Msgbox("No tiene venta el cliente para la promo", "ADVERTENCIA") - Else - c=skmt.ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO = 0 AND CAT_DP_TIPO = 1)") - C.Position =0 - TOT_ART_PROMOR = C.GetString("TOT_ART_PROMO") - End If - C.Close - PROMO_C = PROMO_C * cantidad.Text - PROMO_CR = PROMO_CR * cantidad.Text - - If TOT_ART_PROMO = PROMO_C And TOT_ART_PROMOR = PROMO_CR Then - ' anterior a 29/06/2015 - 'skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))", Array As Object(l_precio.text/(TOT_ART_PROMO/cantidad.Text),l_precio.text/(TOT_ART_PROMO/cantidad.Text))) - 'en pe_cedis meto el codigo de promocion para hacer esta validacion. - skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_CEDIS = (?) WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))", Array As Object(L_PROID.text)) - D=skmt.ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 0") - If D.RowCount>0 Then - For i=0 To D.RowCount -1 - D.Position=i - skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND PE_CLIENTE IN (Select CUENTA from cuentaa) ",Array As Object( D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO_SIMPTOS"),D.GetString("CAT_DP_IDPROD"))) - Next - End If - D.Close - D=skmt.ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND CAT_DP_PRECIO = 0 AND CAT_DP_TIPO = 1") - If D.RowCount>0 Then - For i=0 To D.RowCount -1 - D.Position=i - skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND PE_CLIENTE IN (Select CUENTA from cuentaa) ",Array As Object( D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO_SIMPTOS"),D.GetString("CAT_DP_IDPROD"))) - Next - End If - D.Close - - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - - c.Close - - If Main.tipov = "ABORDO" Then - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - - Else - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - End If - - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - 'skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO) VALUES(?,?,?,?,?,?,?,?,?) ", Array As Object ("COACALCO",cantidad.Text * l_precio.Text, l_precio.text, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario)) - 'para insertar la promo de ades el de regalo en 0 - e=skmt.ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 AND CAT_DP_PRECIO = 0") - - If e.GetString("CUANTOS") > 0 Then - - F=skmt.ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 AND CAT_DP_PRECIO = 0") - 'se coloco el if por la mala promocion. - - For i=0 To F.RowCount -1 - F.Position=i - h=skmt.ExecQuery2("select CAT_GP_NOMBRE from " & query & " where CAT_GP_ID = ? ", Array As String(f.GetString("CAT_DP_IDPROD"))) - h.Position=0 - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, f.GetString("CAT_DP_PZAS") * cantidad.text, h.GetString("CAT_GP_NOMBRE"), f.GetString("CAT_DP_IDPROD"),clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(f.GetString("CAT_DP_PZAS") * cantidad.text, f.GetString("CAT_DP_IDPROD"))) - h.Close - Next - f.Close - End If - e.Close - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - Else - Msgbox("Tiene " & TOT_ART_PROMO & " " & TOT_ART_PROMOR & " y necesita " & PROMO_C & " " & PROMO_CR & " Para la Promo. " , "ADVERTENCIA") - End If - End If - - cantidad.Text = "" - Panel1.Visible= False - - skmt.ExecNonQuery("delete from pedido3") - skmt.ExecNonQuery("UPDATE PEDIDO SET PE_FOLIO = 0 where PE_FOLIO IS NULL") - - skmt.ExecNonQuery("INSERT INTO PEDIDO3 (PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, " & _ - " PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO ) Select PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " SUM(PE_COSTO_TOT) As PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO " & _ - " FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FOLIO ") - c=skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID, " & _ - " PE_CLIENTE, PE_FECHA,PE_USUARIO 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 - skmt.ExecNonQuery2("UPDATE PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ? " _ - , Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - - Next - End If - skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") - - - else If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" And PROMO_C = 0 Then - skmt.ExecNonQuery("delete from PROIDID") - - skmt.ExecNonQuery2("INSERT INTO PROIDID VALUES (?)", Array As Object(L_PROID.text)) - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - - c.Close - - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - 'skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO) VALUES(?,?,?,?,?,?,?,?,?) ", Array As Object ("COACALCO",cantidad.Text * l_precio.Text, l_precio.text, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario)) - 'para insertar la promo de ades el de regalo en 0 - e=skmt.ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) ") - e.Position =0 - If e.GetString("CUANTOS") > 0 Then - F=skmt.ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS, CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID)") - For i =0 To f.RowCount -1 - F.Position =i - h=skmt.ExecQuery2("select CAT_GP_NOMBRE from " & query & " where CAT_GP_ID = ? ", Array As String(f.GetString("CAT_DP_IDPROD"))) - h.Position=0 - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,f.GetString("CAT_DP_PRECIO") * cantidad.text * f.GetString("CAT_DP_PZAS"), f.GetString("CAT_DP_PRECIO"), f.GetString("CAT_DP_PZAS") * cantidad.text, h.GetString("CAT_GP_NOMBRE"), f.GetString("CAT_DP_IDPROD"),clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(f.GetString("CAT_DP_PZAS") * cantidad.text, f.GetString("CAT_DP_IDPROD"))) - - h.Close - Next - f.Close - End If - e.Close - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - cantidad.Text = "" - c=skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Main.lon_gps, Main.lat_gps,ALMACEN,cl_ruta,c.GetString("TOTAL_CLIE_SIN"))) - If Main.tipov <> "ABORDO" Then - skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - End If - - Panel1.Visible= False - - skmt.ExecNonQuery("delete from pedido3") - skmt.ExecNonQuery("UPDATE PEDIDO SET PE_FOLIO = 0 where PE_FOLIO IS NULL") - - skmt.ExecNonQuery("INSERT INTO PEDIDO3 (PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, " & _ - " PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO ) Select PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " SUM(PE_COSTO_TOT) As PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO " & _ - " FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FOLIO ") - c=skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID, " & _ - " PE_CLIENTE, PE_FECHA,PE_USUARIO 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 - skmt.ExecNonQuery2("UPDATE PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ? " _ - , Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - - Next - End If - skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") - - - Else - - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - c.Close - If Main.tipov = "ABORDO" Then - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - - Else - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - End If - - - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_COSTO_SIN,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (ALMACEN,cantidad.Text * l_precio.Text, l_precio.text, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,cl_ruta,preciosin,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - c=skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Main.lon_gps, Main.lat_gps,ALMACEN,cl_ruta,c.GetString("TOTAL_CLIE_SIN"))) - If Main.tipov <> "ABORDO" Then - skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - - End If - Panel1.Visible= False - - skmt.ExecNonQuery("delete from pedido3") - skmt.ExecNonQuery("UPDATE PEDIDO SET PE_FOLIO = 0 where PE_FOLIO IS NULL") - - skmt.ExecNonQuery("INSERT INTO PEDIDO3 (PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, " & _ - " PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO ) Select PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " SUM(PE_COSTO_TOT) As PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO " & _ - " FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FOLIO ") - c=skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID, " & _ - " PE_CLIENTE, PE_FECHA,PE_USUARIO 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 - skmt.ExecNonQuery2("UPDATE PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ? " _ - , Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - - Next - End If - skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") - - 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 Terminar_Click - - If cantidad.Text = "" Then -' StartActivity(fila) - - ELSE If cantidad.Text > l_bodega.Text Then - Msgbox("Exede la existencia", "ADVERTENCIA") - Else If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" And PROMO_C > 0 And cantidad.Text > 0 Then - skmt.ExecNonQuery("delete from PROIDID") - - skmt.ExecNonQuery2("INSERT INTO PROIDID VALUES (?)", Array As Object(L_PROID.text)) - c=skmt.ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 0)") - c.Position =0 - If c.GetString("CUANTOSD") = 0 Then - Msgbox("No tiene venta el cliente para la promo", "ADVERTENCIA") - Else - c=skmt.ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 0)") - C.Position =0 - TOT_ART_PROMO = C.GetString("TOT_ART_PROMO") - COSTO_TOT = C.GetString("COSTO_TOT") - C.Close - - c=skmt.ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO = 0 AND CAT_DP_TIPO = 1)") - c.Position =0 - If c.GetString("CUANTOSD") = 0 Then - TOT_ART_PROMOR = "0" 'Msgbox("No tiene venta el cliente para la promo", "ADVERTENCIA") - Else - c=skmt.ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO = 0 AND CAT_DP_TIPO = 1)") - C.Position =0 - TOT_ART_PROMOR = C.GetString("TOT_ART_PROMO") - End If - C.Close - - - PROMO_C = PROMO_C * cantidad.Text - PROMO_CR = PROMO_CR * cantidad.Text - - If TOT_ART_PROMO = PROMO_C And TOT_ART_PROMOR = PROMO_CR Then - ' anterior a 29/06/2015 - 'skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))", Array As Object(l_precio.text/(TOT_ART_PROMO/cantidad.Text),l_precio.text/(TOT_ART_PROMO/cantidad.Text))) - 'en pe_cedis meto el codigo de promocion para hacer esta validacion. - skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_CEDIS = (?) WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))", Array As Object(L_PROID.text)) - D=skmt.ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 0") - If D.RowCount>0 Then - For i=0 To D.RowCount -1 - D.Position=i - - skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND PE_CLIENTE IN (Select CUENTA from cuentaa) ",Array As Object( D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO_SIMPTOS"),D.GetString("CAT_DP_IDPROD"))) - - Next - End If - D.Close - D=skmt.ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND CAT_DP_PRECIO = 0 AND CAT_DP_TIPO = 1") - If D.RowCount>0 Then - For i=0 To D.RowCount -1 - D.Position=i - - skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND PE_CLIENTE IN (Select CUENTA from cuentaa) ",Array As Object( D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO"), D.GetString("CAT_DP_PRECIO_SIMPTOS"),D.GetString("CAT_DP_IDPROD"))) - - Next - End If - D.Close - - - - 'skmt.ExecNonQuery("UPDATE PEDIDO SET PE_COSTO_TOT = 0.01 WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))") - - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - - c.Close - - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - 'skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO) VALUES(?,?,?,?,?,?,?,?,?) ", Array As Object ("COACALCO",cantidad.Text * l_precio.Text, l_precio.text, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario)) - 'para insertar la promo de ades el de regalo en 0 - e=skmt.ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 AND CAT_DP_PRECIO = 0") - e.Position =0 - If e.GetString("CUANTOS") > 0 Then - F=skmt.ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 AND CAT_DP_PRECIO = 0") - 'meter el otro - F.Position =0 - h=skmt.ExecQuery2("select CAT_GP_NOMBRE from " & query & " where CAT_GP_ID = ? ", Array As String(f.GetString("CAT_DP_IDPROD"))) - h.Position=0 - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, f.GetString("CAT_DP_PZAS") * cantidad.text, h.GetString("CAT_GP_NOMBRE"), f.GetString("CAT_DP_IDPROD"),clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object( f.GetString("CAT_DP_PZAS") * cantidad.text, f.GetString("CAT_DP_IDPROD"))) - - - h.Close - f.Close - End If - e.Close - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - Else - Msgbox("Tiene " & TOT_ART_PROMO & " " & TOT_ART_PROMOR & " y necesita " & PROMO_C & " " & PROMO_CR & " Para la Promo. " , "ADVERTENCIA") - End If - End If - - cantidad.Text = "" - Panel1.Visible= False - - skmt.ExecNonQuery("delete from pedido3") - skmt.ExecNonQuery("UPDATE PEDIDO SET PE_FOLIO = 0 where PE_FOLIO IS NULL") - - skmt.ExecNonQuery("INSERT INTO PEDIDO3 (PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, " & _ - " PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO ) Select PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " SUM(PE_COSTO_TOT) As PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO " & _ - " FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FOLIO ") - c=skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID, " & _ - " PE_CLIENTE, PE_FECHA,PE_USUARIO 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 - skmt.ExecNonQuery2("UPDATE PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ? " _ - , Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - - Next - End If - skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") - -' StartActivity(fila) - else If l_marca.text = "PROMOS" And l_tipo.Text ="PROMOS" And PROMO_C = 0 Then - skmt.ExecNonQuery("delete from PROIDID") - - skmt.ExecNonQuery2("INSERT INTO PROIDID VALUES (?)", Array As Object(L_PROID.text)) - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - - c.Close - - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - 'skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO) VALUES(?,?,?,?,?,?,?,?,?) ", Array As Object ("COACALCO",cantidad.Text * l_precio.Text, l_precio.text, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario)) - 'para insertar la promo de ades el de regalo en 0 - e=skmt.ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) ") - e.Position =0 - If e.GetString("CUANTOS") > 0 Then - F=skmt.ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS, CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID)") - For i =0 To f.RowCount -1 - F.Position =i - h=skmt.ExecQuery2("select CAT_GP_NOMBRE from " & query & " where CAT_GP_ID = ? ", Array As String(f.GetString("CAT_DP_IDPROD"))) - h.Position=0 - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,f.GetString("CAT_DP_PRECIO") * cantidad.text * f.GetString("CAT_DP_PZAS"), f.GetString("CAT_DP_PRECIO"), f.GetString("CAT_DP_PZAS") * cantidad.text, h.GetString("CAT_GP_NOMBRE"), f.GetString("CAT_DP_IDPROD"),clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(f.GetString("CAT_DP_PZAS") * cantidad.text, f.GetString("CAT_DP_IDPROD"))) - - - h.Close - Next - f.Close - End If - e.Close - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (L_PROID.text,0, 0, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,cl_ruta,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - cantidad.Text = "" - c=skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Main.lon_gps, Main.lat_gps,ALMACEN,cl_ruta,c.GetString("TOTAL_CLIE_SIN"))) - skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - - - skmt.ExecNonQuery("delete from pedido3") - skmt.ExecNonQuery("UPDATE PEDIDO SET PE_FOLIO = 0 where PE_FOLIO IS NULL") - - skmt.ExecNonQuery("INSERT INTO PEDIDO3 (PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, " & _ - " PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO ) Select PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " SUM(PE_COSTO_TOT) As PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO " & _ - " FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FOLIO ") - c=skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID, " & _ - " PE_CLIENTE, PE_FECHA,PE_USUARIO 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 - skmt.ExecNonQuery2("UPDATE PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ? " _ - , Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - - Next - End If - skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") -' -' StartActivity(fila) - - Else - - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - c.Close - c=skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - c.Position=0 - cl_ruta = c.GetString("CAT_CL_RUTA") - c.Close - - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_COSTO_SIN,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?) ", Array As Object (ALMACEN,cantidad.Text * l_precio.Text, l_precio.text, cantidad.text, l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,cl_ruta,preciosin,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - c=skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") - c.Position=0 - skmt.ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)") - skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)", Array As Object(clie_id, sDate & sTime, usuario, c.GetString("CANT_CLIE"),c.GetString("TOTAL_CLIE"), Main.lon_gps, Main.lat_gps,ALMACEN,cl_ruta,c.GetString("TOTAL_CLIE_SIN"))) - skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - Panel1.Visible= False - - skmt.ExecNonQuery("delete from pedido3") - skmt.ExecNonQuery("UPDATE PEDIDO SET PE_FOLIO = 0 where PE_FOLIO IS NULL") - - skmt.ExecNonQuery("INSERT INTO PEDIDO3 (PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, " & _ - " PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO ) Select PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " SUM(PE_COSTO_TOT) As PE_COSTO_TOT, PE_COSTOU, SUM(PE_CANT) As PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_USUARIO, PE_FOLIO " & _ - " FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) GROUP BY PE_PRECIO2, PE_TIPO, PE_DESC, PE_COSTO_SIN, PE_RUTA, PE_CEDIS, " & _ - " PE_COSTOU, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FOLIO ") - c=skmt.ExecQuery("select PE_PRECIO2,PE_TIPO,PE_FOLIO,PE_DESC,PE_COSTO_SIN,PE_RUTA,PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID, " & _ - " PE_CLIENTE, PE_FECHA,PE_USUARIO 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 - skmt.ExecNonQuery2("UPDATE PEDIDO3 SET PE_FECHA= ? WHERE PE_CLIENTE = ? AND PE_PRONOMBRE = ? AND PE_PROID = ? AND PE_CEDIS = ? " _ - , Array As Object(c.GetString("PE_FECHA"), c.GetString("PE_CLIENTE"),c.GetString("PE_PRONOMBRE"),c.GetString("PE_PROID"),c.GetString("PE_CEDIS"))) - - Next - End If - skmt.ExecNonQuery("delete from pedido WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ") - skmt.ExecNonQuery("INSERT INTO PEDIDO SELECT * FROM PEDIDO3") - -' StartActivity(fila) - End If -End Sub -Sub i_fotol_Click - i_fotol.Visible = False - -End Sub - -Sub DESC_PROMO_Click - skmt.ExecNonQuery("delete from PROIDID") - skmt.ExecNonQuery2("INSERT INTO PROIDID VALUES (?)", Array As Object(L_PROID.text)) - -' StartActivity(detalle_promo) -End Sub -Sub nopromo_Click - c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("CAMBIOS")) - c.Position =0 - CAMBIOS = c.GetString("CAT_VA_VALOR") - c.Close - If CAMBIOS = "1" Then - c=skmt.ExecQuery("select COUNT(*) AS CUANTOS from HIST_RMI WHERE HR_CLIENTE IN (Select CUENTA from cuentaa) and HR_PROID = '" & L_PROID.Text & "'") - c.Position =0 - EXISTE_CAMBIO = c.GetString("CUANTOS") - c.Close - If EXISTE_CAMBIO = 0 Then - EXISTE_CAMBIO = 0 - Else - c=skmt.ExecQuery("select SUM(HR_CANT) AS CUANTOS from HIST_RMI WHERE HR_CLIENTE IN (Select CUENTA from cuentaa) and HR_PROID = '" & L_PROID.Text & "'") - c.Position =0 - EXISTE_CAMBIO = c.GetString("CUANTOS") - c.Close - - End If - If EXISTE_CAMBIO = 0 Then - Msgbox("NO SE VENDIO ESTE PRODUCTO, NO SE PUEDE CAMBIAR","ALERTA") - ELSE If cantidad.Text = "" Then - Msgbox("Cantidad no puede ser 0","Cantidad") - Else If cantidad.Text > EXISTE_CAMBIO Then - Msgbox("Exede la existencia", "ADVERTENCIA") - Else - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?) ", Array As Object ("DUR",0,0, cantidad.text,"CAMBIO" & l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - - - cantidad.Text = "" - Panel1.Visible= False - - - End If - - Else - If cantidad.Text > 15 Then - Msgbox("Exede la existencia", "ADVERTENCIA") - Else - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - c=skmt.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - clie_id = c.GetString("CUENTA") - c=skmt.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - usuario = c.GetString("USUARIO") - - skmt.ExecNonQuery2("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_TIPO,PE_PRECIO2) VALUES(?,?,?,?,?,?,?,?,?,?,?) ", Array As Object ("DUR",0,0, cantidad.text,"CAMBIO" & l_desc.text, L_PROID.Text,clie_id, sDate & sTime, usuario,Main.tipov,precio2)) - skmt.ExecNonQuery2("update " & query & " set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ", Array As Object(cantidad.Text, L_PROID.Text)) - - - cantidad.Text = "" - Panel1.Visible= False - - - End If - - End If - -End Sub - -Sub LV_PRECIOS_ItemClick (Position As Int, Value As Object) - c=skmt.ExecQuery("select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA = " & "'" & Value &"' AND CAT_GP_ID =" & "'" &L_PROID.TEXT&"' ORDER BY NLISTA ASC") - c.Position=0 - l_precio.Text = c.GetString("PRECIO") - c.Close -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_TicketsDia.bas b/B4A - Copy/C_TicketsDia.bas deleted file mode 100644 index 2a6f13c..0000000 --- a/B4A - Copy/C_TicketsDia.bas +++ /dev/null @@ -1,149 +0,0 @@ -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 skmt As SQL - 'These global variables will be redeclared each time the activity is created. - 'These variables can only be accessed from this module. - Dim c As Cursor - Dim ruta As String - Dim ListView1 As ListView - Dim b_noventa As Button - Dim nombre_boton As String -End Sub - -Private Sub B4XPage_Created (Root1 As B4XView) - Root = Root1 - Root.LoadLayout("buscar") - ruta = File.DirInternal - - ' se crea o no el archivo de la base de ddatos de kmt - 'NOTAS SI SE MODIFICA LA ESTRUCTURA SE QUITA EL IF Y SE VA DIRECTO A LA SENTENCIA FILE.COPY PARA QUE - 'TOME LA NUEVA ESTRUCTURA ES MUY IMPORTANTE TENER EL IF DE LO CONTRARIO SOLO LO ESCRIBE UNA VEZ Y LO BORRA - 'SI SE REGRESA A ESTE ACTIVIDAD. - If File.Exists(ruta, "kmt.db") = False Then - File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db") - End If - - skmt.Initialize(ruta,"kmt.db", True) - - c=skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc") - ListView1.Clear - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 10 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 15 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),"Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO")) - Next - End If - 'la_no_ird.Text = c.GetString("PR_CF_SALDO_ACORT") - - - 'ListView1.AddTwoLines(c.GetString("pr_cd_nombre"),c.GetString("pr_cd_colonia")) - ' Next - 'End If - -End Sub - -Sub B4XPage_Appear - nombre_boton = "NOVENTA" - c=skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc") - ListView1.Clear - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),c.GetString("NOMBRE") &" Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO")) - Next - End If - c.Close -End Sub - -Sub Regresar_Click -' StartActivity(fila) -End Sub - -Sub Activity_KeyPress (key As Int) As Boolean - ' BACK key pressed - If key=KeyCodes.KEYCODE_BACK Then - ' I want to capture the key here so I return True -' StartActivity(seleccion) - 'Return True - End If - ' Returning False signals the system to handle the key - Return False -End Sub - -Sub ListView1_ItemLongClick (Position As Int, Value As Object) - skmt.ExecNonQuery("delete from CUENTAA") - skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(Value)) -' StartActivity(fila) -End Sub - -Sub b_noventa_Click - If nombre_boton = "NOVENTA" Then - nombre_boton = "VENTA" - b_noventa.Text ="VENTA" - - c=skmt.ExecQuery("select NV_CLIENTE,NV_MOTIVO,NV_COMM FROM NOVENTA ORDER BY NV_CLIENTE asc") - ListView1.Clear - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("NV_CLIENTE"),"Motivo #"& c.GetString("NV_MOTIVO")& " Comentario $"& c.GetString("NV_COMM")) - Next - End If - Else - nombre_boton = "NOVENTA" - b_noventa.Text ="NO VENTA" - c=skmt.ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc") - ListView1.Clear - - If c.RowCount>0 Then - For i=0 To c.RowCount -1 - c.Position=i - Dim label1 As Label - label1 = ListView1.TwoLinesLayout.Label - label1.TextSize = 15 - label1.TextColor = Colors.Black - Dim label2 As Label - label2 = ListView1.TwoLinesLayout.SecondLabel - label2.TextSize = 10 - label2.TextColor = Colors.Blue - ListView1.AddTwoLines(c.GetString("PC_CLIENTE"),c.GetString("NOMBRE") &" Cantidad #"& c.GetString("PC_NOART")& " SubTotal $"& c.GetString("PC_MONTO")) - Next - End If - c.Close - End If -End Sub \ No newline at end of file diff --git a/B4A - Copy/C_updateAvailable.bas b/B4A - Copy/C_updateAvailable.bas deleted file mode 100644 index 36fa8d1..0000000 --- a/B4A - Copy/C_updateAvailable.bas +++ /dev/null @@ -1,24 +0,0 @@ -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 -End Sub - -'You can add more parameters here. -Public Sub Initialize As Object - Return Me -End Sub - -'This event will be called once, before the page becomes visible. -Private Sub B4XPage_Created (Root1 As B4XView) - Root = Root1 - 'load the layout to Root - -End Sub - -'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. \ No newline at end of file diff --git a/B4A - Copy/CameraExClass.bas b/B4A - Copy/CameraExClass.bas deleted file mode 100644 index 7da8e8f..0000000 --- a/B4A - Copy/CameraExClass.bas +++ /dev/null @@ -1,290 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=6.8 -@EndOfDesignText@ - -'Class module -'version 1.20 -'See this page for the list of constants: -'http://developer.android.com/intl/fr/reference/android/hardware/Camera.Parameters.html -'Note that you should use the constant values instead of the names. -Sub Class_Globals - Private nativeCam As Object - Private cam As Camera - Private r As Reflector - Private target As Object - Private event As String - Public Front As Boolean - Type CameraInfoAndId (CameraInfo As Object, Id As Int) - Type CameraSize (Width As Int, Height As Int) - Private parameters As Object -End Sub - -Public Sub Initialize (Panel1 As Panel, FrontCamera As Boolean, TargetModule As Object, EventName As String) - target = TargetModule - event = EventName - Front = FrontCamera - Dim id As Int - id = FindCamera(Front).id - If id = -1 Then - Front = Not(Front) 'try different camera - id = FindCamera(Front).id - If id = -1 Then - ToastMessageShow("No camera found.", True) - Return - End If - End If - cam.Initialize2(Panel1, "camera", id) -End Sub - -Private Sub FindCamera (frontCamera As Boolean) As CameraInfoAndId - Dim ci As CameraInfoAndId - Dim cameraInfo As Object - Dim cameraValue As Int - If frontCamera Then cameraValue = 1 Else cameraValue = 0 - cameraInfo = r.CreateObject("android.hardware.Camera$CameraInfo") - Dim numberOfCameras As Int = r.RunStaticMethod("android.hardware.Camera", "getNumberOfCameras", Null, Null) - For i = 0 To numberOfCameras - 1 - r.RunStaticMethod("android.hardware.Camera", "getCameraInfo", Array As Object(i, cameraInfo), _ - Array As String("java.lang.int", "android.hardware.Camera$CameraInfo")) - r.target = cameraInfo - If r.GetField("facing") = cameraValue Then - ci.cameraInfo = r.target - ci.Id = i - Return ci - End If - Next - ci.id = -1 - Return ci -End Sub - -Private Sub SetDisplayOrientation - r.target = r.GetActivity - r.target = r.RunMethod("getWindowManager") - r.target = r.RunMethod("getDefaultDisplay") - r.target = r.RunMethod("getRotation") - Dim previewResult, result, degrees As Int = r.target * 90 - Dim ci As CameraInfoAndId = FindCamera(Front) - r.target = ci.CameraInfo - Dim orientation As Int = r.GetField("orientation") - If Front Then - previewResult = (orientation + degrees) Mod 360 - result = previewResult - previewResult = (360 - previewResult) Mod 360 - Else - previewResult = (orientation - degrees + 360) Mod 360 - result = previewResult - Log(previewResult) - End If - r.target = nativeCam - r.RunMethod2("setDisplayOrientation", previewResult, "java.lang.int") - r.target = parameters - r.RunMethod2("setRotation", result, "java.lang.int") - CommitParameters -End Sub - -Private Sub Camera_Ready (Success As Boolean) - If Success Then - r.target = cam - nativeCam = r.GetField("camera") - r.target = nativeCam - parameters = r.RunMethod("getParameters") - SetDisplayOrientation - Else - Log("success = false, " & LastException) - End If - CallSub2(target, event & "_ready", Success) -End Sub - -Sub Camera_Preview (Data() As Byte) - If SubExists(target, event & "_preview") Then - CallSub2(target, event & "_preview", Data) - End If -End Sub -Public Sub TakePicture - cam.TakePicture -End Sub - -Private Sub Camera_PictureTaken (Data() As Byte) - CallSub2(target, event & "_PictureTaken", Data) -End Sub - -Public Sub StartPreview - cam.StartPreview -End Sub - -Public Sub StopPreview - cam.StopPreview -End Sub - -Public Sub Release - cam.Release -End Sub - -'Saves the data received from PictureTaken event -Public Sub SavePictureToFile(Data() As Byte, Dir As String, FileName As String) - Dim out As OutputStream = File.OpenOutput(Dir, FileName, False) - out.WriteBytes(Data, 0, Data.Length) - out.Close -End Sub - -Public Sub SetParameter(Key As String, Value As String) - r.target = parameters - r.RunMethod3("set", Key, "java.lang.String", Value, "java.lang.String") -End Sub - -Public Sub GetParameter(Key As String) As String - r.target = parameters - Return r.RunMethod2("get", Key, "java.lang.String") -End Sub - -Public Sub CommitParameters - Try - r.target = nativeCam - r.RunMethod4("setParameters", Array As Object(parameters), Array As String("android.hardware.Camera$Parameters")) - Catch - ToastMessageShow("Error setting parameters.", True) - Log(LastException) - End Try -End Sub - -Public Sub GetColorEffect As String - Return GetParameter("effect") -End Sub - -Public Sub SetColorEffect(Effect As String) - SetParameter("effect", Effect) -End Sub - -Public Sub GetSupportedPicturesSizes As CameraSize() - r.target = parameters - Dim list1 As List = r.RunMethod("getSupportedPictureSizes") - Dim cs(list1.Size) As CameraSize - For i = 0 To list1.Size - 1 - r.target = list1.Get(i) - cs(i).Width = r.GetField("width") - cs(i).Height = r.GetField("height") - Next - Return cs -End Sub - -Public Sub SetPictureSize(Width As Int, Height As Int) - r.target = parameters - r.RunMethod3("setPictureSize", Width, "java.lang.int", Height, "java.lang.int") -End Sub - -Public Sub SetJpegQuality(Quality As Int) - r.target = parameters - r.RunMethod2("setJpegQuality", Quality, "java.lang.int") -End Sub - -Public Sub SetFlashMode(Mode As String) - r.target = parameters - r.RunMethod2("setFlashMode", Mode, "java.lang.String") -End Sub - -Public Sub GetFlashMode As String - r.target = parameters - Return r.RunMethod("getFlashMode") -End Sub - -Public Sub GetSupportedFlashModes As List - r.target = parameters - Return r.RunMethod("getSupportedFlashModes") -End Sub - -Public Sub GetSupportedColorEffects As List - r.target = parameters - Return r.RunMethod("getSupportedColorEffects") -End Sub - -Public Sub GetPreviewSize As CameraSize - r.target = parameters - r.target = r.RunMethod("getPreviewSize") - Dim cs As CameraSize - cs.Width = r.GetField("width") - cs.Height = r.GetField("height") - Return cs -End Sub - -Public Sub GetPictureSize As CameraSize - r.target = parameters - r.target = r.RunMethod("getPictureSize") - Dim cs As CameraSize - cs.Width = r.GetField("width") - cs.Height = r.GetField("height") - Return cs -End Sub - -'Converts a preview image formatted in YUV format to JPEG. -'Note that you should not save every preview image as it will slow down the whole process. -Public Sub PreviewImageToJpeg(data() As Byte, quality As Int) As Byte() - Dim size, previewFormat As Object - r.target = parameters - size = r.RunMethod("getPreviewSize") - previewFormat = r.RunMethod("getPreviewFormat") - r.target = size - Dim width = r.GetField("width"), height = r.GetField("height") As Int - Dim yuvImage As Object = r.CreateObject2("android.graphics.YuvImage", _ - Array As Object(data, previewFormat, width, height, Null), _ - Array As String("[B", "java.lang.int", "java.lang.int", "java.lang.int", "[I")) - r.target = yuvImage - Dim rect1 As Rect - rect1.Initialize(0, 0, r.RunMethod("getWidth"), r.RunMethod("getHeight")) - Dim out As OutputStream - out.InitializeToBytesArray(100) - r.RunMethod4("compressToJpeg", Array As Object(rect1, quality, out), _ - Array As String("android.graphics.Rect", "java.lang.int", "java.io.OutputStream")) - Return out.ToBytesArray -End Sub - -Public Sub GetSupportedFocusModes As List - r.target = parameters - Return r.RunMethod("getSupportedFocusModes") -End Sub - -Public Sub SetContinuousAutoFocus - Dim modes As List = GetSupportedFocusModes - If modes.IndexOf("continuous-picture") > -1 Then - SetFocusMode("continuous-picture") - Else If modes.IndexOf("continuous-video") > -1 Then - SetFocusMode("continuous-video") - Else - Log("Continuous focus mode is not available") - End If -End Sub - -Public Sub SetFocusMode(Mode As String) - r.target = parameters - r.RunMethod2("setFocusMode", Mode, "java.lang.String") -End Sub - -Public Sub GetFocusDistances As Float() - Dim F(3) As Float - r.target = parameters - r.RunMethod4("getFocusDistances", Array As Object(F), Array As String("[F")) - Return F -End Sub -'This method should only be called if you need to immediately release the camera. -'For example if you need to start another application that depends on the camera. -Public Sub CloseNow - cam.Release - r.target = cam - r.RunMethod2("releaseCameras", True, "java.lang.boolean") -End Sub -'Calls AutoFocus and then takes the picture if focus was successfull. -Public Sub FocusAndTakePicture - cam.AutoFocus -End Sub -Private Sub Camera_FocusDone (Success As Boolean) - If Success Then - TakePicture - Else - Log("AutoFocus error.") - End If -End Sub - - - diff --git a/B4A - Copy/DBRequestManager.bas b/B4A - Copy/DBRequestManager.bas deleted file mode 100644 index af77225..0000000 --- a/B4A - Copy/DBRequestManager.bas +++ /dev/null @@ -1,275 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=6.8 -@EndOfDesignText@ -'Necesita la libreria RandomAccessFile, ByteConverter - -'Class module -Sub Class_Globals - Private mTarget As Object - Type DBResult (Tag As Object, Columns As Map, Rows As List) - Type DBCommand (Name As String, Parameters() As Object) - Private link As String - Private bc As ByteConverter - Private T_NULL = 0, T_STRING = 1, T_SHORT = 2, T_INT = 3, T_LONG = 4, T_FLOAT = 5 _ - ,T_DOUBLE = 6, T_BOOLEAN = 7, T_BLOB = 8 As Byte - Private VERSION As Float = 0.9 - Private tempArray(1) As Object - Dim jobTagAnterior As String = "" 'Mod por CHV - 211027 -End Sub - -'Target - The module that handles JobDone (usually Me). -'ConnectorLink - URL of the Java server. -Public Sub Initialize (Target As Object, ConnectorLink As String) - mTarget = Target - link = ConnectorLink -End Sub - -'Sends a query request. -'Command - Query name and parameters. -'Limit - Maximum rows to return or 0 for no limit. -'Tag - An object that will be returned in the result. -Public Sub ExecuteQuery(Command As DBCommand, Limit As Int, Tag As Object) - Dim j As HttpJob - Dim ms As OutputStream - Dim out2 As OutputStream = StartJob(j,ms, Tag) - - WriteObject(Command.Name, out2) - WriteInt(Limit, out2) - WriteList(Command.Parameters, out2) - out2.Close - j.PostBytes(link & "?method=query", ms.ToBytesArray) -End Sub - -'Executes a batch of (non-select) commands. -'ListOfCommands - List of the commands that will be executes. -'Tag - An object that will be returned in the result. -Public Sub ExecuteBatch(ListOfCommands As List, Tag As Object) - Dim j As HttpJob - Dim ms As OutputStream - Dim out2 As OutputStream = StartJob(j,ms, Tag) - WriteInt(ListOfCommands.Size, out2) - For Each Command As DBCommand In ListOfCommands - WriteObject(Command.Name, out2) - WriteList(Command.Parameters, out2) - Next - out2.Close - j.PostBytes(link & "?method=batch", ms.ToBytesArray) -End Sub - -'Similar to ExecuteBatch. Sends a single command. -Public Sub ExecuteCommand(Command As DBCommand, Tag As Object) - ExecuteBatch(Array As DBCommand(Command), Tag) -End Sub - -Private Sub StartJob(j As HttpJob, MemoryStream As OutputStream, Tag As Object) As OutputStream - j.Initialize("DBRequest", mTarget) - j.Tag = Tag - MemoryStream.InitializeToBytesArray(0) - Dim compress As CompressedStreams - Dim out As OutputStream = compress.WrapOutputStream(MemoryStream, "gzip") - WriteObject(VERSION, out) - Return out -End Sub - -Private Sub WriteList(Parameters As List, out As OutputStream) - Dim data() As Byte - If Parameters = Null Or Parameters.IsInitialized = False Then - Dim Parameters As List - Parameters.Initialize - End If - data = bc.IntsToBytes(Array As Int(Parameters.Size)) - out.WriteBytes(data, 0, data.Length) - For Each o As Object In Parameters - WriteObject(o, out) - Next -End Sub - -Private Sub WriteObject(o As Object, out As OutputStream) - Dim data() As Byte - tempArray(0) = o - If tempArray(0) = Null Then - out.WriteBytes(Array As Byte(T_NULL), 0, 1) - Else If tempArray(0) Is Short Then - out.WriteBytes(Array As Byte(T_SHORT), 0, 1) - data = bc.ShortsToBytes(Array As Short(o)) - Else If tempArray(0) Is Int Then - out.WriteBytes(Array As Byte(T_INT), 0, 1) - data = bc.IntsToBytes(Array As Int(o)) - Else If tempArray(0) Is Float Then - out.WriteBytes(Array As Byte(T_FLOAT), 0, 1) - data = bc.FloatsToBytes(Array As Float(o)) - Else If tempArray(0) Is Double Then - out.WriteBytes(Array As Byte(T_DOUBLE), 0, 1) - data = bc.DoublesToBytes(Array As Double(o)) - Else If tempArray(0) Is Long Then - out.WriteBytes(Array As Byte(T_LONG), 0, 1) - data = bc.LongsToBytes(Array As Long(o)) - Else If tempArray(0) Is Boolean Then - out.WriteBytes(Array As Byte(T_BOOLEAN), 0, 1) - Dim b As Boolean = 0 - Dim data(1) As Byte - If b Then data(0) = 1 Else data(0) = 0 - Else If GetType(tempArray(0)) = "[B" Then - data = o - out.WriteBytes(Array As Byte(T_BLOB), 0, 1) - WriteInt(data.Length, out) - Else 'If o Is String Then (treat all other values as string) - out.WriteBytes(Array As Byte(T_STRING), 0, 1) - data = bc.StringToBytes(o, "UTF8") - WriteInt(data.Length, out) - End If - If data.Length > 0 Then out.WriteBytes(data, 0, data.Length) -End Sub - -Private Sub ReadObject(In As InputStream) As Object - Dim data(1) As Byte - In.ReadBytes(data, 0, 1) - Select data(0) - Case T_NULL - Return Null - Case T_SHORT - Dim data(2) As Byte - Return bc.ShortsFromBytes(ReadBytesFully(In, data, data.Length))(0) - Case T_INT - Dim data(4) As Byte - Return bc.IntsFromBytes(ReadBytesFully(In, data, data.Length))(0) - Case T_LONG - Dim data(8) As Byte - Return bc.LongsFromBytes(ReadBytesFully(In, data, data.Length))(0) - Case T_FLOAT - Dim data(4) As Byte - Return bc.FloatsFromBytes(ReadBytesFully(In, data, data.Length))(0) - Case T_DOUBLE - Dim data(8) As Byte - Return bc.DoublesFromBytes(ReadBytesFully(In, data, data.Length))(0) - Case T_BOOLEAN - Dim b As Byte = ReadByte(In) - Return b = 1 - Case T_BLOB - Dim len As Int = ReadInt(In) - Dim data(len) As Byte - Return ReadBytesFully(In, data, data.Length) - Case Else - Dim len As Int = ReadInt(In) - Dim data(len) As Byte - ReadBytesFully(In, data, data.Length) - Return BytesToString(data, 0, data.Length, "UTF8") - End Select -End Sub - -Private Sub ReadBytesFully(In As InputStream, Data() As Byte, Len As Int) As Byte() - Dim count = 0, read As Int - Do While count < Len And read > -1 - read = In.ReadBytes(Data, count, Len - count) - count = count + read - Loop - Return Data -End Sub - -Private Sub WriteInt(i As Int, out As OutputStream) - Dim data() As Byte - data = bc.IntsToBytes(Array As Int(i)) - out.WriteBytes(data, 0, data.Length) -End Sub - -Private Sub ReadInt(In As InputStream) As Int - Dim data(4) As Byte - Return bc.IntsFromBytes(ReadBytesFully(In, data, data.Length))(0) -End Sub - -Private Sub ReadByte(In As InputStream) As Byte - Dim data(1) As Byte - In.ReadBytes(data, 0, 1) - Return data(0) -End Sub - -'Handles the Job result and returns a DBResult. -Public Sub HandleJob(Job As HttpJob) As DBResult -' Dim start As Long = DateTime.Now - Dim In As InputStream = Job.GetInputStream - Dim cs As CompressedStreams - In = cs.WrapInputStream(In, "gzip") - Dim serverVersion As Float = ReadObject(In) 'ignore - Dim method As String = ReadObject(In) - Dim table As DBResult - table.Initialize - table.Columns.Initialize - table.rows.Initialize - table.Tag = Job.Tag - If jobTagAnterior <> Job.Tag Then LogColor("HandleJob: '"&Job.Tag&"'", Colors.Blue) 'Mod por CHV - 211023 - jobTagAnterior = Job.Tag 'Mod por CHV - 211023 - If method = "query" Then - Dim numberOfColumns As Int = ReadInt(In) - For i = 0 To numberOfColumns - 1 - table.Columns.Put(ReadObject(In), i) - Next - Do While ReadByte(In) = 1 - Dim rowObjects(numberOfColumns) As Object - table.rows.Add(rowObjects) - For col = 0 To numberOfColumns - 1 - Dim o As Object = ReadObject(In) - rowObjects(col) = o - Next - Loop - Else If method = "batch" Then - table.Columns.Put("AffectedRows", 0) - Dim rows As Int = ReadInt(In) - For i = 0 To rows - 1 - table.rows.Add(Array As Object(ReadInt(In))) - Next - End If - In.Close -' Log("HandleJob: " & (DateTime.Now - start)) - Return table -End Sub -'Reads a file and returns the file as a bytes array. -Public Sub FileToBytes(Dir As String, FileName As String) As Byte() - Dim out As OutputStream - out.InitializeToBytesArray(0) - Dim In As InputStream = File.OpenInput(Dir, FileName) - File.Copy2(In, out) - out.Close - Return out.ToBytesArray -End Sub - -'Converts an image to a bytes array (for BLOB fields). -Public Sub ImageToBytes(Image As Bitmap) As Byte() - Dim out As OutputStream - out.InitializeToBytesArray(0) - Image.WriteToStream(out, 100, "JPEG") - out.Close - Return out.ToBytesArray -End Sub - -'Converts a bytes array to an image (for BLOB fields). -Public Sub BytesToImage(bytes() As Byte) As Bitmap - Dim In As InputStream - In.InitializeFromBytesArray(bytes, 0, bytes.Length) - Dim bmp As Bitmap - bmp.Initialize2(In) - Return bmp -End Sub - -'Prints the table to the logs. -Public Sub PrintTable(Table As DBResult) - Log("Tag: " & Table.Tag & ", Columns: " & Table.Columns.Size & ", Rows: " & Table.Rows.Size) - Dim sb As StringBuilder - sb.Initialize - For Each col In Table.Columns.Keys - sb.Append(col).Append(TAB) - Next - Log(sb.ToString) - For Each row() As Object In Table.Rows - Dim sb As StringBuilder - sb.Initialize - For Each record As Object In row - sb.Append(record).Append(TAB) - Next - ToastMessageShow(sb.ToString, True) - Next -End Sub - - \ No newline at end of file diff --git a/B4A - Copy/Durakelo.b4a b/B4A - Copy/Durakelo.b4a deleted file mode 100644 index 8145209..0000000 --- a/B4A - Copy/Durakelo.b4a +++ /dev/null @@ -1,178 +0,0 @@ -Build1=Default,durakelo.keymon.com.mx,HU2_PUBLIC -File1=alcancia.png -File10=fondo_kmt.jpg -File11=historico.bal -File12=itembuttonblue.png -File13=k.png -File14=K-b27c0809.png -File15=kelloggs.png -File16=login.bal -File17=MainPage.bal -File18=Malo.jpg -File19=NoVenta.bal -File2=alerta_amarilla.png -File20=nuevocliente.bal -File21=palomita_verde.png -File22=planfia_logo.png -File23=principal.bal -File24=rechazo.jpg -File25=salma.jpg -File26=senial.jpg -File27=sync.png -File28=Tiendita.jpg -File29=unilever.jpg -File3=carrito.png -File4=Cliente.bal -File5=Clientes.bal -File6=durakelo.png -File7=durakelo1.png -File8=engrane.jpg -File9=espera.gif -FileGroup1=Default Group -FileGroup10=Default Group -FileGroup11=Default Group -FileGroup12=Default Group -FileGroup13=Default Group -FileGroup14=Default Group -FileGroup15=Default Group -FileGroup16=Default Group -FileGroup17=Default Group -FileGroup18=Default Group -FileGroup19=Default Group -FileGroup2=Default Group -FileGroup20=Default Group -FileGroup21=Default Group -FileGroup22=Default Group -FileGroup23=Default Group -FileGroup24=Default Group -FileGroup25=Default Group -FileGroup26=Default Group -FileGroup27=Default Group -FileGroup28=Default Group -FileGroup29=Default Group -FileGroup3=Default Group -FileGroup4=Default Group -FileGroup5=Default Group -FileGroup6=Default Group -FileGroup7=Default Group -FileGroup8=Default Group -FileGroup9=Default Group -Group=Default Group -Library1=b4xpages -Library10=firebasenotifications -Library11=fusedlocationprovider -Library12=gifdecoder -Library13=googlemaps -Library14=gps -Library15=ime -Library16=javaobject -Library17=json -Library18=okhttputils2 -Library19=phone -Library2=baqrcode -Library20=randomaccessfile -Library21=reflection -Library22=runtimepermissions -Library23=serial -Library24=sql -Library25=xcustomlistview -Library26=zxing_scanner -Library27=bitmapcreator -Library3=batteryprogressview -Library4=byteconverter -Library5=camera -Library6=compressstrings -Library7=core -Library8=fileprovider -Library9=firebaseanalytics -ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~~\n~)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~CreateResourceFromFile(Macro, Themes.LightTheme)~\n~'End of default text.~\n~~\n~AddApplicationText(~\n~~\n~~\n~)~\n~AddManifestText()~\n~AddManifestText()~\n~SetApplicationAttribute(android:usesCleartextTraffic, "true")~\n~~\n~~\n~'/////////////// FLP y FBMessageing MOD Inicia /////////////////////~\n~CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)~\n~CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)~\n~CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)~\n~CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)~\n~'CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)~\n~SetServiceAttribute(Tracker, android:foregroundServiceType, "location")~\n~'/////////////// FLP y FBMessageing MOD Termina /////////////////////~\n~~\n~'Si al cargar un mapa de google manda este error "java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion". agregar la siguiente linea:~\n~AddApplicationText()~\n~SetApplicationAttribute(android:allowBackup, "false")~\n~SetApplicationAttribute(android:exported, "true")~\n~AddManifestText() -Module1=B4XMainPage -Module10=EscPosPrinter -Module11=FirebaseMessaging -Module12=kms_helperSubs -Module13=ManageExternalStorage -Module14=Starter -Module15=Tracker -Module2=BatteryUtilities -Module3=C_Cliente -Module4=C_Clientes -Module5=C_Historico -Module6=C_Nota -Module7=C_NoVenta -Module8=C_Principal -Module9=DBRequestManager -NumberOfFiles=29 -NumberOfLibraries=27 -NumberOfModules=15 -Version=12.5 -@EndOfDesignText@ -#Region Project Attributes - #ApplicationLabel: Durakelo - #VersionCode: 1 - #VersionName: 3.10.09 - 'SupportedOrientations possible values: unspecified, landscape or portrait. - #SupportedOrientations: portrait - #CanInstallToExternalStorage: False - #AdditionalJar: com.android.support:support-v4 - #AdditionalJar: com.google.android.gms:play-services-location -#End Region - -#Region Activity Attributes - #FullScreen: False - #IncludeTitle: True -#End Region - -'#BridgeLogger: True - -Sub Process_Globals - Public ActionBarHomeClicked As Boolean -End Sub - -Sub Globals - -End Sub - -Sub Activity_Create(FirstTime As Boolean) - Dim pm As B4XPagesManager - pm.Initialize(Activity) -End Sub - -'Template version: B4A-1.01 -#Region Delegates - -Sub Activity_ActionBarHomeClick - ActionBarHomeClicked = True - B4XPages.Delegate.Activity_ActionBarHomeClick - ActionBarHomeClicked = False -End Sub - -Sub Activity_KeyPress (KeyCode As Int) As Boolean - Return B4XPages.Delegate.Activity_KeyPress(KeyCode) -End Sub - -Sub Activity_Resume - B4XPages.Delegate.Activity_Resume -End Sub - -Sub Activity_Pause (UserClosed As Boolean) - B4XPages.Delegate.Activity_Pause -End Sub - -Sub Activity_PermissionResult (Permission As String, Result As Boolean) - B4XPages.Delegate.Activity_PermissionResult(Permission, Result) -End Sub - -Sub Create_Menu (Menu As Object) - B4XPages.Delegate.Create_Menu(Menu) -End Sub - -#if Java -public boolean _onCreateOptionsMenu(android.view.Menu menu) { - processBA.raiseEvent(null, "create_menu", menu); - return true; - -} -#End If -#End Region - -'Program code should go into B4XMainPage and other pages. \ No newline at end of file diff --git a/B4A - Copy/Durakelo.b4a.meta b/B4A - Copy/Durakelo.b4a.meta deleted file mode 100644 index fc489ce..0000000 --- a/B4A - Copy/Durakelo.b4a.meta +++ /dev/null @@ -1,51 +0,0 @@ -ModuleBookmarks0= -ModuleBookmarks1= -ModuleBookmarks10= -ModuleBookmarks11= -ModuleBookmarks12= -ModuleBookmarks13= -ModuleBookmarks14= -ModuleBookmarks15= -ModuleBookmarks2= -ModuleBookmarks3= -ModuleBookmarks4= -ModuleBookmarks5= -ModuleBookmarks6= -ModuleBookmarks7= -ModuleBookmarks8= -ModuleBookmarks9= -ModuleBreakpoints0= -ModuleBreakpoints1= -ModuleBreakpoints10= -ModuleBreakpoints11= -ModuleBreakpoints12= -ModuleBreakpoints13= -ModuleBreakpoints14= -ModuleBreakpoints15= -ModuleBreakpoints2= -ModuleBreakpoints3= -ModuleBreakpoints4= -ModuleBreakpoints5= -ModuleBreakpoints6= -ModuleBreakpoints7= -ModuleBreakpoints8= -ModuleBreakpoints9= -ModuleClosedNodes0= -ModuleClosedNodes1= -ModuleClosedNodes10= -ModuleClosedNodes11= -ModuleClosedNodes12= -ModuleClosedNodes13= -ModuleClosedNodes14=1 -ModuleClosedNodes15= -ModuleClosedNodes2= -ModuleClosedNodes3= -ModuleClosedNodes4= -ModuleClosedNodes5= -ModuleClosedNodes6= -ModuleClosedNodes7= -ModuleClosedNodes8= -ModuleClosedNodes9= -NavigationStack=C_Cliente,Tels_Click,306,0,C_Cliente,B_INV_Click,875,0,C_Cliente,B_IMP_Click,447,0,C_Cliente,B_IMP2_Click,670,0,C_Cliente,Guardar_Click,353,5,C_NoVenta,CANCELA_Click,52,1,C_NoVenta,GUARDA_Click,62,6,C_Cliente,initialize,131,0,Visual Designer,Cliente.bal,-100,6,C_Cliente,B4XPage_Created,162,6 -SelectedBuild=0 -VisibleModules=14,1,8,12,6,3,7 diff --git a/B4A - Copy/EscPosPrinter.bas b/B4A - Copy/EscPosPrinter.bas deleted file mode 100644 index 40292c1..0000000 --- a/B4A - Copy/EscPosPrinter.bas +++ /dev/null @@ -1,1148 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=9.3 -@EndOfDesignText@ -#IgnoreWarnings: 9 -' 9 = unused variable - -Sub Class_Globals - ' 1.0 Initial version - ' 2.0 Added FeedPaper, changed many WriteString(.." & Chr(number)) instances to WriteBytes(params) - ' This is to avoid Unicode code page transformations on some numbers > 32 - ' Added PrintAndFeedPaper, setRelativePrintPosn, - ' Added user defined characters, DefineCustomCharacter, DeleteCustomCharacter and setUseCustomCharacters - ' Addedhelper methods CreateCustomCharacter, CreateLine, CreateBox and CreateCircle - Private Version As Double = 2.0 ' Printer class version - - Type AnImage(Width As Int, Height As Int, Data() As Byte) - - Private EventName As String 'ignore - Private CallBack As Object 'ignore - - Private Serial1 As Serial - Private Astream As AsyncStreams - Private Connected As Boolean - Private ConnectedError As String - - Dim ESC As String = Chr(27) - Dim FS As String = Chr(28) - Dim GS As String = Chr(29) - - 'Bold and underline don't work well in reversed text - Dim UNREVERSE As String = GS & "B" & Chr(0) - Dim REVERSE As String = GS & "B" & Chr(1) - - ' Character orientation. Print upside down from right margin - Dim UNINVERT As String = ESC & "{0" - Dim INVERT As String = ESC & "{1" - - ' Character rotation clockwise. Not much use without also reversing the printed character sequence - Dim UNROTATE As String = ESC & "V0" - Dim ROTATE As String = ESC & "V1" - - ' Horizontal tab - Dim HT As String = Chr(9) - - ' Character underline - Dim ULINE0 As String = ESC & "-0" - Dim ULINE1 As String = ESC & "-1" - Dim ULINE2 As String = ESC & "-2" - - ' Character emphasis - Dim BOLD As String = ESC & "E1" - Dim NOBOLD As String = ESC & "E0" - - ' Character height and width - Dim SINGLE As String = GS & "!" & Chr(0x00) - Dim HIGH As String = GS & "!" & Chr(0x01) - Dim WIDE As String = GS & "!" & Chr(0x10) - Dim HIGHWIDE As String = GS & "!" & Chr(0x11) - - ' Default settings - Private LEFTJUSTIFY As String = ESC & "a0" - Private LINEDEFAULT As String = ESC & "2" - Private LINSET0 As String = ESC & "$" & Chr(0x0) & Chr(0x0) - Private LMARGIN0 As String = GS & "L" & Chr(0x0) & Chr(0x0) - Private WIDTH0 As String = GS & "W" & Chr(0xff) & Chr(0xff) - Private CHARSPACING0 As String = ESC & " " & Chr(0) - Private CHARFONT0 As String = ESC & "M" & Chr(0) - Dim DEFAULTS As String = CHARSPACING0 & CHARFONT0 & LMARGIN0 & WIDTH0 & LINSET0 & LINEDEFAULT & LEFTJUSTIFY _ - & UNINVERT & UNROTATE & UNREVERSE & NOBOLD & ULINE0 - -End Sub - -'********** -'PUBLIC API -'********** - -'Initialize the object with the parent and event name -Public Sub Initialize(vCallback As Object, vEventName As String) - EventName = vEventName - CallBack = vCallback - Serial1.Initialize("Serial1") - Connected = False - ConnectedError = "" -End Sub - -' Returns any error raised by the last attempt to connect a printer -Public Sub ConnectedErrorMsg As String - Return ConnectedError -End Sub - -' Returns whether a printer is connected or not -Public Sub IsConnected As Boolean - Return Connected -End Sub - -' Returns whether Bluetooth is on or off -Public Sub IsBluetoothOn As Boolean - Return Serial1.IsEnabled -End Sub - -' Ask the user to connect to a printer and return whether she tried or not -' If True then a subsequent Connected event will indicate success or failure -Public Sub Connect As Boolean - 'leos -' Serial1.Connect("88:6B:0F:3E:53:9E") -' Return True - Try - If Starter.MAC_IMPRESORA = "0" Then - Dim PairedDevices As Map - PairedDevices = Serial1.GetPairedDevices - Dim l As List - l.Initialize - For i = 0 To PairedDevices.Size - 1 - l.Add(PairedDevices.GetKeyAt(i)) - Next - Dim Res As Int - Res = InputList(l, "Choose a printer", -1) 'show list with paired devices 'ignore - If Res <> DialogResponse.CANCEL Then - Serial1.Connect(PairedDevices.Get(l.Get(Res))) 'convert the name to mac address - 'Msgbox(PairedDevices.Get(l.Get(Res)),"mac") - Starter.mac_impresora = PairedDevices.Get(l.Get(Res)) - Return True - End If - Return False - Else - Serial1.Connect(Starter.mac_impresora) - ' Starter.mac_impresora = colonia.MAC_IMPRESORA - Return True - End If - Catch - Log(LastException) - End Try -End Sub - -' Disconnect the printer -Public Sub DisConnect - Serial1.Disconnect - Connected = False -End Sub - -' Reset the printer to the power on state -Public Sub Reset - WriteString(ESC & "@") -End Sub - -'-------------- -' Text Commands -'-------------- - -' Print any outstanding characters then feed the paper the specified number of units of 0.125mm -' This is similar to changing LineSpacing before sending CRLF but this has a one off effect -' A full character height is always fed even if units = 0. Units defines the excess over this minimum -Public Sub PrintAndFeedPaper(units As Int) - WriteString(ESC & "J") - Dim params(1) As Byte - params(0) = units - WriteBytes(params) -End Sub - -' Set the distance between characters -Public Sub setCharacterSpacing(spacing As Int) - WriteString(ESC & " ") - Dim params(1) As Byte - params(0) = spacing - WriteBytes(params) -End Sub - -' Set the left inset of the next line to be printed -' Automatically resets to 0 for the following line -' inset is specified in units of 0.125mm -Public Sub setLeftInset(inset As Int) - Dim dh As Int = inset / 256 - Dim dl As Int = inset - dh - WriteString(ESC & "$" & Chr(dl) & Chr(dh)) - Dim params(2) As Byte - params(0) = dl - params(1) = dh - WriteBytes(params) -End Sub - -' Set the left margin of the print area, must be the first item on a new line -' margin is specified in units of 0.125mm -' This affects barcodes as well as text -Public Sub setLeftMargin(margin As Int) - Dim dh As Int = margin / 256 - Dim dl As Int = margin - dh - WriteString(GS & "L") - Dim params(2) As Byte - params(0) = dl - params(1) = dh - WriteBytes(params) -End Sub - -' Set the width of the print area, must be the first item on a new line -' margin is specified in units of 0.125mm -' This affects barcodes as well as text -' This appears to function more like a right margin than a print area width when used with LeftMargin -Public Sub setPrintWidth(width As Int) - Dim dh As Int = width / 256 - Dim dl As Int = width - dh - WriteString(GS & "W") - Dim params(2) As Byte - params(0) = dl - params(1) = dh - WriteBytes(params) -End Sub - -' Set the distance between lines in increments of 0.125mm -' If spacing is < 0 then the default of 30 is set -Public Sub setLineSpacing(spacing As Int) - If spacing < 0 Then - WriteString(ESC & "2") - Else - WriteString(ESC & "3") - Dim params(1) As Byte - params(0) = spacing - WriteBytes(params) - End If -End Sub - -' Set the line content justification, must be the first item on a new line -' 0 left, 1 centre, 2 right -Public Sub setJustify(justify As Int) - WriteString(ESC & "a" & Chr(justify + 48)) -End Sub - -' Set the codepage of the printer -' You need to look at the printer documentation to establish which codepages are supported -Public Sub setCodePage(codepage As Int) - WriteString(ESC & "t") - Dim params(1) As Byte - params(0) = codepage - WriteBytes(params) -End Sub - -' Select the size of the font for printing text. 0 = Font A (12 x 24), 1 = Font B (9 x 17) -' For font B you may want to set the line spacing to a lower value than the default of 30 -' This affects only the size of printed characters. The code page determines the actual character set -' On my printer setting UseCustomCharacters = while Font B is selected crashes the printer and turns it off -Public Sub setCharacterFont(font As Int) - WriteString(ESC & "M" & Chr(Bit.And(1,font))) -End Sub - -' Set the positions of the horizontal tabs -' Each tab is specified as a number of character widths from the beginning of the line -' There may be up to 32 tab positions specified each of size up to 255 characters -' The printer default is that no tabs are defined -Public Sub setTabPositions(tabs() As Int) - WriteString(ESC & "D") - Dim data(tabs.Length+1) As Byte - For i = 0 To tabs.Length - 1 - data(i) = tabs(i) - Next - data(tabs.Length) = 0 - WriteBytes(data) -End Sub - -' Set print position relative to the current position using horizontal units of 0.125mm -' relposn can be negative -' Unless I have misundertood this doesn't work as documented on my printer -' It only seems take effect at the beginning of a line as a one off effect -Public Sub setRelativePrintPosn(relposn As Int) - Dim dh As Int = relposn / 256 - Dim dl As Int = relposn - dh - WriteString(ESC & "\") - Dim params(2) As Byte - params(0) = dl - params(1) = dh - WriteBytes(params) -End Sub - -' Send the contents of an array of bytes to the printer -' Remember that if the printer is expecting text the bytes will be printed as characters in the current code page -Public Sub WriteBytes(data() As Byte) - If Connected Then - Astream.Write(data) - End If -End Sub - -' Send the string to the printer in IBM437 encoding which is the original PC DOS codepage -' This is usually the default codepage for a printer and is CodePage = 0 -' Beware of using WriteString with Chr() to send numeric values as they may be affected by Unicode to codepage translations -' Most character level operations are pre-defined as UPPERCASE string variables for easy concatenation with other string data -Public Sub WriteString(data As String) - WriteString2(data, "IBM437") -End Sub - -' Send the string to the printer in the specified encoding -' You also need to set the printer to a matching encoding using the CodePage property -' Beware of using WriteString2 with Chr() to send numeric values as they may be affected by codepage substitutions -' Most character level operations are pre-defined as UPPERCASE string variables for easy concatenatipon with other string data -Public Sub WriteString2(data As String, encoding As String) - Try - If Connected Then - Astream.Write(data.GetBytes(encoding)) - End If - Catch - Log("Printer error : " & LastException.Message) - AStream_Error - End Try -End Sub - -'----------------------------------------- -' User defined character commands commands -'----------------------------------------- - -' Delete the specified user defined character mode -' This command deletes the pattern defined for the specified code in the font selected by ESC ! -' If the code is subsequently printed in custom character mode the present code page character is printed instead -Public Sub DeleteCustomCharacter(charcode As Int) - WriteString(ESC & "?") - Dim params(1) As Byte - params(0) = charcode - WriteBytes(params) -End Sub - -' Enable the user defined character mode if custom is True, revert to normal if custom is False -' If a custom character has not been defined for a given character code then the default character for the present font is printed -' FontA and FontB have separate definitions for custom characters -' On my printer setting UseCustomCharacters = while Font B is selected crashes the printer and turns it off -' Therefore the cuatom character routines have not been tested on ont B -Public Sub setUseCustomCharacters(custom As Boolean) - If custom Then - WriteString(ESC & "%1") - Else - WriteString(ESC & "%0") - End If -End Sub - -' Define a user defined character -' The allowable character code range is the 95 characters) from ASCII code 32 (0x20) to 126 (0x7E) -' Characters can be defined in either font A (12*24) or font B (9*17) as selected by present setting of CharacterFont -' The programmer must ensure that the correct font size definition is used for the present setting of CharacterFont -' The user-defined character definition is cleared when Reset is invoked or the printer is turned off -' The vertical and horizontal printed resolution is approximaely 180dpi -' Characters are always defined by sets of three bytes in the vertical direction and up to 9 or 12 sets horizontally -' Each byte defines a vertical line of 8 dots. The MSB of each byte is the highest image pixel, the LSB is the lowest -' Byte(0+n) defines the topmost third of the vertical line, Byte(1+n) is below and Byte(2+n) is the lowest -' Set a bit to 1 to print a dot or 0 to not print a dot -' If the lines to the right of the character are blank then there set of three bytes can be omiited from the byte array -' When the user-defined characters are defined in font B (9*17) only the most significant bit of the 3rd byte of data is used -' charcode defines the character code for the character being defined -' bitdata is a Byte array containing the character definitiopn as described above. -' If the length of bitdata is not a multiple of 3 the definition is ignored and a value of -1 returned -Public Sub DefineCustomCharacter(charcode As Int, bitdata() As Byte) As Int - Dim excess As Int = bitdata.Length Mod 3 - If excess <> 0 Then Return -1 - Dim size As Int = bitdata.Length / 3 - WriteString(ESC & "&") - Dim params(4) As Byte - params(0) = 3 - params(1) = charcode - params(2) = charcode - params(3) = size - WriteBytes(params) - WriteBytes(bitdata) - Return 0 -End Sub - -' The third triangle point is hacked into spare bits keeping the generated Int human readable i hex for other shapes -' The shape array contains the character shapes and characterfont is 0 for a 12*24 character andd 1 for a 9*17 character -' Returns a Byte(36) for characterfont = 0 and a Byte(27) for characterfont = 1 -' The returned array can be directly passed to DefineCustomCharacter -' To define a custom character requires specifying up to 288 data points -' This is a lot of data and in most cases it is mainly white space -' This method takes a character definition that defines only the shapes in the character that are to be printed black -' It will be easier use the outputs from CreateLine, CreateTriangle, CreateBox and CreateCircle rather then building the actual Int values -' Each shape is defined by a single Int value containing four parameters in hex format plugs some single bit flags -' Taking the representation of the Int as eight hex characters numbered from the MS end as 0x01234567 -' 0 contains the shape to draw. 0 = Line, 1 = Box, 2 = Circle, 3 = Triangle -' 1 contains a value between 0 and 0xF. This is either an X coordinate or for a circle the radius -' 2 and 3 contain a value between 0 and 0x1F. This is either a Y coordinate or for a circle the quadrants to draw -' 4 contains a value between 0 and 0xF. This is 0 for an empty shope or 1 for a filled shape -' 5 contains a value between 0 and 0xF. This is an X coordinate -' 5 and 6 contain a value between 0 and 0x1F. This is a Y coordinate -' The coordinate 0,0 is at the top left of the character -' Line -' One point of the vector is contained in the top part of the Int and the other in the bottom half -' To define a single point place its coordinates as both sr=start and end of a line -' Box -' The two X,Y coordinates specify the top left and bottom right corners of the box -' Circle -' The left X parameter is now the radius of the circle, the left Y is the quadrants to be drawn -' The right X and Y parameters are the centre of the circle' -' The quadrants to draw are bit ORed together, UpperRight = 0x1, LowerRight = 0x2, LowerLeft = 0x4, Upper Left = 0x8 -' Triangle -' The left X and Y parameters are now one point of the triangle, the right X and Y parameters another point -' The third triangle point is hacked into spare bits keeping the generated Int human readable in hex for the other shapes -' The bit allocations of a shape are as follows. f = fill as 0 or 1, s = shape as 0 to 7, xn as 0 to 15, yn as 0 to 31 -' Shape 0 = line, 1 = box, 2 = triangle, 3 = circle, 4 to 7 = unused -' fsss xxxx -yyy yyyy xxxx xxxx yyyy yyyy -' 0000 220 0000 2222 1111 2221 1111 -' x0 y2 y0 x2 x1 y2 y1 -' The shape array contains the character shapes and characterfont is 0 for a 12*24 character andd 1 for a 9*17 character -' Returns a Byte(36) for characterfont = 0 and a Byte(27) for characterfont = 1 -' The returned array can be directly passed to DefineCustomCharacter -Public Sub CreateCustomCharacter(shapes() As Int, characterfont As Int) As Byte() - Dim masks(8) As Byte - masks(0) = 0x80 - masks(1) = 0x40 - masks(2) = 0x20 - masks(3) = 0x10 - masks(4) = 0x08 - masks(5) = 0x04 - masks(6) = 0x02 - masks(7) = 0x01 - ' rather than try to catch errors whenever we access this array we Dim it to the maximum possible values of X and Y - ' then copy the top left of it to the final character definition array of the correct size - Dim points(16,32) As Byte - ' initialise the character to all white - For x = 0 To 15 - For y = 0 To 31 - points(x,y) = 0 - Next - Next - Dim size As Int = 12 - If characterfont = 1 Then size = 9 - Dim charbyes(size * 3) As Byte - For c = 0 To charbyes.Length - 1 - charbyes(c) = 0 - Next - ' set the points array from the shapes provided - For i = 0 To shapes.Length -1 - Dim fill As Int = Bit.UnsignedShiftRight(Bit.And(0x80000000, shapes(i)), 31) - Dim shape As Int = Bit.UnsignedShiftRight(Bit.And(0x70000000, shapes(i)), 28) - Dim x0 As Int = Bit.UnsignedShiftRight(Bit.And(0x0f000000, shapes(i)), 24) - Dim y0 As Int = Bit.UnsignedShiftRight(Bit.And(0x001f0000, shapes(i)), 16) - Dim x1 As Int = Bit.UnsignedShiftRight(Bit.And(0x00000f00, shapes(i)), 8) - Dim y1 As Int = Bit.And(0x0000001f, shapes(i)) - Dim x2 As Int = Bit.UnsignedShiftRight(Bit.And(0x0000f000, shapes(i)), 12) - Dim y2 As Int = Bit.UnsignedShiftRight(Bit.And(0x00e00000, shapes(i)), 18) + Bit.UnsignedShiftRight(Bit.And(0x000000e0, shapes(i)), 5) - ' The bit allocations of a shape are as follows. f = fill as 0 or 1, s = shape as 0 to 7, xn as 0 to 15, yn as 0 to 31 - ' Shape 0 = line, 1 = box, 2 = triangle, 3 = circle, 4 to 7 = unused - ' fsss xxxx -yyy yyyy xxxx xxxx yyyy yyyy - ' 0000 220 0000 2222 1111 2221 1111 - ' x0 y2 y0 x2 x1 y2 y1 - Dim logmsg As String = ": Fill=" & fill & " : Points " & x0 & "," & y0 & " " & x1 & "," & y1 & " " & x2 & "," & y2 - If shape = 3 Then - Log("Triangle " & logmsg) - PlotTriangle(x0, y0, x1, y1, x2, y2, points, fill) - else If shape = 2 Then - Log("Circle " & logmsg) - PlotCircle(x0, y0, x1, y1, points, fill) - Else If shape = 1 Then - Log("Box " & logmsg) - PlotBox(x0, y0, x1, y1, points, fill) - Else - Log("Line " & logmsg) - PlotLine(x0, y0, x1, y1, points) - End If - ' map the points array onto the character definition array - For x = 0 To size -1 ' 9 or 12 horizontal bytes - For y = 0 To 2 ' 3 vertical bytes - Dim bits As Byte = 0 - For b = 0 To 7 ' 8 vertical bits - If points(x, y*8+b) <> 0 Then - bits = Bit.Or(bits, masks(b)) - End If - Next - charbyes(x*3+y) = bits - Next - Next - Next - Return charbyes -End Sub - -' This is a higher level method that builds the Int values to pass to CreateCustomCharacter in the shapes array -' Create the value to draw a line in a custom character -' The line starts at X0,Y0 and ends at X1,Y1 -Public Sub CreateLine(x0 As Int, y0 As Int, x1 As Int, y1 As Int) As Int - Dim line As Int = 0 - line = line + Bit.ShiftLeft(Bit.And(0xf,x0), 24) - line = line + Bit.ShiftLeft(Bit.And(0x1f,y0), 16) - line = line + Bit.ShiftLeft(Bit.And(0xf,x1), 8) - line = line + Bit.And(0x1f,y1) - Return line -End Sub - -' This is a higher level method that builds the Int values to pass to CreateCustomCharacter in the shapes array -' Create the value to draw a circle in a custom character -' The circle is centred on X1,Y1 and the quadrants to draw are bit ORed together -' UpperRight = 0x1, LowerRight = 0x2, LowerLeft = 0x4, Upper Left = 0x8 -Public Sub CreateCircle(radius As Int, quadrants As Int, x1 As Int, y1 As Int, fill As Boolean) As Int - Dim circle As Int = 0x20000000 - If fill Then circle = circle + 0x80000000 - circle = circle + Bit.ShiftLeft(radius, 24) - circle = circle + Bit.ShiftLeft(quadrants, 16) - circle = circle + Bit.ShiftLeft(x1, 8) - circle = circle + y1 - Return circle -End Sub - - -' This is a higher level method that builds the Int values to pass to CreateCustomCharacter in the shapes array -' Create the value to draw a triangle in a custom character -' The triangles corners are at X0,Y0 X1,Y1 and X2,Y2 -Public Sub CreateTriangle(x0 As Int, y0 As Int, x1 As Int, y1 As Int, x2 As Int, y2 As Int, fill As Boolean) As Int - Dim triangle As Int = 0x30000000 - If fill Then triangle = triangle + 0x80000000 - triangle = triangle + Bit.ShiftLeft(Bit.And(0xf,x0), 24) - triangle = triangle + Bit.ShiftLeft(Bit.And(0x1f,y0), 16) - triangle = triangle + Bit.ShiftLeft(Bit.And(0xf,x1), 8) - triangle = triangle + Bit.And(0x1f,y1) - triangle = triangle + Bit.ShiftLeft(Bit.And(0xf,x2), 12) ' extra X - triangle = triangle + Bit.ShiftLeft(Bit.And(0x7,y2), 5) ' extra Y lsbits * 3 - triangle = triangle + Bit.ShiftLeft(Bit.And(0x18,y2), 18) ' extra Y msbits * 2 - Return triangle -End Sub - -' This is a higher level method that builds the Int values to pass to CreateCustomCharacter in the shapes array -' Create the value to draw a box in a custom character -' The box top left start is X0,Y0 and bottom right is X1,Y1 -Public Sub CreateBox(x0 As Int, y0 As Int, x1 As Int, y1 As Int, fill As Boolean) As Int - Dim box As Int = 0x10000000 - If fill Then box = box + 0x80000000 - box = box + Bit.ShiftLeft(Bit.And(0xf,x0), 24) - box = box + Bit.ShiftLeft(Bit.And(0x1f,y0), 16) - box = box + Bit.ShiftLeft(Bit.And(0xf,x1), 8) - box = box + Bit.And(0x1f,y1) - Return box -End Sub - -'----------------------------------------- -' Private custom character drawing methods -'----------------------------------------- - -Private Sub PlotTriangle(x0 As Int, y0 As Int, x1 As Int, y1 As Int, x2 As Int, y2 As Int, points(,) As Byte, Fill As Int) - ' This is a pretty crude algorithm, but it is simple, works and it isn't invoked often - PlotLine(x0, y0, x1, y1, points) - PlotLine(x1, y1, x2, y2, points) - PlotLine(x2, y2, x0, y0, points) - If Fill > 0 Then - FillTriangle(x0, y0, x1, y1, x2, y2, points) - End If -End Sub - -Private Sub FillTriangle(x0 As Int, y0 As Int, x1 As Int, y1 As Int, x2 As Int, y2 As Int, points(,) As Byte) - ' first sort the three vertices by y-coordinate ascending so v0 Is the topmost vertice */ - Dim tx, ty As Int - If y0 > y1 Then - tx = x0 : ty = y0 - x0 = x1 : y0 = y1 - x1 = tx : y1 = ty - End If - If y0 > y2 Then - tx = x0 : ty = y0 - x0 = x2 : y0 = y2 - x2 = tx : y2 = ty - End If - If y1 > y2 Then - tx = x1 : ty = y1 - x1 = x2 : y1 = y2 - x2 = tx : y2 = ty - End If - - Dim dx0, dx1, dx2 As Double - Dim x3, x4, y3, y4 As Double - Dim inc As Int - - If y1 - y0 > 0 Then dx0=(x1-x0)/(y1-y0) Else dx0=0 - If y2 - y0 > 0 Then dx1=(x2-x0)/(y2-y0) Else dx1=0 - If y2 - y1 > 0 Then dx2=(x2-x1)/(y2-y1) Else dx2=0 - x3 = x0 : x4 = x0 - y3 = y0 : y4 = y0 - If dx0 > dx1 Then - While - Do While y3 <= y1 - If x3 > x4 Then inc = -1 Else inc = 1 - For x = x3 To x4 Step inc - points(x, y3) = 1 - Next - y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4 = x4 + dx0 - Loop - x4=x1 - y4=y1 - Do While y3 <= y2 - If x3 > x4 Then inc = -1 Else inc = 1 - For x = x3 To x4 Step inc - points(x ,y3) = 1 - Next - y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4 = x4 + dx2 - Loop - Else - While - Do While y3 <= y1 - If x3 > x4 Then inc = -1 Else inc = 1 - For x = x3 To x4 Step inc - points(x, y3) = 1 - Next - y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4 = x4 +dx1 - Loop - x3=x1 - y3=y1 - Do While y3<=y2 - If x3 > x4 Then inc = -1 Else inc = 1 - For x = x3 To x4 Step inc - points(x, y3) = 1 - Next - y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4 = x4 + dx1 - Loop - End If -End Sub - -Private Sub PlotBox(x0 As Int, y0 As Int, x1 As Int, y1 As Int, points(,) As Byte, Fill As Int) - ' This is a pretty crude algorithm, but it is simple, works and itsn't invoked often - PlotLine(x0, y0, x0, y1, points) - PlotLine(x0, y0, x1, y0, points) - PlotLine(x1, y0, x1, y1, points) - PlotLine(x0, y1, x1, y1, points) - If Fill > 0 Then - For x = x0 To x1 - PlotLine(x, y0, x, y1, points) - Next - End If -End Sub - - -Private Sub PlotCircle(radius As Int, quadrants As Int, x1 As Int, y1 As Int, points(,) As Byte, fill As Int) - ' This is a pretty crude algorithm, but it is simple, works and itsn't invoked often - Dim mask As Int = 1 - For q = 3 To 0 Step -1 - If Bit.And(quadrants, mask) <> 0 Then - For i = q*90 To q*90+90 Step 1 - Dim x,y As Double - x = x1 - SinD(i)*radius - y = y1 - CosD(i)*radius - If fill > 0 Then - PlotLine(x1, y1, x, y, points) - Else - points(Round(x), Round(y)) = 1 - End If - Next - End If - mask = Bit.ShiftLeft(mask, 1) - Next -End Sub - -' Bresenham's line algorithm - see Wikipedia -Private Sub PlotLine(x0 As Int, y0 As Int, x1 As Int, y1 As Int, points(,) As Byte ) - If Abs(y1 - y0) < Abs(x1 - x0) Then - If x0 > x1 Then - PlotLineLow(x1, y1, x0, y0, points) - Else - PlotLineLow(x0, y0, x1, y1, points) - End If - Else - If y0 > y1 Then - PlotLineHigh(x1, y1, x0, y0, points) - Else - PlotLineHigh(x0, y0, x1, y1, points) - End If - End If -End Sub - -Private Sub PlotLineHigh(x0 As Int, y0 As Int, x1 As Int, y1 As Int, points(,) As Byte ) - Dim dx As Int = x1 - x0 - Dim dy As Int = y1 - y0 - Dim xi As Int = 1 - If dx < 0 Then - xi = -1 - dx = -dx - End If - Dim D As Int = 2*dx - dy - Dim x As Int = x0 - For y = y0 To y1 - points(x,y) = 1 - If D > 0 Then - x = x + xi - D = D - 2*dy - End If - D = D + 2*dx - Next -End Sub - -Private Sub PlotLineLow(x0 As Int, y0 As Int, x1 As Int,y1 As Int, points(,) As Byte ) - Dim dx As Int = x1 - x0 - Dim dy As Int = y1 - y0 - Dim yi As Int = 1 - If dy < 0 Then - yi = -1 - dy = -dy - End If - Dim D As Int = 2*dy - dx - Dim y As Int = y0 - For x = x0 To x1 - points(x,y) = 1 - If D > 0 Then - y = y + yi - D = D - 2*dx - End If - D = D + 2*dy - Next -End Sub - - -'------------------- -' Image commands -'------------------- -' There are two different image printing options with different pixel formats. -' PrintImage prints an entire image at once with a maximum size of 576x512 -' PrintImage2 prints a slice of an image with a height of 8 or 24 and a maximum width of 576 -' One or other may look better on your particular printer - -' Printer support method for pre-processing images to print -' Convert the bitmap supplied to an array of pixel values representing the luminance value of each original pixel -Sub ImageToBWIMage(bmp As Bitmap) As AnImage - Dim BC As BitmapCreator 'ignore - Dim W As Int = bmp.Width - Dim H As Int = bmp.Height - Dim pixels(W * H) As Byte - - For y = 0 To H - 1 - For x = 0 To W - 1 - Dim j As Int = bmp.GetPixel(x, y) - ' convert color to approximate luminance value - Dim col As ARGBColor - BC.ColorToARGB(j, col ) - Dim lum As Int = col.r * 0.2 + col.b*0.1 + col.g*0.7 - If lum> 255 Then lum = 255 - ' save the pixel luminance - pixels(y*W + x) = lum - Next - Next - Dim ret As AnImage - ret.Width = bmp.Width - ret.Height = bmp.Height - ret.Data = pixels - Return ret -End Sub - -' Printer support method for pre-processing images to print -' Convert the array of luminance values to an array of 0s and 1s according to the threshold value -Sub ThresholdImage(img As AnImage, threshold As Int) As AnImage 'ignore - Dim pixels(img.Data.Length) As Byte - For i = 0 To pixels.Length - 1 - Dim lum As Int = Bit.And(img.Data(i), 0xff) ' bytes are signed values - If lum < threshold Then - lum = 1 - Else - lum = 0 - End If - pixels(i) = lum - Next - Dim ret As AnImage - ret.Width = img.Width - ret.Height = img.Height - ret.Data = pixels - Return ret -End Sub - -' Printer support method for pre-processing images to print -' Convert the array of luminance values to a dithered array of 0s and 1s according to the threshold value -' The dithering algorithm is the simplest one-dimensional error diffusion algorithm -' Normally threshold should be 128 but some images may look better with a little more or less. -' This algorithm tends to produce vertical lines. DitherImage2D will probably look far better -Sub DitherImage1D(img As AnImage, threshold As Int) As AnImage 'ignore - Dim pixels(img.Data.Length) As Byte - Dim error As Int - For y = 0 To img.Height - 1 - error = 0 ' reset on each new line - For x = 0 To img.Width - 1 - Dim lum As Int = Bit.And(img.Data(y*img.Width + x), 0xff) ' bytes are signed values - lum = lum + error - If lum < threshold Then - error = lum - lum = 1 - Else - error = lum - 255 - lum = 0 - End If - pixels(y*img.Width + x) = lum - Next - Next - Dim ret As AnImage - ret.Width = img.Width - ret.Height = img.Height - ret.Data = pixels - Return ret -End Sub - - -' Printer support method for pre-processing images to print -' Convert the array of luminance values to a dithered array of 0s and 1s according to the threshold value -' The dithering algorithm is the simplest two-dimensional error diffusion algorithm -' Normally threshold should be 128 but some images may look better with a little more or less. -' Anything more sophisticated might be overkill considering the image quality of most thermal printers -Sub DitherImage2D(img As AnImage, threshold As Int) As AnImage - Dim pixels(img.Data.Length) As Byte - Dim xerror As Int - Dim yerrors(img.Width) As Int - For i = 0 To yerrors.Length -1 - yerrors(0) = 0 - Next - For y = 0 To img.Height - 1 - xerror = 0 ' reset on each new line - For x = 0 To img.Width - 1 - Dim lum As Int = Bit.And(img.Data(y*img.Width + x), 0xff) ' bytes are signed values - lum = lum + xerror + yerrors(x) - If lum < threshold Then - xerror = lum/2 - yerrors(x) = xerror - lum = 1 - Else - xerror = (lum - 255)/2 - yerrors(x) = xerror - lum = 0 - End If - pixels(y*img.Width + x) = lum - Next - Next - Dim ret As AnImage - ret.Width = img.Width - ret.Height = img.Height - ret.Data = pixels - Return ret -End Sub - - -' GS v0 printing -'--------------- - -' Prints the given image at the specified height and width using the "GS v" command -' Image data is supplied as bytes each containing 8 bits of horizontal image data -' The top left of the image is Byte(0) and the bottom right is Byte(width*height-1) -' MSB of the byte is the leftmost image pixel, the LSB is the rightmost -' Maximum width is 72 bytes (576 bits), Maximum height is 512 bytes -' The printed pixels are square -' Returns status 0 : OK, -1 : too wide, -2 : too high, -3 : array too small -' The printer can take a long time to process the data and start printing -Public Sub PrintImage(img As AnImage) As Int - ' max width = 72 ' 72mm/576 bits wide - ' max height = 512 ' 64mm/512 bits high - If img.width > 72 Then Return -1 - If img.height > 512 Then Return -2 - If img.data.Length < img.width * img.height Then Return -3 - Dim xh As Int = img.width / 256 - Dim xl As Int = img.width - xh * 256 - Dim yh As Int = img.height / 256 - Dim yl As Int = img.height - yh * 256 - Dim params(5) As Byte - params(0) = 0 ' - params(1) = xl - params(2) = xh - params(3) = yl - params(4) = yh - WriteString(GS & "v0") - WriteBytes(params) - WriteBytes(img.data) - WriteString(CRLF) - Return 0 -End Sub - -' Printer support method for pre-processing images to print by PrintImage -' Takes an array of image pixels and packs it for use with PrintImage -' Each byte in the imagedata array is a single pixel valued zero or non-zero for white and black -' The returned array is 8 x smaller and packs 8 horizontal black or white pixels into each byte -' If the horizontal size of the image is not a multiple of 8 it will be truncated so that it is. -Public Sub PackImage(imagedata As AnImage) As AnImage - Dim xbytes As Int = imagedata.width/8 - Dim pixels(xbytes * imagedata.height) As Byte - Dim masks(8) As Byte - masks(0) = 0x80 - masks(1) = 0x40 - masks(2) = 0x20 - masks(3) = 0x10 - masks(4) = 0x08 - masks(5) = 0x04 - masks(6) = 0x02 - masks(7) = 0x01 - Dim index As Int = 0 - For y = 0 To imagedata.Height - 1 - For x = 0 To xbytes - 1 - Dim xbyte As Byte = 0 - For b = 0 To 7 - ' get a pixel - Dim pix As Byte = imagedata.Data(index) - If pix <> 0 Then - xbyte = xbyte + masks(b) - End If - index = index + 1 - Next - pixels(y*xbytes + x) = xbyte - Next - Next - Dim ret As AnImage - ret.Width = xbytes - ret.Height = imagedata.Height - ret.Data = pixels - Return ret -End Sub - - -' ESC * printing -'--------------- - -' Prints the given image slice at the specified height and width using the "ESC *" command -' Image data is supplied as bytes each containing 8 bits of vertical image data -' Pixels are not square, the width:height ratio varies with density and line height -' Returns status 0 = OK, -1 = too wide, -2 = too high, -3 = wrong array length -' Line spacing needs to be set to 0 if printing consecutive slices -' The printed pixels are not square, the ratio varies with the highdensity and dots24 parameter settings -' The highdensity parameter chooses high or low horizontal bit density when printed -' The dots24 parameter chooses 8 or 24 bit data slice height when printed -' Not(highdensity) -' Maximum width is 288 bits. Horizontal dpi is approximately 90 -' MSB of each byte is the highest image pixel, the LSB is the lowest -' highdensity -' Maximum width is 576 bits. Horizontal dpi is approximately 180 -' Not(dots24) -' Vertical printed height is 8 bits at approximately 60dpi -' One byte in the data Array represents one vertical line when printed -' Array size is the same as the width -' MSB of each byte is the highest image pixel, the LSB is the lowest -' dots24 -' Vertical printed height is 24 bits at approximately 180dpi -' Three consecutive bytes in the data array represent one vertical 24bit line when printed -' Array size is 3 times the width -' Byte(n+0) is the highest, byte (n+2) us the lowest -' MSB of each byte is the highest image pixel, the LSB is the lowest -Public Sub PrintImage2(width As Int, data() As Byte, highdensity As Boolean, dotds24 As Boolean) As Int - Dim d As String = Chr(0) - If Not(highdensity) And Not(dotds24 ) Then - d = Chr(0) - If width > 288 Then Return -1 - If data.Length <> width Then Return -3 - Else If highdensity And Not(dotds24) Then - d = Chr(1) - If width > 576 Then Return -1 - If data.Length <> width Then Return -3 - Else If Not(highdensity) And dotds24 Then - d = Chr(32) - If width > 288 Then Return -1 - If data.Length <> width*3 Then Return -3 - Else ' highdensity And dotds24 - d = Chr(33) - If width > 576 Then Return -1 - If data.Length <> width*3 Then Return -3 - End If - Dim xh As Int = width / 256 - Dim xl As Int = width - xh * 256 - Dim params(2) As Byte - params(0) = xl - params(1) = xh - WriteString(ESC & "*" & d) - WriteBytes(params) - WriteBytes(data) - WriteString(CRLF) - Return 0 -End Sub - -' Printer support method for pre-processing images to print by PrintImage2 -' Takes an array of image pixels and packs one slice of it for use with PrintImage2 -' Each byte in the imagedata array is a single pixel valued zero or non-zero for white and black -' The returned array packs 8 vertical black or white pixels into each byte -' If dots24 is True then the slice is 24 pixels high otherwise it is 8 pixels high -Public Sub PackImageSlice(img As AnImage, slice As Int, dots24 As Boolean) As Byte() - Dim bytes As Int = img.width - If dots24 Then - Dim pixels(bytes * 3) As Byte - Dim slicestart As Int = slice * bytes * 8 * 3 - Else - Dim pixels(bytes) As Byte - Dim slicestart As Int = slice * bytes * 8 - End If - - Dim masks(8) As Byte - masks(0) = 0x80 - masks(1) = 0x40 - masks(2) = 0x20 - masks(3) = 0x10 - masks(4) = 0x08 - masks(5) = 0x04 - masks(6) = 0x02 - masks(7) = 0x01 - ' You could compress this into a single code block but I left it as two to make it more obvious what's happening - If dots24 Then - For x = 0 To bytes - 1 - For s = 0 To 2 - Dim xbyte As Byte = 0 - For b = 0 To 7 - ' get a pixel - Dim pix As Byte = img.Data(slicestart + ((b + s*8) * bytes) + x) - If pix <> 0 Then - xbyte = xbyte + masks(b) - End If - Next - pixels(x*3+s) = xbyte - Next - Next - Else - For x = 0 To bytes - 1 - Dim xbyte As Byte = 0 - For b = 0 To 7 - ' get a pixel - Dim pix As Byte = img.Data(slicestart + (b * bytes) + x) - If pix <> 0 Then - xbyte = xbyte + masks(b) - End If - Next - pixels(x) = xbyte - Next - End If - Return pixels -End Sub - -'---------------- -'Barcode commands -'---------------- - -' Set the height of a 2D bar code as number of dots vertically, 1 to 255 -' Automatically resets to the default after printing the barcode -Public Sub setBarCodeHeight(height As Int) - WriteString(GS & "h") - Dim params(1) As Byte - params(0) = height - WriteBytes(params) -End Sub - -' Set the left inset of a 2D barcode, 0 to 255 -' This does not reset on receipt of RESET -Public Sub setBarCodeLeft(left As Int) - WriteString(GS & "x") - Dim params(1) As Byte - params(0) = left - WriteBytes(params) -End Sub - -' Set the width of each bar in a 2D barcode. width value is 2 to 6, default is 3 -' 2 = 0.250, 3 - 0.375, 4 = 0.560, 5 = 0.625, 6 = 0.75 -' Resets to default after printing the barcode -Public Sub setBarCodeWidth(width As Int) - WriteString(GS & "w") - Dim params(1) As Byte - params(0) = width - WriteBytes(params) -End Sub - -'Selects the printing position of HRI (Human Readable Interpretation) characters when printing a 2D bar code. -'0 Not printed, 1 Above the bar code, 2 Below the bar code, 3 Both above And below the bar code -' Automatically resets to the default of 0 after printing the barcode -' The docs say this can be Chr(0, 1 2 or 3) or "0" "1" "2" or "3" but the numeric characters don't work -Public Sub setHriPosn(posn As Int) - WriteString(GS & "H") - Dim params(1) As Byte - params(0) = posn - WriteBytes(params) -End Sub - -'Selects the font for HRI (Human Readable Interpretation) characters when printing a 2D bar code. -'0 Font A (12 x 24), 1 Font B (9 x 17) -' Automatically resets to the default of 0 after printing the barcode -' The docs say this can be Chr(0 or 1) or "0" or "1" but the numeric characters don't work -Public Sub setHriFont(font As Int) - WriteString(GS & "f" & Chr(font)) -End Sub - -' If given invalid data no barcode is printed, only strange characters -' CODABAR needs any of A,B,C or D at the start and end of the barcode. Some decoders may not like them anywhere else -' Bartype Code Number of characters Permitted values -' A | UPC-A | 11 or 12 characters | 0 to 9 | The 12th printed character is always the check digit -' B | UPC-E | 6 characters | 0 to 9 | The 12th printed character is always the check digit -' C | EAN13 | 12 or 13 characters | 0 to 9 | The 12th printed character is always the check digit -' D | EAN8 | 7 or 8 characters | 0 to 9 | The 8th printed character is always the check digit -' E | CODE39 | 1 or more characters | 0 to 9, A to Z, Space $ % + - . / -' F | ITF | 1 or more characters | 0 to 9 | even number of characters only -' G | CODABAR| 3 to 255 characters | 0 to 9, A to D, $ + - . / : | needs any of A,B,C or D at the start and end -' H | CODE93 | 1 to 255 characters | Same as CODE39 -' I | CODE128| 2 to 255 characters | entire 7 bit ASCII set -Public Sub WriteBarCode(bartype As String, data As String) - Dim databytes() As Byte = data.GetBytes("ASCII") - Dim dlow As Int = databytes.Length - Log("Barcode " & bartype & ", Size " & dlow & ", " & data) - WriteString(GS & "k" & bartype.ToUpperCase.CharAt(0)) - Dim params(1) As Byte - params(0) = dlow - WriteBytes(params) - WriteBytes(databytes) -End Sub - -' On my printer QR codes don't seem to be able to be decoded and on high ECs look obviously wrong :( -' size is 1 to 40, 0 is auto-size. Successive versions increase module size by 4 each side -' size = 1 is 21x21, 2 = 25x25 ... size 40 = 177x177 -' EC is error correction level, "L"(7%) or "M"(15%) or "Q"(25%) or "H"(30%) -' scale is 1 to 8, 1 is smallest, 8 is largest -Public Sub WriteQRCode(size As Int, EC As String, scale As Int, data As String) - Dim databytes() As Byte = data.GetBytes("ISO-8859-1") - Dim dhigh As Int = databytes.Length / 256 - Dim dlow As Int = databytes.Length - dhigh*256 - Log("QR Code : Size " & size & ", EC " & EC & ", Scale " & scale & ", Size " & dlow & " " & dhigh & " : Data = " & data) - Dim params(3) As Byte - params(0) = scale - params(1) = dlow - params(2) = dhigh - WriteString(ESC & "Z" & Chr(size) & EC.ToUpperCase.CharAt(0)) - WriteBytes(params) - WriteBytes(databytes) -End Sub - - -'**************** -' PRIVATE METHODS -'**************** - -'----------------------- -' Internal Serial Events -'----------------------- - -Private Sub Serial1_Connected (Success As Boolean) - If Success Then - Astream.Initialize(Serial1.InputStream, Serial1.OutputStream, "astream") - Connected = True - ConnectedError = "" - Serial1.Listen - Else - Connected = False - ConnectedError = LastException.Message - End If - If SubExists(CallBack, EventName & "_Connected") Then - CallSub2(CallBack, EventName & "_Connected", Success) - End If -End Sub - -'---------------------------- -' Internal AsyncStream Events -'---------------------------- - -Private Sub AStream_NewData (Buffer() As Byte) - If SubExists(CallBack, EventName & "_NewData") Then - CallSub2(CallBack, EventName & "_NewData", Buffer) - End If - Log("Data " & Buffer(0)) -End Sub - -Private Sub AStream_Error - If SubExists(CallBack, EventName & "_Error") Then - CallSub(CallBack, EventName & "_Error") - End If -End Sub - -Private Sub AStream_Terminated - Connected = False - If SubExists(CallBack, EventName & "_Terminated") Then - CallSub(CallBack, EventName & "_Terminated") - End If -End Sub diff --git a/B4A - Copy/Files/alcancia.png b/B4A - Copy/Files/alcancia.png deleted file mode 100644 index 5f5cd3d..0000000 Binary files a/B4A - Copy/Files/alcancia.png and /dev/null differ diff --git a/B4A - Copy/Files/alert2.png b/B4A - Copy/Files/alert2.png deleted file mode 100644 index 44d3b7e..0000000 Binary files a/B4A - Copy/Files/alert2.png and /dev/null differ diff --git a/B4A - Copy/Files/alerta.jpg b/B4A - Copy/Files/alerta.jpg deleted file mode 100644 index 5edc6ba..0000000 Binary files a/B4A - Copy/Files/alerta.jpg and /dev/null differ diff --git a/B4A - Copy/Files/alerta_amarilla.png b/B4A - Copy/Files/alerta_amarilla.png deleted file mode 100644 index 4f4beac..0000000 Binary files a/B4A - Copy/Files/alerta_amarilla.png and /dev/null differ diff --git a/B4A - Copy/Files/amarillo.png b/B4A - Copy/Files/amarillo.png deleted file mode 100644 index 44e8c49..0000000 Binary files a/B4A - Copy/Files/amarillo.png and /dev/null differ diff --git a/B4A - Copy/Files/anterior.jpg b/B4A - Copy/Files/anterior.jpg deleted file mode 100644 index 48e56e4..0000000 Binary files a/B4A - Copy/Files/anterior.jpg and /dev/null differ diff --git a/B4A - Copy/Files/buscar.bal b/B4A - Copy/Files/buscar.bal deleted file mode 100644 index d40f58f..0000000 Binary files a/B4A - Copy/Files/buscar.bal and /dev/null differ diff --git a/B4A - Copy/Files/carrito.png b/B4A - Copy/Files/carrito.png deleted file mode 100644 index 03889f6..0000000 Binary files a/B4A - Copy/Files/carrito.png and /dev/null differ diff --git a/B4A - Copy/Files/celltitle.bal b/B4A - Copy/Files/celltitle.bal deleted file mode 100644 index ecdae05..0000000 Binary files a/B4A - Copy/Files/celltitle.bal and /dev/null differ diff --git a/B4A - Copy/Files/cliente.bal b/B4A - Copy/Files/cliente.bal deleted file mode 100644 index 932e004..0000000 Binary files a/B4A - Copy/Files/cliente.bal and /dev/null differ diff --git a/B4A - Copy/Files/clientes.bal b/B4A - Copy/Files/clientes.bal deleted file mode 100644 index 6628403..0000000 Binary files a/B4A - Copy/Files/clientes.bal and /dev/null differ diff --git a/B4A - Copy/Files/detalle_promo.bal b/B4A - Copy/Files/detalle_promo.bal deleted file mode 100644 index c8d6b01..0000000 Binary files a/B4A - Copy/Files/detalle_promo.bal and /dev/null differ diff --git a/B4A - Copy/Files/durakelo.png b/B4A - Copy/Files/durakelo.png deleted file mode 100644 index e1c956c..0000000 Binary files a/B4A - Copy/Files/durakelo.png and /dev/null differ diff --git a/B4A - Copy/Files/durakelo1.png b/B4A - Copy/Files/durakelo1.png deleted file mode 100644 index 00cb434..0000000 Binary files a/B4A - Copy/Files/durakelo1.png and /dev/null differ diff --git a/B4A - Copy/Files/durakelo_192x192.png b/B4A - Copy/Files/durakelo_192x192.png deleted file mode 100644 index c1e7bb7..0000000 Binary files a/B4A - Copy/Files/durakelo_192x192.png and /dev/null differ diff --git a/B4A - Copy/Files/engrane.jpg b/B4A - Copy/Files/engrane.jpg deleted file mode 100644 index 01159de..0000000 Binary files a/B4A - Copy/Files/engrane.jpg and /dev/null differ diff --git a/B4A - Copy/Files/engrane3.png b/B4A - Copy/Files/engrane3.png deleted file mode 100644 index 2bd5fa0..0000000 Binary files a/B4A - Copy/Files/engrane3.png and /dev/null differ diff --git a/B4A - Copy/Files/espera.gif b/B4A - Copy/Files/espera.gif deleted file mode 100644 index 605679f..0000000 Binary files a/B4A - Copy/Files/espera.gif and /dev/null differ diff --git a/B4A - Copy/Files/fondo_kmt.jpg b/B4A - Copy/Files/fondo_kmt.jpg deleted file mode 100644 index 4055faf..0000000 Binary files a/B4A - Copy/Files/fondo_kmt.jpg and /dev/null differ diff --git a/B4A - Copy/Files/foto.bal b/B4A - Copy/Files/foto.bal deleted file mode 100644 index 3476c4d..0000000 Binary files a/B4A - Copy/Files/foto.bal and /dev/null differ diff --git a/B4A - Copy/Files/guardagestion.bal b/B4A - Copy/Files/guardagestion.bal deleted file mode 100644 index 6272b4e..0000000 Binary files a/B4A - Copy/Files/guardagestion.bal and /dev/null differ diff --git a/B4A - Copy/Files/guna_viejo.png b/B4A - Copy/Files/guna_viejo.png deleted file mode 100644 index d937027..0000000 Binary files a/B4A - Copy/Files/guna_viejo.png and /dev/null differ diff --git a/B4A - Copy/Files/historico.bal b/B4A - Copy/Files/historico.bal deleted file mode 100644 index f8786e7..0000000 Binary files a/B4A - Copy/Files/historico.bal and /dev/null differ diff --git a/B4A - Copy/Files/infonavit1.jpg b/B4A - Copy/Files/infonavit1.jpg deleted file mode 100644 index b8cce4c..0000000 Binary files a/B4A - Copy/Files/infonavit1.jpg and /dev/null differ diff --git a/B4A - Copy/Files/itembuttonblue.png b/B4A - Copy/Files/itembuttonblue.png deleted file mode 100644 index af4dc0b..0000000 Binary files a/B4A - Copy/Files/itembuttonblue.png and /dev/null differ diff --git a/B4A - Copy/Files/k.png b/B4A - Copy/Files/k.png deleted file mode 100644 index 065a070..0000000 Binary files a/B4A - Copy/Files/k.png and /dev/null differ diff --git a/B4A - Copy/Files/kelloggs.png b/B4A - Copy/Files/kelloggs.png deleted file mode 100644 index 4debf15..0000000 Binary files a/B4A - Copy/Files/kelloggs.png and /dev/null differ diff --git a/B4A - Copy/Files/keymon_logo.png b/B4A - Copy/Files/keymon_logo.png deleted file mode 100644 index 945e546..0000000 Binary files a/B4A - Copy/Files/keymon_logo.png and /dev/null differ diff --git a/B4A - Copy/Files/kmt.db b/B4A - Copy/Files/kmt.db deleted file mode 100644 index de4ec5a..0000000 Binary files a/B4A - Copy/Files/kmt.db and /dev/null differ diff --git a/B4A - Copy/Files/login.bal b/B4A - Copy/Files/login.bal deleted file mode 100644 index 57df977..0000000 Binary files a/B4A - Copy/Files/login.bal and /dev/null differ diff --git a/B4A - Copy/Files/logo sanfer.jpg b/B4A - Copy/Files/logo sanfer.jpg deleted file mode 100644 index 791fe4f..0000000 Binary files a/B4A - Copy/Files/logo sanfer.jpg and /dev/null differ diff --git a/B4A - Copy/Files/logo_exitus1.jpg b/B4A - Copy/Files/logo_exitus1.jpg deleted file mode 100644 index b8cce4c..0000000 Binary files a/B4A - Copy/Files/logo_exitus1.jpg and /dev/null differ diff --git a/B4A - Copy/Files/mainpage.bal b/B4A - Copy/Files/mainpage.bal deleted file mode 100644 index acba0d3..0000000 Binary files a/B4A - Copy/Files/mainpage.bal and /dev/null differ diff --git a/B4A - Copy/Files/malo.jpg b/B4A - Copy/Files/malo.jpg deleted file mode 100644 index bbf3c87..0000000 Binary files a/B4A - Copy/Files/malo.jpg and /dev/null differ diff --git a/B4A - Copy/Files/mapa.bal b/B4A - Copy/Files/mapa.bal deleted file mode 100644 index 7ed1bb4..0000000 Binary files a/B4A - Copy/Files/mapa.bal and /dev/null differ diff --git a/B4A - Copy/Files/mapa_rutas.bal b/B4A - Copy/Files/mapa_rutas.bal deleted file mode 100644 index da1d154..0000000 Binary files a/B4A - Copy/Files/mapa_rutas.bal and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-0.png b/B4A - Copy/Files/marker-azul-0.png deleted file mode 100644 index 17a8f6b..0000000 Binary files a/B4A - Copy/Files/marker-azul-0.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-1.png b/B4A - Copy/Files/marker-azul-1.png deleted file mode 100644 index 899d8e1..0000000 Binary files a/B4A - Copy/Files/marker-azul-1.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-10.png b/B4A - Copy/Files/marker-azul-10.png deleted file mode 100644 index ec613c7..0000000 Binary files a/B4A - Copy/Files/marker-azul-10.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-100.png b/B4A - Copy/Files/marker-azul-100.png deleted file mode 100644 index 45793a2..0000000 Binary files a/B4A - Copy/Files/marker-azul-100.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-11.png b/B4A - Copy/Files/marker-azul-11.png deleted file mode 100644 index 473dfd2..0000000 Binary files a/B4A - Copy/Files/marker-azul-11.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-12.png b/B4A - Copy/Files/marker-azul-12.png deleted file mode 100644 index 92aa8f5..0000000 Binary files a/B4A - Copy/Files/marker-azul-12.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-13.png b/B4A - Copy/Files/marker-azul-13.png deleted file mode 100644 index af75744..0000000 Binary files a/B4A - Copy/Files/marker-azul-13.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-14.png b/B4A - Copy/Files/marker-azul-14.png deleted file mode 100644 index d477221..0000000 Binary files a/B4A - Copy/Files/marker-azul-14.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-15.png b/B4A - Copy/Files/marker-azul-15.png deleted file mode 100644 index 97d8538..0000000 Binary files a/B4A - Copy/Files/marker-azul-15.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-16.png b/B4A - Copy/Files/marker-azul-16.png deleted file mode 100644 index e8a9951..0000000 Binary files a/B4A - Copy/Files/marker-azul-16.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-17.png b/B4A - Copy/Files/marker-azul-17.png deleted file mode 100644 index b6d0538..0000000 Binary files a/B4A - Copy/Files/marker-azul-17.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-18.png b/B4A - Copy/Files/marker-azul-18.png deleted file mode 100644 index 068a465..0000000 Binary files a/B4A - Copy/Files/marker-azul-18.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-19.png b/B4A - Copy/Files/marker-azul-19.png deleted file mode 100644 index d9da3c9..0000000 Binary files a/B4A - Copy/Files/marker-azul-19.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-2.png b/B4A - Copy/Files/marker-azul-2.png deleted file mode 100644 index 0442732..0000000 Binary files a/B4A - Copy/Files/marker-azul-2.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-20.png b/B4A - Copy/Files/marker-azul-20.png deleted file mode 100644 index 5eaae1a..0000000 Binary files a/B4A - Copy/Files/marker-azul-20.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-21.png b/B4A - Copy/Files/marker-azul-21.png deleted file mode 100644 index 6461085..0000000 Binary files a/B4A - Copy/Files/marker-azul-21.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-22.png b/B4A - Copy/Files/marker-azul-22.png deleted file mode 100644 index 16fe14b..0000000 Binary files a/B4A - Copy/Files/marker-azul-22.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-23.png b/B4A - Copy/Files/marker-azul-23.png deleted file mode 100644 index 6006f4d..0000000 Binary files a/B4A - Copy/Files/marker-azul-23.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-24.png b/B4A - Copy/Files/marker-azul-24.png deleted file mode 100644 index b747dcb..0000000 Binary files a/B4A - Copy/Files/marker-azul-24.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-25.png b/B4A - Copy/Files/marker-azul-25.png deleted file mode 100644 index 8b7f0fc..0000000 Binary files a/B4A - Copy/Files/marker-azul-25.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-26.png b/B4A - Copy/Files/marker-azul-26.png deleted file mode 100644 index 08de106..0000000 Binary files a/B4A - Copy/Files/marker-azul-26.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-27.png b/B4A - Copy/Files/marker-azul-27.png deleted file mode 100644 index f3b4058..0000000 Binary files a/B4A - Copy/Files/marker-azul-27.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-28.png b/B4A - Copy/Files/marker-azul-28.png deleted file mode 100644 index 30eb4e4..0000000 Binary files a/B4A - Copy/Files/marker-azul-28.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-29.png b/B4A - Copy/Files/marker-azul-29.png deleted file mode 100644 index 66bc0c1..0000000 Binary files a/B4A - Copy/Files/marker-azul-29.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-3.png b/B4A - Copy/Files/marker-azul-3.png deleted file mode 100644 index 0de2d16..0000000 Binary files a/B4A - Copy/Files/marker-azul-3.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-30.png b/B4A - Copy/Files/marker-azul-30.png deleted file mode 100644 index 613f60d..0000000 Binary files a/B4A - Copy/Files/marker-azul-30.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-31.png b/B4A - Copy/Files/marker-azul-31.png deleted file mode 100644 index 1282d99..0000000 Binary files a/B4A - Copy/Files/marker-azul-31.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-32.png b/B4A - Copy/Files/marker-azul-32.png deleted file mode 100644 index eb87a1d..0000000 Binary files a/B4A - Copy/Files/marker-azul-32.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-33.png b/B4A - Copy/Files/marker-azul-33.png deleted file mode 100644 index 0da4e53..0000000 Binary files a/B4A - Copy/Files/marker-azul-33.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-34.png b/B4A - Copy/Files/marker-azul-34.png deleted file mode 100644 index 9c398e8..0000000 Binary files a/B4A - Copy/Files/marker-azul-34.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-35.png b/B4A - Copy/Files/marker-azul-35.png deleted file mode 100644 index ef09cd8..0000000 Binary files a/B4A - Copy/Files/marker-azul-35.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-36.png b/B4A - Copy/Files/marker-azul-36.png deleted file mode 100644 index f2819af..0000000 Binary files a/B4A - Copy/Files/marker-azul-36.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-37.png b/B4A - Copy/Files/marker-azul-37.png deleted file mode 100644 index 856fce2..0000000 Binary files a/B4A - Copy/Files/marker-azul-37.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-38.png b/B4A - Copy/Files/marker-azul-38.png deleted file mode 100644 index 016bd9f..0000000 Binary files a/B4A - Copy/Files/marker-azul-38.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-39.png b/B4A - Copy/Files/marker-azul-39.png deleted file mode 100644 index a73f734..0000000 Binary files a/B4A - Copy/Files/marker-azul-39.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-4.png b/B4A - Copy/Files/marker-azul-4.png deleted file mode 100644 index 26be4c1..0000000 Binary files a/B4A - Copy/Files/marker-azul-4.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-40.png b/B4A - Copy/Files/marker-azul-40.png deleted file mode 100644 index 33c5d5f..0000000 Binary files a/B4A - Copy/Files/marker-azul-40.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-41.png b/B4A - Copy/Files/marker-azul-41.png deleted file mode 100644 index 09fd1d0..0000000 Binary files a/B4A - Copy/Files/marker-azul-41.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-42.png b/B4A - Copy/Files/marker-azul-42.png deleted file mode 100644 index 09f032f..0000000 Binary files a/B4A - Copy/Files/marker-azul-42.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-43.png b/B4A - Copy/Files/marker-azul-43.png deleted file mode 100644 index 55ee249..0000000 Binary files a/B4A - Copy/Files/marker-azul-43.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-44.png b/B4A - Copy/Files/marker-azul-44.png deleted file mode 100644 index acde8e4..0000000 Binary files a/B4A - Copy/Files/marker-azul-44.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-45.png b/B4A - Copy/Files/marker-azul-45.png deleted file mode 100644 index e646d8e..0000000 Binary files a/B4A - Copy/Files/marker-azul-45.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-46.png b/B4A - Copy/Files/marker-azul-46.png deleted file mode 100644 index dd25e3b..0000000 Binary files a/B4A - Copy/Files/marker-azul-46.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-47.png b/B4A - Copy/Files/marker-azul-47.png deleted file mode 100644 index 77fd47c..0000000 Binary files a/B4A - Copy/Files/marker-azul-47.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-48.png b/B4A - Copy/Files/marker-azul-48.png deleted file mode 100644 index 40c0bbc..0000000 Binary files a/B4A - Copy/Files/marker-azul-48.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-49.png b/B4A - Copy/Files/marker-azul-49.png deleted file mode 100644 index 49a852a..0000000 Binary files a/B4A - Copy/Files/marker-azul-49.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-5.png b/B4A - Copy/Files/marker-azul-5.png deleted file mode 100644 index bf12336..0000000 Binary files a/B4A - Copy/Files/marker-azul-5.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-50.png b/B4A - Copy/Files/marker-azul-50.png deleted file mode 100644 index f67e274..0000000 Binary files a/B4A - Copy/Files/marker-azul-50.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-51.png b/B4A - Copy/Files/marker-azul-51.png deleted file mode 100644 index b9be7b6..0000000 Binary files a/B4A - Copy/Files/marker-azul-51.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-52.png b/B4A - Copy/Files/marker-azul-52.png deleted file mode 100644 index 1115bd0..0000000 Binary files a/B4A - Copy/Files/marker-azul-52.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-53.png b/B4A - Copy/Files/marker-azul-53.png deleted file mode 100644 index b0ccc4d..0000000 Binary files a/B4A - Copy/Files/marker-azul-53.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-54.png b/B4A - Copy/Files/marker-azul-54.png deleted file mode 100644 index 5b4c8cb..0000000 Binary files a/B4A - Copy/Files/marker-azul-54.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-55.png b/B4A - Copy/Files/marker-azul-55.png deleted file mode 100644 index 1499701..0000000 Binary files a/B4A - Copy/Files/marker-azul-55.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-56.png b/B4A - Copy/Files/marker-azul-56.png deleted file mode 100644 index 85b27ba..0000000 Binary files a/B4A - Copy/Files/marker-azul-56.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-57.png b/B4A - Copy/Files/marker-azul-57.png deleted file mode 100644 index bb71e82..0000000 Binary files a/B4A - Copy/Files/marker-azul-57.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-58.png b/B4A - Copy/Files/marker-azul-58.png deleted file mode 100644 index f593e65..0000000 Binary files a/B4A - Copy/Files/marker-azul-58.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-59.png b/B4A - Copy/Files/marker-azul-59.png deleted file mode 100644 index 0f7d449..0000000 Binary files a/B4A - Copy/Files/marker-azul-59.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-6.png b/B4A - Copy/Files/marker-azul-6.png deleted file mode 100644 index 38021e6..0000000 Binary files a/B4A - Copy/Files/marker-azul-6.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-60.png b/B4A - Copy/Files/marker-azul-60.png deleted file mode 100644 index cf5d8df..0000000 Binary files a/B4A - Copy/Files/marker-azul-60.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-61.png b/B4A - Copy/Files/marker-azul-61.png deleted file mode 100644 index e0e58c4..0000000 Binary files a/B4A - Copy/Files/marker-azul-61.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-62.png b/B4A - Copy/Files/marker-azul-62.png deleted file mode 100644 index 4a53f2f..0000000 Binary files a/B4A - Copy/Files/marker-azul-62.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-63.png b/B4A - Copy/Files/marker-azul-63.png deleted file mode 100644 index f679f01..0000000 Binary files a/B4A - Copy/Files/marker-azul-63.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-64.png b/B4A - Copy/Files/marker-azul-64.png deleted file mode 100644 index ebe5a9e..0000000 Binary files a/B4A - Copy/Files/marker-azul-64.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-65.png b/B4A - Copy/Files/marker-azul-65.png deleted file mode 100644 index be9a15c..0000000 Binary files a/B4A - Copy/Files/marker-azul-65.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-66.png b/B4A - Copy/Files/marker-azul-66.png deleted file mode 100644 index 50f342b..0000000 Binary files a/B4A - Copy/Files/marker-azul-66.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-67.png b/B4A - Copy/Files/marker-azul-67.png deleted file mode 100644 index 8aa412a..0000000 Binary files a/B4A - Copy/Files/marker-azul-67.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-68.png b/B4A - Copy/Files/marker-azul-68.png deleted file mode 100644 index 09c887b..0000000 Binary files a/B4A - Copy/Files/marker-azul-68.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-69.png b/B4A - Copy/Files/marker-azul-69.png deleted file mode 100644 index ed2e8a7..0000000 Binary files a/B4A - Copy/Files/marker-azul-69.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-7.png b/B4A - Copy/Files/marker-azul-7.png deleted file mode 100644 index 8413c29..0000000 Binary files a/B4A - Copy/Files/marker-azul-7.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-70.png b/B4A - Copy/Files/marker-azul-70.png deleted file mode 100644 index 0c1c482..0000000 Binary files a/B4A - Copy/Files/marker-azul-70.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-71.png b/B4A - Copy/Files/marker-azul-71.png deleted file mode 100644 index 905b19e..0000000 Binary files a/B4A - Copy/Files/marker-azul-71.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-72.png b/B4A - Copy/Files/marker-azul-72.png deleted file mode 100644 index cfb4098..0000000 Binary files a/B4A - Copy/Files/marker-azul-72.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-73.png b/B4A - Copy/Files/marker-azul-73.png deleted file mode 100644 index 511f0e7..0000000 Binary files a/B4A - Copy/Files/marker-azul-73.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-74.png b/B4A - Copy/Files/marker-azul-74.png deleted file mode 100644 index 02bd35e..0000000 Binary files a/B4A - Copy/Files/marker-azul-74.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-75.png b/B4A - Copy/Files/marker-azul-75.png deleted file mode 100644 index 01493a0..0000000 Binary files a/B4A - Copy/Files/marker-azul-75.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-76.png b/B4A - Copy/Files/marker-azul-76.png deleted file mode 100644 index 0d5aa06..0000000 Binary files a/B4A - Copy/Files/marker-azul-76.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-77.png b/B4A - Copy/Files/marker-azul-77.png deleted file mode 100644 index a3f9457..0000000 Binary files a/B4A - Copy/Files/marker-azul-77.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-78.png b/B4A - Copy/Files/marker-azul-78.png deleted file mode 100644 index e01d1da..0000000 Binary files a/B4A - Copy/Files/marker-azul-78.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-79.png b/B4A - Copy/Files/marker-azul-79.png deleted file mode 100644 index 438248d..0000000 Binary files a/B4A - Copy/Files/marker-azul-79.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-8.png b/B4A - Copy/Files/marker-azul-8.png deleted file mode 100644 index c4afaa5..0000000 Binary files a/B4A - Copy/Files/marker-azul-8.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-80.png b/B4A - Copy/Files/marker-azul-80.png deleted file mode 100644 index 438406c..0000000 Binary files a/B4A - Copy/Files/marker-azul-80.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-81.png b/B4A - Copy/Files/marker-azul-81.png deleted file mode 100644 index ba7b5a8..0000000 Binary files a/B4A - Copy/Files/marker-azul-81.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-82.png b/B4A - Copy/Files/marker-azul-82.png deleted file mode 100644 index 6d4471b..0000000 Binary files a/B4A - Copy/Files/marker-azul-82.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-83.png b/B4A - Copy/Files/marker-azul-83.png deleted file mode 100644 index 0adbcf0..0000000 Binary files a/B4A - Copy/Files/marker-azul-83.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-84.png b/B4A - Copy/Files/marker-azul-84.png deleted file mode 100644 index 181af1f..0000000 Binary files a/B4A - Copy/Files/marker-azul-84.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-85.png b/B4A - Copy/Files/marker-azul-85.png deleted file mode 100644 index 1a7a81a..0000000 Binary files a/B4A - Copy/Files/marker-azul-85.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-86.png b/B4A - Copy/Files/marker-azul-86.png deleted file mode 100644 index 6a8ed41..0000000 Binary files a/B4A - Copy/Files/marker-azul-86.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-87.png b/B4A - Copy/Files/marker-azul-87.png deleted file mode 100644 index 5833b00..0000000 Binary files a/B4A - Copy/Files/marker-azul-87.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-88.png b/B4A - Copy/Files/marker-azul-88.png deleted file mode 100644 index 9726f25..0000000 Binary files a/B4A - Copy/Files/marker-azul-88.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-89.png b/B4A - Copy/Files/marker-azul-89.png deleted file mode 100644 index 98a88f8..0000000 Binary files a/B4A - Copy/Files/marker-azul-89.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-9.png b/B4A - Copy/Files/marker-azul-9.png deleted file mode 100644 index 6db0a59..0000000 Binary files a/B4A - Copy/Files/marker-azul-9.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-90.png b/B4A - Copy/Files/marker-azul-90.png deleted file mode 100644 index 83278bd..0000000 Binary files a/B4A - Copy/Files/marker-azul-90.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-91.png b/B4A - Copy/Files/marker-azul-91.png deleted file mode 100644 index 8765559..0000000 Binary files a/B4A - Copy/Files/marker-azul-91.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-92.png b/B4A - Copy/Files/marker-azul-92.png deleted file mode 100644 index b5838e5..0000000 Binary files a/B4A - Copy/Files/marker-azul-92.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-93.png b/B4A - Copy/Files/marker-azul-93.png deleted file mode 100644 index 6d4f390..0000000 Binary files a/B4A - Copy/Files/marker-azul-93.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-94.png b/B4A - Copy/Files/marker-azul-94.png deleted file mode 100644 index 702beff..0000000 Binary files a/B4A - Copy/Files/marker-azul-94.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-95.png b/B4A - Copy/Files/marker-azul-95.png deleted file mode 100644 index 67e9be2..0000000 Binary files a/B4A - Copy/Files/marker-azul-95.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-96.png b/B4A - Copy/Files/marker-azul-96.png deleted file mode 100644 index 7f7d1f4..0000000 Binary files a/B4A - Copy/Files/marker-azul-96.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-97.png b/B4A - Copy/Files/marker-azul-97.png deleted file mode 100644 index bb83f5f..0000000 Binary files a/B4A - Copy/Files/marker-azul-97.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-98.png b/B4A - Copy/Files/marker-azul-98.png deleted file mode 100644 index 1baf391..0000000 Binary files a/B4A - Copy/Files/marker-azul-98.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-azul-99.png b/B4A - Copy/Files/marker-azul-99.png deleted file mode 100644 index 3a8e4dc..0000000 Binary files a/B4A - Copy/Files/marker-azul-99.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-0.png b/B4A - Copy/Files/marker-rojo-0.png deleted file mode 100644 index c2f508a..0000000 Binary files a/B4A - Copy/Files/marker-rojo-0.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-1.png b/B4A - Copy/Files/marker-rojo-1.png deleted file mode 100644 index 4a38c88..0000000 Binary files a/B4A - Copy/Files/marker-rojo-1.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-10.png b/B4A - Copy/Files/marker-rojo-10.png deleted file mode 100644 index 878642f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-10.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-100.png b/B4A - Copy/Files/marker-rojo-100.png deleted file mode 100644 index 3cf987b..0000000 Binary files a/B4A - Copy/Files/marker-rojo-100.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-11.png b/B4A - Copy/Files/marker-rojo-11.png deleted file mode 100644 index 89598b8..0000000 Binary files a/B4A - Copy/Files/marker-rojo-11.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-12.png b/B4A - Copy/Files/marker-rojo-12.png deleted file mode 100644 index 7eb6c40..0000000 Binary files a/B4A - Copy/Files/marker-rojo-12.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-13.png b/B4A - Copy/Files/marker-rojo-13.png deleted file mode 100644 index 093e073..0000000 Binary files a/B4A - Copy/Files/marker-rojo-13.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-14.png b/B4A - Copy/Files/marker-rojo-14.png deleted file mode 100644 index b0065d7..0000000 Binary files a/B4A - Copy/Files/marker-rojo-14.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-15.png b/B4A - Copy/Files/marker-rojo-15.png deleted file mode 100644 index ba35cef..0000000 Binary files a/B4A - Copy/Files/marker-rojo-15.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-16.png b/B4A - Copy/Files/marker-rojo-16.png deleted file mode 100644 index 43d6533..0000000 Binary files a/B4A - Copy/Files/marker-rojo-16.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-17.png b/B4A - Copy/Files/marker-rojo-17.png deleted file mode 100644 index 4b3a15b..0000000 Binary files a/B4A - Copy/Files/marker-rojo-17.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-18.png b/B4A - Copy/Files/marker-rojo-18.png deleted file mode 100644 index 13deb65..0000000 Binary files a/B4A - Copy/Files/marker-rojo-18.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-19.png b/B4A - Copy/Files/marker-rojo-19.png deleted file mode 100644 index 37bf798..0000000 Binary files a/B4A - Copy/Files/marker-rojo-19.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-2.png b/B4A - Copy/Files/marker-rojo-2.png deleted file mode 100644 index 8b6fde5..0000000 Binary files a/B4A - Copy/Files/marker-rojo-2.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-20.png b/B4A - Copy/Files/marker-rojo-20.png deleted file mode 100644 index 666d7df..0000000 Binary files a/B4A - Copy/Files/marker-rojo-20.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-21.png b/B4A - Copy/Files/marker-rojo-21.png deleted file mode 100644 index 366795c..0000000 Binary files a/B4A - Copy/Files/marker-rojo-21.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-22.png b/B4A - Copy/Files/marker-rojo-22.png deleted file mode 100644 index 3ce407f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-22.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-23.png b/B4A - Copy/Files/marker-rojo-23.png deleted file mode 100644 index 55e3a4b..0000000 Binary files a/B4A - Copy/Files/marker-rojo-23.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-24.png b/B4A - Copy/Files/marker-rojo-24.png deleted file mode 100644 index c8f8988..0000000 Binary files a/B4A - Copy/Files/marker-rojo-24.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-25.png b/B4A - Copy/Files/marker-rojo-25.png deleted file mode 100644 index 11a6b96..0000000 Binary files a/B4A - Copy/Files/marker-rojo-25.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-26.png b/B4A - Copy/Files/marker-rojo-26.png deleted file mode 100644 index c9ca4da..0000000 Binary files a/B4A - Copy/Files/marker-rojo-26.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-27.png b/B4A - Copy/Files/marker-rojo-27.png deleted file mode 100644 index e7ff1c0..0000000 Binary files a/B4A - Copy/Files/marker-rojo-27.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-28.png b/B4A - Copy/Files/marker-rojo-28.png deleted file mode 100644 index a6854ee..0000000 Binary files a/B4A - Copy/Files/marker-rojo-28.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-29.png b/B4A - Copy/Files/marker-rojo-29.png deleted file mode 100644 index 77ef66b..0000000 Binary files a/B4A - Copy/Files/marker-rojo-29.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-3.png b/B4A - Copy/Files/marker-rojo-3.png deleted file mode 100644 index 481ed6d..0000000 Binary files a/B4A - Copy/Files/marker-rojo-3.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-30.png b/B4A - Copy/Files/marker-rojo-30.png deleted file mode 100644 index 0487006..0000000 Binary files a/B4A - Copy/Files/marker-rojo-30.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-31.png b/B4A - Copy/Files/marker-rojo-31.png deleted file mode 100644 index 7f6c2ec..0000000 Binary files a/B4A - Copy/Files/marker-rojo-31.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-32.png b/B4A - Copy/Files/marker-rojo-32.png deleted file mode 100644 index 630a62c..0000000 Binary files a/B4A - Copy/Files/marker-rojo-32.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-33.png b/B4A - Copy/Files/marker-rojo-33.png deleted file mode 100644 index a80ecda..0000000 Binary files a/B4A - Copy/Files/marker-rojo-33.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-34.png b/B4A - Copy/Files/marker-rojo-34.png deleted file mode 100644 index 1bcdaf4..0000000 Binary files a/B4A - Copy/Files/marker-rojo-34.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-35.png b/B4A - Copy/Files/marker-rojo-35.png deleted file mode 100644 index 5757e67..0000000 Binary files a/B4A - Copy/Files/marker-rojo-35.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-36.png b/B4A - Copy/Files/marker-rojo-36.png deleted file mode 100644 index f455e2a..0000000 Binary files a/B4A - Copy/Files/marker-rojo-36.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-37.png b/B4A - Copy/Files/marker-rojo-37.png deleted file mode 100644 index 2e9ab4f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-37.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-38.png b/B4A - Copy/Files/marker-rojo-38.png deleted file mode 100644 index 23a83ce..0000000 Binary files a/B4A - Copy/Files/marker-rojo-38.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-39.png b/B4A - Copy/Files/marker-rojo-39.png deleted file mode 100644 index 3306d3b..0000000 Binary files a/B4A - Copy/Files/marker-rojo-39.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-4.png b/B4A - Copy/Files/marker-rojo-4.png deleted file mode 100644 index 7a104b3..0000000 Binary files a/B4A - Copy/Files/marker-rojo-4.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-40.png b/B4A - Copy/Files/marker-rojo-40.png deleted file mode 100644 index cbe0b39..0000000 Binary files a/B4A - Copy/Files/marker-rojo-40.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-41.png b/B4A - Copy/Files/marker-rojo-41.png deleted file mode 100644 index 9f06504..0000000 Binary files a/B4A - Copy/Files/marker-rojo-41.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-42.png b/B4A - Copy/Files/marker-rojo-42.png deleted file mode 100644 index c34f146..0000000 Binary files a/B4A - Copy/Files/marker-rojo-42.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-43.png b/B4A - Copy/Files/marker-rojo-43.png deleted file mode 100644 index 8579b75..0000000 Binary files a/B4A - Copy/Files/marker-rojo-43.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-44.png b/B4A - Copy/Files/marker-rojo-44.png deleted file mode 100644 index fe923a3..0000000 Binary files a/B4A - Copy/Files/marker-rojo-44.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-45.png b/B4A - Copy/Files/marker-rojo-45.png deleted file mode 100644 index d21b1ff..0000000 Binary files a/B4A - Copy/Files/marker-rojo-45.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-46.png b/B4A - Copy/Files/marker-rojo-46.png deleted file mode 100644 index e60a891..0000000 Binary files a/B4A - Copy/Files/marker-rojo-46.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-47.png b/B4A - Copy/Files/marker-rojo-47.png deleted file mode 100644 index b83f51e..0000000 Binary files a/B4A - Copy/Files/marker-rojo-47.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-48.png b/B4A - Copy/Files/marker-rojo-48.png deleted file mode 100644 index 2b94152..0000000 Binary files a/B4A - Copy/Files/marker-rojo-48.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-49.png b/B4A - Copy/Files/marker-rojo-49.png deleted file mode 100644 index a96c078..0000000 Binary files a/B4A - Copy/Files/marker-rojo-49.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-5.png b/B4A - Copy/Files/marker-rojo-5.png deleted file mode 100644 index 07edb89..0000000 Binary files a/B4A - Copy/Files/marker-rojo-5.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-50.png b/B4A - Copy/Files/marker-rojo-50.png deleted file mode 100644 index cc6cbea..0000000 Binary files a/B4A - Copy/Files/marker-rojo-50.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-51.png b/B4A - Copy/Files/marker-rojo-51.png deleted file mode 100644 index fb10bbe..0000000 Binary files a/B4A - Copy/Files/marker-rojo-51.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-52.png b/B4A - Copy/Files/marker-rojo-52.png deleted file mode 100644 index 6b91537..0000000 Binary files a/B4A - Copy/Files/marker-rojo-52.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-53.png b/B4A - Copy/Files/marker-rojo-53.png deleted file mode 100644 index 12d7d68..0000000 Binary files a/B4A - Copy/Files/marker-rojo-53.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-54.png b/B4A - Copy/Files/marker-rojo-54.png deleted file mode 100644 index 134857a..0000000 Binary files a/B4A - Copy/Files/marker-rojo-54.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-55.png b/B4A - Copy/Files/marker-rojo-55.png deleted file mode 100644 index a6448c7..0000000 Binary files a/B4A - Copy/Files/marker-rojo-55.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-56.png b/B4A - Copy/Files/marker-rojo-56.png deleted file mode 100644 index 13a83e2..0000000 Binary files a/B4A - Copy/Files/marker-rojo-56.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-57.png b/B4A - Copy/Files/marker-rojo-57.png deleted file mode 100644 index f78cbe9..0000000 Binary files a/B4A - Copy/Files/marker-rojo-57.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-58.png b/B4A - Copy/Files/marker-rojo-58.png deleted file mode 100644 index 3e0d74e..0000000 Binary files a/B4A - Copy/Files/marker-rojo-58.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-59.png b/B4A - Copy/Files/marker-rojo-59.png deleted file mode 100644 index f0b6893..0000000 Binary files a/B4A - Copy/Files/marker-rojo-59.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-6.png b/B4A - Copy/Files/marker-rojo-6.png deleted file mode 100644 index 59e4f11..0000000 Binary files a/B4A - Copy/Files/marker-rojo-6.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-60.png b/B4A - Copy/Files/marker-rojo-60.png deleted file mode 100644 index d43ae90..0000000 Binary files a/B4A - Copy/Files/marker-rojo-60.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-61.png b/B4A - Copy/Files/marker-rojo-61.png deleted file mode 100644 index 4357d6d..0000000 Binary files a/B4A - Copy/Files/marker-rojo-61.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-62.png b/B4A - Copy/Files/marker-rojo-62.png deleted file mode 100644 index 3c8b717..0000000 Binary files a/B4A - Copy/Files/marker-rojo-62.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-63.png b/B4A - Copy/Files/marker-rojo-63.png deleted file mode 100644 index 615904f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-63.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-64.png b/B4A - Copy/Files/marker-rojo-64.png deleted file mode 100644 index d58fda6..0000000 Binary files a/B4A - Copy/Files/marker-rojo-64.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-65.png b/B4A - Copy/Files/marker-rojo-65.png deleted file mode 100644 index ec82963..0000000 Binary files a/B4A - Copy/Files/marker-rojo-65.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-66.png b/B4A - Copy/Files/marker-rojo-66.png deleted file mode 100644 index cdd6a90..0000000 Binary files a/B4A - Copy/Files/marker-rojo-66.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-67.png b/B4A - Copy/Files/marker-rojo-67.png deleted file mode 100644 index 426e4d3..0000000 Binary files a/B4A - Copy/Files/marker-rojo-67.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-68.png b/B4A - Copy/Files/marker-rojo-68.png deleted file mode 100644 index ba24d79..0000000 Binary files a/B4A - Copy/Files/marker-rojo-68.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-69.png b/B4A - Copy/Files/marker-rojo-69.png deleted file mode 100644 index 2241ba6..0000000 Binary files a/B4A - Copy/Files/marker-rojo-69.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-7.png b/B4A - Copy/Files/marker-rojo-7.png deleted file mode 100644 index c4d60f3..0000000 Binary files a/B4A - Copy/Files/marker-rojo-7.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-70.png b/B4A - Copy/Files/marker-rojo-70.png deleted file mode 100644 index 3c6b4fa..0000000 Binary files a/B4A - Copy/Files/marker-rojo-70.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-71.png b/B4A - Copy/Files/marker-rojo-71.png deleted file mode 100644 index b120276..0000000 Binary files a/B4A - Copy/Files/marker-rojo-71.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-72.png b/B4A - Copy/Files/marker-rojo-72.png deleted file mode 100644 index ca042e4..0000000 Binary files a/B4A - Copy/Files/marker-rojo-72.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-73.png b/B4A - Copy/Files/marker-rojo-73.png deleted file mode 100644 index 207c726..0000000 Binary files a/B4A - Copy/Files/marker-rojo-73.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-74.png b/B4A - Copy/Files/marker-rojo-74.png deleted file mode 100644 index 832476f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-74.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-75.png b/B4A - Copy/Files/marker-rojo-75.png deleted file mode 100644 index ee95407..0000000 Binary files a/B4A - Copy/Files/marker-rojo-75.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-76.png b/B4A - Copy/Files/marker-rojo-76.png deleted file mode 100644 index eea3c80..0000000 Binary files a/B4A - Copy/Files/marker-rojo-76.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-77.png b/B4A - Copy/Files/marker-rojo-77.png deleted file mode 100644 index cc4b52f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-77.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-78.png b/B4A - Copy/Files/marker-rojo-78.png deleted file mode 100644 index 2ca2aed..0000000 Binary files a/B4A - Copy/Files/marker-rojo-78.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-79.png b/B4A - Copy/Files/marker-rojo-79.png deleted file mode 100644 index 82b5d74..0000000 Binary files a/B4A - Copy/Files/marker-rojo-79.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-8.png b/B4A - Copy/Files/marker-rojo-8.png deleted file mode 100644 index 68b46ff..0000000 Binary files a/B4A - Copy/Files/marker-rojo-8.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-80.png b/B4A - Copy/Files/marker-rojo-80.png deleted file mode 100644 index e555061..0000000 Binary files a/B4A - Copy/Files/marker-rojo-80.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-81.png b/B4A - Copy/Files/marker-rojo-81.png deleted file mode 100644 index 0fbb379..0000000 Binary files a/B4A - Copy/Files/marker-rojo-81.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-82.png b/B4A - Copy/Files/marker-rojo-82.png deleted file mode 100644 index 832b635..0000000 Binary files a/B4A - Copy/Files/marker-rojo-82.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-83.png b/B4A - Copy/Files/marker-rojo-83.png deleted file mode 100644 index b9021a0..0000000 Binary files a/B4A - Copy/Files/marker-rojo-83.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-84.png b/B4A - Copy/Files/marker-rojo-84.png deleted file mode 100644 index 9dc88c5..0000000 Binary files a/B4A - Copy/Files/marker-rojo-84.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-85.png b/B4A - Copy/Files/marker-rojo-85.png deleted file mode 100644 index 6f49fdd..0000000 Binary files a/B4A - Copy/Files/marker-rojo-85.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-86.png b/B4A - Copy/Files/marker-rojo-86.png deleted file mode 100644 index 592e9ae..0000000 Binary files a/B4A - Copy/Files/marker-rojo-86.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-87.png b/B4A - Copy/Files/marker-rojo-87.png deleted file mode 100644 index 938aca9..0000000 Binary files a/B4A - Copy/Files/marker-rojo-87.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-88.png b/B4A - Copy/Files/marker-rojo-88.png deleted file mode 100644 index f93407f..0000000 Binary files a/B4A - Copy/Files/marker-rojo-88.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-89.png b/B4A - Copy/Files/marker-rojo-89.png deleted file mode 100644 index ddfc4cc..0000000 Binary files a/B4A - Copy/Files/marker-rojo-89.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-9.png b/B4A - Copy/Files/marker-rojo-9.png deleted file mode 100644 index 2f8d39c..0000000 Binary files a/B4A - Copy/Files/marker-rojo-9.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-90.png b/B4A - Copy/Files/marker-rojo-90.png deleted file mode 100644 index 24a52cf..0000000 Binary files a/B4A - Copy/Files/marker-rojo-90.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-91.png b/B4A - Copy/Files/marker-rojo-91.png deleted file mode 100644 index f45cce0..0000000 Binary files a/B4A - Copy/Files/marker-rojo-91.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-92.png b/B4A - Copy/Files/marker-rojo-92.png deleted file mode 100644 index 73c0ddc..0000000 Binary files a/B4A - Copy/Files/marker-rojo-92.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-93.png b/B4A - Copy/Files/marker-rojo-93.png deleted file mode 100644 index ad9499b..0000000 Binary files a/B4A - Copy/Files/marker-rojo-93.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-94.png b/B4A - Copy/Files/marker-rojo-94.png deleted file mode 100644 index 99c864d..0000000 Binary files a/B4A - Copy/Files/marker-rojo-94.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-95.png b/B4A - Copy/Files/marker-rojo-95.png deleted file mode 100644 index 0d0c2a7..0000000 Binary files a/B4A - Copy/Files/marker-rojo-95.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-96.png b/B4A - Copy/Files/marker-rojo-96.png deleted file mode 100644 index d08f85a..0000000 Binary files a/B4A - Copy/Files/marker-rojo-96.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-97.png b/B4A - Copy/Files/marker-rojo-97.png deleted file mode 100644 index 7645d01..0000000 Binary files a/B4A - Copy/Files/marker-rojo-97.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-98.png b/B4A - Copy/Files/marker-rojo-98.png deleted file mode 100644 index 9196062..0000000 Binary files a/B4A - Copy/Files/marker-rojo-98.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-rojo-99.png b/B4A - Copy/Files/marker-rojo-99.png deleted file mode 100644 index 3fcb55d..0000000 Binary files a/B4A - Copy/Files/marker-rojo-99.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-0.png b/B4A - Copy/Files/marker-verde-0.png deleted file mode 100644 index 2ce1df5..0000000 Binary files a/B4A - Copy/Files/marker-verde-0.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-1.png b/B4A - Copy/Files/marker-verde-1.png deleted file mode 100644 index b317d43..0000000 Binary files a/B4A - Copy/Files/marker-verde-1.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-10.png b/B4A - Copy/Files/marker-verde-10.png deleted file mode 100644 index b9f6f61..0000000 Binary files a/B4A - Copy/Files/marker-verde-10.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-100.png b/B4A - Copy/Files/marker-verde-100.png deleted file mode 100644 index 985db2c..0000000 Binary files a/B4A - Copy/Files/marker-verde-100.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-11.png b/B4A - Copy/Files/marker-verde-11.png deleted file mode 100644 index 331a0f1..0000000 Binary files a/B4A - Copy/Files/marker-verde-11.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-12.png b/B4A - Copy/Files/marker-verde-12.png deleted file mode 100644 index 99f39c4..0000000 Binary files a/B4A - Copy/Files/marker-verde-12.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-13.png b/B4A - Copy/Files/marker-verde-13.png deleted file mode 100644 index 80d8d05..0000000 Binary files a/B4A - Copy/Files/marker-verde-13.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-14.png b/B4A - Copy/Files/marker-verde-14.png deleted file mode 100644 index 3a161ee..0000000 Binary files a/B4A - Copy/Files/marker-verde-14.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-15.png b/B4A - Copy/Files/marker-verde-15.png deleted file mode 100644 index d1bc6fd..0000000 Binary files a/B4A - Copy/Files/marker-verde-15.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-16.png b/B4A - Copy/Files/marker-verde-16.png deleted file mode 100644 index 18f2133..0000000 Binary files a/B4A - Copy/Files/marker-verde-16.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-17.png b/B4A - Copy/Files/marker-verde-17.png deleted file mode 100644 index e44ec2c..0000000 Binary files a/B4A - Copy/Files/marker-verde-17.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-18.png b/B4A - Copy/Files/marker-verde-18.png deleted file mode 100644 index eef4bab..0000000 Binary files a/B4A - Copy/Files/marker-verde-18.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-19.png b/B4A - Copy/Files/marker-verde-19.png deleted file mode 100644 index 999b2db..0000000 Binary files a/B4A - Copy/Files/marker-verde-19.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-2.png b/B4A - Copy/Files/marker-verde-2.png deleted file mode 100644 index 61ab429..0000000 Binary files a/B4A - Copy/Files/marker-verde-2.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-20.png b/B4A - Copy/Files/marker-verde-20.png deleted file mode 100644 index 2c40e51..0000000 Binary files a/B4A - Copy/Files/marker-verde-20.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-21.png b/B4A - Copy/Files/marker-verde-21.png deleted file mode 100644 index 125c182..0000000 Binary files a/B4A - Copy/Files/marker-verde-21.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-22.png b/B4A - Copy/Files/marker-verde-22.png deleted file mode 100644 index 192e285..0000000 Binary files a/B4A - Copy/Files/marker-verde-22.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-23.png b/B4A - Copy/Files/marker-verde-23.png deleted file mode 100644 index 217312d..0000000 Binary files a/B4A - Copy/Files/marker-verde-23.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-24.png b/B4A - Copy/Files/marker-verde-24.png deleted file mode 100644 index e0e2039..0000000 Binary files a/B4A - Copy/Files/marker-verde-24.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-25.png b/B4A - Copy/Files/marker-verde-25.png deleted file mode 100644 index 25590ce..0000000 Binary files a/B4A - Copy/Files/marker-verde-25.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-26.png b/B4A - Copy/Files/marker-verde-26.png deleted file mode 100644 index 119e92a..0000000 Binary files a/B4A - Copy/Files/marker-verde-26.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-27.png b/B4A - Copy/Files/marker-verde-27.png deleted file mode 100644 index 48bf7c7..0000000 Binary files a/B4A - Copy/Files/marker-verde-27.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-28.png b/B4A - Copy/Files/marker-verde-28.png deleted file mode 100644 index dceee5a..0000000 Binary files a/B4A - Copy/Files/marker-verde-28.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-29.png b/B4A - Copy/Files/marker-verde-29.png deleted file mode 100644 index ae4cbdf..0000000 Binary files a/B4A - Copy/Files/marker-verde-29.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-3.png b/B4A - Copy/Files/marker-verde-3.png deleted file mode 100644 index bc79da4..0000000 Binary files a/B4A - Copy/Files/marker-verde-3.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-30.png b/B4A - Copy/Files/marker-verde-30.png deleted file mode 100644 index fcaa4e0..0000000 Binary files a/B4A - Copy/Files/marker-verde-30.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-31.png b/B4A - Copy/Files/marker-verde-31.png deleted file mode 100644 index c8dd474..0000000 Binary files a/B4A - Copy/Files/marker-verde-31.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-32.png b/B4A - Copy/Files/marker-verde-32.png deleted file mode 100644 index f491032..0000000 Binary files a/B4A - Copy/Files/marker-verde-32.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-33.png b/B4A - Copy/Files/marker-verde-33.png deleted file mode 100644 index e9045fb..0000000 Binary files a/B4A - Copy/Files/marker-verde-33.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-34.png b/B4A - Copy/Files/marker-verde-34.png deleted file mode 100644 index 90500f4..0000000 Binary files a/B4A - Copy/Files/marker-verde-34.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-35.png b/B4A - Copy/Files/marker-verde-35.png deleted file mode 100644 index 0aa922d..0000000 Binary files a/B4A - Copy/Files/marker-verde-35.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-36.png b/B4A - Copy/Files/marker-verde-36.png deleted file mode 100644 index a295437..0000000 Binary files a/B4A - Copy/Files/marker-verde-36.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-37.png b/B4A - Copy/Files/marker-verde-37.png deleted file mode 100644 index fac6931..0000000 Binary files a/B4A - Copy/Files/marker-verde-37.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-38.png b/B4A - Copy/Files/marker-verde-38.png deleted file mode 100644 index bb0eff1..0000000 Binary files a/B4A - Copy/Files/marker-verde-38.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-39.png b/B4A - Copy/Files/marker-verde-39.png deleted file mode 100644 index ba3ca5d..0000000 Binary files a/B4A - Copy/Files/marker-verde-39.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-4.png b/B4A - Copy/Files/marker-verde-4.png deleted file mode 100644 index 4d4c268..0000000 Binary files a/B4A - Copy/Files/marker-verde-4.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-40.png b/B4A - Copy/Files/marker-verde-40.png deleted file mode 100644 index b3f4dd2..0000000 Binary files a/B4A - Copy/Files/marker-verde-40.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-41.png b/B4A - Copy/Files/marker-verde-41.png deleted file mode 100644 index f3703fa..0000000 Binary files a/B4A - Copy/Files/marker-verde-41.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-42.png b/B4A - Copy/Files/marker-verde-42.png deleted file mode 100644 index 290e787..0000000 Binary files a/B4A - Copy/Files/marker-verde-42.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-43.png b/B4A - Copy/Files/marker-verde-43.png deleted file mode 100644 index b6fc701..0000000 Binary files a/B4A - Copy/Files/marker-verde-43.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-44.png b/B4A - Copy/Files/marker-verde-44.png deleted file mode 100644 index fd600a8..0000000 Binary files a/B4A - Copy/Files/marker-verde-44.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-45.png b/B4A - Copy/Files/marker-verde-45.png deleted file mode 100644 index 32608e4..0000000 Binary files a/B4A - Copy/Files/marker-verde-45.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-46.png b/B4A - Copy/Files/marker-verde-46.png deleted file mode 100644 index c144603..0000000 Binary files a/B4A - Copy/Files/marker-verde-46.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-47.png b/B4A - Copy/Files/marker-verde-47.png deleted file mode 100644 index 0df3c65..0000000 Binary files a/B4A - Copy/Files/marker-verde-47.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-48.png b/B4A - Copy/Files/marker-verde-48.png deleted file mode 100644 index 63fda42..0000000 Binary files a/B4A - Copy/Files/marker-verde-48.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-49.png b/B4A - Copy/Files/marker-verde-49.png deleted file mode 100644 index e86d131..0000000 Binary files a/B4A - Copy/Files/marker-verde-49.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-5.png b/B4A - Copy/Files/marker-verde-5.png deleted file mode 100644 index 0cb0d02..0000000 Binary files a/B4A - Copy/Files/marker-verde-5.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-50.png b/B4A - Copy/Files/marker-verde-50.png deleted file mode 100644 index fea9ebf..0000000 Binary files a/B4A - Copy/Files/marker-verde-50.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-51.png b/B4A - Copy/Files/marker-verde-51.png deleted file mode 100644 index c25429b..0000000 Binary files a/B4A - Copy/Files/marker-verde-51.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-52.png b/B4A - Copy/Files/marker-verde-52.png deleted file mode 100644 index cb0022c..0000000 Binary files a/B4A - Copy/Files/marker-verde-52.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-53.png b/B4A - Copy/Files/marker-verde-53.png deleted file mode 100644 index a67f9d9..0000000 Binary files a/B4A - Copy/Files/marker-verde-53.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-54.png b/B4A - Copy/Files/marker-verde-54.png deleted file mode 100644 index cf040c7..0000000 Binary files a/B4A - Copy/Files/marker-verde-54.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-55.png b/B4A - Copy/Files/marker-verde-55.png deleted file mode 100644 index 1d1557f..0000000 Binary files a/B4A - Copy/Files/marker-verde-55.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-56.png b/B4A - Copy/Files/marker-verde-56.png deleted file mode 100644 index 8a84e20..0000000 Binary files a/B4A - Copy/Files/marker-verde-56.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-57.png b/B4A - Copy/Files/marker-verde-57.png deleted file mode 100644 index 0fdff90..0000000 Binary files a/B4A - Copy/Files/marker-verde-57.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-58.png b/B4A - Copy/Files/marker-verde-58.png deleted file mode 100644 index 961d5bc..0000000 Binary files a/B4A - Copy/Files/marker-verde-58.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-59.png b/B4A - Copy/Files/marker-verde-59.png deleted file mode 100644 index 760e66b..0000000 Binary files a/B4A - Copy/Files/marker-verde-59.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-6.png b/B4A - Copy/Files/marker-verde-6.png deleted file mode 100644 index fdf72ff..0000000 Binary files a/B4A - Copy/Files/marker-verde-6.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-60.png b/B4A - Copy/Files/marker-verde-60.png deleted file mode 100644 index fdc2b5a..0000000 Binary files a/B4A - Copy/Files/marker-verde-60.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-61.png b/B4A - Copy/Files/marker-verde-61.png deleted file mode 100644 index b7a00de..0000000 Binary files a/B4A - Copy/Files/marker-verde-61.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-62.png b/B4A - Copy/Files/marker-verde-62.png deleted file mode 100644 index c07d103..0000000 Binary files a/B4A - Copy/Files/marker-verde-62.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-63.png b/B4A - Copy/Files/marker-verde-63.png deleted file mode 100644 index fdb84e0..0000000 Binary files a/B4A - Copy/Files/marker-verde-63.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-64.png b/B4A - Copy/Files/marker-verde-64.png deleted file mode 100644 index 509b955..0000000 Binary files a/B4A - Copy/Files/marker-verde-64.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-65.png b/B4A - Copy/Files/marker-verde-65.png deleted file mode 100644 index 646a789..0000000 Binary files a/B4A - Copy/Files/marker-verde-65.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-66.png b/B4A - Copy/Files/marker-verde-66.png deleted file mode 100644 index 8765de9..0000000 Binary files a/B4A - Copy/Files/marker-verde-66.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-67.png b/B4A - Copy/Files/marker-verde-67.png deleted file mode 100644 index 7683549..0000000 Binary files a/B4A - Copy/Files/marker-verde-67.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-68.png b/B4A - Copy/Files/marker-verde-68.png deleted file mode 100644 index 40baa6c..0000000 Binary files a/B4A - Copy/Files/marker-verde-68.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-69.png b/B4A - Copy/Files/marker-verde-69.png deleted file mode 100644 index 8964a67..0000000 Binary files a/B4A - Copy/Files/marker-verde-69.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-7.png b/B4A - Copy/Files/marker-verde-7.png deleted file mode 100644 index d3d1c74..0000000 Binary files a/B4A - Copy/Files/marker-verde-7.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-70.png b/B4A - Copy/Files/marker-verde-70.png deleted file mode 100644 index dbe22fc..0000000 Binary files a/B4A - Copy/Files/marker-verde-70.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-71.png b/B4A - Copy/Files/marker-verde-71.png deleted file mode 100644 index 22ce3b3..0000000 Binary files a/B4A - Copy/Files/marker-verde-71.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-72.png b/B4A - Copy/Files/marker-verde-72.png deleted file mode 100644 index e1da10e..0000000 Binary files a/B4A - Copy/Files/marker-verde-72.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-73.png b/B4A - Copy/Files/marker-verde-73.png deleted file mode 100644 index b13439d..0000000 Binary files a/B4A - Copy/Files/marker-verde-73.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-74.png b/B4A - Copy/Files/marker-verde-74.png deleted file mode 100644 index 21cdb8a..0000000 Binary files a/B4A - Copy/Files/marker-verde-74.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-75.png b/B4A - Copy/Files/marker-verde-75.png deleted file mode 100644 index 8ac9232..0000000 Binary files a/B4A - Copy/Files/marker-verde-75.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-76.png b/B4A - Copy/Files/marker-verde-76.png deleted file mode 100644 index 619484b..0000000 Binary files a/B4A - Copy/Files/marker-verde-76.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-77.png b/B4A - Copy/Files/marker-verde-77.png deleted file mode 100644 index df97587..0000000 Binary files a/B4A - Copy/Files/marker-verde-77.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-78.png b/B4A - Copy/Files/marker-verde-78.png deleted file mode 100644 index b2014f1..0000000 Binary files a/B4A - Copy/Files/marker-verde-78.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-79.png b/B4A - Copy/Files/marker-verde-79.png deleted file mode 100644 index 3eec8de..0000000 Binary files a/B4A - Copy/Files/marker-verde-79.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-8.png b/B4A - Copy/Files/marker-verde-8.png deleted file mode 100644 index 84353cd..0000000 Binary files a/B4A - Copy/Files/marker-verde-8.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-80.png b/B4A - Copy/Files/marker-verde-80.png deleted file mode 100644 index 8b97221..0000000 Binary files a/B4A - Copy/Files/marker-verde-80.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-81.png b/B4A - Copy/Files/marker-verde-81.png deleted file mode 100644 index ebd400b..0000000 Binary files a/B4A - Copy/Files/marker-verde-81.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-82.png b/B4A - Copy/Files/marker-verde-82.png deleted file mode 100644 index 680bd4f..0000000 Binary files a/B4A - Copy/Files/marker-verde-82.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-83.png b/B4A - Copy/Files/marker-verde-83.png deleted file mode 100644 index 1a8acb4..0000000 Binary files a/B4A - Copy/Files/marker-verde-83.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-84.png b/B4A - Copy/Files/marker-verde-84.png deleted file mode 100644 index f4bc40e..0000000 Binary files a/B4A - Copy/Files/marker-verde-84.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-85.png b/B4A - Copy/Files/marker-verde-85.png deleted file mode 100644 index 1143b40..0000000 Binary files a/B4A - Copy/Files/marker-verde-85.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-86.png b/B4A - Copy/Files/marker-verde-86.png deleted file mode 100644 index 2f4aaf8..0000000 Binary files a/B4A - Copy/Files/marker-verde-86.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-87.png b/B4A - Copy/Files/marker-verde-87.png deleted file mode 100644 index e518310..0000000 Binary files a/B4A - Copy/Files/marker-verde-87.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-88.png b/B4A - Copy/Files/marker-verde-88.png deleted file mode 100644 index d2012fc..0000000 Binary files a/B4A - Copy/Files/marker-verde-88.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-89.png b/B4A - Copy/Files/marker-verde-89.png deleted file mode 100644 index 5fd8701..0000000 Binary files a/B4A - Copy/Files/marker-verde-89.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-9.png b/B4A - Copy/Files/marker-verde-9.png deleted file mode 100644 index e499aff..0000000 Binary files a/B4A - Copy/Files/marker-verde-9.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-90.png b/B4A - Copy/Files/marker-verde-90.png deleted file mode 100644 index 723b4f5..0000000 Binary files a/B4A - Copy/Files/marker-verde-90.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-91.png b/B4A - Copy/Files/marker-verde-91.png deleted file mode 100644 index 015e858..0000000 Binary files a/B4A - Copy/Files/marker-verde-91.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-92.png b/B4A - Copy/Files/marker-verde-92.png deleted file mode 100644 index c2d59d0..0000000 Binary files a/B4A - Copy/Files/marker-verde-92.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-93.png b/B4A - Copy/Files/marker-verde-93.png deleted file mode 100644 index f3128b4..0000000 Binary files a/B4A - Copy/Files/marker-verde-93.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-94.png b/B4A - Copy/Files/marker-verde-94.png deleted file mode 100644 index 38acfdb..0000000 Binary files a/B4A - Copy/Files/marker-verde-94.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-95.png b/B4A - Copy/Files/marker-verde-95.png deleted file mode 100644 index 4d1340a..0000000 Binary files a/B4A - Copy/Files/marker-verde-95.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-96.png b/B4A - Copy/Files/marker-verde-96.png deleted file mode 100644 index c0f2a0d..0000000 Binary files a/B4A - Copy/Files/marker-verde-96.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-97.png b/B4A - Copy/Files/marker-verde-97.png deleted file mode 100644 index a4e1612..0000000 Binary files a/B4A - Copy/Files/marker-verde-97.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-98.png b/B4A - Copy/Files/marker-verde-98.png deleted file mode 100644 index 78e0199..0000000 Binary files a/B4A - Copy/Files/marker-verde-98.png and /dev/null differ diff --git a/B4A - Copy/Files/marker-verde-99.png b/B4A - Copy/Files/marker-verde-99.png deleted file mode 100644 index 6628e9a..0000000 Binary files a/B4A - Copy/Files/marker-verde-99.png and /dev/null differ diff --git a/B4A - Copy/Files/noventa.bal b/B4A - Copy/Files/noventa.bal deleted file mode 100644 index 7b1ac25..0000000 Binary files a/B4A - Copy/Files/noventa.bal and /dev/null differ diff --git a/B4A - Copy/Files/nuevocliente.bal b/B4A - Copy/Files/nuevocliente.bal deleted file mode 100644 index 0ef6fcf..0000000 Binary files a/B4A - Copy/Files/nuevocliente.bal and /dev/null differ diff --git a/B4A - Copy/Files/palomita_verde.png b/B4A - Copy/Files/palomita_verde.png deleted file mode 100644 index f8e11e6..0000000 Binary files a/B4A - Copy/Files/palomita_verde.png and /dev/null differ diff --git a/B4A - Copy/Files/pedido.bal b/B4A - Copy/Files/pedido.bal deleted file mode 100644 index 30db91e..0000000 Binary files a/B4A - Copy/Files/pedido.bal and /dev/null differ diff --git a/B4A - Copy/Files/planfia_logo.png b/B4A - Copy/Files/planfia_logo.png deleted file mode 100644 index 680ffd0..0000000 Binary files a/B4A - Copy/Files/planfia_logo.png and /dev/null differ diff --git a/B4A - Copy/Files/planfia_logo_old.png b/B4A - Copy/Files/planfia_logo_old.png deleted file mode 100644 index 4adb130..0000000 Binary files a/B4A - Copy/Files/planfia_logo_old.png and /dev/null differ diff --git a/B4A - Copy/Files/planfia_logo_old2.png b/B4A - Copy/Files/planfia_logo_old2.png deleted file mode 100644 index 316f337..0000000 Binary files a/B4A - Copy/Files/planfia_logo_old2.png and /dev/null differ diff --git a/B4A - Copy/Files/principal.bal b/B4A - Copy/Files/principal.bal deleted file mode 100644 index 7f616b6..0000000 Binary files a/B4A - Copy/Files/principal.bal and /dev/null differ diff --git a/B4A - Copy/Files/productos.bal b/B4A - Copy/Files/productos.bal deleted file mode 100644 index 51d45cc..0000000 Binary files a/B4A - Copy/Files/productos.bal and /dev/null differ diff --git a/B4A - Copy/Files/qr.bal b/B4A - Copy/Files/qr.bal deleted file mode 100644 index 0faca59..0000000 Binary files a/B4A - Copy/Files/qr.bal and /dev/null differ diff --git a/B4A - Copy/Files/rechazo.jpg b/B4A - Copy/Files/rechazo.jpg deleted file mode 100644 index afb7ed3..0000000 Binary files a/B4A - Copy/Files/rechazo.jpg and /dev/null differ diff --git a/B4A - Copy/Files/rojo.png b/B4A - Copy/Files/rojo.png deleted file mode 100644 index 81d363d..0000000 Binary files a/B4A - Copy/Files/rojo.png and /dev/null differ diff --git a/B4A - Copy/Files/salma.jpg b/B4A - Copy/Files/salma.jpg deleted file mode 100644 index 8308c95..0000000 Binary files a/B4A - Copy/Files/salma.jpg and /dev/null differ diff --git a/B4A - Copy/Files/salma.png b/B4A - Copy/Files/salma.png deleted file mode 100644 index 00cb434..0000000 Binary files a/B4A - Copy/Files/salma.png and /dev/null differ diff --git a/B4A - Copy/Files/senial.jpg b/B4A - Copy/Files/senial.jpg deleted file mode 100644 index a758065..0000000 Binary files a/B4A - Copy/Files/senial.jpg and /dev/null differ diff --git a/B4A - Copy/Files/sync.png b/B4A - Copy/Files/sync.png deleted file mode 100644 index ff7d32e..0000000 Binary files a/B4A - Copy/Files/sync.png and /dev/null differ diff --git a/B4A - Copy/Files/tache_rojo.png b/B4A - Copy/Files/tache_rojo.png deleted file mode 100644 index 2f5f59d..0000000 Binary files a/B4A - Copy/Files/tache_rojo.png and /dev/null differ diff --git a/B4A - Copy/Files/telefonos.bal b/B4A - Copy/Files/telefonos.bal deleted file mode 100644 index 1f048f6..0000000 Binary files a/B4A - Copy/Files/telefonos.bal and /dev/null differ diff --git a/B4A - Copy/Files/tiendita.jpg b/B4A - Copy/Files/tiendita.jpg deleted file mode 100644 index 5f52563..0000000 Binary files a/B4A - Copy/Files/tiendita.jpg and /dev/null differ diff --git a/B4A - Copy/Files/unilever.jpg b/B4A - Copy/Files/unilever.jpg deleted file mode 100644 index a144bdf..0000000 Binary files a/B4A - Copy/Files/unilever.jpg and /dev/null differ diff --git a/B4A - Copy/Files/verde.png b/B4A - Copy/Files/verde.png deleted file mode 100644 index 59edded..0000000 Binary files a/B4A - Copy/Files/verde.png and /dev/null differ diff --git a/B4A - Copy/FirebaseMessaging.bas b/B4A - Copy/FirebaseMessaging.bas deleted file mode 100644 index 5d2157b..0000000 --- a/B4A - Copy/FirebaseMessaging.bas +++ /dev/null @@ -1,253 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Service -Version=10.2 -@EndOfDesignText@ -'/////////////////////////////////////////////////////////////////////////////////////// -'/// Agregar estas lineas al editor de manifiestos -' -' CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase) -' CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase) -' CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics) -' CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications) -' -'/// Agregar modulo de servicio nuevo FirebaseMessaging y copiar este modulo -' -'/// Bajar el archivo google-services.json de la consola de Firebase (https://console.firebase.google.com/) -'/// El nombre de la app en el archivo json tiene que ser el mismo que el nombre del paquete (Proyecto/Conf de Compilacion/Paquete) -' -'/// En Starter agregar esta linea -' -' Sub Service_Create -' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") -' End Sub -' -'/// En Main en Sub Process_Globals agregar esta linea -' -' Private const API_KEY As String = "AAAAv__xxxxxxxxxxxxx-xxxxxxxxxxxxxx-xxxxxxxxxxxx" -' -'/// Esta llave se consigue igualmente en la consola de Firebase, configuracion de proyecto, Cloud Messaging, -'/// es la clave de servidor. -'/// -'/// Se necesitan agregar las librerías: FirebaseAnalitics, FirebaseNotifications, JSON y OkHttpUtils2 -'/// ... JSON es necesario si se van a enviar mensajes, si solo se van a recibir, no es necesario. -' -'/////////////////////////////////////////////////////////////////////////////////////// - -Sub Process_Globals - Private fm As FirebaseMessaging - Private const API_KEY As String = "AAAAv1qt3Lk:APA91bECIR-pHn6ul53eYyoVlpPuOo85RO-0zcAgEXwE7vqw8DFSbBtCaCINiqWQAkBBZXxHtQMdpU6B-jHIqgFKVL196UgwHv0Gw6_IgmipfV_NiItjzlH9d2QNpGLp9y_JUKVjUEhP" - Dim locRequest As String - Dim phn As Phone - Dim devModel As String - Dim pe As PhoneEvents - Dim c As Cursor - Public GZip As GZipStrings - Dim Subscrito As String = "" - Dim au As String - Dim puntosRuta As Int = 380 -End Sub - -Sub Service_Create - fm.Initialize("fm") 'Inicializamos FirebaseMessaging - pe.Initialize("pe") 'Para obtener la bateria -End Sub - -Public Sub SubscribeToTopics -' fm.SubscribeToTopic("Trckr") 'Global (you can subscribe to more topics) - fm.SubscribeToTopic("Trckr") 'Tracker global - Log("Subscrito al tracker global") - fm.SubscribeToTopic("Trckr-Durakelo") 'Global (you can subscribe to more topics) - Log("Subscrito a Trckr-Durakelo") - If Starter.usuario <> Subscrito Then - fm.SubscribeToTopic(Starter.usuario) 'Propio (you can subscribe to more topics) - fm.UnsubscribeFromTopic(Subscrito) 'Unsubscribe from topic - End If - If Starter.logger Then Log("Subscrito a "&Starter.usuario) - Subscrito = Starter.usuario -End Sub - -Sub Service_Start (StartingIntent As Intent) - If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent) - Sleep(0) - Service.StopAutomaticForeground 'remove if not using B4A v8+. - StartServiceAt(Me, DateTime.Now + 10 * DateTime.TicksPerMinute, True) 'Iniciamos servicio cada XX minutos -End Sub - -Sub fm_MessageArrived (Message As RemoteMessage) - If Starter.logger Then Log("Message arrived") - If Starter.logger Then Log($"Message data: ${Message.GetData}"$) -' getPhnId - If Message.GetData.ContainsKey("t") Then - Dim tipos As List = Regex.Split(",",Message.GetData.Get("t")) - If tipos.IndexOf("pu") <> -1 Or tipos.IndexOf("au") <> -1 Then 'Si es una peticion de ubicacion - If Starter.logger Then Log("Es una peticion de ubicacion") - locRequest="Activa" - If Starter.logger Then Log("Llamamos StartFLP2Reqs") - CallSubDelayed(Tracker, "StartFLP2Reqs") - CallSubDelayed(Tracker, "StartFLP") - End If - If tipos.IndexOf("au") <> -1 Then 'Si es una actualizacion de ubicacion - au = 1 - End If - If tipos.IndexOf("ping") <> -1 Then 'Si es un ping - If Starter.logger Then Log("Es un ping") - If Starter.logger Then Log("Mandamos pong") - Dim params As Map = CreateMap("topic":"Sprv-Durakelo","title":"pong", "body":Starter.usuario&" - Recibi mensaje "&Message.GetData.Get("title"), "t":"pong") - SendMessage(params) - End If - If tipos.IndexOf("bgps") <> -1 Then 'Si es una instruccion de borrar archivo gps - If Starter.logger Then Log("Es una instruccion de borrar archivo gps") - If Starter.logger Then Log("Borramos archivo gps") - borramosArchivoGPS - End If - If tipos.IndexOf("dr") <> -1 Then 'Si es una peticion de ruta gps - If Starter.logger Then Log("Es una peticion de Ruta GPS") - Dim rutaGpsCmp As String = dameRuta - Dim params As Map = CreateMap("topic":"Sprv-Durakelo","title":"ruta", "body":Starter.usuario&" - Recibi mensaje "&Message.GetData.Get("title"), "t":"ruta", "r":rutaGpsCmp) - SendMessage(params) - End If - If tipos.IndexOf("bgps2") <> -1 Then 'Si es una instruccion de borrar DB gps - If Starter.logger Then Log("Es una instruccion de borrar BD gps") - If Starter.logger Then Log("Borramos BD gps") - borraGPSHist - End If - If tipos.IndexOf("pu") = -1 And tipos.IndexOf("au") = -1 And tipos.IndexOf("ping") = -1 And tipos.IndexOf("dr") = -1 Then - If Starter.logger Then Log("No es ping ni solicitud de ubicacion o ruta, entonces no hacemos nada") - End If - End If -End Sub - -Sub Service_Destroy - -End Sub - -Sub SendMessage(params As Map) -' Dim topic As String= params.Get("topic") -' Dim title As String= params.Get("title") -' Dim body As String= params.Get("body") -' Dim tipo As String= params.Get("t") -' If params.ContainsKey("r") Then -' If Starter.logger Then Log("Con ruta") -' Dim rutaGpsCmp As String= params.Get("r") -' Else -' If Starter.logger Then Log("Sin ruta") -' Dim rutaGpsCmp As String = "" -' End If -' Dim Job As HttpJob -' Job.Initialize("fcm", Me) -' Dim m As Map = CreateMap("to": $"/topics/${topic}"$) -' Dim data As Map = CreateMap("title":title, "body":body, "d":Starter.usuario, "t":tipo, "b":Main.batt, "mt":Main.montoActual, "r":rutaGpsCmp, "v":Main.v) -' m.Put("data", data) -' Dim jg As JSONGenerator -' jg.Initialize(m) -' Job.PostString("https://fcm.googleapis.com/fcm/send", jg.ToString) -' Job.GetRequest.SetContentType("application/json;charset=UTF-8") -' Job.GetRequest.SetHeader("Authorization", "key=" & API_KEY) -' If Starter.logger Then Log(m) -End Sub - -Sub mandamosLoc(coords As String) -' If Starter.logger Then Log("Iniciamos mandamosLoc "&coords) -' If Starter.logger Then Log("locRequest="&locRequest) -' Dim t As String -' guardaInfoEnArchivo(coords)'Escribimos coordenadas y fecha a un archivo de texto -' If locRequest="Activa" Then 'Si hay solicitud de ubicacion, entonces la mandamos ... -' If au = 1 Then -' t = "au" ' es una actualizacion -' Else -' t = "u" ' es una peticion -' End If -' Dim params As Map = CreateMap("topic":"Sprv-Durakelo","title":"ubicacionRecibida", "body":coords, "t":t) -' SendMessage(params) -' locRequest="Enviada" -' CallSubDelayed(Tracker,"CreateLocationRequest") -' End If -End Sub - -Sub guardaInfoEnArchivo(coords As String) 'Escribimos coordenadas y fecha a un archivo de texto -'' Cambiamos el formato de la hora -'' Dim OrigFormat As String=DateTime.DateFormat 'save orig date format -'' DateTime.DateFormat="MMM-dd HH:mm:ss" -'' Dim lastUpdate As String=DateTime.Date(DateTime.Now) -'' DateTime.DateFormat=OrigFormat 'return to orig date format -' -' If Starter.logger Then Log("Guardamos ubicacion en db") -' Dim latlon() As String = Regex.Split(",", coords) -' Try -' Main.skmt.ExecNonQuery2("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)", Array As Object (latlon(2),latlon(0),latlon(1))) -' Catch -' If Starter.logger Then Log("Error guardando ubicacion") 'Si la horaMinSeg es el mismo no lo guarda -' Log(LastException) -' End Try -End Sub - -Sub borramosArchivoGPS - Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "gps.txt", False) - Dim s As String = "" - Dim t() As Byte = s.GetBytes("UTF-8") - out.WriteBytes(t, 0, t.Length) - out.Close -End Sub - -Sub pe_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent) -' Main.batt=Level -End Sub - -Sub compress(str As String) As String - ' Compression - Private su As StringUtils - Dim compressed() As Byte = GZip.compress(str) - If Starter.logger Then Log($"CompressedBytesLength: ${compressed.Length}"$) - Dim base64 As String = su.EncodeBase64(compressed) - If Starter.logger Then Log($"CompressedBytes converted to base64 Length: ${base64.Length}"$) - If Starter.logger Then Log($"CompressedBytes converted to base64: ${base64}"$) - Return base64 -End Sub - -Sub decompress(base64 As String) As String - ' Decompression - Private su As StringUtils - Dim decompressedbytes() As Byte = su.DecodeBase64(base64) - If Starter.logger Then Log($"decompressedbytesLength: ${decompressedbytes.Length}"$) - Dim bc As ByteConverter - Dim uncompressed As String = bc.StringFromBytes(decompressedbytes,"UTF8") - If Starter.logger Then Log($"uncompressedLength: ${uncompressed.Length}"$) ' 6163 Bytes - If Starter.logger Then Log($"Decompressed String = ${uncompressed}"$) - Return uncompressed -End Sub - -Sub dameRuta As String -' If Starter.logger Then Log("dameRuta") -' Dim OrigFormat As String = DateTime.DateFormat 'save orig date format -' DateTime.DateFormat="yyMMdd" -'' Dim lastUpdate As String=DateTime.Date(fecha) -' Dim hoy As String = DateTime.Date(DateTime.Now)&"000000" -' DateTime.DateFormat=OrigFormat 'return to orig date format -' If Starter.logger Then Log(hoy) -' Dim c As Cursor -' c = Main.skmt.ExecQuery("select LAT, LON from RUTA_GPS where fecha > "& hoy &" order by fecha desc limit "&puntosRuta) -' c.Position = 0 -' Dim ruta2 As String = "" -' If c.RowCount>0 Then -' For i=0 To c.RowCount -1 -' c.Position=i -' ruta2=ruta2&CRLF&c.GetString("LAT")&","&c.GetString("LON") -' Next -' End If -' c.Close -' Return compress(ruta2) -End Sub - -Sub borraGPSHist -' c=Main.skmt.ExecQuery("select count(*) as cuantos FROM RUTA_GPS") -' c.Position=0 -' If Starter.logger Then Log(c.GetInt("cuantos")) -' Main.skmt.ExecNonQuery("delete from RUTA_GPS") -' c=Main.skmt.ExecQuery("select count(*) as cuantos FROM RUTA_GPS") -' c.Position=0 -' Log(c.GetInt("cuantos")) -' Log("Borramos RUTA_GPS") -' c.Close -End Sub \ No newline at end of file diff --git a/B4A - Copy/ManageExternalStorage.bas b/B4A - Copy/ManageExternalStorage.bas deleted file mode 100644 index f14c1f7..0000000 --- a/B4A - Copy/ManageExternalStorage.bas +++ /dev/null @@ -1,79 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=10.7 -@EndOfDesignText@ -' Version 1.00 -#Event: StorageAvailable -Sub Class_Globals - Private ion As Object - Private mCallback As Object - Private mEventName As String - -End Sub - - -' This pretty trivial class is modelled on (plagiarised from!) Erel's ExternalStorage class -' It applies to devices implementing SDK30 and later -' It allows apps to access the internal 'external' storage as was possible on earlier Android versions ussing traditional file I/O -' You must manually add 'AddPermission(android.permission.MANAGE_EXTERNAL_STORAGE)' to the manifest -' You must ensure that you provide the package name of your app in Sub GetPermission -' This class uses the MANAGE_APP_ALL_FILES_ACCESS_PERMISSION intent action to direct users to a system settings page -' They must enable the option on that page to give permission - -'Initializes the object -Public Sub Initialize (Callback As Object, EventName As String) - mCallback = Callback - mEventName = EventName -End Sub - - -' Determine if the app already has MANAGE_EXTERNAL_STORAGE call Environment.isExternalStorageManager() -' Return True if this app already has MANAGE_EXTERNAL_STORAGE permission -Public Sub HasPermission As Boolean - Dim has As Boolean - Dim jo As JavaObject - jo.InitializeStatic("android.os.Environment") - has = jo.RunMethod("isExternalStorageManager", Null) - Return has -End Sub - -' Check whether this app has MANAGE_EXTERNAL_STORAGE permission -' If not show the user a dialog to enable MANAGE_EXTERNAL_STORAGE permission for this app -' Raises the StorageAvailable event in the calling activity when complete -Public Sub GetPermission - If HasPermission Then - RaiseEvent - Return - End If - Dim in As Intent - ' Be sure to reference your app package name in "pakageg:xxx" - in.Initialize("android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION", $"package:${Application.PackageName}"$) - StartActivityForResult(in) -End Sub - - -Private Sub RaiseEvent - Log("Calling : " & mEventName & "_StorageAvailable") - CallSubDelayed(mCallback, mEventName & "_StorageAvailable") -End Sub - - -Private Sub ion_Event (MethodName As String, Args() As Object) As Object - RaiseEvent - Return Null -End Sub - - -Private Sub StartActivityForResult(i As Intent) - Dim jo As JavaObject = GetBA - ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null) - jo.RunMethod("startActivityForResult", Array As Object(ion, i)) -End Sub - -Private Sub GetBA As Object - Dim jo As JavaObject = Me - Return jo.RunMethod("getBA", Null) -End Sub - diff --git a/B4A - Copy/Starter.bas b/B4A - Copy/Starter.bas deleted file mode 100644 index abc79cc..0000000 --- a/B4A - Copy/Starter.bas +++ /dev/null @@ -1,108 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Service -Version=9.85 -@EndOfDesignText@ -#Region Service Attributes - #StartAtBoot: False - #ExcludeFromLibrary: 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 logger As Boolean = True - Dim lat_gps, lon_gps As String - Dim rp As RuntimePermissions - Dim skmt As SQL - Dim usuario As String - Dim ultimaActualizacionGPS As String = 235959 - Private BTAdmin As BluetoothAdmin - Dim MAC_IMPRESORA As String - Public BluetoothState As Boolean - Public rp As RuntimePermissions - Public FLP As FusedLocationProvider - Dim Timer1 As Timer - Dim Interval As Int = 300 - Private flpStarted As Boolean - Dim DBReqServer As String = "http://keymon.lat:1782" - Dim FECHA_HOY As String - Dim tipov As String = "" -End Sub - -Sub Service_Create - 'This is the program entry point. - 'This is a good place to load resources that are not specific to a single activity. - CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") - BTAdmin.Initialize("admin") -' serial.Initialize("serial") - If BTAdmin.IsEnabled = False Then - If BTAdmin.Enable = False Then - ToastMessageShow("Error enabling Bluetooth adapter.", True) - Else - ToastMessageShow("Enabling Bluetooth adapter...", False) - End If - Else - BluetoothState = True - End If - Timer1.Initialize("Timer1", Interval * 1000) - Timer1.Enabled = True -End Sub - -Sub Service_Start (StartingIntent As Intent) - Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases. - If File.Exists(File.DirInternal, "kmt.db") = False Then File.Copy(File.DirAssets, "kmt.db", File.DirInternal, "kmt.db") - skmt.Initialize(File.DirInternal,"kmt.db", True) - StartService(Tracker) -End Sub - -Private Sub BTAdmin_StateChanged (NewState As Int, OldState As Int) - If logger Then Log("BT state changed: " & NewState) - BluetoothState = NewState = BTAdmin.STATE_ON -' StateChanged -End Sub - -Private Sub Timer1_Tick -' ToastMessageShow("Timer",False) - If logger Then Log("Siguiente actuaizacion " & DateTime.Time(DateTime.Now + Interval * 1000)) - ENVIA_ULTIMA_GPS -End Sub - -Sub Service_TaskRemoved - 'This event will be raised when the user removes the app from the recent apps list. -End Sub - -'Return true to allow the OS default exceptions handler to handle the uncaught exception. -Sub Application_Error (Error As Exception, StackTrace As String) As Boolean - Return True -End Sub - -Sub Service_Destroy - -End Sub - -Sub ENVIA_ULTIMA_GPS 'ignore - Log("Iniciamos ENVIA_ULTIMA_GPS") - Dim skmt As SQL - Dim cmd As DBCommand - Dim reqManager As DBRequestManager - DateTime.TimeFormat = "HHmmss" - ultimaActualizacionGPS = DateTime.Time(DateTime.Now) - reqManager.Initialize(Me, DBReqServer) - skmt.Initialize(File.DirInternal,"kmt.db", True) -' cmd.Initialize -' cmd.Name = "select_fechat" -' reqManager.ExecuteQuery(cmd , 0, "fechat") -' Dim cmd As DBCommand -' cmd.Initialize -' cmd.Name = "UPDATE_DURK_ACTUAL2_GPS" -' cmd.Parameters = Array As Object(Main.montoActual,Main.clientestotal, Main.clientesventa,Main.clientesvisitados,lat_gps,lon_gps,Main.batt,0, 0, 0,Main.ALMACEN,Main.rutapreventa) -' reqManager.ExecuteCommand(cmd,"inst_visitas") -' skmt.ExecNonQuery2("Update cat_variables set CAT_VA_VALOR = ? WHERE CAT_VA_DESCRIPCION = ?" , Array As String(DateTime.Time(DateTime.Now),"HoraIngreso")) - - 'Reiniciamos el timer para cuando llamamos el Sub desde "seleccion" - Timer1.Enabled = False - Timer1.Interval = Interval * 1000 - Timer1.Enabled = True -End Sub \ No newline at end of file diff --git a/B4A - Copy/Tracker.bas b/B4A - Copy/Tracker.bas deleted file mode 100644 index b6f43f8..0000000 --- a/B4A - Copy/Tracker.bas +++ /dev/null @@ -1,223 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Service -Version=10.2 -@EndOfDesignText@ -#Region Service Attributes - #StartAtBoot: True -#End Region -'****************************************************************************** -'No olvidar agregar esta linea al editor de manifiesto: -' SetServiceAttribute(Tracker, android:foregroundServiceType, "location") -' -'En Starter agregar estas lineas en Process_Globals -' Public rp As RuntimePermissions -' Public FLP As FusedLocationProvider -' Private flpStarted As Boolean -' -'En Main agregar estas lineas a Activity_Resume -' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION) -' Wait For Activity_PermissionResult (Permission As String, Result As Boolean) -' If Result Then -' StartService(Tracker) -' Log("Start Tracker") -' Else -' ToastMessageShow("No permission", True) -' End If -' -'Se necesitan las librerias FusedLocationProvider, GPS, Phone y RunTimePermissions -' -'Y en Main agregar estas dos lineas: -'#AdditionalJar: com.android.support:support-v4 -'#AdditionalJar: com.google.android.gms:play-services-location - -Sub Process_Globals - Private nid As Int = 1 - Private Tracking As Boolean - Private lock As PhoneWakeState - 'Para FusedLocationProvider (2 lineas) - Public FLP As FusedLocationProvider - Dim actualLR As LocationRequest - Private flpStarted As Boolean -End Sub - -Sub Service_Create - Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER 'we are handling it ourselves - 'Para FusedLocationProvider (2 lineas) - FLP.Initialize("flp") - FLP.Connect - lock.PartialLock - StartFLP -End Sub - -Sub flp_ConnectionSuccess - If Starter.logger Then Log("Connected to location provider") - 'FLP.GetLastKnownLocation -End Sub - -Sub flp_ConnectionFailed(ConnectionResult1 As Int) - If Starter.logger Then Log("Failed to connect to location provider") -End Sub - -Sub flp_ConnectionSuspended(ConnectionResult1 As Int) - If Starter.logger Then Log("FLP conection suspended") - StartFLP -End Sub - -Sub Service_Start (StartingIntent As Intent) - If Starter.logger Then Log("Tracker Service Started") - 'Para FusedLocationProvider (1 linea) - Service.StopAutomaticForeground - Service.StartForeground(nid, CreateNotification("...")) - Track - StartServiceAt(Me, DateTime.Now + 5 * DateTime.TicksPerMinute, True) -End Sub - -Public Sub Track - If Starter.logger Then Log("Inicia Track - Tracking : "&Tracking) - If Tracking Then -' Log(actualLR.GetSmallestDisplacement) - Return 'Si ya estamos "rastreando" no hacemos nada (return) - End If - If Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION) = False Then - If Starter.logger Then Log("No permission") - Return - End If - StartFLP 'Iniciamos FusedLocationProvider - Tracking = True -End Sub - -Public Sub StartFLP - Log("StartFLP - flpStarted="&flpStarted) - Do While FLP.IsConnected = False - Sleep(500) - If Starter.logger Then Log("sleeping") - Loop -' If flpStarted = False Then - If Starter.logger Then Log("RequestLocationUpdates") - FLP.RequestLocationUpdates(CreateLocationRequest) 'Buscamos ubicacion - If Starter.logger Then Log("Buscamos ubicacion") - If Starter.logger Then Log(actualLR.GetSmallestDisplacement) - flpStarted = True -' End If -End Sub - -Public Sub StartFLP2Reqs - If Starter.logger Then Log("StartFLP - flpStarted="&flpStarted) - Do While FLP.IsConnected = False - Sleep(500) - If Starter.logger Then Log("sleeping") - Loop - dameUltimaUbicacionConocida 'Regresamos ultima ubicacion conocida - FLP.RequestLocationUpdates(CreateLocationRequest2times) 'Buscamos ubicacion 2 peticiones - If Starter.logger Then Log("Buscamos ubicacion 2 peticiones") - If Starter.logger Then Log(actualLR.GetSmallestDisplacement) -End Sub - -Private Sub CreateLocationRequest As LocationRequest - If Starter.logger Then Log("CreateLocationRequest") - Dim lr As LocationRequest - lr.Initialize - lr.SetInterval(10000) 'Intervalo deseado para actualizaciones de ubicacion - lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion - lr.SetSmallestDisplacement(75) 'Solo registra cambio de ubicacion si es mayor a XX mts - lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY) - actualLR=lr - Return lr -End Sub - -Private Sub CreateLocationRequest2times As LocationRequest - If Starter.logger Then Log("Iniciamos CreateLocationRequest2times") - Dim lr As LocationRequest - lr.Initialize - lr.SetInterval(2000) 'Intervalo deseado para actualizaciones de ubicacion - lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion - lr.setNumUpdates(2) 'Solicitamos solo 2 actualizaciones con estos parametros - lr.SetSmallestDisplacement(10) 'Solo registra cambio de ubicacion si es mayor a XX mts - lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY) - actualLR=lr - Return lr -End Sub - -Sub dameUltimaUbicacionConocida - If FLP.GetLastKnownLocation.IsInitialized Then 'Mandamos ultima ubicacion guardada - If Starter.logger Then Log("Mandamos GetLastKnownLocation : "&formatoFecha(FLP.GetLastKnownLocation.Time)) - Dim coords As String = FLP.GetLastKnownLocation.Latitude&","&FLP.GetLastKnownLocation.Longitude&","&formatoFecha(FLP.GetLastKnownLocation.Time) - CallSubDelayed2(FirebaseMessaging,"mandamosLoc",coords) - End If -End Sub - -Public Sub StopFLP - 'Log("StopFLP") - If flpStarted Then - FLP.RemoveLocationUpdates 'Eliminamos todas las solicitudes de ubicacion - flpStarted = False - End If -End Sub - -Sub flp_LocationChanged (Location1 As Location) - If Starter.logger Then Log("SmallestDisplacement="&actualLR.GetSmallestDisplacement) -' CallSub2(Starter, "GPS_LocationChanged", Location1) -' CallSub2(gestion, "GPS_LocationChanged", Location1) -' CallSub2(MAPA_RUTAS, "GPS_LocationChanged", Location1) -' CallSub2(fila, "GPS_LocationChanged", Location1) - - Starter.lat_gps = Location1.Latitude - Starter.lon_gps = Location1.Longitude - '/////// para la ultima ubicacion FL - Dim sDate,sTime As String - DateTime.DateFormat = "MM/dd/yyyy" - sDate=DateTime.Date(DateTime.Now) - sTime=DateTime.Time(DateTime.Now) - Try - Starter.skmt.ExecNonQuery("DELETE FROM HIST_GPS") - Starter.skmt.ExecNonQuery2("INSERT INTO HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, Starter.lat_gps, Starter.lon_gps)) - Catch - If Starter.logger Then Log("Error al borrar o insertar nuevas coordendas en HIST_GPS") - End Try - '/////// - Dim coords As String = Location1.Latitude&","&Location1.Longitude&","&formatoFecha(Location1.Time) - If Starter.logger Then Log("Loc changed : "&Location1.Latitude&","&Location1.Longitude&"|"&Starter.usuario&"|") - If Starter.logger Then Log("Mandamos Ubicacion") - If Starter.logger Then Log(FirebaseMessaging.locRequest) - ' Solo mandamos la ubicacion si la precision es dentro de XX mts - If Location1.Accuracy < 300 Then CallSubDelayed2(FirebaseMessaging,"mandamosLoc",coords) - Dim origFormat As String = DateTime.TimeFormat 'Guardamos formato de fecha - DateTime.TimeFormat = "HHmmss" ' Modificamos formato de fecha - Dim minsDif As Int = DateTime.Time(DateTime.Now) - Starter.ultimaActualizacionGPS -' If Starter.logger Then Log("UltimaAct="&Starter.ultimaActualizacionGPS&" MinsDif="&minsDif) - If Location1.Accuracy < 100 And minsDif > 240 Then 'Si precision de 100 y 4 min transcurridos manda a web - If Starter.logger Then Log("actualizamos Ubicacion") - CallSubDelayed(Starter, "ENVIA_ULTIMA_GPS") - End If - DateTime.TimeFormat = origFormat 'Regresamos formato de fecha original -' CallSubDelayed2(FirebaseMessaging,"mandamosLoc",coords) -End Sub - -Sub CreateNotification (Body As String) As Notification - Dim notification As Notification - notification.Initialize2(notification.IMPORTANCE_LOW) - notification.Icon = "icon" - notification.SetInfo("Durakelo", Body, Main) - If Starter.logger Then Log("Creamos notificacion") - Return notification -End Sub - -Sub Service_Destroy - If Tracking Then - StopFLP - End If - Tracking = False - lock.ReleasePartialLock -End Sub - -Sub formatoFecha(fecha As String) As String 'Convierte una fecha al formato yyMMddHHmmss -' Log(fecha) - Dim OrigFormat As String = DateTime.DateFormat 'save orig date format - DateTime.DateFormat="yyMMddHHmmss" - Dim lastUpdate As String=DateTime.Date(fecha) - DateTime.DateFormat=OrigFormat 'return to orig date format -' Log(lastUpdate) - Return lastUpdate -End Sub \ No newline at end of file diff --git a/B4A - Copy/google-services.json b/B4A - Copy/google-services.json deleted file mode 100644 index b21b6d3..0000000 --- a/B4A - Copy/google-services.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "project_info": { - "project_number": "821860097209", - "project_id": "pusher-4c091", - "storage_bucket": "pusher-4c091.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:821860097209:android:7bdc730c1cad5927f24f68", - "android_client_info": { - "package_name": "durakelo.keymon.com.mx" - } - }, - "oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDS-_5lpLX5IiKYrG-0Et-KCKx1bwlY7R0" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:821860097209:android:4a9c1af4c93ba100f24f68", - "android_client_info": { - "package_name": "flp2.chv.com" - } - }, - "oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDS-_5lpLX5IiKYrG-0Et-KCKx1bwlY7R0" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:821860097209:android:7b6620b2a870f23cf24f68", - "android_client_info": { - "package_name": "gunav2.keymon.com.mx" - } - }, - "oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDS-_5lpLX5IiKYrG-0Et-KCKx1bwlY7R0" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:821860097209:android:7780f81ae43bf0f3f24f68", - "android_client_info": { - "package_name": "pusher.chv.com" - } - }, - "oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDS-_5lpLX5IiKYrG-0Et-KCKx1bwlY7R0" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:821860097209:android:7c55bc95da6d952df24f68", - "android_client_info": { - "package_name": "ths.keymon.com.mx" - } - }, - "oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDS-_5lpLX5IiKYrG-0Et-KCKx1bwlY7R0" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "821860097209-ef17t5620111ghub7l0tple62otbb56v.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/B4A - Copy/kms_helperSubs.bas b/B4A - Copy/kms_helperSubs.bas deleted file mode 100644 index 8d16374..0000000 --- a/B4A - Copy/kms_helperSubs.bas +++ /dev/null @@ -1,545 +0,0 @@ -B4A=true -Group=Default Group -ModulesStructureVersion=1 -Type=Class -Version=12.2 -@EndOfDesignText@ -Sub Class_Globals - Private Root As B4XView 'ignore - Private xui As XUI 'ignore - Dim skmt, rkmt As SQL - Private EventName As String 'ignore - Private CallBack As Object 'ignore - Dim rp As RuntimePermissions - Dim safePath As String - Dim fechaHoy As String - Dim skmtAttached As Boolean = False - '####### MES Vars ###### - Private ion As Object -' Dim device As Phone -' Private mesCallback As Object -' Private mesEventName As String - Dim RD_Init_IsInitialized As Boolean = False - Dim btAdmin As BluetoothAdmin -End Sub - -'Inicializa la clase "kms_helperSubs". -Public Sub Initialize (vCallback As Object, vEventName As String) As Object - EventName = vEventName - CallBack = vCallback - Return Me -End Sub - -'This event will be called once, before the page becomes visible. -'Private Sub B4XPage_Created (Root1 As B4XView) -' Root = Root1 -' 'load the layout to Root -'End Sub - -'RD - Inicializa Respaldo Diario -Sub RD_Init - Dim Dirp As String = File.DirRootExternal - Dim Dir As String -' Dim Dir2 As String - Try - File.MakeDir(Dirp,"/kmts") - Dir = "/kmts" -' Log("creado en kmts " & Dirp & Dir) - Catch - Dir = "" -' Log("creado en raiz") - End Try - safePath = Dirp & Dir - If Starter.Logger Then Log($"Safepath:${safePath}"$) - Private name() As String = Regex.split(" ", Application.LabelName) - rkmt.Initialize(safePath,$"${name(0)}.rkmt.km"$, True) - skmt.Initialize(File.DirInternal,"kmt.db", False) - If chkIfTableExists(skmt, "PEDIDO") Then rkmt.ExecNonQuery($"create table if not exists PEDIDO (${getTableColumnList(skmt, "PEDIDO")}, FECHA TEXT)"$) - If chkIfTableExists(skmt, "CAT_DETALLES_PAQ") Then rkmt.ExecNonQuery($"create table if not exists CAT_DETALLES_PAQ (${getTableColumnList(skmt, "CAT_DETALLES_PAQ")}, FECHA TEXT)"$) - If chkIfTableExists(skmt, "CAT_GUNAPROD") Then rkmt.ExecNonQuery($"create table if not exists CAT_GUNAPROD (${getTableColumnList(skmt, "CAT_GUNAPROD")}, FECHA TEXT)"$) - If chkIfTableExists(skmt, "CAT_GUNAPROD2") Then rkmt.ExecNonQuery($"create table if not exists CAT_GUNAPROD2 (${getTableColumnList(skmt, "CAT_GUNAPROD2")}, FECHA TEXT)"$) - If chkIfTableExists(skmt, "kmt_info") Then rkmt.ExecNonQuery($"create table if not exists kmt_info (${getTableColumnList(skmt, "kmt_info")}, FECHA TEXT)"$) - DateTime.DateFormat = "MM/dd/yyyy" - fechaHoy = DateTime.Date(DateTime.Now) - If Starter.Logger Then Log("RKMTS: " & rkmt.IsInitialized) - If revisaSkmtAttached And rkmt.IsInitialized Then RD_Init_IsInitialized = True Else RD_Init_IsInitialized = False -End Sub - -'RD - Revisa si esta montada "kmt.db" como "skmt1" y si no, la monta -'Para que "rkmt" vea a "skmt", es necesario montarla (attach). -Sub revisaSkmtAttached As Boolean - skmtAttached = False - Dim rs As ResultSet = rkmt.ExecQuery("SELECT * FROM pragma_database_list") - Do While rs.NextRow 'Revisamos si esta montada "kmt.db" como "skmt1" y si no, la montamos. - If rs.GetString("name") = "skmt1" Then skmtAttached = True - Loop - If Not(skmtAttached) Then - rkmt.ExecNonQuery($"attach database '${File.Combine(File.DirInternal, "kmt.db")}' as skmt1;"$) - skmtAttached = True - End If - Return skmtAttached -End Sub - -'Inicializa la BD con "kmt.db" en "File.DirInternal", si el archivo no existe, lo copia desde "File.DirAssets". -'Ej: dim skmt as sql = dbInit -Sub dbInit As SQL 'ignore - Private db As SQL - If File.Exists(File.DirInternal, "kmt.db") = False Then File.Copy(File.DirAssets, "kmt.db", File.DirInternal, "kmt.db") - db.Initialize(File.DirInternal,"kmt.db", True) -' dbOk(True) -' Log(db.IsInitialized) - Return db -End Sub - -'RD - Copia la tabla PEDIDO a rkmt.db en la tarjeta del celular. -Sub RD_respalda_pedido - Private inicio As String = DateTime.Now -' Log("Copiando PEDIDO ...") - Private lasCols As String = getTableColumnListName(skmt, "PEDIDO") - rkmt.BeginTransaction - rkmt.ExecNonQuery($"delete from PEDIDO where FECHA = '${fechaHoy}'"$) - rkmt.ExecNonQuery($"insert into PEDIDO (${lasCols}, FECHA) select ${lasCols}, '${fechaHoy}' as FECHA from skmt1.PEDIDO where substr(pe_fecha, 1, 10) = '${fechaHoy}'"$) - rkmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!! - rkmt.EndTransaction - Log(((DateTime.Now - inicio)/1000) & " segs") -End Sub - -'RD - Copia la tabla CAT_GUNAPRODS a rkmt.db en la tarjeta del celular. -Sub RD_respalda_cat_gunaprod - Private inicio As String = DateTime.Now -' Log("Copiando CAT_GUNAPROD ...") - Private lasCols As String = getTableColumnListName(skmt, "CAT_GUNAPROD") - lasCols = lasCols.Replace(", CAT_GP_IMG", "") 'Quitamos la imagen del respaldo. - rkmt.BeginTransaction - rkmt.ExecNonQuery($"delete from CAT_GUNAPROD where FECHA = '${fechaHoy}'"$) - rkmt.ExecNonQuery($"insert into CAT_GUNAPROD (${lasCols}, FECHA) select ${lasCols}, '${fechaHoy}' as FECHA from skmt1.CAT_GUNAPROD"$) - rkmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!! - rkmt.EndTransaction - Log(((DateTime.Now - inicio)/1000) & " segs") -End Sub - -'RD - Copia la tabla CAT_GUNAPROD2 a rkmt.db en la tarjeta del celular. -Sub RD_respalda_cat_gunaprod2 - Private inicio As String = DateTime.Now -' Log("Copiando CAT_GUNAPROD2 ...") - Private lasCols As String = getTableColumnListName(skmt, "CAT_GUNAPROD2") - lasCols = lasCols.Replace(", CAT_GP_IMG", "") 'Quitamos la imagen del respaldo. - rkmt.BeginTransaction - rkmt.ExecNonQuery($"delete from CAT_GUNAPROD2 where FECHA = '${fechaHoy}'"$) - rkmt.ExecNonQuery($"insert into CAT_GUNAPROD2 (${lasCols}, FECHA) select ${lasCols}, '${fechaHoy}' as FECHA from skmt1.CAT_GUNAPROD2"$) - rkmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!! - rkmt.EndTransaction - Log(((DateTime.Now - inicio)/1000) & " segs") -End Sub - -'RD - Copia la tabla CAT_DETALLE_PAQ a rkmt.db en la tarjeta del celular. -Sub RD_respalda_cat_detalle_paq - Private inicio As String = DateTime.Now -' Log("Copiando CAT_DETALLES_PAQ ...") - Private lasCols As String = getTableColumnListName(skmt, "CAT_DETALLES_PAQ") - If rkmt.IsInitialized Then - rkmt.BeginTransaction - rkmt.ExecNonQuery($"delete from CAT_DETALLES_PAQ where fecha = '${fechaHoy}'"$) - rkmt.ExecNonQuery($"insert into CAT_DETALLES_PAQ (${lasCols}, FECHA) select ${lasCols}, '${fechaHoy}' as FECHA from skmt1.CAT_DETALLES_PAQ"$) - rkmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!! - rkmt.EndTransaction - Log(((DateTime.Now - inicio)/1000) & " segs") - End If -End Sub - -'RD - Copia la tabla CAT_DETALLE_PAQ a rkmt.db en la tarjeta del celular. -Sub RD_respalda_kmt_info - Private inicio As String = DateTime.Now -' Log("Copiando kmt_info ...") - Private lasCols As String = getTableColumnListName(skmt, "kmt_info") - rkmt.BeginTransaction - rkmt.ExecNonQuery($"delete from kmt_info where fecha = '${fechaHoy}'"$) - rkmt.ExecNonQuery($"insert into kmt_info (${lasCols}, FECHA) select ${lasCols}, '${fechaHoy}' as FECHA from skmt1.kmt_info"$) - rkmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!! - rkmt.EndTransaction - Log(((DateTime.Now - inicio)/1000) & " segs") -End Sub - -'RD - Realiza un "vacuum" de la base de datos "rkmt". -Sub RD_vacuum 'ignore - Log("Vacuum") - rkmt.ExecNonQuery("vacuum;") -End Sub - -'Agrega una columna a la tabla especificada. -'Hay que indicar el "tipo" de la columna (TEXT, INTEGER, ETC) -'Ej. agregaColumna(DB, "TABLA", "COLUMNA", "TIPO") -Sub agregaColumna(db As SQL, tabla As String, columna As String, tipo As String) 'ignore - Try 'Intentamos usar "pragma_table_info" para revisar si existe la columna en la tabla - Private c As Cursor = db.ExecQuery($"SELECT COUNT(*) AS fCol FROM pragma_table_info('${tabla}') WHERE name='${columna}'"$) - c.Position = 0 - If c.GetString("fCol") = 0 Then 'Si no esta la columna la agregamos - db.ExecNonQuery($"ALTER TABLE ${tabla} ADD COLUMN ${columna} ${tipo}"$) - Log($"Columna "${columna} ${tipo}", agregada a "${tabla}"."$) - End If - Catch 'Si no funciona "pragma_table_info" lo hacemos con try/catch - Try - db.ExecNonQuery($"ALTER TABLE ${tabla} ADD COLUMN ${columna} ${tipo}"$) - Log($"Columna "${columna} ${tipo}", agregada a "${tabla}".."$) - Catch - Log(LastException) - End Try - End Try -End Sub - -'Regresa los nombres y tipos de las columnas de una tabla dada. -Sub getTableColumnList(db As SQL, table As String) As String 'ignore - Private l As String = "" - If chkIfTableExists(db, table) Then - Private c As Cursor = db.ExecQuery($"pragma table_info(${table})"$) - If c.RowCount > 0 Then - For i = 0 To c.RowCount - 1 - c.Position = i - If l.Length = 0 Then - l = $"${c.GetString("name")} ${c.GetString("type")}"$ - Else - l = $"${l}, ${c.GetString("name")} ${c.GetString("type")}"$ - End If - Next - End If - Else - Return "No existe la tabla." - End If - c.Close - Return l -End Sub - -'Regresa solo los nombres de las columnas de una tabla dada. -Sub getTableColumnListName(db As SQL, table As String) As String 'ignore - Private l As String = "" - If chkIfTableExists(db, table) Then - Private c As Cursor = db.ExecQuery($"pragma table_info(${table})"$) - If c.RowCount > 0 Then - For i = 0 To c.RowCount - 1 - c.Position = i - If l.Length = 0 Then - l = $"${c.GetString("name")}"$ - Else - l = $"${l}, ${c.GetString("name")}"$ - End If - Next - End If - Else - Return "No existe la tabla." - End If - c.Close - Return l -End Sub - -'Revisa si una tabla dada existe en una base de datos dada, regresa true o false. -Sub chkIfTableExists(db As SQL, table As String) As Boolean 'ignore - Private t As Boolean = False 'ignore - If db.IsInitialized Then - Private c As Cursor = db.ExecQuery($"SELECT name FROM sqlite_master WHERE type='table' AND name='${table}'"$) - If c.RowCount > 0 Then t = True - c.Close - End If - Return t -End Sub - -'Hace visible y trae al frente el panel con los parametros "Top" y "Left" dados -Sub panelVisible(panel As Panel, top As Int, left As Int) 'ignore - panel.BringToFront - panel.Visible = True - panel.Top = top - panel.Left = left -End Sub - -'Centra una etiqueta dentro de un elemento superior -Sub centraEtiqueta(elemento As Label, anchoElementoSuperior As Int) 'ignore - elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2) - etiquetaCentrada(True) -End Sub - -Sub etiquetaCentrada(Success As Boolean) - If SubExists(CallBack, EventName & "_etiquetaCentrada") Then - CallSub2(CallBack, EventName & "_etiquetaCentrada", Success) - End If -End Sub - -'Centra un panel horizontalmente dentro de un elemento superior -Sub centraPanel(elemento As Panel, anchoElementoSuperior As Int) 'ignore - elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2) -End Sub - -'Centra un panel verticalmente dentro de un elemento superior -Sub centraPanelV(elemento As Panel, altoElementoSuperior As Int) 'ignore - elemento.Top = Round(altoElementoSuperior/2)-(elemento.Height/2) -End Sub - -'Centra una barra de progreso dentro de un elemento superior -Sub centraProgressBar(elemento As ProgressBar, anchoElementoSuperior As Int) 'ignore - elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2) -End Sub - -'Regresa el usuario de la tabla USUARIOA, si no lo encuentra regresa "SinUsuario" -Sub traeUsuarioDeDB(db As SQL) As String 'ignore - Private c As Cursor - Private u As String = "SinUsuario" - c = db.ExecQuery("select USUARIO from usuarioa") - c.Position=0 - If c.RowCount > 0 Then u = c.GetString("USUARIO") - c.Close - Return u -End Sub - -'Regresa el almacen actual de la base de datos. -Sub traeAlmacen(db As SQL) As String 'ignore - Private c As Cursor - Private a As String - c = db.ExecQuery("select ID_ALMACEN from CAT_ALMACEN") - c.Position = 0 - a = c.GetString("ID_ALMACEN") - c.Close - Return a -End Sub - -'Regresa el nombre del producto desde CAT_GUNAPROD. -Sub traeProdNombre(db As SQL, id As String) As String 'ignore - Private h As Cursor - Private n As String - h = db.ExecQuery2("select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = ? ", Array As String(id.Trim)) - If h.RowCount > 0 Then - h.Position = 0 - n = h.GetString("CAT_GP_NOMBRE") -' Log(h.RowCount&"|"&id&"|"&n&"|") - End If - h.Close - If n = Null Or n="" Then n = "N/A" -' Log(h.RowCount&"|"&id&"|"&n&"|") - Return n -End Sub - -'Regresa la ruta actual de la base de datos. -Sub traeRuta(db As SQL) As String 'ignore - Private c As Cursor - Private r As String - c = db.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") - r = "0" - If c.RowCount > 0 Then - c.Position=0 - r = c.GetString("CAT_CL_RUTA") - End If - c.Close - Return r -End Sub - -'Regresa el cliente actual de la base de dtos (CUENTAA). -Sub traeCliente(db As SQL) As String 'ignore - Private c As Cursor - Private cl As String - c = db.ExecQuery("Select CUENTA from cuentaa") - c.Position=0 - cl = c.GetString("CUENTA") - c.Close - Return cl -End Sub - -'Regresa en un mapa el total de productos y monto del pedido del cliente actual -'resultado = {"productos":"antidad_de_productos", "monto":"costo_total"} -Sub traeTotalesClienteActual(db As SQL) As Map 'ignore - Private m As Map - m.Initialize - Private c_prodsX As Cursor = db.ExecQuery("select ifnull(sum(PE_CANT), 0) as cantProds, ifnull(sum(PE_COSTO_TOT), 0) as costoTotal FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PRONOMBRE asc") - c_prodsX.Position = 0 -' LogColor($"Productos de la orden: ${c_prodsX.GetString("cantProds")}, Total: ${c_prodsX.GetString("costoTotal")}"$, Colors.red) - m = CreateMap("productos": c_prodsX.GetString("cantProds"), "monto" : c_prodsX.GetString("costoTotal")) - Return m -End Sub - -'Borra el pedido del cliente actual. -'Borra los registros de la tabla "PEDIDO" y "PEDIDO_CLIENTE" -'Actualiza las tablas "cat_gunaprod" y "kmt_info". -Sub borraPedidoClienteActual(db As SQL) As String 'ignore - Private thisC As Cursor - thisC = db.ExecQuery("select PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) ") - If thisC.RowCount>0 Then - For i=0 To thisC.RowCount -1 - thisC.Position=i - db.ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(thisC.GetString("PE_CANT"),thisC.GetString("PE_PROID"))) - db.ExecNonQuery2("INSERT INTO INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ", Array As Object (traeAlmacen(db), thisC.GetString("PE_PROID"),thisC.GetString("PE_CANT")* -1)) - Next - End If - db.ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)") - db.ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)") - db.ExecNonQuery("UPDATE kmt_info set gestion = 0 where CAT_CL_CODIGO In (select cuenta from cuentaa)") - Return 1 -End Sub - -'Regresa verdadero si la columna gestion en la tabla "kmt_info" tene valor 2. -'si no, entonces regresa falso. -Sub pedidoGuardado(db As SQL) As Boolean 'ignore - Private guardado As Boolean = False - Private g As Cursor = db.ExecQuery("select gestion from kmt_info where CAT_CL_CODIGO in (Select CUENTA from cuentaa)") - If g.RowCount > 0 Then - g.Position=0 - If g.GetString("gestion") = "2" Then guardado = True - End If - Log($"Guardado=${guardado}"$) - Return guardado -End Sub - -'Regresa verdadero si hay pedido en la tabla "PEDIDO" del cliente actual. -Sub hayPedido(db As SQL) As Boolean 'ignore - Private thisC As Cursor = db.ExecQuery($"select count(PE_CLIENTE) as hayPedido from PEDIDO where PE_CLIENTE = '${traeCliente(db)}'"$) - thisC.Position = 0 - Private hay As Boolean = False - If thisC.GetInt("hayPedido") > 0 Then hay = True -' Log($"Cliente actual=${traeCliente}, hayPedido=${hay}"$) - Return hay -End Sub - -'Guarda el nombre y version de la app en CAT_VARIABLES. -Sub guardaAppInfo(db As SQL) 'ignore - db.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'EMPRESA' or CAT_VA_DESCRIPCION = 'APP_NAME' or CAT_VA_DESCRIPCION = 'APP_VERSION'") - db.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_NAME', '${Application.LabelName}')"$) - db.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_VERSION', '${Application.VersionName}')"$) -End Sub - -'Muestra en el Log los campos y valores que regresan en el JobDone. -Sub logJobDoneResultados(resultado As DBResult) 'ignore - For Each records() As Object In resultado.Rows - LogColor($"====== ${resultado.Tag} - REGISTROS = ${resultado.Rows.Size}"$, Colors.RGB(215,37,0)) - For Each k As String In resultado.Columns.Keys - LogColor(k & " = " & records(resultado.Columns.Get(k)), Colors.RGB(215,37,0)) - Next - Next -End Sub - -'Revisa si la aplicación tiene permiso para acceder a las notificaciones. -Sub CheckNotificationAccess As Boolean - Dim ph As Phone - Dim nstr, pstr As String - Dim r As Reflector - pstr = r.GetStaticField("anywheresoftware.b4a.BA", "packageName") - nstr = ph.GetSettings("enabled_notification_listeners") - Return nstr.Contains(pstr) -End Sub - -'################ Manage External Storage (MES) ######################### -' -''Inicializa "Manage External Storage" (MES), que nos da acceso a la tarjeta de memoria en Android 11+ -'Public Sub MES_Init (mCallBack As Object, mEventName As String) -' mesCallback = mCallBack -' mesEventName = mEventName -'End Sub -' -'Sub MES_checkPermission 'ignore -'' ' get the device SDK version -'' Dim SdkVersion As Int = device.SdkVersion -'' ' Choose which permission to request in order to access external storgage -'' If SdkVersion < 30 Then -''' Log("SDK = " & SdkVersion & " : Requesting WRITE_EXTERNAL_STORAGE permission") -'' Dim rp As RuntimePermissions -'' rp.CheckAndRequestPermission(rp.PERMISSION_WRITE_EXTERNAL_STORAGE) ' Implicit read capability if granted -'' Wait For Activity_PermissionResult (Permission As String, Result As Boolean) -''' Log($"PERMISSION_WRITE_EXTERNAL_STORAGE = ${Result}"$) -'' Else -''' Log("SDK = " & SdkVersion & " : Requesting MANAGE_EXTERNAL_STORAGE permission") -''' Log("On Entry MANAGE_EXTERNAL_STORAGE = " & MES1.HasPermission) -'' If Not(MES_HasPermission) Then -'' MsgboxAsync("This app requires access to all files, please enable the option", "Manage All Files") -'' Wait For Msgbox_Result(Res As Int) -''' Log("Getting permission") -'' MES_GetPermission -'' Wait For MES_StorageAvailable -'' End If -'' End If -'End Sub -' -'' Determine if the app already has MANAGE_EXTERNAL_STORAGE call Environment.isExternalStorageManager() -'' Return True if this app already has MANAGE_EXTERNAL_STORAGE permission -'Public Sub MES_HasPermission As Boolean -' Dim has As Boolean -' Dim jo As JavaObject -' jo.InitializeStatic("android.os.Environment") -' has = jo.RunMethod("isExternalStorageManager", Null) -' Return has -'End Sub -' -'' Check whether this app has MANAGE_EXTERNAL_STORAGE permission -'' If not show the user a dialog to enable MANAGE_EXTERNAL_STORAGE permission for this app -'' Raises the StorageAvailable event in the calling activity when complete -'Public Sub MES_GetPermission -' If MES_HasPermission Then -' RaiseEvent -' Return -' End If -' Dim in As Intent -' ' Be sure to reference your app package name in "pakageg:xxx" -' in.Initialize("android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION", $"package:${Application.PackageName}"$) -' StartActivityForResult(in) -'End Sub -' -'Private Sub RaiseEvent -' Log("Calling : " & mesEventName & "_StorageAvailable") -' CallSubDelayed(mesCallback, mesEventName & "_StorageAvailable") -'End Sub -' -'Private Sub ion_Event (MethodName As String, Args() As Object) As Object -' RaiseEvent -' Return Null -'End Sub -' -'Private Sub StartActivityForResult(i As Intent) -' Dim jo As JavaObject = MES_GetBA -' ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null) -' jo.RunMethod("startActivityForResult", Array As Object(ion, i)) -'End Sub -' -'Private Sub MES_GetBA As Object -' Dim jo As JavaObject = Me -' Return jo.RunMethod("getBA", Null) -'End Sub -'################ TERMINA Manage External Storage (MES) ######################### - - -'################ INICIA ENABLE BLUETOOTH ######################### -Sub StartBluetooth 'ignore - btAdmin.Initialize("btAdmin") - Log("btAdmin: " & btAdmin.IsEnabled) - If btAdmin.IsEnabled = False Then - Wait For (EnableBluetooth) Complete (Success As Boolean) - If Success = False Then - ToastMessageShow("Failed to enable bluetooth", True) - End If - Log(Success) - End If - Log($"BTADMIN: ${btAdmin.IsEnabled}"$) -End Sub - -Sub EnableBluetooth As ResumableSub - ToastMessageShow("Enabling Bluetooth adapter...", False) - Private ph As Phone - If ph.SdkVersion >= 31 Then - rp.CheckAndRequest("android.permission.BLUETOOTH_CONNECT") - Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) - If Result = False Then Return False - Log($"BTCONNECT: ${Result}"$) - If ph.SdkVersion >= 33 Then - Dim in As Intent - in.Initialize("android.bluetooth.adapter.action.REQUEST_ENABLE", "") - StartActivityForResult(in) - Wait For ion_Event (MethodName As String, Args() As Object) - Return btAdmin.IsEnabled - End If - End If - Return btAdmin.Enable -End Sub - -Private Sub GetBA As Object - Dim jo As JavaObject = Me - Return jo.RunMethod("getBA", Null) -End Sub - -Private Sub StartActivityForResult(i As Intent) - Dim jo As JavaObject = GetBA - ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null) - jo.RunMethod("startActivityForResult", Array As Object(ion, i)) -End Sub -'################ TERMINA ENABLE BLUETOOTH ######################### \ No newline at end of file diff --git a/B4A/AutoBackups/Backup Durakelo 2023-09-21 13.06.zip b/B4A/AutoBackups/Backup Durakelo 2023-09-21 13.06.zip deleted file mode 100644 index 4ceabba..0000000 Binary files a/B4A/AutoBackups/Backup Durakelo 2023-09-21 13.06.zip and /dev/null differ diff --git a/B4A/AutoBackups/Backup Durakelo 2023-09-21 13.49.zip b/B4A/AutoBackups/Backup Durakelo 2023-09-21 13.49.zip deleted file mode 100644 index 3025ad3..0000000 Binary files a/B4A/AutoBackups/Backup Durakelo 2023-09-21 13.49.zip and /dev/null differ diff --git a/B4A/AutoBackups/Backup Durakelo 2023-09-21 15.29.zip b/B4A/AutoBackups/Backup Durakelo 2023-09-21 15.29.zip deleted file mode 100644 index daced5d..0000000 Binary files a/B4A/AutoBackups/Backup Durakelo 2023-09-21 15.29.zip and /dev/null differ diff --git a/B4A/AutoBackups/Backup Durakelo 2023-09-21 16.40.zip b/B4A/AutoBackups/Backup Durakelo 2023-09-21 16.40.zip deleted file mode 100644 index 3e0d098..0000000 Binary files a/B4A/AutoBackups/Backup Durakelo 2023-09-21 16.40.zip and /dev/null differ