mirror of
https://github.com/KeymonSoft/Guna_Preventa_BAT.git
synced 2026-04-19 21:59:28 +00:00
6.03.01
se agrega la parte de las encuestas y se corrige los indicadores
This commit is contained in:
@@ -24,6 +24,12 @@ Sub Class_Globals
|
||||
Private l_credito As Label
|
||||
Private ImageView4 As ImageView
|
||||
Private Guardar As Button
|
||||
Private p_deuda As Panel
|
||||
Private Panel5 As Panel
|
||||
Private b_okdeuda As Button
|
||||
Private l_deuda As Label
|
||||
Private I_fotogrande As ImageView
|
||||
Private P_Imagengrande As Panel
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -81,6 +87,8 @@ Sub B4XPage_Appear
|
||||
|
||||
End If
|
||||
|
||||
Subs.centraPanel(P_Imagengrande,Root.Width)
|
||||
|
||||
Dim coloressaldo As Cursor=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_CLASIFICADOR3,0) AS CAT_CL_CLASIFICADOR3, IFNULL(CAT_CL_CLASIFICADOR4,0) AS CAT_CL_CLASIFICADOR4, IFNULL(CAT_CL_CLASIFICADOR2,'') AS CAT_CL_CLASIFICADOR2 from CAT_CATCLIENTESTODOS where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||
coloressaldo.Position = 0
|
||||
|
||||
@@ -146,9 +154,108 @@ Sub B4XPage_Appear
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub l_limite_Click
|
||||
|
||||
|
||||
Dim pagarepen As Cursor = B4XPages.MainPage.skmt.ExecQuery("select FECHA, SALDO_PENDIENTE FROM ABONOSPTOD WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||
If pagarepen.RowCount > 0 Then
|
||||
Dim cs As CSBuilder
|
||||
cs.Initialize
|
||||
p_deuda.Visible = True
|
||||
p_deuda.Width = Root.Width
|
||||
p_deuda.Height = Root.Height
|
||||
|
||||
pagarepen.Position = 0
|
||||
DateTime.DateFormat="dd/MM/yyyy"
|
||||
Dim FechaInicio As String = pagarepen.GetString("FECHA") ' Formato: dd/MM/yyyy
|
||||
' Dim FechaHoy As String = DateTime.Date(DateTime.Now) ' Fecha actual en formato dd/MM/yyyy
|
||||
Log(pagarepen.GetString("FECHA"))
|
||||
|
||||
' Convertir las fechas a milisegundos (desde 01/01/1970)
|
||||
Dim TicksInicio As Long = DateTime.DateParse(FechaInicio)
|
||||
Dim TicksHoy As Long = DateTime.DateParse(DateTime.Date(DateTime.Now))
|
||||
|
||||
' Calcular diferencia en días
|
||||
Dim DiferenciaDias As Int = (TicksHoy - TicksInicio) / DateTime.TicksPerDay
|
||||
|
||||
' Mostrar resultado
|
||||
Log($"Días transcurridos: ${DiferenciaDias}"$)
|
||||
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_DIASCREDITO,0) AS CAT_CL_DIASCREDITO from CAT_CATCLIENTESTODOS where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||
c.Position = 0
|
||||
|
||||
If DiferenciaDias <= c.GetInt("CAT_CL_DIASCREDITO") + 8 Then
|
||||
' Msgbox2Async($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio", "Ok", "", "", LoadBitmap(File.DirAssets,"alert2.png"), False)
|
||||
|
||||
' l_deuda.Text = ($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$)
|
||||
l_deuda.Text = cs.Color(Colors.Black).Append("Monto de la deuda:" & CRLF&CRLF).Pop.Size(18).Color(Colors.RGB(48,109,0)).Append("$ "& pagarepen.GetString("SALDO_PENDIENTE")).PopAll
|
||||
Else If DiferenciaDias > c.GetInt("CAT_CL_DIASCREDITO") + 8 Then
|
||||
' l_deuda.Text = ($"No se puede realizar venta por que presenta ${(DiferenciaDias-(c.GetInt("CAT_CL_DIASCREDITO") +1))} días de atraso en el credito, por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$)
|
||||
l_deuda.Text = cs.Color(Colors.Black).Append("Monto de la deuda:" & CRLF&CRLF).Pop.Color(Colors.Red).Size(18).Append("$ " &pagarepen.GetString("SALDO_PENDIENTE")&CRLF&CRLF).Pop.Size(14).Color(Colors.Black).Append("Dias de atraso:" & CRLF&CRLF).Pop.Size(18).Color(Colors.Red).Append((DiferenciaDias-(c.GetInt("CAT_CL_DIASCREDITO") +1))).PopAll
|
||||
End If
|
||||
Else
|
||||
p_deuda.Visible = True
|
||||
|
||||
p_deuda.Width = Root.Width
|
||||
p_deuda.Height = Root.Height
|
||||
|
||||
l_deuda.Text = "No tiene adeudo"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
'' BACK key pressed
|
||||
'' Return True To close, False To cancel
|
||||
'
|
||||
' If P_Imagengrande.Visible Then
|
||||
' P_Imagengrande.Visible = False
|
||||
' Return False
|
||||
' Else if Subs.hayPedido Then
|
||||
' ToastMessageShow("Por favor presione el botón de GUARDAR", True)
|
||||
'' Return False
|
||||
'' else If p_deuda.Visible Then
|
||||
'' p_deuda.Visible = False
|
||||
'' Return False
|
||||
' Else
|
||||
'' Starter.enCliente = False
|
||||
' B4XPages.ShowPage("Clientes_Completos")
|
||||
' End If
|
||||
'' Return True
|
||||
' Return False
|
||||
'End Sub
|
||||
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Private Sub Guardar_Click
|
||||
B4XPages.ShowPage("Principal")
|
||||
End Sub
|
||||
|
||||
Private Sub ImageView4_LongClick
|
||||
Private fotomostrar As Cursor = Starter.skmt.ExecQuery("SELECT FOTO FROM FOTOS where CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||
If fotomostrar.RowCount > 0 Then
|
||||
|
||||
fotomostrar.Position = 0
|
||||
Private fotomostrarfinal() As Byte = fotomostrar.GetBlob("FOTO")
|
||||
Dim InputStream1 As InputStream
|
||||
InputStream1.InitializeFromBytesArray(fotomostrarfinal, 0, fotomostrarfinal.Length)
|
||||
Dim Bitmap1 As Bitmap
|
||||
Bitmap1.Initialize2(InputStream1)
|
||||
InputStream1.Close
|
||||
I_fotogrande.Bitmap = Bitmap1
|
||||
Log("aqui si hay foto")
|
||||
Else
|
||||
I_fotogrande.Bitmap = LoadBitmap(File.DirAssets,"images.png")
|
||||
Log("aqui no hay foto")
|
||||
End If
|
||||
P_Imagengrande.Visible = True
|
||||
End Sub
|
||||
|
||||
Sub P_Imagengrande_click
|
||||
P_Imagengrande.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub b_okdeuda_Click
|
||||
p_deuda.Visible = False
|
||||
End Sub
|
||||
Reference in New Issue
Block a user