mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-17 18:26:11 +00:00
- Se agregó la opcion de importar la base de datos directamente desde Whatsapp, hay que ingresar al engrane con el usuario KMTS1.
This commit is contained in:
@@ -113,6 +113,10 @@ Sub Class_Globals
|
||||
Private l_cartaPorte As Label
|
||||
Private et_maxClientesNuevos As EditText
|
||||
Private l_maxClientesNuevos As Label
|
||||
Dim in As Intent
|
||||
Dim intentUsado As Boolean = False
|
||||
Private p_importarBDWA As Panel
|
||||
Private cb_importarBDWA As CheckBox
|
||||
End Sub
|
||||
|
||||
Public Sub Initialize
|
||||
@@ -339,6 +343,37 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
Log("LLAMAMOS traeUsarIntentBDWA")
|
||||
If kh.traeUsarIntentBDWA Then
|
||||
Private tmpBDWA As Boolean = kh.traeUsarIntentBDWA
|
||||
If Not(in.IsInitialized) Then in = B4XPages.GetNativeParent(Me).GetStartingIntent
|
||||
If Not(intentUsado) And in <> Null Then
|
||||
' Log(in)
|
||||
intentUsado = True
|
||||
' Log(in.As(String))
|
||||
If in.GetData <> Null Then
|
||||
Dim XmlData As String
|
||||
XmlData = in.GetData
|
||||
' ToastMessageShow(XmlData, False)
|
||||
' Send_Make_somthing(in)
|
||||
' Activity.Finish
|
||||
Try
|
||||
Dim OutStr As OutputStream = File.OpenOutput(File.DirInternal,"kmt.db",False)
|
||||
Dim InStr As InputStream = File.OpenInput("ContentDir",XmlData)
|
||||
File.Copy2(InStr,OutStr)
|
||||
LogColor("BD copiada a interna.", Colors.Blue)
|
||||
OutStr.Close
|
||||
If in.As(String).Contains("whatsapp") Then ToastMessageShow("BD cargada desde Whatsapp", False)
|
||||
Catch
|
||||
Log(LastException)
|
||||
End Try
|
||||
' ExitApplication
|
||||
End If
|
||||
End If
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'")
|
||||
Starter.skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('IMPORTAR_BD_WA', '${tmpBDWA}')"$)
|
||||
|
||||
End If
|
||||
MES1.Initialize(Me, "MES1")
|
||||
Log("SDK: " & device.SdkVersion)
|
||||
' Get the device SDK version
|
||||
@@ -371,6 +406,8 @@ Sub B4XPage_Appear
|
||||
kh.SetButtonTintList(cb_cartaPorte, Colors.LightGray, Colors.RGB(43, 154, 211))
|
||||
cb_geocerca.Checked = kh.traeUsarGeocerca
|
||||
cb_cartaPorte.Checked = kh.traeUsarCartaPorte
|
||||
' Log("LLAMAMOS traeUsarIntentBDWA")
|
||||
cb_importarBDWA.Checked = kh.traeUsarIntentBDWA
|
||||
et_maxClientesNuevos.Text = kh.traeMaxClientesNuevos
|
||||
' server = "http://keymon.com.mx:1782"
|
||||
' server = "http://201.99.139.28:1782"
|
||||
@@ -623,7 +660,13 @@ Sub i_engranes_Click
|
||||
Panel1.Top = (Root.Height/2) - (Panel1.Height/2)
|
||||
Panel1.Elevation = 100
|
||||
Panel1.BringToFront
|
||||
If user.Text = "KMTS1" Then b_importarBD.Visible = True Else b_importarBD.Visible = False
|
||||
If user.Text.Trim = "KMTS1" Then
|
||||
b_importarBD.Visible = True
|
||||
p_importarBDWA.Visible = True
|
||||
Else
|
||||
b_importarBD.Visible = False
|
||||
p_importarBDWA.Visible = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub i_engranes_LongClick
|
||||
@@ -844,3 +887,9 @@ Private Sub b_aceptarExtras_Click
|
||||
et_geocerca.Text = ""
|
||||
p_extras.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub cb_importarBDWA_CheckedChange(Checked As Boolean)
|
||||
' LogColor($"cb_importarBDWA_CheckedChange = ${Checked}"$, Colors.Red)
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'")
|
||||
Starter.skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('IMPORTAR_BD_WA', '${Checked}')"$)
|
||||
End Sub
|
||||
@@ -570,7 +570,7 @@ Sub b_prodMenos_Click
|
||||
' clv_prods_ll.GetValue(index).As(Map).Get("almacen") = clv_prods_ll.GetValue(index).As(Map).Get("almacen") + 1
|
||||
End If
|
||||
If laCant.Text = "" Then laCant.Text = 0
|
||||
laCant.Text = $"$1.0{laCant.Text - 1}"$
|
||||
laCant.Text = $"${NumberFormat2((laCant.Text - 1), 1, 0, 0, False)}"$
|
||||
If laCant.Text < 0 Then laCant.Text = 0
|
||||
Private tmpMap As Map = clv_prods_ll.GetValue(index).As(Map)
|
||||
Private precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -61,7 +61,7 @@ ModuleBreakpoints7=
|
||||
ModuleBreakpoints8=
|
||||
ModuleBreakpoints9=
|
||||
ModuleClosedNodes0=
|
||||
ModuleClosedNodes1=
|
||||
ModuleClosedNodes1=4
|
||||
ModuleClosedNodes10=
|
||||
ModuleClosedNodes11=
|
||||
ModuleClosedNodes12=
|
||||
@@ -82,7 +82,7 @@ ModuleClosedNodes25=
|
||||
ModuleClosedNodes26=
|
||||
ModuleClosedNodes27=
|
||||
ModuleClosedNodes28=
|
||||
ModuleClosedNodes29=
|
||||
ModuleClosedNodes29=69
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes30=
|
||||
ModuleClosedNodes4=
|
||||
@@ -91,6 +91,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=Subs,traeinventario,1780,1,C_Productos,l_prodX_Click,1093,6,C_Productos,CreateListItem,543,0,Subs,hayPedido,1566,0,C_Productos,Class_Globals,97,0,Subs,totalPedido,1569,0,C_Productos,b_prodMas_Click,708,6,C_Productos,b_prodMenos_Click,606,0,C_Productos,et_pCant_FocusChanged,797,0,C_Productos,et_pCant_TextChanged,733,6
|
||||
NavigationStack=Visual Designer,login.bal,-100,6,B4XMainPage,cb_geocerca_CheckedChange,809,0,kms_helperSubs,traeUsarGeocerca,873,0,B4XMainPage,i_engranes_Click,652,6,kms_helperSubs,traeUsarCartaPorte,884,0,B4XMainPage,b_aceptarExtras_Click,876,0,kms_helperSubs,RD_Init,58,0,B4XMainPage,cb_importarBDWA_CheckedChange,885,6,kms_helperSubs,traeUsarIntentBDWA,893,4,B4XMainPage,B4XPage_Appear,402,6
|
||||
SelectedBuild=0
|
||||
VisibleModules=1,28,11,3,26,29,12,4,13
|
||||
VisibleModules=1,28,11,3,26,23,29,12,4,13
|
||||
|
||||
@@ -993,8 +993,6 @@ Sub actualizaProducto(cedis As String, costoU As String, cant As String, nombre
|
||||
c.Close
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
'Regresa un mapa con la información de la promo.
|
||||
'Regresa: {id, maxXcliente, maxRecurrente, maxPromos, historico,
|
||||
' productos={idProducto={idProducto, preciosimptos, precio, almacen, tipo, piezas, usuario, fecha, regalo, clasif}} 'Mapa con los productos de la promo y los datos de cada uno.
|
||||
@@ -1782,7 +1780,7 @@ Sub logJobDoneResultados(resultado As DBResult)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub traeinventario(id As String) As String
|
||||
Sub traeinventario(id As String) As Int
|
||||
Dim c As Cursor
|
||||
Dim inventario As String = "0"
|
||||
c=Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${traeTablaProds(Starter.tipov)} where CAT_GP_ID = '${id}'"$)
|
||||
|
||||
@@ -889,6 +889,18 @@ Sub traeUsarCartaPorte As Boolean 'ignore
|
||||
Return CP
|
||||
End Sub
|
||||
|
||||
'Regresa si se debe de usar el intent de importar la base d datos desde Whatsapp.
|
||||
Sub traeUsarIntentBDWA As Boolean 'ignore
|
||||
Private BDWA As Boolean = False
|
||||
Private x As Cursor = Starter.skmt.ExecQuery($"select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'"$)
|
||||
If x.RowCount > 0 Then
|
||||
x.Position = 0
|
||||
If x.GetString("CAT_VA_VALOR") = "true" Then BDWA = True
|
||||
End If
|
||||
' Log($"cb_importarBDWA = ${BDWA}"$)
|
||||
Return BDWA
|
||||
End Sub
|
||||
|
||||
'Regresa los clientes nuevos maximos.
|
||||
'Si no está especificado, el default es 2.
|
||||
Sub traeMaxClientesNuevos As Int 'ignore
|
||||
|
||||
Reference in New Issue
Block a user