diff --git a/B4A/B4XMainPage.bas b/B4A/B4XMainPage.bas index 816d600..a32ad8d 100644 --- a/B4A/B4XMainPage.bas +++ b/B4A/B4XMainPage.bas @@ -1063,4 +1063,43 @@ Private Sub i_engrane_LongClick ' Log(LastException) ToastMessageShow("La aplicación Tienda 360 no está instalada o no puede manejar la URL.", True) End Try +End Sub + +Sub l_version_longClick + DateTime.DateFormat="MM/dd/yyyy HH:mm:ss" + Private Fecha As String=DateTime.Date(DateTime.now) + Private telefono As String = "5215554192439" + Private monto As String = "1500" + Private idCliente As String = "10748" + Private ruta As String = "333" + Private almacen As String = "1" + +' CON POST + Private link As String = "http://keymon.lat:9000/v1/messages" + Private elJSON As String = $"{ + "number":"${telefono}", + "message":"Tu compra de Guna va ser a *crédito* por el monto de $${NumberFormat2(monto, 1, 2, 2, True)}\n\nManda *1* para confirmar\nManda *0* para rechazar\n\n*Nota:* Si este mensaje no se contesta, se considerará que el pago es en *EFECTIVO*.\n\n(Solo el *número* por favor)", + "monto":"${monto}", + "idcliente":"${idCliente}", + "almacen":"${almacen}", + "ruta": "${ruta}", + "fecha":"${Fecha}" + }"$ + Private job As HttpJob + job.Initialize("", Me) + job.PostString(link, elJSON) + job.GetRequest.SetContentType("application/json") + Wait For (job) JobDone(job As HttpJob) + +' CON GET +' Private retorno As String = "%0D%0A" +' Private link As String = $"http://keymon.lat:9000/v1/messages?number=${telefono}&message=Tu compra de Guna va ser a crédito por el monto de $${NumberFormat2(monto, 1, 2, 2, True)}${retorno}${retorno}Manda *1* para confirmar${retorno}Manda *0* para rechazar${retorno}${retorno}*Nota: Si este mensaje no se contesta, se considerará que el pago es en EFECTIVO*${retorno}${retorno}(Solo el *número* por favor)&monto=${monto}&idcliente=${idCliente}&almacen=1&ruta=333&fecha=${Fecha}"$ +' Private job As HttpJob +' job.Initialize("", Me) +'' job.PostString(link, elJSON) +' job.Download(link) +'' job.GetRequest.SetContentType("application/json") +' Wait For (job) JobDone(job As HttpJob) + + Log("Whatsapp enviado con exito: " & job.Success) End Sub \ No newline at end of file diff --git a/B4A/C_Principal.bas b/B4A/C_Principal.bas index 9a08ad1..6272256 100644 --- a/B4A/C_Principal.bas +++ b/B4A/C_Principal.bas @@ -1095,19 +1095,18 @@ Sub cargar_Click cmd.Name = "selectPromo3055Jul-Sep_Guna" cmd.Parameters = Array As Object(e_ruta.text, ALMACEN) B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "hist_pro3055") - + 'SUPLENCIA If E_RUTA2.text <> "" Then - Starter.skmt.ExecNonQuery("DELETE from RUTA_SUPLENCIA") B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO RUTA_SUPLENCIA(RS_RUTA) VALUES(?)",Array As String(E_RUTA2.Text)) E_RUTA2.Visible = False p_ruta2.Visible = False - + cmd.Initialize cmd.Name = "select_cat_clientes_guna_GV2" cmd.Parameters = Array As Object(E_RUTA2.text, ALMACEN) B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "kmt_datos2") - + cmd.Initialize cmd.Name = "select_hist_datos_GV2_2" cmd.Parameters = Array As Object(E_RUTA2.text, ALMACEN,E_RUTA2.text, ALMACEN,E_RUTA2.text, ALMACEN) diff --git a/B4A/Guna Vistas V3.1.b4a b/B4A/Guna Vistas V3.1.b4a index e4e3907..3d45693 100644 --- a/B4A/Guna Vistas V3.1.b4a +++ b/B4A/Guna Vistas V3.1.b4a @@ -256,12 +256,12 @@ Module9=C_Mapas NumberOfFiles=96 NumberOfLibraries=33 NumberOfModules=27 -Version=13.1 +Version=12.8 @EndOfDesignText@ #Region Project Attributes #ApplicationLabel: Guna Preventa #VersionCode: 1 - #VersionName: 5.03.10 + #VersionName: 5.03.22 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: portrait #CanInstallToExternalStorage: False diff --git a/B4A/Guna Vistas V3.1.b4a.meta b/B4A/Guna Vistas V3.1.b4a.meta index 4f46c1e..48fb417 100644 --- a/B4A/Guna Vistas V3.1.b4a.meta +++ b/B4A/Guna Vistas V3.1.b4a.meta @@ -82,6 +82,6 @@ ModuleClosedNodes6= ModuleClosedNodes7=5,6,8,9,10,11 ModuleClosedNodes8= ModuleClosedNodes9= -NavigationStack=C_NoVenta,Class_Globals,0,0,C_NoVenta,GUARDA_Click,114,0,Subs,traePromo,798,0,Subs,traeMaxPromos,934,0,Subs,procesaPromocion,982,1,C_Principal,Class_Globals,0,0,Diseñador Visual,resdia.bal,-100,4,C_Principal,resdia_Click,2604,0,B4XMainPage,B4XPage_Created,174,0,C_Principal,cargar_Click,1082,6 +NavigationStack=Subs,centraEditText,579,0,Subs,centraProgressBar,573,0,Subs,panelVisible,556,0,B4XMainPage,b_envioBD_Click,855,0,Diseñador Visual,login.bal,-100,6,Subs,fechaKMT,70,0,Subs,deleteFolder,1787,0,Subs,enviaWhatsappMsg,1788,6,B4XMainPage,l_version_longClick,1074,6,B4XMainPage,i_engrane_LongClick,1060,0 SelectedBuild=0 VisibleModules=25,2,14,26,5,10,15,11 diff --git a/B4A/Subs.bas b/B4A/Subs.bas index 1caf67d..5a6ae9f 100644 --- a/B4A/Subs.bas +++ b/B4A/Subs.bas @@ -1789,4 +1789,41 @@ Sub deleteFolder(folder As String) End If File.Delete(folder, f) Next +End Sub + +Sub enviaWhatsappMsg() +' DateTime.DateFormat="MM/dd/yyyy HH:mm:ss" +' Private Fecha As String=DateTime.Date(DateTime.now) +' Private telefono As String = "5215554192439" +' Private monto As String = "1500" +' Private idCliente As String = "10748" +' +'' CON POST +' Dim link As String = "http://keymon.lat:9000/v1/messages" +' Dim elJSON As String = $"{ +' "number":"${telefono}", +' "message":"Tu compra de Guna va ser a crédito por el monto de $${NumberFormat2(monto, 1, 2, 2, True)}${retorno}${retorno}Manda *1* para confirmar${retorno}Manda *0* para rechazar${retorno}${retorno}(Solo el *número* por favor), +' "monto":${monto}, +' "idcliente":${idCliente}, +' "almacen":"1", +' "ruta": "333", +' "fecha":${Fecha} +' }"$ +' Dim job As HttpJob +' job.Initialize("", Me) +' job.PostString(link, elJSON) +' job.GetRequest.SetContentType("application/json") +' Wait For (job) JobDone(job As HttpJob) +' +'' CON GET +' Dim retorno As String = "%0D%0A" +' Dim link As String = $"http://keymon.lat:9000/v1/messages?number=${telefono}&message=Tu compra de Guna va ser a crédito por el monto de $${NumberFormat2(monto, 1, 2, 2, True)}${retorno}${retorno}Manda *1* para confirmar${retorno}Manda *0* para rechazar${retorno}${retorno}(Solo el *número* por favor)&monto=${monto}&idcliente=${idCliente}&almacen=1&ruta=333&fecha=${Fecha}"$ +' Dim job As HttpJob +' job.Initialize("", Me) +'' job.PostString(link, elJSON) +' job.Download(link) +'' job.GetRequest.SetContentType("application/json") +' Wait For (job) JobDone(job As HttpJob) +' +' Log("Whatsapp enviado con exito: " & job.Success) End Sub \ No newline at end of file