mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-20 11:39:13 +00:00
Correcciones de pedido sugerido y ordenamiento
This commit is contained in:
@@ -736,6 +736,7 @@ Sub B4XPage_Appear
|
||||
' l_doe.Text = $"Pedido DOE: $${kh.traeTotalClienteDOE}${CRLF}TOTAL PEDIDO: $${(kh.traeTotalCliente+kh.traeTotalClienteDOE)}"$
|
||||
End If
|
||||
If Subs.revisaImpresa Then Guardar.Visible = True
|
||||
|
||||
End Sub
|
||||
|
||||
Sub Printer1_Connected (Success As Boolean)
|
||||
@@ -1081,7 +1082,30 @@ Sub B_IMP_Click
|
||||
End Sub
|
||||
|
||||
Sub B_IMP2_Click
|
||||
' Log("inicia B_IMP2_Click")
|
||||
LogColor(kh.traeDisponibleAbordo,Colors.Green)
|
||||
If kh.traeDisponibleAbordo < 0 Then
|
||||
Msgbox2Async("No tienes venta suficiente","Atención", "Modificar pedido", "", "Borrar pedido",LoadBitmap(File.DirAssets,"alert2.png"),False)
|
||||
Wait For Msgbox_Result (result As Int)
|
||||
If result = DialogResponse.POSITIVE Then
|
||||
|
||||
ToastMessageShow("Positivo",True)
|
||||
B4XPages.ShowPage("Productos")
|
||||
|
||||
Else If result = DialogResponse.NEGATIVE Then
|
||||
|
||||
ToastMessageShow("Negativo",True)
|
||||
B4XPages.MainPage.nota.borra_Click
|
||||
B4XPage_Appear
|
||||
|
||||
End If
|
||||
Else If kh.traeDisponibleAbordo >= 0 Then
|
||||
Imprime_ticket
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub Imprime_ticket
|
||||
Log("inicia B_IMP2_Click")
|
||||
B_IMP2.Enabled = False
|
||||
If l_total.Text <> Null And l_total.Text <> "null" Then Subs.ponImpreso(la_cuenta.Text) 'Solo lo marcamos como impreso si tiene venta (total > 0).
|
||||
ProgressDialogShow("Imprimiendo, un momento ...")
|
||||
@@ -1111,7 +1135,7 @@ Sub B_IMP2_Click
|
||||
Sleep(500)
|
||||
impresoraConectada = False
|
||||
End If
|
||||
' If Logger Then Log($"Impresora Conectada: ${Printer1.IsConnected}"$)
|
||||
' If Logger Then Log($"Impresora Conectada: ${Printer1.IsConnected}"$)
|
||||
If la_cuenta.Text <> "0" And la_cuenta.Text <> "null" Then
|
||||
Starter.skmt.ExecNonQuery2("UPDATE PEDIDO SET PE_TIPO = ? WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) ", Array As Object("VENTA"))
|
||||
Starter.skmt.ExecNonQuery("UPDATE kmt_info set IMPRESION = 1 where CAT_CL_CODIGO In (select cuenta from cuentaa)")''
|
||||
@@ -1200,13 +1224,13 @@ Sub B_IMP2_Click
|
||||
For E=0 To ESPACIO -1
|
||||
BLANCO = " " & BLANCO
|
||||
Next
|
||||
' If Logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
' If Logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
Private pecostou As String = 0
|
||||
If s.GETSTRING("PE_COSTOU") <> Null And IsNumber(s.GETSTRING("PE_COSTOU")) Then pecostou = s.GETSTRING("PE_COSTOU")
|
||||
Private pecostotot As String = 0
|
||||
If s.GETSTRING("PE_COSTO_TOT") <> Null And IsNumber(s.GETSTRING("PE_COSTO_TOT")) Then pecostotot = s.GETSTRING("PE_COSTO_TOT")
|
||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & NumberFormat2(pecostou, 1, 2, 2, False) & " $" & NumberFormat2(pecostotot, 1, 2, 2, False) & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
TAMANO = 0
|
||||
ESPACIO = 14
|
||||
BLANCO = " "
|
||||
@@ -1239,7 +1263,7 @@ Sub B_IMP2_Click
|
||||
Private pecostotot As String = 0
|
||||
If s.GETSTRING("PE_COSTO_TOT") <> Null And IsNumber(s.GETSTRING("PE_COSTO_TOT")) Then pecostotot = s.GETSTRING("PE_COSTO_TOT")
|
||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & NumberFormat2(pecostou, 1, 2, 2, False) & " $" & NumberFormat2(pecostotot, 1, 2, 2, False) & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
TAMANO = 0
|
||||
ESPACIO = 14
|
||||
BLANCO = " "
|
||||
@@ -1265,7 +1289,7 @@ Sub B_IMP2_Click
|
||||
Private total3 As String = 0
|
||||
If s.GETSTRING("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then total3 = s.GETSTRING("TOTAL")
|
||||
Printer1.WriteString( Printer1.BOLD & "Total pedido: $" & NumberFormat2(total3, 1, 2, 2, False) & CRLF)
|
||||
|
||||
|
||||
s.Close
|
||||
s=Starter.skmt.ExecQuery2("select SUM(PE_CANT) AS TOTAL FROM PEDIDO WHERE PE_TIPO = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("ABORDO"))
|
||||
s.Position =0
|
||||
@@ -1275,8 +1299,8 @@ Sub B_IMP2_Click
|
||||
Printer1.WriteString("===============================" & CRLF)
|
||||
s.Close
|
||||
Printer1.WriteString(Printer1.DEFAULTS)
|
||||
|
||||
' printer.WriteLine("------------VENTA-------------")
|
||||
|
||||
' printer.WriteLine("------------VENTA-------------")
|
||||
Printer1.WriteString(CRLF)
|
||||
Printer1.WriteString(CRLF)
|
||||
|
||||
@@ -1326,7 +1350,7 @@ Sub B_IMP2_Click
|
||||
''''''' PEDIDOS DOE
|
||||
s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_COSTO_TOT) as L_COSTO_TOT, PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS,PE_PRONOMBRE", Array As String("DOE"))
|
||||
|
||||
' s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_COSTO_TOT) as L_COSTO_TOT, PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? and pe_codpromo = ? and substr(pe_pronombre,1,6) <> ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS,PE_PRONOMBRE", Array As String("VENTA", "DOE", "CAMBIO"))
|
||||
' s=Starter.skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_COSTO_TOT) as L_COSTO_TOT, PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_TIPO = ? and pe_codpromo = ? and substr(pe_pronombre,1,6) <> ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS,PE_PRONOMBRE", Array As String("VENTA", "DOE", "CAMBIO"))
|
||||
If S.RowCount>0 Then
|
||||
Printer1.WriteString("------------------------------" & CRLF)
|
||||
Printer1.WriteString("PEDIDO DON TOÑO" & CRLF)
|
||||
@@ -1351,8 +1375,8 @@ Sub B_IMP2_Click
|
||||
Private pecostotot As String = 0
|
||||
If s.GETSTRING("PE_COSTO_TOT") <> Null And IsNumber(s.GETSTRING("PE_COSTO_TOT")) Then pecostotot = s.GETSTRING("PE_COSTO_TOT")
|
||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & NumberFormat2(pecostou, 1, 2, 2, False) & " $" & NumberFormat2(pecostotot, 1, 2, 2, False) & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' If Logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' If Logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
TAMANO = 0
|
||||
ESPACIO = 14
|
||||
BLANCO = " "
|
||||
@@ -1368,7 +1392,7 @@ Sub B_IMP2_Click
|
||||
LogColor(s.GetString("TOTAL"),Colors.Magenta)
|
||||
If s.GetString("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then
|
||||
sTotal2 = s.GetString("TOTAL")
|
||||
' sTotal2 = Subs.sumaPedido(Subs.traeCliente)
|
||||
' sTotal2 = Subs.sumaPedido(Subs.traeCliente)
|
||||
Printer1.WriteString( $"Sub Total : $${NumberFormat2(sTotal2, 1, 2, 2, False)}"$ & CRLF)
|
||||
Else
|
||||
sTotal2 = 0
|
||||
@@ -1413,8 +1437,8 @@ Sub B_IMP2_Click
|
||||
Private pecostotot As String = 0
|
||||
If s.GETSTRING("PE_COSTO_TOT") <> Null And IsNumber(s.GETSTRING("PE_COSTO_TOT")) Then pecostotot = s.GETSTRING("PE_COSTO_TOT")
|
||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & NumberFormat2(pecostou, 1, 2, 2, False) & " $" & NumberFormat2(pecostotot, 1, 2, 2, False) & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' If Logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' If Logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
TAMANO = 0
|
||||
ESPACIO = 14
|
||||
BLANCO = " "
|
||||
@@ -1425,11 +1449,11 @@ Sub B_IMP2_Click
|
||||
s=Starter.skmt.ExecQuery2("select sum(PE_CANT) as CANTIDAD, SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CEDIS <> PE_PROID AND PE_TIPO = ? and substr(pe_pronombre,1,6) <> ? AND PE_CEDIS <> ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("VENTA","CAMBIO","DOE"))
|
||||
s.Position = 0
|
||||
Private sTotal2 As Double
|
||||
' If s.GetString("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then
|
||||
' sTotal2 = s.GetString("TOTAL")
|
||||
' Else
|
||||
' sTotal2 = 0
|
||||
' End If
|
||||
' If s.GetString("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then
|
||||
' sTotal2 = s.GetString("TOTAL")
|
||||
' Else
|
||||
' sTotal2 = 0
|
||||
' End If
|
||||
sTotal2 = kh.traeTotalCliente
|
||||
s=Starter.skmt.ExecQuery2("select sum(PE_CANT) as CANTIDAD, SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CEDIS <> PE_PROID AND PE_TIPO = ? and substr(pe_pronombre,1,6) = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("VENTA","CAMBIO"))
|
||||
s.Position = 0
|
||||
@@ -1469,7 +1493,7 @@ Sub B_IMP2_Click
|
||||
Private pecostotot As String = 0
|
||||
If s.GETSTRING("PE_COSTO_TOT") <> Null And IsNumber(s.GETSTRING("PE_COSTO_TOT")) Then pecostotot = s.GETSTRING("PE_COSTO_TOT")
|
||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & NumberFormat2(pecostou, 1, 2, 2, False) & " $" & NumberFormat2(pecostotot, 1, 2, 2, False) & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & CRLF)
|
||||
If logger Then Log($"|${ESPACIO}|, |${TAMANO}|, |${BLANCO}|"$)
|
||||
TAMANO = 0
|
||||
ESPACIO = 14
|
||||
@@ -1499,13 +1523,13 @@ Sub B_IMP2_Click
|
||||
s.Position =0
|
||||
Printer1.WriteString(Printer1.REVERSE & "===============================" & CRLF)
|
||||
Private total2 As String = 0
|
||||
' If s.GETSTRING("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then total2 = s.GETSTRING("TOTAL")
|
||||
' If s.GETSTRING("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then total2 = s.GETSTRING("TOTAL")
|
||||
total2 = kh.traeTotalCliente
|
||||
Printer1.WriteString(Printer1.UNREVERSE & Printer1.BOLD & "Total venta: $" & NumberFormat2(total2, 1, 2, 2, False) & CRLF)
|
||||
' Printer1.WriteString(Printer1.UNREVERSE & Printer1.BOLD & "Total venta: $" & s.GetString("TOTAL") & CRLF)
|
||||
' Printer1.WriteString("===============================" & CRLF)
|
||||
'
|
||||
' Printer1.WriteString( "Total venta: $" & s.GetString("TOTAL") & CRLF)
|
||||
' Printer1.WriteString(Printer1.UNREVERSE & Printer1.BOLD & "Total venta: $" & s.GetString("TOTAL") & CRLF)
|
||||
' Printer1.WriteString("===============================" & CRLF)
|
||||
'
|
||||
' Printer1.WriteString( "Total venta: $" & s.GetString("TOTAL") & CRLF)
|
||||
s.Close
|
||||
s=Starter.skmt.ExecQuery2("select SUM(PE_CANT) AS TOTAL FROM PEDIDO WHERE PE_CEDIS <> PE_PROID AND PE_TIPO = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa)", Array As String("VENTA"))
|
||||
s.Position =0
|
||||
@@ -1514,14 +1538,14 @@ Sub B_IMP2_Click
|
||||
Printer1.WriteString(Printer1.BOLD & "No. Productos vendidos: " & (total5 - cantidad2) & CRLF)
|
||||
Printer1.WriteString(Printer1.BOLD & "Productos devueltos : " & cantidad2 & CRLF)
|
||||
Printer1.WriteString(Printer1.REVERSE & "===============================" & CRLF)
|
||||
' Printer1.WriteString( "No. Productos: " & s.GetString("TOTAL") & CRLF)
|
||||
' Printer1.WriteString( "===============================" & CRLF)
|
||||
' Printer1.WriteString( "No. Productos: " & s.GetString("TOTAL") & CRLF)
|
||||
' Printer1.WriteString( "===============================" & CRLF)
|
||||
s.Close
|
||||
Printer1.WriteString(Printer1.UNREVERSE)
|
||||
Printer1.WriteString(Printer1.NOBOLD)
|
||||
' printer.WriteLine("------------VENTA-------------")
|
||||
' printer.WriteLine("TOTAL COMPRA: $:" & total_cliente)
|
||||
' Printer1.WriteString(Printer1.DEFAULTS & CRLF)
|
||||
' printer.WriteLine("------------VENTA-------------")
|
||||
' printer.WriteLine("TOTAL COMPRA: $:" & total_cliente)
|
||||
' Printer1.WriteString(Printer1.DEFAULTS & CRLF)
|
||||
Printer1.WriteString(CRLF)
|
||||
' Printer1.WriteString(Printer1.SINGLE)
|
||||
'Printer1.WriteString("------------------------------")
|
||||
@@ -1553,7 +1577,7 @@ Sub B_IMP2_Click
|
||||
Sleep(1000)
|
||||
B_IMP2.Enabled = True
|
||||
ProgressDialogHide
|
||||
' If Logger Then Log("Habilitamos boton")
|
||||
' If Logger Then Log("Habilitamos boton")
|
||||
End Sub
|
||||
|
||||
Sub B_IMP2BAK_Click
|
||||
|
||||
Reference in New Issue
Block a user