- Correcciones para el resumen

This commit is contained in:
Jose Alberto Guerra Ugalde
2024-06-22 01:01:24 -06:00
parent 66550abbbf
commit 56dfbf950f
6 changed files with 93 additions and 14 deletions

View File

@@ -70,7 +70,7 @@ Library6=javaobject
Library7=json
Library8=okhttputils2
Library9=preoptimizedclv
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="21" android:targetSdkVersion="33"/>~\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.LightTheme)~\n~'End of default text.~\n~~\n~SetApplicationAttribute(android:usesCleartextTraffic, "true")~\n~AddPermission(android.permission.BLUETOOTH_ADVERTISE)~\n~AddPermission(android.permission.BLUETOOTH_CONNECT)~\n~AddPermission(android.permission.BLUETOOTH_SCAN)~\n~SetApplicationAttribute(android:largeHeap, "true")~\n~SetApplicationAttribute(android:allowBackup, "false")~\n~SetApplicationAttribute(android:exported, "true")~\n~~\n~AddApplicationText(<provider android:name="android.support.v4.content.FileProvider"~\n~ android:authorities="$PACKAGE$.provider" android:exported="false"~\n~ android:grantUriPermissions="true"><meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>~\n~ </provider>)~\n~CreateResource(xml, provider_paths,~\n~ <paths><external-files-path name="name" path="" /><files-path name="name" path="" /><files-path name="name" path="shared" /></paths>~\n~)
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="21" android:targetSdkVersion="33"/>~\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.LightTheme)~\n~'End of default text.~\n~~\n~SetApplicationAttribute(android:usesCleartextTraffic, "true")~\n~AddPermission(android.permission.BLUETOOTH_ADVERTISE)~\n~AddPermission(android.permission.BLUETOOTH_CONNECT)~\n~AddPermission(android.permission.BLUETOOTH_SCAN)~\n~SetApplicationAttribute(android:largeHeap, "true")~\n~SetApplicationAttribute(android:allowBackup, "false")~\n~SetApplicationAttribute(android:exported, "true")~\n~~\n~AddApplicationText(<provider android:name="android.support.v4.content.FileProvider"~\n~ android:authorities="$PACKAGE$.provider" android:exported="false"~\n~ android:grantUriPermissions="true"><meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>~\n~ </provider>)~\n~CreateResource(xml, provider_paths,~\n~ <paths><external-files-path name="name" path="" /><files-path name="name" path="" /><files-path name="name" path="shared" /></paths>~\n~)~\n~~\n~ 'Para que se registre para abrir bases de datos~\n~ AddActivityText(main,~\n~<intent-filter>~\n~<action android:name="android.intent.action.VIEW" />~\n~<category android:name="android.intent.category.DEFAULT" />~\n~<data android:pathPattern=".*\\.db" />~\n~<data android:mimeType="*/*" />~\n~</intent-filter>)~\n~~\n~'AddActivityText(main,~\n~'<intent-filter>~\n~'<action android:name="android.intent.action.VIEW" />~\n~'<category android:name="android.intent.category.BROWSABLE" />~\n~'<category android:name="android.intent.category.DEFAULT" />~\n~'<data android:scheme="http" />~\n~'<data android:host="*" />~\n~'<data android:pathPattern=".*\\.db" />~\n~'<data android:mimeType="*/*" />~\n~'</intent-filter>)
Module1=DBRequestManager
Module2=errorManager
Module3=EscPosPrinter
@@ -86,7 +86,7 @@ Version=12.8
#Region Project Attributes
#ApplicationLabel: Lanterna
#VersionCode: 1
#VersionName: 4.06.14
#VersionName: 4.06.21
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
@@ -102,6 +102,8 @@ Version=12.8
'###########################################################################################################
#End Region
'4625 y 25
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: False
@@ -141,6 +143,11 @@ Sub Globals
Private b_leyendaDescuento As Button
Private p_leyendaDescuento As Panel
Private b_reimprimirTicket As Button
Private b_fix As Button
Dim in As Intent
Dim intentUsado As Boolean = False
Private cb_importarDesdeWA As CheckBox
Dim habilitarImportarDesdeWA As Boolean = False
End Sub
Sub Activity_Create(FirstTime As Boolean)
@@ -186,14 +193,22 @@ Sub Activity_Resume
Loop
cb_impresionActiva.Checked = ia
Starter.imprimirTicket = ia
importaBDDesdeWhatsApp
End Sub
Sub Activity_KeyPress (key As Int) As Boolean
' BACK key pressed
If key=KeyCodes.KEYCODE_BACK Then
p_configuracion.Visible = False
Subs.panelVisible(p_login, 0, 0)
If p_configuracion.Visible Then
p_configuracion.Visible = False
Else If p_login.Visible Then
ExitApplication
Else
p_configuracion.Visible = False
Subs.panelVisible(p_login, 0, 0)
End If
End If
Return True
' Returning False signals the system to handle the key
@@ -251,7 +266,7 @@ Private Sub b_envioBD_Click
File.Copy(File.DirInternal, FileName, Provider.SharedFolder, FileName)
Dim email As Email
email.To.Add("soporte@keymonsoft.com")
email.Subject = "Envio Base de datos Mariana Censos"
email.Subject = "Envio Base de datos Lanterna"
email.Attachments.Add(Provider.GetFileUri(FileName))
' email.Attachments.Add(Provider.GetFileUri(FileName)) 'second attachment
Dim in As Intent = email.GetIntent
@@ -405,4 +420,45 @@ End Sub
Private Sub b_reimprimirTicket_Click
End Sub
Private Sub b_fix_Click
Starter.skmt.ExecNonQuery($"update pedido_ticket set PT_NOART = '25', PT_MONTO = '4625', PT_PAGO2 = 'Visa/Mastercard Credito', PT_TARJETA = 'Visa/Mastercard Credito' where PT_TICKET = '00014' and PT_MESA = '5'"$)
Starter.skmt.ExecNonQuery($"update pedido_ticket set PT_PAGO2 = 'Visa/Mastercard Credito' where PT_PAGO2 is null "$)
ToastMessageShow("LISTO", True)
End Sub
' Se revisa si hay una intención (intent) de abrir una base de datos y si es así, entonces se importa esa base de datos.
Sub importaBDDesdeWhatsApp
' Private tmpBDWA As Boolean = traeUsarIntentBDWA
habilitarImportarDesdeWA = True
If Not(in.IsInitialized) Then in = Activity.GetStartingIntent ' Si se usa esta funcion en Mainpage, se pone "Me" en lugar de B4XPages.MainPage.
If Not(intentUsado) And in <> Null Then
' Log(in)
intentUsado = True
' Log(in.As(String))
If in.GetData <> Null Then
If habilitarImportarDesdeWA Then
Dim XmlData As String
XmlData = in.GetData
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
Else
ToastMessageShow("NO se cargo la BD, por favor habilitar la opción en la configuración.", False)
End If
End If
End If
End Sub
Private Sub cb_importarDesdeWA_CheckedChange(Checked As Boolean)
If Checked Then habilitarImportarDesdeWA = True
End Sub