mirror of
https://github.com/KeymonSoft/SoporteKeymonsoft.git
synced 2026-04-17 12:46:08 +00:00
- Otro cambio para las mayusculas en el usuario de desbloqueo.
1937 lines
79 KiB
Plaintext
1937 lines
79 KiB
Plaintext
Build1=Default,soporte.keymon.lat
|
|
File1=cat.gif
|
|
File2=conf.ini
|
|
File3=ew.gif
|
|
File4=kelloggs.bal
|
|
File5=layout1.bal
|
|
File6=logo_Keymon.png
|
|
FileGroup1=Default Group
|
|
FileGroup2=Default Group
|
|
FileGroup3=Default Group
|
|
FileGroup4=Default Group
|
|
FileGroup5=Default Group
|
|
FileGroup6=Default Group
|
|
Group=Default Group
|
|
Library1=bitmapcreator
|
|
Library10=wobblemenu
|
|
Library11=b4xgifview
|
|
Library2=byteconverter
|
|
Library3=clipboard
|
|
Library4=core
|
|
Library5=ime
|
|
Library6=okhttputils2
|
|
Library7=phone
|
|
Library8=randomaccessfile
|
|
Library9=runtimepermissions
|
|
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~<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~CreateResourceFromFile(Macro, Themes.DarkTheme)~\n~'End of default text.~\n~SetActivityAttribute(main, android:windowSoftInputMode, adjustPan|stateHidden)
|
|
Module1=DBRequestManager
|
|
Module2=DBRequestManagerV2
|
|
Module3=Starter
|
|
Module4=Subs
|
|
NumberOfFiles=6
|
|
NumberOfLibraries=11
|
|
NumberOfModules=4
|
|
Version=12.8
|
|
@EndOfDesignText@
|
|
#Region Project Attributes
|
|
#ApplicationLabel: Soporte Keymonsoft
|
|
#VersionName: 5.08.28.1
|
|
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
|
#SupportedOrientations: portrait
|
|
#CanInstallToExternalStorage: False
|
|
#BridgeLogger: True
|
|
'###########################################################################################################
|
|
'###################### 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
|
|
'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\
|
|
|
|
'Ver 3.01.23 - Se agregó el nombre del producto al query cuando se borra el producto de un ticket, para evitar que borre cambios y no cambios por igual.
|
|
'Ver 3.08.27 - Se implementó el borrar venta de todas las empresas desde una misma pantalla.
|
|
|
|
#Region Activity Attributes
|
|
#FullScreen: False
|
|
#IncludeTitle: false
|
|
#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 DBRS_1782 As String = "http://keymon.lat:1782"
|
|
' Dim DBRS_1781 As String = "http://keymon.lat:1781"
|
|
' Dim DBRS_9000 As String = "http://keymon.lat:9000"
|
|
Dim DBRS_1782 As String = "http://192.99.93.204:1782"
|
|
Dim DBRS_1781 As String = "http://192.99.93.204:1781"
|
|
Dim DBRS_9000 As String = "http://192.99.93.204:9000"
|
|
' Dim DBRS_1782 As String = "http://11.0.0.231:1783" 'Para pruebas locales
|
|
' Dim DBRS_1782 As String = "http://187.189.244.154:1782" 'Para pruebas locales
|
|
Dim conexionDBRS As String = "externa"
|
|
Dim DBRChecked As Boolean = False
|
|
Dim atrasPresionado As Boolean = False
|
|
Dim pruebaPaso As Int = 0
|
|
Dim pass1, usrDesbloqueo As String
|
|
Dim versionOk As Boolean = False
|
|
Dim prodsList As List
|
|
' Dim buscarDonde As String = "Usuario"
|
|
' Dim buscarQue As String = ""
|
|
Type DBResult (Tag As Object, Columns As Map, Rows As List)
|
|
Type DBCommand (Name As String, Parameters() As Object)
|
|
End Sub
|
|
|
|
Sub Globals
|
|
'These global variables will be redeclared each time the activity is created.
|
|
'These variables can only be accessed from this module.
|
|
Dim reqManager, reqManager1781 As DBRequestManager
|
|
Dim cmd As DBCommand
|
|
Dim kb As IME
|
|
Private WobbleMenu1 As WobbleMenu
|
|
Private Panel1 As Panel
|
|
Private PanelKelloggs As Panel
|
|
Private Panel3 As Panel
|
|
Private Panel4 As Panel
|
|
Private Panel5 As Panel
|
|
Private b_desbloquea As Button
|
|
Private l_almacen As Label
|
|
Private s_almacen1 As Spinner
|
|
Private et_ruta1 As EditText
|
|
Private s_almacen3 As Spinner
|
|
Private et_ruta3 As EditText
|
|
Private b_borrarVenta1 As Button
|
|
Private b_borrarVenta3 As Button
|
|
Private s_almacen4 As Spinner
|
|
Private et_ruta4 As EditText
|
|
Private b_borrarVenta4 As Button
|
|
Private b_forzarVenta1 As Button
|
|
Private b_forzarVenta3 As Button
|
|
Private b_forzarVenta4 As Button
|
|
Private s_almacen2 As Spinner
|
|
Private et_ruta2 As EditText
|
|
Private b_borrarVenta2 As Button
|
|
Private b_forzarVenta2 As Button
|
|
Private s_tipoVenta As Spinner
|
|
Private et_usuario As EditText
|
|
Dim empresasMap As Map
|
|
Dim spinnerGunaMap, spinnerKelloggsMap, spinnerKelloggs2Map, spinnerSalmaMap, spinnerDanvitMap, spinnerDurakeloMap, spinnerMardsMap, spinnerIntmexMap, spinnerEmpresaMap As Map
|
|
Dim almacenGuna, almacenKelloggs, almacenKelloggs2, almacenSalma, almacenDanvit, almacenDurakelo, almacenDeRuta, almacenMards, almacenEmpresa As String
|
|
Dim tipoVentaKelloggs As String = "VENTA"
|
|
Private l_version As Label
|
|
Private l_cita As Label
|
|
Private l_copyright As Label
|
|
Private l_copyright1 As Label
|
|
Private p_login As Panel
|
|
Private et_login As EditText
|
|
Private p_backLogin As Panel
|
|
Private l_toast As Label
|
|
Private p_toast As Panel
|
|
Private cb_usrMayusc As CheckBox
|
|
Private p_opcDesbloqueo As Panel
|
|
Private p_copyright As Panel
|
|
Private p_buscar As Panel
|
|
Private et_usr As EditText
|
|
Private et_almacen As EditText
|
|
Private et_ruta As EditText
|
|
Private b_buscarUsr As Button
|
|
Private lv_resultadosBusqueda As ListView
|
|
Private b_revisaVenta As Button
|
|
Private b_revisaVenta2 As Button
|
|
Private p_botones1 As Panel
|
|
Private p_botones2 As Panel
|
|
Private p_botones3 As Panel
|
|
Private p_botones4 As Panel
|
|
Private s_usrEmpresa As Spinner
|
|
Private usrEmpresa As String = "GUNA"
|
|
Private b_login As Button
|
|
Private s_almacen2_2 As Spinner
|
|
Private et_cliente As EditText
|
|
Private b_borrarTicket As Button
|
|
Private p_botones_k2 As Panel
|
|
Private b_revisaTicket As Button
|
|
Private lv_ticket As ListView
|
|
Private sv_kelloggs As ScrollView
|
|
Private et_referencia As EditText
|
|
Private et_folio As EditText
|
|
Private et_monto As EditText
|
|
Private b_borrarPagare As Button
|
|
' Private Panel2 As Panel
|
|
Private Panel16 As Panel
|
|
Private PanelFacturacion As Panel
|
|
Private b_libBanderaFactura As Button
|
|
Private b_libBanderaCargaForanea As Button
|
|
Private gv_gato As B4XGifView
|
|
Private gv_bicho As B4XGifView
|
|
Dim timerBicho As Timer
|
|
Private p_ticket As Panel
|
|
Private b_cerrarTicket As Button
|
|
Private Panel2 As Panel
|
|
Private l_SinProductos As Label
|
|
Dim liquidada As Boolean = False
|
|
Private p_Mards As Panel
|
|
Private b_forzarVentaMards As Button
|
|
Private b_borrarVentaMards As Button
|
|
Private b_revisaVentaMards As Button
|
|
Private p_botonesMards As Panel
|
|
Private s_almacenMards As Spinner
|
|
Private et_rutaMards As EditText
|
|
Private p_borrarVenta As Panel
|
|
Private s_empresaBV As Spinner
|
|
Private s_almacenBV As Spinner
|
|
Private et_rutaBV As EditText
|
|
Private s_tipoVentaBV As Spinner
|
|
Private b_revisarVentaBV As Button
|
|
Private b_borrarVentaBV As Button
|
|
Private b_forzarVentaBV As Button
|
|
Dim laEmpresa As String = ""
|
|
Dim laRuta As String = ""
|
|
Private l_tipoVentaBV As Label
|
|
Private p_tipoVentaBV As Panel
|
|
Dim elTipoDeVenta As String
|
|
Private b_pasarInfoMovilKellogs As Button
|
|
Private b_pasarInfoMovilDurakelo As Button
|
|
Private b_pasarInfoMovilDurakeloRep As Button
|
|
Private b_pasarInfoMovilIntmex As Button
|
|
Private l_resVentaTitulo As Label
|
|
Private l_resVentaTotal As Label
|
|
Private l_resArqueo As Label
|
|
Private l_resLiquidacion As Label
|
|
Private b_cerrar As Button
|
|
Private p_resVenta As Panel
|
|
Private p_resVentaTransparente As Panel
|
|
Private l_version1 As Label
|
|
Private b_resDuplicadosKell As Button
|
|
Private s_empresaAA As Spinner
|
|
Private s_almacenAA As Spinner
|
|
Private et_rutaAA As EditText
|
|
Private b_abrirAvion As Button
|
|
Dim empresaAA, almacenAA As String
|
|
Dim cuantosAbrirAvion As Int = 0
|
|
Private p_botonesAA As Panel
|
|
Dim reqManagerT As DBRequestManagerV2
|
|
End Sub
|
|
|
|
Sub Activity_Create(FirstTime As Boolean)
|
|
'Do not forget to load the layout file created with the visual designer. For example:
|
|
Activity.LoadLayout("Layout1")
|
|
If FirstTime Then
|
|
DateTime.DateFormat = "yyyy"
|
|
l_copyright1.Text = $"KeymonSoft ${DateTime.Date(DateTime.Now)}."$
|
|
End If
|
|
prodsList.Initialize
|
|
' sv_kelloggs.Panel.LoadLayout("Kelloggs")
|
|
p_login.BringToFront
|
|
Subs.panelVisible(p_login, 0, 0, Activity)
|
|
Subs.centraETEnPanel(et_login, p_login)
|
|
Subs.centraPanelEnPanel(p_backLogin, p_login)
|
|
l_version.text = "Version " & Application.VersionName
|
|
ProgressDialogShow("Descargando información")
|
|
Log("DBServer: " & DBRS_1782)
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
' ToastMessageShow("Probando: " & DBRS_1782, False)
|
|
cmd.Initialize
|
|
cmd.Name = "select_soporte" 'Intentamos conectarnos al servido publico y si no responde cambiamos al interno.
|
|
reqManager.ExecuteQuery(cmd , 0, "pruebaConexion", 750) 'request con timeout corto en ms.
|
|
DBRChecked = False
|
|
Do While Not(DBRChecked) ' Esperamos a que termine la prueba de conexion.
|
|
Sleep(20)
|
|
Loop
|
|
' et_usuario.InputType = Bit.Or(et_usuario.InputType, 4096) 'Esta linea es para que cuando se escriba en el campo, sea con mayusculas, para mas tipos vaya a: https://developer.android.com/reference/android/text/InputType.html#TYPE_TEXT_FLAG_CAP_CHARACTERS
|
|
' et_usr.InputType = Bit.Or(et_usuario.InputType, 4096) 'Esta linea es para que cuando se escriba en el campo, sea con mayusculas, para mas tipos vaya a: https://developer.android.com/reference/android/text/InputType.html#TYPE_TEXT_FLAG_CAP_CHARACTERS
|
|
et_almacen.InputType = Bit.Or(et_usuario.InputType, 4096) 'Esta linea es para que cuando se escriba en el campo, sea con mayusculas, para mas tipos vaya a: https://developer.android.com/reference/android/text/InputType.html#TYPE_TEXT_FLAG_CAP_CHARACTERS
|
|
et_ruta.InputType = Bit.Or(et_usuario.InputType, 4096) 'Esta linea es para que cuando se escriba en el campo, sea con mayusculas, para mas tipos vaya a: https://developer.android.com/reference/android/text/InputType.html#TYPE_TEXT_FLAG_CAP_CHARACTERS
|
|
WobbleMenu1.SetTabTextIcon(1,"Guna", Chr(0xF0C0), Typeface.FONTAWESOME)
|
|
WobbleMenu1.SetTabTextIcon(2,"Kellogg's", Chr(0xF007), Typeface.FONTAWESOME)
|
|
WobbleMenu1.SetTabTextIcon(3,"Salma", Chr(0xF2BE), Typeface.FONTAWESOME)
|
|
WobbleMenu1.SetTabTextIcon(4,"Danvit", Chr(0xF21B), Typeface.FONTAWESOME)
|
|
WobbleMenu1.SetTabTextIcon(5,"Borrar Venta", Chr(0xF29D), Typeface.FONTAWESOME)
|
|
WobbleMenu1.SetTabTextIcon(6,"Facturacion", Chr(0xF2D9), Typeface.FONTAWESOME)
|
|
WobbleMenu1.SetTabTextIcon(7,"Otro", Chr(0xF2D9), Typeface.FONTAWESOME)
|
|
' WobbleMenu1.SetBadge(4,5,Colors.White,Colors.Blue)
|
|
Subs.panelVisible(Panel1, 0, 0, Activity)
|
|
' Subs.centraBotonEnPanel(b_borrarVenta1, Panel1)
|
|
' Subs.centraBotonEnPanel(b_forzarVenta1, Panel1)
|
|
|
|
s_tipoVenta.AddAll(Array As String("VENTA", "ABORDO"))
|
|
s_usrEmpresa.AddAll(Array As String("GUNA", "KELLOGGS", "SALMA", "DANVIT"))
|
|
' s_buscarD.AddAll(Array As String("Usuario", "Nombre", "Almacen", "Ruta"))
|
|
empresasMap.Initialize
|
|
spinnerGunaMap.Initialize
|
|
spinnerKelloggsMap.Initialize
|
|
spinnerKelloggs2Map.Initialize
|
|
spinnerSalmaMap.Initialize
|
|
spinnerDanvitMap.Initialize
|
|
spinnerDurakeloMap.Initialize
|
|
spinnerMardsMap.Initialize
|
|
spinnerIntmexMap.Initialize
|
|
spinnerEmpresaMap.Initialize
|
|
s_empresaBV.Clear
|
|
s_empresaBV.AddAll(Array As String("-= Seleccione =-", "Danvit", "Durakelo", "Guna", "Kelloggs", "Mards", "Salma"))
|
|
s_empresaAA.AddAll(Array As String("-= Seleccione =-", "Danvit", "Durakelo", "Guna", "Intmex", "Kelloggs", "Mards", "Salma"))
|
|
s_tipoVentaBV.AddAll(Array As String("VENTA", "ABORDO"))
|
|
s_tipoVentaBV.SelectedIndex = 0
|
|
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
'Traemos los almacenes de Guna
|
|
cmd.Initialize
|
|
cmd.Name = "select_almacenes_GUNA"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesGuna", 0)
|
|
'Traemos los almacenes de Danvit
|
|
' cmd.Initialize
|
|
cmd.Name = "select_almacenes_DANVIT"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesDanvit", 0)
|
|
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = "select_almacenes_DURAKELO"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesDurakelo", 0)
|
|
'Traemos los almacenes de Kelloggs
|
|
' cmd.Initialize
|
|
cmd.Name = "select_almacenes_KELL"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesKelloggs", 0)
|
|
'Traemos los almacenes de Salma
|
|
' cmd.Initialize
|
|
cmd.Name = "select_almacenes_SALMA"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesSalma", 0)
|
|
'Traemos los almacenes de Mards
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = "select_almacenes_Mards"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesMards", 0)
|
|
cmd.Name = "select_almacenes_Intmex"
|
|
reqManager.ExecuteQuery(cmd , 0, "almacenesIntmex", 0)
|
|
kb.Initialize("kb")
|
|
gv_gato.SetGif(File.DirAssets, "cat.gif")
|
|
gv_bicho.SetGif(File.DirAssets, "ew.gif")
|
|
timerBicho.Initialize("timerBicho", 5000)
|
|
timerBicho.Enabled = True
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
Subs.centraEtiquetaEnPanel(l_version1, p_login)
|
|
l_version1.Top = Activity.Height * 0.85
|
|
l_version1.text = "Version " & Application.VersionName
|
|
End Sub
|
|
|
|
Sub Activity_Resume
|
|
' reqManager.Initialize(Me, DBRS_1782)
|
|
' If Starter.mayusculasDesbloqueo = "1" Then cb_usrMayusc.Checked = True
|
|
Dim label1 As Label = lv_resultadosBusqueda.TwoLinesLayout.Label
|
|
label1.TextSize = 13
|
|
label1.TextColor = Colors.Black
|
|
Dim label2 As Label = lv_resultadosBusqueda.TwoLinesLayout.SecondLabel
|
|
label2.TextSize = 13
|
|
label2.TextColor = Colors.Black
|
|
|
|
Dim label12 As Label = lv_ticket.TwoLinesLayout.Label
|
|
label12.TextSize = 13
|
|
label12.TextColor = Colors.Black
|
|
' label12.Height = 12dip
|
|
Dim label22 As Label = lv_ticket.TwoLinesLayout.SecondLabel
|
|
label22.TextSize = 13
|
|
label22.TextColor = Colors.Black
|
|
' label22.Height = 12dip
|
|
lv_ticket.TwoLinesLayout.ItemHeight = 50dip
|
|
|
|
b_login.Height = Activity.Height
|
|
b_login.Width = Activity.Width
|
|
b_login.Top = 0 : b_login.left = 0
|
|
Subs.SetElevation(et_login, 10)
|
|
End Sub
|
|
|
|
Sub Activity_Pause (UserClosed As Boolean)
|
|
|
|
End Sub
|
|
|
|
Sub timerBicho_Tick
|
|
Private rand As Int = Rnd(1,3)
|
|
If rand = 1 Then gv_bicho.mBase.Visible = True Else gv_bicho.mBase.Visible = False
|
|
' Log("Bicho visible = " & rand)
|
|
End Sub
|
|
|
|
Sub WobbleMenu1_Tab1Click 'Guna
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
' Log("Tab 1")
|
|
' sv_kelloggs.Visible = False
|
|
WobbleMenu1.RemoveBadge(4)
|
|
Subs.panelVisible(Panel1, 0, 0, Activity)
|
|
' Subs.panelOculto(PanelKelloggs)
|
|
' sv_kelloggs.Visible = False
|
|
Subs.panelOculto(Panel2)
|
|
Subs.panelOculto(Panel3)
|
|
Subs.panelOculto(Panel4)
|
|
Subs.panelOculto(p_borrarVenta)
|
|
Subs.panelOculto(PanelFacturacion)
|
|
Subs.panelOculto(Panel5)
|
|
' Subs.centraBotonEnPanel(b_borrarVenta1, Panel1)
|
|
' Subs.centraBotonEnPanel(b_forzarVenta1, Panel1)
|
|
Subs.centraPanelEnPanel(p_botones1, Panel1)
|
|
End Sub
|
|
|
|
Sub WobbleMenu1_Tab2Click 'Kelloggs
|
|
' Log("Tab 2")
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
WobbleMenu1.RemoveBadge(4)
|
|
' sv_kelloggs.Top = 0
|
|
' sv_kelloggs.Left = 0
|
|
' sv_kelloggs.Width = Activity.Width
|
|
' sv_kelloggs.Height = Activity.Height - 50
|
|
' sv_kelloggs.Visible = True
|
|
|
|
' PanelKelloggs.Height = Activity.Height
|
|
lv_ticket.Width = Activity.Width * 0.9
|
|
lv_ticket.Left = (Activity.Width/2) - (lv_ticket.Width/2)
|
|
|
|
' Subs.panelVisible(PanelKelloggs, 0, 0, Activity)
|
|
' PanelKelloggs.Visible = True
|
|
' PanelKelloggs.Width = Activity.Width
|
|
Subs.panelVisible(Panel2, 0, 0, Activity)
|
|
Panel2.Width = Activity.Width
|
|
Subs.panelOculto(Panel1)
|
|
Subs.panelOculto(Panel3)
|
|
Subs.panelOculto(Panel4)
|
|
Subs.panelOculto(p_borrarVenta)
|
|
Subs.panelOculto(PanelFacturacion)
|
|
Subs.panelOculto(Panel5)
|
|
' Subs.centraPanelEnPanel(p_botones2, PanelKelloggs)
|
|
' Subs.centraPanelEnPanel(p_botones_k2, PanelKelloggs)
|
|
' Subs.centraBotonEnPanel(b_borrarPagare, PanelKelloggs)
|
|
End Sub
|
|
|
|
Sub WobbleMenu1_Tab3Click 'Salma
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
WobbleMenu1.RemoveBadge(4)
|
|
Subs.panelVisible(Panel3, 0, 0, Activity)
|
|
Subs.panelOculto(Panel1)
|
|
Subs.panelOculto(Panel2)
|
|
' Subs.panelOculto(PanelKelloggs)
|
|
' sv_kelloggs.Visible = False
|
|
Subs.panelOculto(Panel4)
|
|
Subs.panelOculto(p_borrarVenta)
|
|
Subs.panelOculto(PanelFacturacion)
|
|
Subs.panelOculto(Panel5)
|
|
' Log("Tab 3")
|
|
' Subs.centraBotonEnPanel(b_borrarVenta3, Panel3)
|
|
' Subs.centraBotonEnPanel(b_forzarVenta3, Panel3)
|
|
Subs.centraPanelEnPanel(p_botones3, Panel3)
|
|
End Sub
|
|
|
|
Sub WobbleMenu1_Tab4Click 'Danvit
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
WobbleMenu1.RemoveBadge(4)
|
|
Subs.panelVisible(Panel4, 0, 0, Activity) 'Danvit
|
|
Subs.panelOculto(Panel1)
|
|
' Subs.panelOculto(PanelKelloggs)
|
|
' sv_kelloggs.Visible = False
|
|
Subs.panelOculto(Panel2)
|
|
Subs.panelOculto(Panel3)
|
|
Subs.panelOculto(p_borrarVenta)
|
|
Subs.panelOculto(PanelFacturacion)
|
|
Subs.panelOculto(Panel5)
|
|
' Log("Tab 4")
|
|
' Subs.centraBotonEnPanel(b_borrarVenta4, Panel4)
|
|
' Subs.centraBotonEnPanel(b_forzarVenta4, Panel4)
|
|
Subs.centraPanelEnPanel(p_botones4, Panel4)
|
|
End Sub
|
|
|
|
Sub WobbleMenu1_Tab5Click 'Borrar Venta
|
|
' WobbleMenu1.RemoveBadge(4)
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
Subs.panelVisible(p_borrarVenta, 0, 0, Activity)
|
|
Subs.panelOculto(Panel1)
|
|
Subs.panelOculto(Panel2)
|
|
' Subs.panelOculto(PanelKelloggs)
|
|
' sv_kelloggs.Visible = False
|
|
Subs.panelOculto(Panel3)
|
|
Subs.panelOculto(Panel4)
|
|
Subs.panelOculto(PanelFacturacion)
|
|
Subs.panelOculto(Panel5)
|
|
' Log("Tab 3")
|
|
' Subs.centraBotonEnPanel(b_borrarVenta3, Panel3)
|
|
' Subs.centraBotonEnPanel(b_forzarVenta3, Panel3)
|
|
Subs.centraPanelEnPanel(p_botonesMards, p_borrarVenta)
|
|
' Subs.centraBotonEnPanel(b_abrirAvion, p_borrarVenta)
|
|
Subs.centraPanelEnPanel(p_botonesAA, p_borrarVenta)
|
|
s_empresaBV.SelectedIndex = 0
|
|
s_almacenBV.SelectedIndex = 0
|
|
End Sub
|
|
|
|
'Sub WobbleMenu1_Tab5Click '(Antes usuarios)
|
|
' Subs.panelVisible(p_buscar, 0, 0, Activity)
|
|
' gv_bicho.mBase.Visible = True
|
|
'' Subs.panelOculto(PanelKelloggs)
|
|
'' sv_kelloggs.Visible = False
|
|
' Subs.panelOculto(Panel1)
|
|
' Subs.panelOculto(Panel2)
|
|
' Subs.panelOculto(Panel3)
|
|
' Subs.panelOculto(Panel4)
|
|
' Subs.panelOculto(PanelFacturacion)
|
|
' Subs.panelOculto(Panel5)
|
|
' Subs.centraBotonEnPanel(b_buscarUsr, p_buscar)
|
|
' lv_resultadosBusqueda.Left = (p_buscar.Width/2)-(lv_resultadosBusqueda.Width/2)
|
|
' lv_resultadosBusqueda.Height = Activity.Height - lv_resultadosBusqueda.Top - 200
|
|
'End Sub
|
|
|
|
Sub WobbleMenu1_Tab6Click 'Facturacion
|
|
' Log("Tab Facturacion")
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
l_cita.Text = Subs.dameCita(Starter.citas)
|
|
Subs.panelVisible(PanelFacturacion, 0, 0, Activity)
|
|
' Subs.panelOculto(PanelKelloggs)
|
|
Subs.panelOculto(Panel1)
|
|
' sv_kelloggs.Visible = False
|
|
Subs.panelOculto(Panel2)
|
|
Subs.panelOculto(Panel3)
|
|
Subs.panelOculto(Panel4)
|
|
Subs.panelOculto(Panel5)
|
|
Subs.panelOculto(p_borrarVenta)
|
|
Subs.centraBotonEnPanel(b_borrarPagare, PanelFacturacion)
|
|
' Subs.centraPanelEnPanel(Panel16, PanelFacturacion)
|
|
Subs.centraBotonEnPanel(b_libBanderaFactura, PanelFacturacion)
|
|
Subs.centraBotonEnPanel(b_libBanderaCargaForanea, PanelFacturacion)
|
|
Subs.centraBotonEnPanel(b_pasarInfoMovilKellogs, PanelFacturacion)
|
|
Subs.centraBotonEnPanel(b_pasarInfoMovilDurakelo, PanelFacturacion)
|
|
Subs.centraBotonEnPanel(b_pasarInfoMovilDurakeloRep, PanelFacturacion)
|
|
Subs.centraBotonEnPanel(b_pasarInfoMovilIntmex, PanelFacturacion)
|
|
End Sub
|
|
|
|
Sub WobbleMenu1_Tab7Click 'About
|
|
' Log("Tab Otro")
|
|
' reqManager.Initialize(Me, DBRS_1782)
|
|
' WobbleMenu1.RemoveBadge(4)
|
|
l_cita.Text = Subs.dameCita(Starter.citas)
|
|
Subs.panelVisible(Panel5, 0, 0, Activity)
|
|
gv_bicho.mBase.Visible = False
|
|
Subs.panelOculto(Panel1)
|
|
' Subs.panelOculto(PanelKelloggs)
|
|
' sv_kelloggs.Visible = False
|
|
Subs.panelOculto(Panel2)
|
|
Subs.panelOculto(Panel3)
|
|
Subs.panelOculto(Panel4)
|
|
Subs.panelOculto(PanelFacturacion)
|
|
Subs.panelOculto(p_borrarVenta)
|
|
Subs.centraEtiquetaEnPanel(l_version, Panel5)
|
|
Subs.centraEtiquetaEnPanel(l_cita, Panel5)
|
|
Subs.centraPanelEnPanel (p_copyright, Panel5)
|
|
End Sub
|
|
|
|
'Desbloquea el usuario de Guna especificado en "et_usuario".
|
|
Private Sub b_desbloquea_Click
|
|
If et_usuario.Text <> "" Then
|
|
cmd.Initialize
|
|
cmd.Name = "update_usuario_guna"
|
|
Dim tempUsr As String = et_usuario.Text
|
|
tempUsr = tempUsr.Trim 'Quitamos espacios de antes y despues.
|
|
' If Starter.mayusculasDesbloqueo = "1" Then tempUsr = tempUsr.ToUpperCase 'Mandamos el usuario en mayusculas.
|
|
cmd.Parameters = Array As Object(tempUsr)
|
|
Log("Mandamos DBRequest desbloqueo: " & tempUsr)
|
|
usrDesbloqueo = tempUsr
|
|
reqManager.ExecuteCommand(cmd , "desbloqueaUsuario")
|
|
Else
|
|
Toast("Por favor ingrese el usuario a desbloquear. 🙄", 650)
|
|
End If
|
|
kb.HideKeyboard
|
|
End Sub
|
|
|
|
'Desbloquea el usuario de Intmex especificado en "et_usuario".
|
|
Private Sub b_desbloqueaIntmex_Click
|
|
If et_usuario.Text <> "" Then
|
|
reqManager1781.Initialize(Me, DBRS_1781)
|
|
cmd.Initialize
|
|
cmd.Name = "desbloqueaUsuarioIntmex"
|
|
Dim tempUsr As String = et_usuario.Text
|
|
tempUsr = tempUsr.Trim 'Quitamos espacios de antes y despues.
|
|
' If Starter.mayusculasDesbloqueo = "1" Then tempUsr = tempUsr.ToUpperCase 'Mandamos el usuario en mayusculas.
|
|
cmd.Parameters = Array As Object(tempUsr)
|
|
Log("Mandamos DBRequest desbloqueo: " & tempUsr)
|
|
usrDesbloqueo = tempUsr
|
|
reqManager1781.ExecuteCommand(cmd , "desbloqueaUsuario")
|
|
Else
|
|
Toast("Por favor ingrese el usuario a desbloquear. 🙄", 650)
|
|
End If
|
|
kb.HideKeyboard
|
|
End Sub
|
|
|
|
|
|
|
|
Sub s_almacen1_ItemClick (Position As Int, Value As Object)
|
|
almacenGuna = spinnerGunaMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log(Value)
|
|
Log($"Almacén ${almacenGuna} de Guna seleccionado"$ )
|
|
End Sub
|
|
|
|
Sub s_almacen2_ItemClick (Position As Int, Value As Object)
|
|
almacenKelloggs = spinnerKelloggsMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log($"Almacén ${almacenKelloggs} de Kelloggs seleccionado"$ )
|
|
End Sub
|
|
|
|
Private Sub s_tipoVenta_ItemClick (Position As Int, Value As Object)
|
|
tipoVentaKelloggs = Value
|
|
End Sub
|
|
|
|
Sub s_almacen3_ItemClick (Position As Int, Value As Object)
|
|
almacenSalma = spinnerSalmaMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log($"Almacén ${almacenSalma} de Salma seleccionado"$ )
|
|
End Sub
|
|
|
|
Sub s_almacen4_ItemClick (Position As Int, Value As Object)
|
|
almacenDanvit = spinnerDanvitMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log($"Almacén ${almacenDanvit} de Danvit seleccionado"$ )
|
|
End Sub
|
|
|
|
'Sub s_almacen5_ItemClick (Position As Int, Value As Object)
|
|
' almacenDurakelo = spinnerDurakeloMap.Get(Value)
|
|
' almacenDeRuta = Value
|
|
' Log($"Almacén ${almacenDurakelo} de Danvit seleccionado"$ )
|
|
'End Sub
|
|
|
|
Private Sub s_almacenMards_ItemClick (Position As Int, Value As Object)
|
|
almacenMards = spinnerMardsMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log($"Almacén ${almacenMards} de Mards seleccionado"$ )
|
|
End Sub
|
|
|
|
'Revisa si la venta de Guna se puede borrar, y si SI se puede, la borra.
|
|
Private Sub b_borrarVenta1_Click
|
|
kb.HideKeyboard
|
|
Log(et_ruta1.Text & "|" & almacenGuna)
|
|
If et_ruta1.Text.Trim <> "" And almacenGuna <> "" Then
|
|
cmd.Initialize
|
|
cmd.Name = "revisa_liquidada_Guna" 'Primero revisamos que no este liquidada o con descuento.
|
|
cmd.Parameters = Array As Object(almacenGuna, et_ruta1.Text.Trim)
|
|
Log($"Revisamos venta liquidada Guna: almacen: ${almacenGuna}, ruta: ${et_ruta1.Text} "$)
|
|
reqManager.ExecuteQuery(cmd , 0, "revisa_liquidada_Guna", 0)
|
|
Else
|
|
Toast("Por favor ingrese ruta y almacén 🤦🏽♂️", 600)
|
|
End If
|
|
End Sub
|
|
|
|
'Forzamos borrar venta de Guna en clic
|
|
Private Sub b_forzarVenta1_Click
|
|
borrarVentaForzadaGuna
|
|
End Sub
|
|
|
|
'Revisa si la venta de Kelloggs se puede borrar, y si SI se puede, la borra.
|
|
Private Sub b_borrarVenta2_Click
|
|
kb.HideKeyboard
|
|
If et_ruta2.Text.Trim <> "" And almacenKelloggs <> "" Then
|
|
cmd.Initialize
|
|
cmd.Name = "revisa_liquidada_Kell" 'Primero revisamos que no este liquidada o con descuento.
|
|
cmd.Parameters = Array As Object(almacenKelloggs, et_ruta2.Text.Trim, tipoVentaKelloggs)
|
|
Log($"Revisamos venta liquidada Kelloggs: almacen: ${almacenKelloggs}, ruta: ${et_ruta2.Text}"$)
|
|
reqManager.ExecuteQuery(cmd , 0, "revisa_liquidada_Kell", 0)
|
|
Else
|
|
Toast("Por favor ingrese ruta y almacén 🤦🏽♂️", 600)
|
|
End If
|
|
End Sub
|
|
|
|
'Forzamos borrar venta de Kelloggs en clic
|
|
Private Sub b_forzarVenta2_Click
|
|
borrarVentaForzadaKelloggs
|
|
End Sub
|
|
|
|
'Forzamos el borrado de la venta de Kelloggs
|
|
Sub borrarVentaForzadaKelloggs
|
|
Private rutaVenta As Int
|
|
If p_borrarVenta.Visible Then
|
|
rutaVenta = et_rutaBV.Text.trim
|
|
almacenKelloggs = spinnerEmpresaMap.Get(s_almacenBV.SelectedItem)
|
|
tipoVentaKelloggs = s_tipoVentaBV.SelectedItem
|
|
Else
|
|
rutaVenta = et_ruta2.Text.Trim
|
|
End If
|
|
Private usrSoporte As String = "appSoporte"
|
|
' Private tipoVenta As String = tipoVentaKelloggs
|
|
Private bandera As Int = 1
|
|
cmd.Initialize 'Se borra la venta forzada
|
|
cmd.Name = "proc_QUITAR_VENTA_KELL"
|
|
cmd.Parameters = Array As Object(almacenKelloggs, rutaVenta, usrSoporte, tipoVentaKelloggs, bandera)
|
|
Log("Madamos borrar venta Kellogs: " & almacenKelloggs&"|"& rutaVenta&"|"&usrSoporte&"|"&tipoVentaKelloggs&"|"&bandera)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaKelloggs")
|
|
End Sub
|
|
|
|
'Forzamos el borrado de la venta de Kelloggs
|
|
Sub borrarVentaForzadaDurakelo
|
|
Private rutaVenta As Int
|
|
tipoVentaKelloggs = s_tipoVentaBV.SelectedItem
|
|
almacenEmpresa = spinnerEmpresaMap.Get(s_almacenBV.SelectedItem)
|
|
If p_borrarVenta.Visible Then
|
|
rutaVenta = et_rutaBV.Text.trim
|
|
Else
|
|
rutaVenta = et_ruta2.Text.Trim
|
|
End If
|
|
Private usrSoporte As String = "appSoporte"
|
|
' Private tipoVenta As String = tipoVentaKelloggs
|
|
Private bandera As Int = 1
|
|
cmd.Initialize 'Se borra la venta forzada
|
|
cmd.Name = "proc_QUITAR_VENTA_DURAKELO"
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, usrSoporte, tipoVentaKelloggs)
|
|
Log("Madamos borrar venta Kellogs: " & almacenEmpresa&"|"& rutaVenta&"|"&usrSoporte&"|"&tipoVentaKelloggs&"|"&bandera)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaKelloggs")
|
|
End Sub
|
|
|
|
'Forzamos el borrado de la venta de Guna
|
|
Sub borrarVentaForzadaGuna
|
|
Private rutaVenta As Int
|
|
If p_borrarVenta.Visible Then
|
|
rutaVenta = et_rutaBV.Text.trim
|
|
almacenGuna = spinnerEmpresaMap.Get(s_almacenBV.SelectedItem)
|
|
Else
|
|
rutaVenta = et_ruta1.Text.Trim
|
|
End If
|
|
Private usrSoporte As String = "appSoporte"
|
|
Private bandera As Int = 1
|
|
Log("Llamamos proc_QUITAR_VENTA_GUNA")
|
|
cmd.Initialize 'Se borra la venta forzada
|
|
cmd.Name = "proc_QUITAR_VENTA_GUNA"
|
|
cmd.Parameters = Array As Object(almacenGuna, rutaVenta, usrSoporte, bandera)
|
|
Log("Madamos borrar venta Guna: " & almacenGuna&"|"& rutaVenta&"|"&usrSoporte&"|"&bandera)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaGuna")
|
|
End Sub
|
|
|
|
'Borramos la venta de Salma
|
|
Private Sub b_borrarVenta3_Click
|
|
If et_ruta3.text <> "" And almacenSalma <> "" Then
|
|
kb.HideKeyboard
|
|
Private rutaVenta As Int = et_ruta3.Text.Trim
|
|
Private usrSoporte As String = "appSoporte"
|
|
cmd.Initialize
|
|
cmd.Name = "proc_QUITAR_VENTA_SALMA"
|
|
cmd.Parameters = Array As Object(almacenSalma, rutaVenta, usrSoporte)
|
|
Log($"Mandamos borrar venta de Salma, almacen: ${almacenSalma}, ruta: ${rutaVenta}, usuario: '${usrSoporte}'"$)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaSalma")
|
|
Else
|
|
Toast("Por favor ingrese ruta y almacén 🙄", 600)
|
|
End If
|
|
End Sub
|
|
|
|
'Borramos venta de Danvit
|
|
Private Sub b_borrarVenta4_Click
|
|
If et_ruta4.text <> "" And almacenDanvit <> "" Then
|
|
kb.HideKeyboard
|
|
Private rutaVenta As Int = et_ruta4.Text.Trim
|
|
Private usrSoporte As String = "appSoporte"
|
|
cmd.Initialize
|
|
cmd.Name = "proc_QUITAR_VENTA_DANVIT"
|
|
cmd.Parameters = Array As Object(almacenDanvit, rutaVenta, usrSoporte)
|
|
Log($"Madamos borrar venta Danvit, almacen: ${almacenDanvit}, ruta: ${rutaVenta}, usuario: '${usrSoporte}'"$)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaDanvit")
|
|
Else
|
|
Toast("Por favor ingrese ruta y almacén 🤦🏽♂️", 600)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub et_ruta2_TextChanged (Old As String, New As String)
|
|
b_forzarVenta2.Visible = False
|
|
End Sub
|
|
|
|
'Detectamos clics en actividad para poner en 'False' la variable 'atrasPresionado' y para ocultar el panel de opciones de desbloqueo.
|
|
Sub activity_Click
|
|
If atrasPresionado Then atrasPresionado = False
|
|
' If p_opcDesbloqueo.Visible Then p_opcDesbloqueo.Visible = False
|
|
End Sub
|
|
|
|
Sub Activity_KeyPress (key As Int) As Boolean
|
|
' BACK key pressed
|
|
If key=KeyCodes.KEYCODE_BACK Then
|
|
If atrasPresionado Then ExitApplication 'Solo salimos de la aplicación si se presiona 'Atras' 2 veces seguidas.
|
|
ToastMessageShow("Presiona 'Atras' nuevamente para salir de la aplicación.", True)
|
|
atrasPresionado = True
|
|
' Log("atrasPresionado: True")
|
|
' I want to capture the key here so I return True
|
|
Return True
|
|
End If
|
|
' Returning 'False' signals the system to handle the key
|
|
Return False
|
|
End Sub
|
|
|
|
Sub JobDone(Job As HttpJob)
|
|
LogColor("jobDone: " & Job.Tag, Colors.Magenta)
|
|
If Job.Success = False Then
|
|
LogColor("***** jobDone Error *****", Colors.Red)
|
|
If Job.Tag = "borrarVentaKelloggs" Then
|
|
Toast("Venta Eliminada.", 0) 'El request de eliminar venta (Stored Procedure) siempre regresa error, asi que asumimos que SI se borro la venta.
|
|
b_forzarVenta2.Visible = False
|
|
else If Job.Tag = "borrarVentaGuna" Then
|
|
Toast("Venta Eliminada.", 0) 'El request de eliminar venta (Stored Procedure) siempre regresa error, asi que asumimos que SI se borro la venta.
|
|
b_forzarVenta1.Visible = False
|
|
' else If Job.Tag = "borrarVentaSalma" Or Job.Tag = "borrarVentaDanvit" Then
|
|
' ToastMessageShow("Venta Eliminada.", False) 'El request de eliminar venta (Stored Procedure) siempre regresa error, asi que asumimos que SI se borro la venta.
|
|
'/////////////////// Si hay error de conexion con keymon.lat nos cambiamos a 10.0.0.205 ///////////////////////
|
|
else If Job.Tag = "pruebaConexion" And Job.ErrorMessage.IndexOf("Failed to connect to keymon.lat") = -1 Then
|
|
DBRS_1782 = "http://keymon.net:1782"
|
|
Dim DBRS_1781 As String = "http://keymon.net:1782"
|
|
' DBRS_1782 = "http://11.0.0.231:1783" 'Para pruebas locales
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
conexionDBRS = "interna"
|
|
pruebaPaso = pruebaPaso + 1
|
|
Toast("Cambiando a servidor interno. 🕵🏼", 0)
|
|
' ToastMessageShow("Cambiando a servidor interno. 🕵🏼", False)
|
|
LogColor("Cambiando a servidor interno.", Colors.RGB(255,123,0))
|
|
If pruebaPaso < 2 Then
|
|
Log("Reintentamos conexión con servidor nuevo.")
|
|
cmd.Initialize
|
|
cmd.Name = "select_soporte" 'Reintentamos conexión.
|
|
reqManager.ExecuteQuery(cmd , 0, "pruebaConexion", 0)
|
|
End If
|
|
else If Job.Tag = "pasarInfoMovilKell" Then
|
|
' Subs.logJobDoneResultados(result)
|
|
b_pasarInfoMovilKellogs.Enabled = True
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilKellogs.Text = $"PasarInfoMovil Kelloggs"$
|
|
else If Job.Tag = "pasarInfoMovilDur" Then
|
|
' Subs.logJobDoneResultados(result)
|
|
b_pasarInfoMovilDurakelo.Enabled = True
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilDurakelo.Text = $"PasarInfoMovil Durakelo"$
|
|
else If Job.Tag = "pasarInfoMovilDurRep" Then
|
|
' Subs.logJobDoneResultados(result)
|
|
b_pasarInfoMovilDurakeloRep.Enabled = True
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilDurakeloRep.Text = $"PasarInfoMovil Durakelo Rep"$
|
|
else If Job.Tag = "pasarInfoMovilIntmex" Then
|
|
' Subs.logJobDoneResultados(result)
|
|
b_pasarInfoMovilIntmex.Enabled = True
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilIntmex.Text = $"PasarInfoMovil Intmex"$
|
|
Else
|
|
LogColor("JobDone Error: " & Job.ErrorMessage, Colors.red)
|
|
Toast("Error: " & Job.ErrorMessage, 0)
|
|
End If
|
|
DBRChecked = True 'Prueba de conexión finalizada.
|
|
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
Else
|
|
DBRChecked = True 'Prueba de conexión finalizada.
|
|
Log(1)
|
|
If Job.Tag <> "testTraeConexion" Then
|
|
Log(2)
|
|
|
|
LogColor("JobDone: '" & reqManager.HandleJob(Job).tag & "' - Registros: " & reqManager.HandleJob(Job).Rows.Size, Colors.Green) 'Mod por CHV - 211027
|
|
If Job.JobName = "DBRequest" Then 'Para desbloquear un usuario Guna.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "desbloqueaUsuario" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
et_usuario.Text = ""
|
|
Private pp As BClipboard
|
|
pp.setText($"${Subs.generaSaludo}usuario *${usrDesbloqueo}* desbloqueado, por favor *cerrar* navegadores por completo y reingresar."$) 'Copiamos el texto al portapapeles.
|
|
' ToastMessageShow("Mensaje copiado al portapapeles.", False)
|
|
Log("Usuario desbloqueado! 🔓")
|
|
Toast("Usuario desbloqueado 🔓", 0)
|
|
Next
|
|
End If
|
|
End If
|
|
Log(2)
|
|
If Job.JobName = "DBRequest" Then 'Traemos info de soporte.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "pruebaConexion" Then 'query tag
|
|
Log($"Conectado a ${DBRS_1782} - ${conexionDBRS}"$)
|
|
For Each records() As Object In result.Rows
|
|
' For Each k As String In result.Columns.Keys
|
|
' Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
' Next
|
|
pass1 = records(result.Columns.Get("CONTRASENA"))
|
|
Next
|
|
'Si la version de la aplicacion es menor que la autorizada, salimos de la aplicación.
|
|
If Subs.comparaVersiones(Application.VersionName, records(result.Columns.Get("VERSIONAUTORIZADA"))) = -1 Then
|
|
versionOk = False
|
|
Msgbox("Disculpe las molestias que estas obras le ocasionan, estamos trabajando para mejorar. 🤹🏽♂️", "VERSION EN MANTENIMIENTO") 'ignore
|
|
ExitApplication
|
|
End If
|
|
versionOk = True
|
|
p_backLogin.Visible = True
|
|
et_login.Visible = True
|
|
ProgressDialogHide
|
|
End If
|
|
End If
|
|
' If Job.JobName = "DBRequest" Then 'Para borrar venta de Guna.
|
|
' Dim result As DBResult = reqManager.HandleJob(Job) 'El procedimiento de borrar venta, aunque SI borra la venta, siempre regresa error, así que este IF en realidad no se usa!!
|
|
' If result.Tag = "borrarVentaGuna" Then 'query tag
|
|
' For Each records() As Object In result.Rows
|
|
' For Each k As String In result.Columns.Keys
|
|
' Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
' Next
|
|
' Log("Rows - " & result.Rows.Size)
|
|
' Toast("Venta Eliminada.", 0)
|
|
' Next
|
|
' End If
|
|
' End If
|
|
If Job.JobName = "DBRequest" Then 'Traemos los almacenes de Guna.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "almacenesGuna" Then 'query tag
|
|
s_almacen1.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
s_almacen1.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerGunaMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Guna", spinnerGunaMap)
|
|
' Log(spinnerGunaMap)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Traemos los almacenes de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "almacenesKelloggs" Then 'query tag
|
|
s_almacen2.Add("-= Selecciona =-")
|
|
s_almacen2_2.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
s_almacen2.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
s_almacen2_2.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerKelloggsMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
spinnerKelloggs2Map.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Kelloggs", spinnerKelloggsMap)
|
|
' Log(spinnerKelloggsMap)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Traemos los almacenes de Salma.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "almacenesSalma" Then 'query tag
|
|
s_almacen3.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
s_almacen3.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerSalmaMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Salma", spinnerSalmaMap)
|
|
' Log(spinnerSalmaMap)
|
|
Next
|
|
End If
|
|
If result.Tag = "almacenesMards" Then 'query tag
|
|
s_almacenMards.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
s_almacenMards.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerMardsMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Mards", spinnerMardsMap)
|
|
' Log(spinnerMardsMap)
|
|
Next
|
|
End If
|
|
If result.Tag = "almacenesIntmex" Then 'query tag
|
|
s_almacenAA.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
' s_almacenAA.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerIntmexMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Intmex", spinnerIntmexMap)
|
|
' Log(spinnerMardsMap)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Traemos los almacenes de Danvit.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "almacenesDanvit" Then 'query tag
|
|
s_almacen4.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
s_almacen4.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerDanvitMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Danvit", spinnerDanvitMap)
|
|
' Log(spinnerDanvitMap)
|
|
Next
|
|
End If
|
|
If result.Tag = "almacenesDurakelo" Then 'query tag
|
|
' s_almacen4.Add("-= Selecciona =-")
|
|
For Each records() As Object In result.Rows
|
|
' s_almacen4.Add(records(result.Columns.Get("CAT_AG_NOMBRE")))
|
|
spinnerDurakeloMap.Put(records(result.Columns.Get("CAT_AG_NOMBRE")), records(result.Columns.Get("CAT_AG_ID")))
|
|
empresasMap.Put("Durakelo", spinnerDurakeloMap)
|
|
' Log(spinnerDanvitMap)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Regresamos validación de si la venta esta liquidada (Kellogg's).
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "revisa_liquidada_Kell" Or result.Tag = "revisa_liquidada_Durakelo" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log(records(result.Columns.Get("LIQUIDADA")))
|
|
If records(result.Columns.Get("LIQUIDADA")) > 0 Then
|
|
Log("La venta ya esta impresa, forzar el borrado??")
|
|
' ToastMessageShow("La ruta ya esta impresa!", True)
|
|
Msgbox("La venta ya esta impresa, no es posible borrarla!", "VENTA IMPRESA") 'ignore
|
|
If p_borrarVenta.Visible Then
|
|
b_forzarVentaBV.Visible = True
|
|
Else
|
|
b_forzarVenta2.Visible = True
|
|
End If
|
|
Else
|
|
If result.Tag = "revisa_liquidada_Kell" Then borrarVentaForzadaKelloggs
|
|
If result.Tag = "revisa_liquidada_Durakelo" Then borrarVentaForzadaDurakelo
|
|
End If
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Regresamos validación de si la venta esta liquidada (Guna).
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "revisa_liquidada_Guna" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
If records(result.Columns.Get("LIQUIDADA")) > 0 Then
|
|
Log("La venta ya esta impresa, forzar el borrado??")
|
|
' ToastMessageShow("La ruta ya esta impresa!", True)
|
|
Msgbox("La venta ya esta impresa, no es posible borrarla!", "VENTA IMPRESA") 'ignore
|
|
b_forzarVenta1.Visible = True
|
|
Else
|
|
borrarVentaForzadaGuna
|
|
End If
|
|
Next
|
|
End If
|
|
End If
|
|
' If Job.JobName = "DBRequest" Then 'Borramos la venta de Salma o Danvit.
|
|
' Dim result As DBResult = reqManager.HandleJob(Job)
|
|
' If result.Tag = "borrarVentaSalma" Or result.Tag = "borrarVentaDanvit" Then 'query tag
|
|
' For Each records() As Object In result.Rows
|
|
' For Each k As String In result.Columns.Keys
|
|
' Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
' Next
|
|
' Toast("Venta Eliminada.", 0)
|
|
' Next
|
|
' End If
|
|
' End If
|
|
If Job.JobName = "DBRequest" Then 'Borramos la venta de Guna, Kelloggs, Danvit, Salma o Mards.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
Private rutaBorrada As String = ""
|
|
If result.Tag = "borrarVentaGuna" Or _
|
|
result.Tag = "borrarVentaKelloggs" Or _
|
|
result.Tag = "borrarVentaSalma" Or _
|
|
result.Tag = "borrarVentaMards" Or _
|
|
result.Tag = "borrarVentaDanvit" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log("ProcSuccess - Rows: " & result.Rows.Size)
|
|
Toast("Venta Eliminada.", 0)
|
|
If result.Tag = "borrarVentaGuna" Then rutaBorrada = et_ruta1.Text
|
|
If result.Tag = "borrarVentaKelloggs" Then rutaBorrada = et_ruta2.Text
|
|
If result.Tag = "borrarVentaSalma" Then rutaBorrada = et_ruta3.Text
|
|
If result.Tag = "borrarVentaMards" Then rutaBorrada = et_rutaMards.Text
|
|
If result.Tag = "borrarVentaDanvit" Then rutaBorrada = et_ruta4.Text
|
|
Log(spinnerGunaMap.Keys)
|
|
Private pp As BClipboard
|
|
pp.setText($"${Subs.generaSaludo}venta de la ruta *${rutaBorrada}*, del almacén *${almacenDeRuta}* eliminada!"$) 'Copiamos el texto al portapapeles.
|
|
et_ruta1.Text = ""
|
|
et_ruta2.Text = ""
|
|
et_ruta3.Text = ""
|
|
et_ruta4.Text = ""
|
|
et_rutaMards.Text = ""
|
|
et_rutaBV.Text = ""
|
|
s_almacen1.SelectedIndex = 0
|
|
s_almacen2.SelectedIndex = 0
|
|
s_almacen3.SelectedIndex = 0
|
|
s_almacen4.SelectedIndex = 0
|
|
s_almacenMards.SelectedIndex = 0
|
|
s_almacenBV.SelectedIndex = 0
|
|
s_tipoVentaBV.SelectedIndex = 0
|
|
b_forzarVenta1.Visible = False 'Escondemos el boton de forzar borrado de Guna.
|
|
b_forzarVenta2.Visible = False 'Escondemos el boton de forzar borrado de Kelloggs.
|
|
b_forzarVentaBV.Visible = False 'Escondemos el boton de forzar borrado de Global.
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Buscams datos de usuario.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "select_todos_soporte" Then 'query tag
|
|
Dim cs, cs2 As CSBuilder
|
|
lv_resultadosBusqueda.Clear
|
|
For Each records() As Object In result.Rows
|
|
cs.Initialize
|
|
cs2.Initialize
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
lv_resultadosBusqueda.AddTwoLines(cs.Color(Colors.RGB(255,0,0)).Append("U: ").Pop.Append(records(result.Columns.Get("CAT_LO_USUARIO"))).Color(Colors.RGB(255,0,0)).Append(" N: ").Pop.Append(records(result.Columns.Get("CAT_LO_NOMBRE"))).PopAll, _
|
|
cs2.Color(Colors.RGB(255,0,0)).Append("A: ").Pop.Append(records(result.Columns.Get("CAT_AG_NOMBRE"))).Color(Colors.RGB(255,0,0)).Append(" R: ").Pop.Append(records(result.Columns.Get("CAT_RU_RUTA"))).Color(Colors.RGB(255,0,0)).Append(" E: ").Pop.Append(records(result.Columns.Get("CAT_LO_ESTATUS"))).Color(Colors.RGB(255,0,0)).Append(" C: ").Pop.Append(records(result.Columns.Get("CAT_LO_CONTRASENA"))).PopAll)
|
|
Next
|
|
If result.Rows.Size > 19 Then Toast("Solo se muestran los primeros 20 resultados.", 600)
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Buscamos si existe la venta.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "select_ventaXrutaGuna_soporte" Then 'query tag
|
|
' Log(reqManager.HandleJob(Job).Rows.Size)
|
|
' Log(result.Rows.Size)
|
|
For Each records() As Object In result.Rows
|
|
' For Each k As String In result.Columns.Keys
|
|
' Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
' Next
|
|
Toast($"Ruta ${records(result.Columns.Get("HVD_RUTA"))}${CRLF}$$1.2{records(result.Columns.Get("MONTO"))}, ${records(result.Columns.Get("HVD_TIPOVENTA"))}"$, 0)
|
|
Next
|
|
Subs.logJobDoneResultados(result)
|
|
If result.Rows.Size = 0 Then Toast("NO HAY VENTA", 0)
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Buscamos si existe la venta.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "select_ventaXrutaKelloggs_soporte" Then 'query tag
|
|
b_revisaVenta2.text = "Revisar Venta"
|
|
Log(reqManager.HandleJob(Job).Rows.Size)
|
|
Log(result.Rows.Size)
|
|
Log(456)
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Toast($"Ruta ${records(result.Columns.Get("HVD_RUTA"))}${CRLF}$$1.2{records(result.Columns.Get("MONTO"))}, ${records(result.Columns.Get("HVD_TIPOVENTA"))}"$, 0)
|
|
Log(123)
|
|
l_resVentaTitulo.Text = $"Ruta ${records(result.Columns.Get("HVD_RUTA"))}"$
|
|
l_resVentaTotal.Text = $"$$1.2{records(result.Columns.Get("MONTO"))}, ${records(result.Columns.Get("HVD_TIPOVENTA"))}"$
|
|
p_resVentaTransparente.Left = 0 : p_resVentaTransparente.top = 0
|
|
p_resVentaTransparente.Width = Activity.Width : p_resVentaTransparente.height = Activity.height
|
|
Subs.centraPanelEnPanel(p_resVenta, p_resVentaTransparente)
|
|
p_resVentaTransparente.BringToFront
|
|
p_resVentaTransparente.Visible = True
|
|
Next
|
|
If result.Rows.Size = 0 Then Toast("NO HAY VENTA", 0)
|
|
End If
|
|
If result.Tag = "select_ventaXrutaDurakelo_soporte" Then 'query tag
|
|
b_revisaVenta2.text = "Revisar Venta"
|
|
Log(reqManager.HandleJob(Job).Rows.Size)
|
|
Log(result.Rows.Size)
|
|
Log(456)
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Toast($"Ruta ${records(result.Columns.Get("HVD_RUTA"))}${CRLF}$$1.2{records(result.Columns.Get("MONTO"))}, ${records(result.Columns.Get("HVD_TIPOVENTA"))}"$, 0)
|
|
Log(123)
|
|
l_resVentaTitulo.Text = $"Ruta ${records(result.Columns.Get("HVD_RUTA"))}"$
|
|
l_resVentaTotal.Text = $"$$1.2{records(result.Columns.Get("MONTO"))}, ${records(result.Columns.Get("HVD_TIPOVENTA"))}"$
|
|
p_resVentaTransparente.Left = 0 : p_resVentaTransparente.top = 0
|
|
p_resVentaTransparente.Width = Activity.Width : p_resVentaTransparente.height = Activity.height
|
|
Subs.centraPanelEnPanel(p_resVenta, p_resVentaTransparente)
|
|
p_resVentaTransparente.BringToFront
|
|
p_resVentaTransparente.Visible = True
|
|
Next
|
|
If result.Rows.Size = 0 Then Toast("NO HAY VENTA", 0)
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Buscamos si existe la venta.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "select_ventaXrutaSalma_soporte" Then 'query tag
|
|
' Log(reqManager.HandleJob(Job).Rows.Size)
|
|
' Log(result.Rows.Size)
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Toast($"Ruta ${records(result.Columns.Get("HVD_RUTA"))}${CRLF}$$1.2{records(result.Columns.Get("MONTO"))}"$, 0)
|
|
Next
|
|
If result.Rows.Size = 0 Then Toast("NO HAY VENTA", 0)
|
|
End If
|
|
If result.Tag = "select_ventaXrutaMards_soporte" Then 'query tag
|
|
' Log(reqManager.HandleJob(Job).Rows.Size)
|
|
' Log(result.Rows.Size)
|
|
Subs.logJobDoneResultados(result)
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Toast($"Ruta ${records(result.Columns.Get("HVD_RUTA"))}${CRLF}$$1.2{records(result.Columns.Get("MONTO"))}"$, 0)
|
|
Next
|
|
If result.Rows.Size = 0 Then Toast("NO HAY VENTA", 0)
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Buscamos si existe la venta.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "select_ventaXrutaDanvit_soporte" Then 'query tag
|
|
' Log(reqManager.HandleJob(Job).Rows.Size)
|
|
' Log(result.Rows.Size)
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Toast($"Ruta ${records(result.Columns.Get("HVD_RUTA"))}${CRLF}$$1.2{records(result.Columns.Get("MONTO"))}"$, 0)
|
|
Next
|
|
If result.Rows.Size = 0 Then Toast("NO HAY VENTA", 0)
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Borramos el ticket de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "revisaTicketLiquidadoKelloggs" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
' For Each k As String In result.Columns.Keys
|
|
' Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
' Next
|
|
If records(result.Columns.Get("ESTATUS")) = "Liquidado" Then
|
|
Toast("Ticket LIQUIDADO, no se puede borrar", 600)
|
|
Else
|
|
cmd.Name = "proc_QUITAR_TICKET_KELLOGGS"
|
|
cmd.Parameters = Array As Object(records(result.Columns.Get("HVD_CEDIS")), records(result.Columns.Get("CLIENTE")), "appSoporte")
|
|
Log($"Mandamos borrar: almacen=${records(result.Columns.Get("HVD_CEDIS"))}, cliente=${records(result.Columns.Get("CLIENTE"))}"$)
|
|
reqManager.ExecuteCommand(cmd, "borrarTicketKelloggs")
|
|
End If
|
|
Log("Success - Rows: " & result.Rows.Size)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Borramos el ticket de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "borrarTicketKelloggs" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log("ProcSuccess - Rows: " & result.Rows.Size)
|
|
Toast("Ticket Eliminado.", 0)
|
|
et_cliente.Text = ""
|
|
s_almacen2_2.SelectedIndex = 0
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Revisamos el ticket de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
Private costoTotal As Float = 0
|
|
liquidada = False
|
|
If result.Tag = "revisaTicketKelloggs" Then 'query tag
|
|
Dim cs, cs2 As CSBuilder
|
|
lv_ticket.Clear
|
|
prodsList.Initialize
|
|
If result.Rows.Size > 0 Then p_ticket.Visible = True
|
|
For Each records() As Object In result.Rows
|
|
cs.Initialize
|
|
cs2.Initialize
|
|
' For Each k As String In result.Columns.Keys
|
|
' Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
' Next
|
|
Private esteStatus As String = records(result.Columns.Get("ESTATUS"))
|
|
If esteStatus = "Liquidado" Then liquidada = True
|
|
prodsList.Add(CreateMap("id":records(result.Columns.Get("PRODUCTO_ID")), "P":records(result.Columns.Get("NOMBRE_PRODUCTO")), "cant":records(result.Columns.Get("CANTIDAD")), "almacen":records(result.Columns.Get("HVD_CEDIS")), "tipo":records(result.Columns.Get("TIPOVENTA"))))
|
|
lv_ticket.AddTwoLines(cs.Color(Colors.RGB(255,0,0)).Append("ID:").Pop.Append(records(result.Columns.Get("PRODUCTO_ID"))).Color(Colors.RGB(255,0,0)).Append(" P: ").Pop.Append(records(result.Columns.Get("NOMBRE_PRODUCTO"))).PopAll, _
|
|
cs2.Color(Colors.RGB(255,0,0)).Append("Cant: ").Pop.Append(records(result.Columns.Get("CANTIDAD"))).Color(Colors.RGB(255,0,0)).Append(" Costo Total: ").Pop.Append($"$$1.2{records(result.Columns.Get("COSTO_TOTAL"))}"$).Color(Colors.RGB(255,0,0)).Append(" Almacen: ").Pop.Append(records(result.Columns.Get("HVD_CEDIS"))).Color(Colors.RGB(255,0,0)).Append(" " & esteStatus.ToUpperCase ).PopAll)
|
|
If records(result.Columns.Get("COSTO_TOTAL")) <> "" Then costoTotal = costoTotal + records(result.Columns.Get("COSTO_TOTAL"))
|
|
' Log($"|${records(result.Columns.Get("COSTO_TOTAL"))}| - |${costoTotal}|"$)
|
|
Next
|
|
' For i=0 To 10
|
|
' cs.Initialize
|
|
' cs2.Initialize
|
|
' prodsList.Add(CreateMap("id":i, "P":i, "cant":i, "almacen":i))
|
|
'' lv_ticket.
|
|
' lv_ticket.AddTwoLines(cs.Color(Colors.RGB(255,0,0)).Append("ID:").Pop.Append(i).Color(Colors.RGB(255,0,0)).Append(" P: ").Pop.Append(i).PopAll, _
|
|
' cs2.Color(Colors.RGB(255,0,0)).Append("Cant: ").Pop.Append(i).Color(Colors.RGB(255,0,0)).Append(" Costo Total: ").Pop.Append($"$$1.2{i}"$).Color(Colors.RGB(255,0,0)).Append(" Almacen: ").Pop.Append(i).Color(Colors.RGB(255,0,0)).Append(" " & esteStatus.ToUpperCase ).PopAll)
|
|
' Next
|
|
Toast("Productos: " & result.Rows.Size & " Total $" & $"$1.2{costoTotal}"$, 350)
|
|
If result.Rows.Size = 0 Then l_SinProductos.Visible = True Else l_SinProductos.Visible = False
|
|
If liquidada Then
|
|
MsgboxAsync("Ya no se pueden borrar productos de este ticket.", "Ticket Liquidado")
|
|
End If
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Borramos pago duplicado de pagare de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "borrarPagoPagareDuplicado" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log("ProcSuccess - Rows: " & result.Rows.Size)
|
|
Toast("Pago duplicado Eliminado.", 0)
|
|
et_cliente.Text = ""
|
|
s_almacen2_2.SelectedIndex = 0
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Liberamos la bandera de facturación de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "liberaBanderaFacturacion" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log("ProcSuccess - Rows: " & result.Rows.Size)
|
|
Toast("Bandera de Facturacion LIBERADA.", 0)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Liberamos la bandera de carga foranea de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "liberaBanderaCargaForanea" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log("ProcSuccess - Rows: " & result.Rows.Size)
|
|
Toast("Bandera de Carga Foranea LIBERADA.", 0)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Liberamos la bandera de carga foranea de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "borraProductoTicket" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
' Log("ProcSuccess - Rows: " & result.Rows.Size)
|
|
' Toast("Bandera de Carga Foranea LIBERADA.", 0)
|
|
Next
|
|
End If
|
|
End If
|
|
If Job.JobName = "DBRequest" Then 'Liberamos la bandera de carga foranea de Kelloggs.
|
|
Dim result As DBResult = reqManager.HandleJob(Job)
|
|
If result.Tag = "copiaProdHVD2" Then 'query tag
|
|
For Each records() As Object In result.Rows
|
|
For Each k As String In result.Columns.Keys
|
|
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
|
Next
|
|
Log("Producto copiado a hist_ventas_detalle_2")
|
|
' Toast("Bandera de Carga Foranea LIBERADA.", 0)
|
|
Next
|
|
End If
|
|
If result.Tag = "borrarVentaGlobal" Then
|
|
Subs.logJobDoneResultados(result)
|
|
s_almacenBV.SelectedIndex = 0
|
|
et_rutaBV.Text = ""
|
|
s_tipoVentaBV.SelectedIndex = 0
|
|
Toast("Venta Eliminada.", 0)
|
|
End If
|
|
If result.Tag = "pasarInfoMovilKell" Then
|
|
Subs.logJobDoneResultados(result)
|
|
' s_almacenBV.SelectedIndex = 0
|
|
' et_rutaBV.Text = ""
|
|
' s_tipoVentaBV.SelectedIndex = 0
|
|
b_pasarInfoMovilKellogs.Enabled = True
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilKellogs.Text = $"PasarInfoMovil Kelloggs"$
|
|
Toast("Corriendo PasarInfoMovil Kelloggs.", 0)
|
|
End If
|
|
If result.Tag = "revisaArqueoYLiquidacion_Kelloggs" Or result.Tag = "revisaArqueoYLiquidacion_Durakelo" Then
|
|
b_revisaVenta2.text = "Revisar Venta"
|
|
Subs.logJobDoneResultados(result)
|
|
For Each records() As Object In result.Rows
|
|
Private arqueo As String = records(result.Columns.Get("ARQUEO"))
|
|
If arqueo = "null" Then arqueo = "ABIERTO"
|
|
Private liquidado As String = records(result.Columns.Get("LIQUIDADO"))
|
|
If liquidado <> "NO" Then liquidado = records(result.Columns.Get("HVD_DTECIERRE"))
|
|
l_resArqueo.Text = $"ARQUEO: ${arqueo}"$
|
|
l_resLiquidacion.Text = $"LIQUIDADA: ${liquidado}"$
|
|
Next
|
|
' Log(9999)
|
|
' p_resVentaTransparente.BringToFront
|
|
' p_resVentaTransparente.Visible = True
|
|
End If
|
|
|
|
If result.Tag = "revisaDuplicados_Kelloggs" Or result.Tag = "revisaDuplicados_Durakelo" Then
|
|
' Subs.logJobDoneResultados(result)
|
|
If result.Rows.Size > 0 Then
|
|
Log("=====> Hay Duplicados <======")
|
|
b_resDuplicadosKell.Enabled = True
|
|
b_resDuplicadosKell.Text = "HAY DUPLICADOS"& CRLF &"=> QUITARLOS <="
|
|
Else
|
|
Log("=====> NO Hay Duplicados <======")
|
|
b_resDuplicadosKell.Enabled = False
|
|
b_resDuplicadosKell.Text = "Sin duplicados"
|
|
End If
|
|
End If
|
|
|
|
If result.Tag = "quitarDuplicados_Kelloggs" Then
|
|
Subs.logJobDoneResultados(result)
|
|
b_resDuplicadosKell.Enabled = False
|
|
b_resDuplicadosKell.Text = "¡Listo!" & CRLF & "Duplicados Borrados"
|
|
End If
|
|
|
|
If result.Tag = "quitarDuplicados_Durakelo" Then
|
|
Subs.logJobDoneResultados(result)
|
|
b_resDuplicadosKell.Enabled = False
|
|
b_resDuplicadosKell.Text = "¡Listo!" & CRLF & "Duplicados Borrados"
|
|
End If
|
|
|
|
If result.Tag.As(String).Contains("abrirAvion") Then
|
|
Subs.logJobDoneResultados(result)
|
|
cuantosAbrirAvion = cuantosAbrirAvion + 1
|
|
If cuantosAbrirAvion = 2 Then
|
|
Log("¡Listo avión abierto!")
|
|
Toast("¡Listo avión abierto!", 0)
|
|
End If
|
|
End If
|
|
|
|
If result.Tag.As(String).Contains("revisaAvion_") Then
|
|
Subs.logJobDoneResultados(result)
|
|
|
|
If result.Rows.Size > 0 Then
|
|
For Each records() As Object In result.Rows
|
|
Private fecha As String = records(result.Columns.Get("HVD_CIERREAVION"))
|
|
Private hora As String = Regex.Split(" ", fecha)(1)
|
|
hora = hora.SubString2(0, hora.IndexOf("."))
|
|
Toast($"Cerrado a las ${hora}"$, 600)
|
|
Next
|
|
Else
|
|
Toast("¡Avión abierto!", 0)
|
|
End If
|
|
' cuantosAbrirAvion = cuantosAbrirAvion + 1
|
|
' If cuantosAbrirAvion = 2 Then
|
|
' Log("¡Listo avión abierto!")
|
|
' Toast("¡Listo avión abierto!", 0)
|
|
' End If
|
|
End If
|
|
|
|
|
|
|
|
End If
|
|
Job.Release
|
|
Else
|
|
Log("VERSION2")
|
|
LogColor("JobDone: '" & reqManagerT.HandleJob(Job).tag & "' - Registros: " & reqManagerT.HandleJob(Job).Rows.Size, Colors.Green) 'Mod por CHV - 211027
|
|
If Job.JobName = "DBRequest" Then 'Para desbloquear un usuario Guna.
|
|
Dim resultado As DBResult = reqManagerT.HandleJob(Job)
|
|
If resultado.Tag = "testTraeConexion" Then 'query tag
|
|
Private n, r As String
|
|
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))
|
|
If k = "CONEXION" Then
|
|
n = "CONEXION"
|
|
r = records(resultado.Columns.Get(k))
|
|
End If
|
|
Next
|
|
Next
|
|
Toast($"${n}: ${r}"$, 0)
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
|
|
End If
|
|
End Sub
|
|
|
|
'Revisamos que la contraseña ingresada sea la correcta para el día y hora.
|
|
Private Sub et_login_TextChanged (Old As String, New As String)
|
|
Private contrasenaHoy As String = pass1 & DateTime.GetDayOfMonth(DateTime.Now) & DateTime.GetHour(DateTime.now)
|
|
Log($"${contrasenaHoy}"$)
|
|
Log(New)
|
|
If New = contrasenaHoy Then
|
|
p_login.Visible = False
|
|
Sleep(80)
|
|
et_usuario.Text = ""
|
|
If Not(versionOk) Then ExitApplication 'Si la version no es correcta, salimos de la aplicacion.
|
|
kb.HideKeyboard
|
|
End If
|
|
End Sub
|
|
|
|
'Muestra un toast con texto y ancho dados, si el ancho es 0, entonces se queda el default.
|
|
Sub Toast(texto As String, ancho As Int)
|
|
p_toast.BringToFront
|
|
If ancho <> 0 Then p_toast.Width = ancho
|
|
p_toast.left = (Activity.Width/2)-(p_toast.Width/2) 'Centramos el panel en la actividad.
|
|
l_toast.Width = p_toast.Width
|
|
p_toast.top = (Activity.Height * 0.8) 'Ponemos el toast a 3/4 de la pantalla.
|
|
l_toast.Text = texto
|
|
p_toast.SetVisibleAnimated(1000, True)
|
|
Sleep(2000)
|
|
p_toast.SetVisibleAnimated(1000, False)
|
|
End Sub
|
|
|
|
'Mostramos u ocultamos el panel de opciones de desbloqueo.
|
|
Sub b_desbloquea_longClick
|
|
' If p_opcDesbloqueo.Visible Then
|
|
' p_opcDesbloqueo.Visible = False
|
|
' Else
|
|
' p_opcDesbloqueo.Visible = True
|
|
' End If
|
|
End Sub
|
|
|
|
'Si se modifica el checkbox de "Forzar mayusculas" de las opciones de desbloqueo, guardamos la configuración.
|
|
Private Sub cb_usrMayusc_CheckedChange(Checked As Boolean)
|
|
' p_opcDesbloqueo.Visible = False
|
|
' Private cb As String = "0"
|
|
' If cb_usrMayusc.Checked Then cb = "1"
|
|
'' Starter.mayusculasDesbloqueo = cb
|
|
' Starter.confMap.Put("mayusculasDesbloqueo", cb)
|
|
' Subs.escribreConf
|
|
End Sub
|
|
|
|
Private Sub et_usr_TextChanged (Old As String, New As String)
|
|
If New.Length > 2 Then buscaUsuario
|
|
End Sub
|
|
|
|
Private Sub et_almacen_TextChanged (Old As String, New As String)
|
|
If New.Length > 2 Then buscaUsuario
|
|
End Sub
|
|
|
|
Private Sub et_ruta_TextChanged (Old As String, New As String)
|
|
If New.Length > 1 Then buscaUsuario
|
|
End Sub
|
|
|
|
Private Sub b_buscarUsr_Click
|
|
buscaUsuario
|
|
kb.HideKeyboard
|
|
End Sub
|
|
|
|
Sub buscaUsuario
|
|
Private usr As String = et_usr.text.Trim
|
|
Private alm As String = et_almacen.text.Trim
|
|
Private rut As String = et_ruta.text.Trim
|
|
cmd.Initialize
|
|
cmd.Name = $"select_todos${usrEmpresa}_soporte"$
|
|
cmd.Parameters = Array As Object(usr, usr, alm, rut)
|
|
Log($"Buscar: ${usrEmpresa}, ${alm}, ${usr}, ${rut}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , $"select_todos_soporte"$, 0)
|
|
End Sub
|
|
|
|
Private Sub b_revisaVenta_Click
|
|
kb.HideKeyboard
|
|
Private rut As String = et_ruta1.text.Trim
|
|
cmd.Name = "select_ventaXrutaGuna_soporte"
|
|
cmd.Parameters = Array As Object(rut, almacenGuna)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenGuna}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "select_ventaXrutaGuna_soporte", 0)
|
|
End Sub
|
|
|
|
Private Sub b_revisaVenta2_Click
|
|
laEmpresa = "Kelloggs"
|
|
laRuta = et_ruta2.Text.trim
|
|
almacenEmpresa = almacenKelloggs
|
|
kb.HideKeyboard
|
|
b_revisaVenta2.text = "Revisando ..."
|
|
Private rut As String = et_ruta2.text.Trim
|
|
cmd.Name = "select_ventaXrutaKelloggs_soporte"
|
|
cmd.Parameters = Array As Object(rut, almacenKelloggs, tipoVentaKelloggs)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenKelloggs}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "select_ventaXrutaKelloggs_soporte", 0)
|
|
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = "revisaDuplicados_Kelloggs"
|
|
cmd.Parameters = Array As Object(almacenKelloggs, rut)
|
|
b_resDuplicadosKell.Enabled = False
|
|
b_resDuplicadosKell.Text = "Buscando duplicados ..."
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenKelloggs}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "revisaDuplicados_Kelloggs", 0)
|
|
Log($"################ REVISAMOS DUPLICADOS ${almacenKelloggs}, ${rut} ########################"$)
|
|
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = "revisaArqueoYLiquidacion_Kelloggs"
|
|
cmd.Parameters = Array As Object(almacenKelloggs, rut, almacenKelloggs, rut)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenKelloggs}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "revisaArqueoYLiquidacion_Kelloggs", 0)
|
|
Sleep(500)
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
End Sub
|
|
|
|
Private Sub b_revisaVenta3_Click
|
|
kb.HideKeyboard
|
|
Private rut As String = et_ruta3.text.Trim
|
|
cmd.Name = "select_ventaXrutaSalma_soporte"
|
|
cmd.Parameters = Array As Object(rut, almacenSalma)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenSalma}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "select_ventaXrutaSalma_soporte", 0)
|
|
End Sub
|
|
|
|
Private Sub b_revisaVenta4_Click
|
|
kb.HideKeyboard
|
|
Private rut As String = et_ruta4.text.Trim
|
|
cmd.Name = "select_ventaXrutaDanvit_soporte"
|
|
cmd.Parameters = Array As Object(rut, almacenDanvit)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenDanvit}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "select_ventaXrutaDanvit_soporte", 0)
|
|
End Sub
|
|
|
|
Private Sub s_usrEmpresa_ItemClick (Position As Int, Value As Object)
|
|
usrEmpresa = Value
|
|
End Sub
|
|
|
|
Private Sub s_almacen2_2_ItemClick (Position As Int, Value As Object)
|
|
almacenKelloggs2 = spinnerKelloggs2Map.Get(Value)
|
|
Log($"Almacén ${almacenKelloggs2} de Kelloggs 2 seleccionado"$ )
|
|
End Sub
|
|
|
|
Private Sub b_borrarTicket_Click
|
|
kb.HideKeyboard
|
|
cmd.Name = "select_prodsTicket_Kelloggs"
|
|
cmd.Parameters = Array As Object(almacenKelloggs2, et_cliente.Text.Trim)
|
|
Log($"Mandamos: almacen=${almacenKelloggs2}, cliente=${et_cliente.Text}"$)
|
|
reqManager.ExecuteQuery(cmd, 1, "revisaTicketLiquidadoKelloggs", 0)
|
|
End Sub
|
|
|
|
Private Sub b_revisaTicket_Click
|
|
Log("revisando")
|
|
kb.HideKeyboard
|
|
p_ticket.Width = Activity.Width * 0.95
|
|
p_ticket.Left = (Activity.Width/2) - (p_ticket.Width/2)
|
|
Subs.centraEtiquetaEnPanel(l_SinProductos, p_ticket)
|
|
Subs.centraBotonEnPanel(b_cerrarTicket, p_ticket)
|
|
p_ticket.BringToFront
|
|
' p_ticket.Visible = True
|
|
lv_ticket.Clear
|
|
cmd.Name = "select_prodsTicket_Kelloggs"
|
|
cmd.Parameters = Array As Object(almacenKelloggs2, et_cliente.Text.Trim)
|
|
Log($"Mandamos: almacen=${almacenKelloggs2}, cliente=${et_cliente.Text}"$)
|
|
reqManager.ExecuteQuery(cmd, 0, "revisaTicketKelloggs", 0)
|
|
End Sub
|
|
|
|
Private Sub b_borrarPagare_Click
|
|
kb.HideKeyboard
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = "proc_QUITAR_PAGOPAGARE_KELLOGGS"
|
|
cmd.Parameters = Array As Object(et_referencia.text.Trim, et_folio.Text.Trim, et_monto.Text.Trim)
|
|
Log($"Mandamos: ref:${et_referencia.text}, folio:${et_folio.Text}, monto:${et_monto.Text}"$)
|
|
reqManager.ExecuteCommand(cmd, "borrarPagoPagareDuplicado")
|
|
End Sub
|
|
|
|
Private Sub b_libBanderaFactura_Click
|
|
kb.HideKeyboard
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
' reqManager.Initialize(Me, "http://keymon.lat:9001") 'DBReqSrver de pruebas
|
|
cmd.Name = "proc_LIBERA_BANDERA_FACTURACION_KELLOGGS"
|
|
' cmd.Parameters = Array As Object(et_referencia.text, et_folio.Text, et_monto.Text)
|
|
' Log($"Mandamos: ref:${et_referencia.text}, folio:${et_folio.Text}, monto:${et_monto.Text}"$)
|
|
Log("Llamamos procedimiento liberar bandera facturacion")
|
|
reqManager.ExecuteCommand(cmd, "liberaBanderaFacturacion")
|
|
End Sub
|
|
|
|
Private Sub b_libBanderaCargaForanea_Click
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
kb.HideKeyboard
|
|
cmd.Name = "proc_LIBERA_BANDERA_CARGAFORANEA_KELLOGGS"
|
|
cmd.Parameters = Array As Object("101", "")
|
|
Log("Llamamos procedimiento liberar carga foranea")
|
|
reqManager.ExecuteCommand(cmd, "liberaBanderaCargaForanea")
|
|
End Sub
|
|
|
|
Private Sub b_cerrarTicket_Click
|
|
p_ticket.Visible = False
|
|
l_SinProductos.Visible = False
|
|
End Sub
|
|
|
|
Private Sub p_ticket_Click
|
|
|
|
End Sub
|
|
|
|
Private Sub lv_ticket_ItemClick (Position As Int, Value As Object)
|
|
Log(prodsList.get(Position)) ' SUR 9120761
|
|
If Not(liquidada) And prodsList.Size > 1 Then
|
|
Msgbox2Async($"Deseas borrar el producto ${prodsList.Get(Position).As(Map).Get("id")}"$, "Borrar Producto", "Borrar", "Cancelar", "", Null, True)
|
|
Wait For Msgbox_Result (Result As Int)
|
|
If Result = DialogResponse.POSITIVE Then
|
|
' borrarProducto
|
|
Log("Borramos producto " & prodsList.Get(Position).As(Map).Get("id"))
|
|
Private m As Map = prodsList.get(Position)
|
|
Log(m)
|
|
lv_ticket.RemoveAt(Position)
|
|
prodsList.RemoveAt(Position)
|
|
|
|
cmd.Name = "insertIntoHVD2"
|
|
cmd.Parameters = Array As Object(et_cliente.Text, m.Get("id"), m.Get("cant"), m.Get("tipo"), m.Get("almacen"))
|
|
Log($"Mandamos ${et_cliente.Text}, ${m.Get("id")}, ${m.Get("cant")}, ${m.Get("tipo")}, ${m.Get("almacen")}"$)
|
|
reqManager.ExecuteCommand(cmd, "copiaProdHVD2")
|
|
|
|
cmd.Name = "delete_ProdTicket"
|
|
cmd.Parameters = Array As Object(et_cliente.Text, m.Get("id"), m.Get("cant"), m.Get("tipo"), m.Get("almacen"), m.Get("P"))
|
|
Log($"Mandamos ${et_cliente.Text}, ${m.Get("id")}, ${m.Get("cant")}, ${m.Get("tipo")}, ${m.Get("almacen")}, ${m.Get("P")}"$)
|
|
reqManager.ExecuteCommand(cmd, "borraProductoTicket")
|
|
End If
|
|
Log(prodsList)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub b_revisaVentaMards_Click
|
|
kb.HideKeyboard
|
|
Private rut As String = et_rutaMards.text.Trim
|
|
cmd.Name = "select_ventaXrutaMards_soporte"
|
|
cmd.Parameters = Array As Object(rut, almacenMards)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenMards}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , "select_ventaXrutaMards_soporte", 0)
|
|
End Sub
|
|
|
|
Private Sub b_borrarVentaMards_Click
|
|
If et_rutaMards.text <> "" And almacenMards <> "" Then
|
|
kb.HideKeyboard
|
|
Private rutaVenta As Int = et_rutaMards.Text.Trim
|
|
Private usrSoporte As String = "appSoporte"
|
|
cmd.Initialize
|
|
cmd.Name = "proc_QUITAR_VENTA_MARDS"
|
|
cmd.Parameters = Array As Object(almacenMards, rutaVenta, usrSoporte)
|
|
Log($"Mandamos borrar venta de Mards, almacen: ${almacenMards}, ruta: ${rutaVenta}, usuario: '${usrSoporte}'"$)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaMards")
|
|
Else
|
|
Toast("Por favor ingrese ruta y almacén 🙄", 600)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub b_forzarVentaBV_Click
|
|
Private rutaVenta As Int
|
|
rutaVenta = et_rutaBV.Text.trim
|
|
almacenEmpresa = spinnerEmpresaMap.Get(s_almacenBV.SelectedItem)
|
|
Private usrSoporte As String = "appSoporte"
|
|
' Private tipoVenta As String = tipoVentaKelloggs
|
|
Private bandera As Int = 1
|
|
cmd.Initialize 'Se borra la venta forzada
|
|
If laEmpresa = "Kelloggs" Then
|
|
cmd.Name = "proc_QUITAR_VENTA_KELL"
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, usrSoporte, tipoVentaKelloggs, bandera)
|
|
End If
|
|
If laEmpresa = "Durakelo" Then
|
|
cmd.Name = "proc_QUITAR_VENTA_DURAKELO"
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, usrSoporte, tipoVentaKelloggs)
|
|
End If
|
|
Log($"Madamos borrar venta ${laEmpresa}: "$ & almacenEmpresa&"|"& rutaVenta&"|"&usrSoporte&"|"&tipoVentaKelloggs&"|"&bandera)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaKelloggs")
|
|
End Sub
|
|
|
|
Private Sub b_borrarVentaBV_Click
|
|
laEmpresa = s_empresaBV.SelectedItem
|
|
almacenEmpresa = s_almacenBV.SelectedItem
|
|
almacenEmpresa = spinnerEmpresaMap.Get(s_almacenBV.SelectedItem)
|
|
b_forzarVentaBV.Visible = False
|
|
If et_rutaBV.text <> "" And almacenEmpresa <> "" Then
|
|
kb.HideKeyboard
|
|
Private rutaVenta As Int = et_rutaBV.Text.Trim
|
|
Private usrSoporte As String = "appSoporte"
|
|
elTipoDeVenta = s_tipoVentaBV.SelectedItem
|
|
cmd.Initialize
|
|
Private laEmp As String = laEmpresa.ToUpperCase
|
|
If laEmp = "KELLOGGS" Then
|
|
cmd.Name = "revisa_liquidada_Kell" 'Primero revisamos que no este liquidada o con descuento.
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, elTipoDeVenta)
|
|
Log($"Revisamos venta liquidada Kelloggs: almacen: ${almacenEmpresa}, ruta: ${rutaVenta}, tipoVenta:${elTipoDeVenta}"$)
|
|
reqManager.ExecuteQuery(cmd , 0, "revisa_liquidada_Kell", 0)
|
|
else if laEmp = "GUNA" Then
|
|
cmd.Name = "revisa_liquidada_Guna" 'Primero revisamos que no este liquidada o con descuento.
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta)
|
|
Log($"Revisamos venta liquidada Guna: almacen: ${almacenEmpresa}, ruta: ${rutaVenta} "$)
|
|
reqManager.ExecuteQuery(cmd , 0, "revisa_liquidada_Guna", 0)
|
|
else if laEmp = "SALMA" Then
|
|
cmd.Name = "proc_QUITAR_VENTA_SALMA"
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, usrSoporte)
|
|
Log($"Mandamos borrar venta de Salma, almacen: ${almacenEmpresa}, ruta: ${rutaVenta}, usuario: '${usrSoporte}'"$)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaSalma")
|
|
else if laEmp = "MARDS" Then
|
|
cmd.Name = "proc_QUITAR_VENTA_MARDS"
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, usrSoporte)
|
|
Log($"Mandamos borrar venta de Mards, almacen: ${almacenEmpresa}, ruta: ${rutaVenta}, usuario: '${usrSoporte}'"$)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaMards")
|
|
else if laEmp = "DURAKELO" Then
|
|
cmd.Name = "revisa_liquidada_Durakelo"
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, elTipoDeVenta)
|
|
Log($"Revisamos venta liquidada Durakelo: almacen: ${almacenEmpresa}, ruta: ${rutaVenta}, tipoVenta:${elTipoDeVenta}"$)
|
|
reqManager.ExecuteQuery(cmd , 0, "revisa_liquidada_Durakelo", 0)
|
|
Else
|
|
If laEmpresa = "Kelloggs" Then laEmp = "KELL"
|
|
cmd.Name = $"proc_QUITAR_VENTA_${laEmp}"$
|
|
Log($"proc_QUITAR_VENTA_${laEmp}"$)
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rutaVenta, usrSoporte)
|
|
Log($"Mandamos borrar venta de Mards, almacen: ${almacenEmpresa}, ruta: ${rutaVenta}, usuario: '${usrSoporte}'"$)
|
|
reqManager.ExecuteCommand(cmd , "borrarVentaGlobal")
|
|
End If
|
|
Else
|
|
Toast("Por favor ingrese ruta y almacén 🙄", 600)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub b_revisarVentaBV_Click
|
|
kb.HideKeyboard
|
|
b_forzarVentaBV.Visible = False
|
|
laEmpresa = s_empresaBV.SelectedItem
|
|
tipoVentaKelloggs = s_tipoVentaBV.SelectedItem
|
|
' Log("============================= " & CRLF & spinnerEmpresaMap)
|
|
almacenEmpresa = spinnerEmpresaMap.Get(s_almacenBV.SelectedItem)
|
|
Private rut As String = et_rutaBV.text.Trim
|
|
laRuta = rut
|
|
cmd.Name = $"select_ventaXruta${laEmpresa}_soporte"$
|
|
cmd.Parameters = Array As Object(rut, almacenEmpresa)
|
|
If laEmpresa = "Kelloggs" Or laEmpresa = "Durakelo" Then
|
|
cmd.Parameters = Array As Object(rut, almacenEmpresa, tipoVentaKelloggs)
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenEmpresa}, ${tipoVentaKelloggs}, select_ventaXruta${laEmpresa}_soporte"$)
|
|
End If
|
|
Log($"mandamos: ruta=${rut}, almacen=${almacenEmpresa}, select_ventaXruta${laEmpresa}_soporte"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , $"select_ventaXruta${laEmpresa}_soporte"$, 0)
|
|
|
|
If laEmpresa = "Kelloggs" Or laEmpresa = "Durakelo" Then
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = $"revisaDuplicados_${laEmpresa}"$
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rut)
|
|
b_resDuplicadosKell.Enabled = False
|
|
b_resDuplicadosKell.Text = "Buscando duplicados ..."
|
|
Log($"Duplicados mandamos: ruta=${rut}, almacen=${almacenEmpresa}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , $"revisaDuplicados_${laEmpresa}"$, 0)
|
|
Log($"################ REVISAMOS DUPLICADOS ${almacenEmpresa}, ${rut} ########################"$)
|
|
|
|
cmd.Name = $"revisaArqueoYLiquidacion_${laEmpresa}"$
|
|
cmd.Parameters = Array As Object(almacenEmpresa, rut, almacenEmpresa, rut)
|
|
Log($"revisaArqueoYLiquidacion mandamos: ruta=${rut}, almacen=${almacenEmpresa}"$)
|
|
reqManager.ExecuteQuery(cmd, 0 , $"revisaArqueoYLiquidacion_${laEmpresa}"$, 0)
|
|
Sleep(500)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub s_tipoVentaBV_ItemClick (Position As Int, Value As Object)
|
|
elTipoDeVenta = Value
|
|
End Sub
|
|
|
|
Private Sub et_rutaBV_TextChanged (Old As String, New As String)
|
|
|
|
End Sub
|
|
|
|
Private Sub s_almacenBV_ItemClick (Position As Int, Value As Object)
|
|
almacenEmpresa = spinnerEmpresaMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log(Value)
|
|
Log($"Almacén ${almacenEmpresa} de ${laEmpresa} seleccionado"$ )
|
|
End Sub
|
|
|
|
Private Sub s_empresaBV_ItemClick (Position As Int, Value As Object)
|
|
laEmpresa = Value
|
|
If laEmpresa = "Kelloggs" Or laEmpresa = "Durakelo" Then
|
|
l_tipoVentaBV.Visible = True
|
|
s_tipoVentaBV.Visible = True
|
|
p_tipoVentaBV.Visible = True
|
|
Else
|
|
l_tipoVentaBV.Visible = False
|
|
s_tipoVentaBV.Visible = False
|
|
p_tipoVentaBV.Visible = False
|
|
End If
|
|
If laEmpresa = "Mards" Or laEmpresa = "Kelloggs" Or laEmpresa = "Durakelo" Or laEmpresa = "Salma" Or laEmpresa = "Intmex" Then
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
Log("Mards o Kelloggs")
|
|
Else
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
End If
|
|
spinnerEmpresaMap = empresasMap.Get(Value)
|
|
' Log(empresasMap & "|" & Value)
|
|
' Log($"${spinnerEmpresaMap}"$)
|
|
s_almacenBV.Clear
|
|
s_almacenBV.Add("-= Seleccione =-")
|
|
For Each e In empresasMap.Get(Value).As(Map).Keys
|
|
' Log(e)
|
|
s_almacenBV.Add(e)
|
|
Next
|
|
s_almacenBV.SelectedIndex = 0
|
|
Log($"Empresa seleccionada: ${Value}"$ )
|
|
End Sub
|
|
|
|
Private Sub b_pasarInfoMovilKellogs_Click
|
|
b_pasarInfoMovilKellogs.Enabled = False
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilKellogs.Text = $"pimKell - Inicio a las ${DateTime.Date(DateTime.Now)}"$
|
|
Toast("Corriendo PasarInfoMovil Kelloggs.", 0)
|
|
' reqManager.Initialize(Me, "http://keymon.lat:9001")
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Initialize
|
|
cmd.Name = "sp_pasarInfo_Kelloggs"
|
|
reqManager.ExecuteQuery(cmd , 0, "pasarInfoMovilKell", 180000) 'request con timeout largo en ms.
|
|
End Sub
|
|
|
|
Private Sub b_pasarInfoMovilDurakelo_Click
|
|
b_pasarInfoMovilDurakelo.Enabled = False
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilDurakelo.Text = $"pimDur - Inicio a las ${DateTime.Date(DateTime.Now)}"$
|
|
Toast("Corriendo PasarInfoMovil Durakelo.", 0)
|
|
' reqManager.Initialize(Me, "http://keymon.lat:9001")
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Initialize
|
|
cmd.Name = "sp_pasarInfo_Durakelo"
|
|
reqManager.ExecuteQuery(cmd , 0, "pasarInfoMovilDur", 180000) 'request con timeout largo en ms.
|
|
End Sub
|
|
|
|
Private Sub b_pasarInfoMovilDurakeloRep_Click
|
|
b_pasarInfoMovilDurakeloRep.Enabled = False
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilDurakeloRep.Text = $"pimDurRep - Inicio a las ${DateTime.Date(DateTime.Now)}"$
|
|
Toast("Corriendo PasarInfoMovil Durakelo Rep.", 0)
|
|
' reqManager.Initialize(Me, "http://keymon.lat:9001")
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Initialize
|
|
cmd.Name = "sp_pasarInfo_DurakeloRep"
|
|
reqManager.ExecuteQuery(cmd , 0, "pasarInfoMovilDurRep", 180000) 'request con timeout largo en ms.
|
|
End Sub
|
|
|
|
Private Sub b_pasarInfoMovilIntmex_Click
|
|
b_pasarInfoMovilIntmex.Enabled = False
|
|
DateTime.DateFormat = "HH:mm:ss"
|
|
b_pasarInfoMovilIntmex.Text = $"pimIntmex - Inicio a las ${DateTime.Date(DateTime.Now)}"$
|
|
Toast("Corriendo PasarInfoMovil Intmex.", 0)
|
|
' reqManager.Initialize(Me, "http://keymon.lat:9001")
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Initialize
|
|
cmd.Name = "sp_pasarInfo_Intmex"
|
|
reqManager.ExecuteQuery(cmd , 0, "pasarInfoMovilIntmex", 180000) 'request con timeout largo en ms.
|
|
End Sub
|
|
|
|
Private Sub b_cerrar_Click
|
|
p_resVentaTransparente.Visible = False
|
|
End Sub
|
|
|
|
Private Sub p_resVentaTransparente_Click
|
|
p_resVentaTransparente.Visible = False
|
|
End Sub
|
|
|
|
Private Sub b_resDuplicadosKell_Click
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = $"quitarDuplicados_${laEmpresa}"$
|
|
cmd.Parameters = Array As Object(almacenEmpresa, laRuta, "appSoporte")
|
|
Log($"mandamos QUITAR duplicados: ruta=${laRuta}, almacen=${almacenEmpresa}"$)
|
|
reqManager.ExecuteCommand(cmd, $"quitarDuplicados_${laEmpresa}"$)
|
|
Log($"################ QUITAMOS DUPLICADOS ${laEmpresa}, ${almacenEmpresa}, ${laRuta} ########################"$)
|
|
End Sub
|
|
|
|
Private Sub s_empresaAA_ItemClick (Position As Int, Value As Object)
|
|
laEmpresa = Value
|
|
' If laEmpresa = "Kelloggs" Or laEmpresa = "Durakelo" Then
|
|
' l_tipoVentaBV.Visible = True
|
|
' s_tipoVentaBV.Visible = True
|
|
' p_tipoVentaBV.Visible = True
|
|
' Else
|
|
' l_tipoVentaBV.Visible = False
|
|
' s_tipoVentaBV.Visible = False
|
|
' p_tipoVentaBV.Visible = False
|
|
' End If
|
|
If laEmpresa = "Mards" Or laEmpresa = "Kelloggs" Or laEmpresa = "Durakelo" Or laEmpresa = "Salma" Or laEmpresa = "Intmex" Then
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
Log("Mards o Kelloggs")
|
|
Else
|
|
reqManager.Initialize(Me, DBRS_1782)
|
|
End If
|
|
spinnerEmpresaMap = empresasMap.Get(Value)
|
|
' Log(empresasMap & "|" & Value)
|
|
' Log($"${spinnerEmpresaMap}"$)
|
|
s_almacenAA.Clear
|
|
s_almacenAA.Add("-= Seleccione =-")
|
|
For Each e In empresasMap.Get(Value).As(Map).Keys
|
|
' Log(e)
|
|
s_almacenAA.Add(e)
|
|
Next
|
|
empresaAA = Value
|
|
s_almacenAA.SelectedIndex = 0
|
|
Log($"Empresa seleccionada: ${Value}"$ )
|
|
End Sub
|
|
|
|
Private Sub s_almacenAA_ItemClick (Position As Int, Value As Object)
|
|
almacenEmpresa = spinnerEmpresaMap.Get(Value)
|
|
almacenDeRuta = Value
|
|
Log(Value)
|
|
almacenAA = almacenEmpresa
|
|
Log($"Almacén ${almacenEmpresa} de ${laEmpresa} seleccionado"$ )
|
|
End Sub
|
|
|
|
Private Sub b_abrirAvion_Click
|
|
' Log(empresaAA)
|
|
' Log(almacenAA)
|
|
' Log(et_rutaAA.text)
|
|
cuantosAbrirAvion = 0
|
|
reqManager.Initialize(Me, DBRS_1781)
|
|
cmd.Name = $"abrirAvion1_${empresaAA}"$
|
|
cmd.Parameters = Array As Object(almacenAA, et_rutaAA.text)
|
|
reqManager.ExecuteCommand(cmd, $"abrirAvion1_${empresaAA}"$)
|
|
cmd.Name = $"abrirAvion2_${empresaAA}"$
|
|
cmd.Parameters = Array As Object(et_rutaAA.text, almacenAA)
|
|
reqManager.ExecuteCommand(cmd, $"abrirAvion2_${empresaAA}"$)
|
|
End Sub
|
|
|
|
Private Sub b_revisaAA_Click
|
|
cmd.Name = $"revisaAvion_${empresaAA}"$
|
|
cmd.Parameters = Array As Object(almacenAA, et_rutaAA.text)
|
|
reqManager.ExecuteQuery(cmd, 0, $"revisaAvion_${empresaAA}"$, 0)
|
|
End Sub
|
|
|
|
Private Sub Label1_LongClick
|
|
Log("Clicked Global")
|
|
' Private reqManagerT As DBRequestManagerV2
|
|
Private cmd2 As DBCommand
|
|
cmd2.Initialize
|
|
' reqManagerT.Initialize(Me, "http://192.168.100.20:9000")
|
|
reqManagerT.Initialize(Me, "http://keymon.net:9010/DB2")
|
|
cmd2.Name = "traeConexion"
|
|
reqManagerT.ExecuteQuery(cmd2 , 0, "testTraeConexion", 0)
|
|
End Sub |