mirror of
https://github.com/KeymonSoft/Guna_Preventa.git
synced 2026-04-19 21:59:15 +00:00
....
This commit is contained in:
@@ -35,6 +35,7 @@ Sub Class_Globals
|
||||
Private almacen As String
|
||||
Private p_nota As Panel
|
||||
Dim tipo_venta As String = Subs.traeTipoVentaDeBD
|
||||
Private Panel1 As Panel
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -64,6 +65,9 @@ Sub B4XPage_Appear
|
||||
ToastMessageShow("Es necesario tener el GPS encendido", True)
|
||||
StartActivity(Starter.gps.LocationSettingsIntent)
|
||||
End If
|
||||
p_nota.Height = Root.Height * 0.9
|
||||
p_nota.Width = Root.Width * 0.9
|
||||
Panel1.Visible = True
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
|
||||
C.Position =0
|
||||
almacen = C.GetString("ID_ALMACEN")
|
||||
@@ -76,6 +80,7 @@ Sub B4XPage_Appear
|
||||
C.Close
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select PE_PRONOMBRE,PE_COSTO_TOT, PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS desc")
|
||||
ListView1.Clear
|
||||
ListView1.Height = Root.Height * 0.65
|
||||
Private cs As CSBuilder
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
@@ -83,25 +88,33 @@ Sub B4XPage_Appear
|
||||
c.Position=i
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 15
|
||||
label1.TextSize = 20
|
||||
label1.TextColor = Colors.Black
|
||||
label1.color = Colors.White
|
||||
Private textColor As Int = Colors.black
|
||||
If c.GetString("PE_CEDIS").Contains("PRO") Then textColor = Colors.RGB(210,105,30) 'Si es promo, cambiamos el color del texto.
|
||||
If Not(IsNumber(c.GetString("PE_CEDIS"))) Then textColor = Colors.RGB(210,105,30) 'Si es promo, cambiamos el color del texto.
|
||||
Private textColor As Int = Colors.White
|
||||
If c.GetString("PE_CEDIS").Contains("PRO") Then textColor = Colors.Blue 'Si es promo, cambiamos el color del texto.
|
||||
If Not(IsNumber(c.GetString("PE_CEDIS"))) Then textColor = Colors.Blue 'Si es promo, cambiamos el color del texto.
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 10
|
||||
label2.TextColor = Colors.Blue
|
||||
ListView1.AddSingleLine(cs.Color(textColor).Size(12).append(c.GetString("PE_PRONOMBRE") & " ").pop.Append(CRLF).Size(8).Color(Colors.Blue).Append("Cantidad #"& c.GetString("PE_CANT")).Append(" SubTotal $"& c.GetString("PE_COSTO_TOT")).Append(" " & c.GetString("PE_FOLIO")& " " &c.GetString("PE_CEDIS")).PopAll)
|
||||
label2.TextSize = 16
|
||||
label2.TextColor = Colors.White
|
||||
|
||||
ListView1.AddSingleLine(cs.Color(textColor).Size(20).append(c.GetString("PE_PRONOMBRE") & " ").pop.Append(CRLF).Size(16).Color(Colors.White).Append("Cantidad #"& c.GetString("PE_CANT")).Append(" SubTotal $"& c.GetString("PE_COSTO_TOT")).Append(" " & c.GetString("PE_FOLIO")& " " &c.GetString("PE_CEDIS")).PopAll)
|
||||
label1.Height = 90dip
|
||||
' label2.Height = 60dip
|
||||
'
|
||||
' ListView1.TwoLinesLayout.ItemHeight = 120dip
|
||||
ListView1.SingleLineLayout.ItemHeight = 90dip
|
||||
label1.Typeface = Typeface.CreateNew(Typeface.DEFAULT_BOLD, Typeface.STYLE_BOLD)
|
||||
label2.Typeface = Typeface.CreateNew(Typeface.DEFAULT_BOLD, Typeface.STYLE_BOLD)
|
||||
folio = c.GetString("PE_FOLIO")
|
||||
Next
|
||||
End If
|
||||
If Existe <> 0 Then
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select pc_noart, pc_monto from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)")
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select SUM(PE_CANT) AS PE_CANT from pedido where pe_cliente in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ")
|
||||
C.Position=0
|
||||
L_CANT.Text = c.GetString("PC_NOART")
|
||||
L_TOTAL.Text = NumberFormat2(c.GetString("PC_MONTO"), 1, 2, 2, True)
|
||||
L_CANT.Text = c.GetString("PE_CANT")
|
||||
' L_TOTAL.Text = NumberFormat2(c.GetString("PC_MONTO"), 1, 2, 2, True)
|
||||
c.Close
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select SUM(IFNULL(PE_DESC,0)) AS DESCUENTO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
||||
c.Position=0
|
||||
@@ -121,8 +134,6 @@ Sub B4XPage_Appear
|
||||
|
||||
L_TOTAL.Text =NumberFormat2(s.GetString("TOTAL_CLIE") + s5.GetString("TOTAL_CLIE"),0,2,2,True)
|
||||
|
||||
|
||||
|
||||
s.Close
|
||||
|
||||
|
||||
@@ -234,6 +245,8 @@ Sub borra_Click
|
||||
End Sub
|
||||
|
||||
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
Log(Subs.traeTablaProds(tipo_venta))
|
||||
Log(Value)
|
||||
Private X() As String = Regex.Split(" ", Value)
|
||||
Log(X.Length)
|
||||
Private nom As String = ""
|
||||
@@ -349,7 +362,13 @@ Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
Next
|
||||
' Log(nom)
|
||||
nom = nom.Trim
|
||||
Private cedis As String = X(X.Length-1)
|
||||
If X(X.Length-1) <> ".01" Then
|
||||
Private cedis As String = X(X.Length-1)
|
||||
Else
|
||||
Private cedis As String = (X(X.Length-2) &" " & X(X.Length-1))
|
||||
End If
|
||||
Log(nom)
|
||||
Log(cedis)
|
||||
c=B4XPages.MainPage.skmt.ExecQuery($"select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '${nom}' or pe_pronombre = '${nom} ') AND PE_CEDIS = '${cedis}' and pe_cliente in (Select CUENTA from cuentaa)"$) ' Se agregó el "pe_pronombre = '${nom} '" porque al nombre de los productos de promo se les agrega un "espacio al final" para que cuando exiiste en el pedido un mismo producto fuera de promocion, el "quitaduplicados" no los elimine.
|
||||
Log($"select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO where (pe_pronombre = '${nom}' or pe_pronombre = '${nom} ') AND PE_CEDIS = '${cedis}' and pe_cliente in (Select CUENTA from cuentaa)"$)
|
||||
Log(c.RowCount)
|
||||
|
||||
Reference in New Issue
Block a user