mirror of
https://github.com/KeymonSoft/DBCheck.git
synced 2026-04-17 19:37:09 +00:00
...
This commit is contained in:
@@ -7,11 +7,10 @@ Version=9.85
|
||||
#Region Shared Files
|
||||
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\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
|
||||
'Ctrl + click to sync files con Github Desktop ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\
|
||||
#End Region
|
||||
|
||||
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
|
||||
|
||||
Sub Class_Globals
|
||||
Private Root As B4XView
|
||||
Private xui As XUI
|
||||
@@ -39,6 +38,11 @@ Sub Class_Globals
|
||||
Private l_progressDialog As Label
|
||||
Private p_editaRuta As Panel
|
||||
Private p_editaAlmacen As Panel
|
||||
Private b_cargarBD As Button
|
||||
Private p_datos As Panel
|
||||
Private p_principal As Panel
|
||||
Private l_appInfo As Label
|
||||
Dim empresa, appVersion As String
|
||||
End Sub
|
||||
|
||||
Public Sub Initialize
|
||||
@@ -49,8 +53,11 @@ End Sub
|
||||
Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Root = Root1
|
||||
Root.LoadLayout("MainPage")
|
||||
p_principal.Width = Root.Width
|
||||
p_principal.Height = Root.Height
|
||||
Subs.centraPanel(p_datos, Root.Width)
|
||||
reqManager.Initialize(Me, "http://187.189.244.154:1782")
|
||||
B4XPages.SetTitle(Me, "Mariana revisión de BD")
|
||||
B4XPages.SetTitle(Me, "Revisión de BD")
|
||||
Subs.centraPanel(p_progressDialog, Root.Width)
|
||||
Subs.centraPanel(p_editaRuta, Root.Width)
|
||||
Subs.centraPanel(p_editaAlmacen, Root.Width)
|
||||
@@ -86,14 +93,25 @@ Sub B4XPage_Appear
|
||||
Log($"Existe BD: ${File.Exists(File.DirInternal, "kmt.db") }"$)
|
||||
If File.Exists(File.DirInternal, "kmt.db") Then
|
||||
If Not(skmt.IsInitialized) Then skmt.Initialize(File.DirInternal,"kmt.db", True)
|
||||
Dim ai As Cursor = skmt.ExecQuery($"select CAT_VA_DESCRIPCION, CAT_VA_VALOR from cat_variables where CAT_VA_DESCRIPCION = 'EMPRESA' or CAT_VA_DESCRIPCION = 'APP_VERSION'"$)
|
||||
If ai.RowCount > 1 Then
|
||||
For i = 0 To ai.RowCount -1
|
||||
ai.Position = i
|
||||
If ai.GetString("CAT_VA_DESCRIPCION") = "EMPRESA" Then empresa = ai.GetString("CAT_VA_VALOR")
|
||||
If ai.GetString("CAT_VA_DESCRIPCION") = "APP_VERSION" Then appVersion = ai.GetString("CAT_VA_VALOR")
|
||||
Next
|
||||
l_appInfo.Text = $"${empresa} ${appVersion}"$
|
||||
End If
|
||||
Dim c As Cursor = skmt.ExecQuery($"select count(distinct pe_cliente) as pedidos, group_concat(distinct substr(pe_fecha, 4,2)) as diasVenta, sum(pe_costo_tot) as total, (select PE_CANT from pedido where PE_CANT = 0) as cantsEnCero, (select count(PE_CLIENTE) from pedido where printf("%d", PE_CLIENTE) <> PE_CLIENTE ) as clienteNoNumerico from pedido"$)
|
||||
Log(c.RowCount)
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
l_pedidos2.Text = c.GetString("pedidos")
|
||||
l_diasVenta.Text = c.GetString("diasVenta")
|
||||
l_totalVenta.Text = "$" & NumberFormat2(c.GetString("total"), 1, 2, 2, True)
|
||||
l_cantsEnCero.Text = c.GetString("cantsEnCero")
|
||||
l_diasVenta.Text = "N/A"
|
||||
If c.GetString("diasVenta") <> Null Then l_diasVenta.Text = c.GetString("diasVenta")
|
||||
If c.GetString("total") <> Null Then l_totalVenta.Text = "$" & NumberFormat2(c.GetString("total"), 1, 2, 2, True) Else l_totalVenta.Text = "0"
|
||||
l_cantsEnCero.Text = "0"
|
||||
If c.GetString("cantsEnCero") <> Null Then l_cantsEnCero.Text = c.GetString("cantsEnCero")
|
||||
l_clienteNoNumerico.Text = c.GetString("clienteNoNumerico")
|
||||
End If
|
||||
Dim c As Cursor = skmt.ExecQuery("select pe_ruta from pedido")
|
||||
@@ -380,6 +398,15 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
Return False
|
||||
End Sub
|
||||
|
||||
Private Sub b_cargarBD_Click
|
||||
Private FH As FileHandler
|
||||
FH.Initialize
|
||||
Wait For (FH.Load) Complete (Result As LoadResult) 'Abre un fileManager para seleccionar la base de datos a importar.
|
||||
File.Copy(Result.Dir, Result.FileName, File.DirInternal, "kmt.db") 'Copia la base de datos seleccionada al directorio interno.
|
||||
skmt.Initialize(File.DirInternal,"kmt.db", True) 'Reiniciliza la base de datos con la recien importada.
|
||||
ToastMessageShow("¡BD importada!", False)
|
||||
End Sub
|
||||
|
||||
Private Sub l_ruta2_LongClick
|
||||
p_editaRuta.Top = l_ruta2.top
|
||||
p_editaRuta.Visible = True
|
||||
|
||||
Reference in New Issue
Block a user