mirror of
https://github.com/KeymonSoft/Intmex_Preventa.git
synced 2026-04-19 05:39:18 +00:00
se corrije que puedan ingresar productos en 0 y es la version final
This commit is contained in:
59
B4A/Subs.bas
59
B4A/Subs.bas
@@ -778,10 +778,11 @@ Sub guardaProductoSinGestion(cedis As String, costoU As String, cant As String,
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)", Array As Object(clienteId, fecha, usuario, c.GetString("CANT_CLIE"), c.GetString("TOTAL_CLIE"), B4XPages.MainPage.lon_gps, B4XPages.MainPage.lat_gps, cedis, c.GetString("TOTAL_CLIE_SIN")))
|
||||
End Sub
|
||||
|
||||
Sub actualizaProducto(cedis As String, costoU As String, cant As String, nombre As String, prodId As String, clienteId As String, fecha As String, usuario As String, rutaV As String, precioSin As String, tipoVenta As String)
|
||||
Sub actualizaProducto(cedis As String, costoU As String, cant As Int, nombre As String, prodId As String, clienteId As String, fecha As String, usuario As String, rutaV As String, precioSin As String, tipoVenta As String)
|
||||
Private c As Cursor=B4XPages.MainPage.skmt.ExecQuery($"select * from pedido where pe_cedis = '${cedis}' and pe_proid = '${prodId}' and pe_cliente = '${clienteId}' AND PE_FOLIO = '${B4XPages.MainPage.tipo_venta}'"$)
|
||||
' Log($"ROWCOUNT: ${c.RowCount}, ${cant}"$)
|
||||
LogColor($"actualizaProducto, c=${clienteId}, p=${prodId}, nombre=${nombre}, cant=${cant}, cedis=${cedis}, tipo=${tipoVenta}"$, Colors.Magenta)
|
||||
|
||||
If c.RowCount > 0 Then
|
||||
c.Position=0
|
||||
Private antCant As Int = 0
|
||||
@@ -804,6 +805,62 @@ Sub actualizaProducto(cedis As String, costoU As String, cant As String, nombre
|
||||
c.Close
|
||||
End Sub
|
||||
|
||||
Sub traeTotalCliente As Double
|
||||
Private sumaTotal As Double
|
||||
Private cursorprueba As Cursor = B4XPages.MainPage.skmt.ExecQuery("Select PE_COSTO_TOT from pedido where PE_CLIENTE <> 0 ")
|
||||
For i= 0 To cursorprueba.RowCount -1
|
||||
cursorprueba.Position = i
|
||||
' LogColor(cursorprueba.GetString("PE_COSTO_TOT"),Colors.Red)
|
||||
sumaTotal = sumaTotal + cursorprueba.GetString("PE_COSTO_TOT")
|
||||
sumaTotal = NumberFormat2(sumaTotal, 0, 2, 2, False)
|
||||
' Log(NumberFormat2(sumaTotal, 0, 2, 2, False))
|
||||
Next
|
||||
cursorprueba.Close
|
||||
Return sumaTotal
|
||||
End Sub
|
||||
|
||||
Sub traeTotalClienteabordo As Double
|
||||
Private sumaTotal As Double
|
||||
Private cursorprueba As Cursor = B4XPages.MainPage.skmt.ExecQuery2("Select PE_COSTO_TOT from pedido where PE_FOLIO = ? AND PE_CLIENTE = 0", Array As String ("ABORDO"))
|
||||
For i= 0 To cursorprueba.RowCount -1
|
||||
cursorprueba.Position = i
|
||||
' LogColor(cursorprueba.GetString("PE_COSTO_TOT"),Colors.Red)
|
||||
sumaTotal = sumaTotal + cursorprueba.GetString("PE_COSTO_TOT")
|
||||
sumaTotal = NumberFormat2(sumaTotal, 0, 2, 2, False)
|
||||
' Log(NumberFormat2(sumaTotal, 0, 2, 2, False))
|
||||
Next
|
||||
cursorprueba.Close
|
||||
Return sumaTotal
|
||||
End Sub
|
||||
|
||||
Sub traeTotalClientepreventa As Double
|
||||
Private sumaTotal As Double
|
||||
Private cursorprueba As Cursor = B4XPages.MainPage.skmt.ExecQuery2("Select PE_COSTO_TOT from pedido where PE_FOLIO = ? AND PE_CLIENTE <> 0", Array As String ("PREVENTA"))
|
||||
For i= 0 To cursorprueba.RowCount -1
|
||||
cursorprueba.Position = i
|
||||
' LogColor(cursorprueba.GetString("PE_COSTO_TOT"),Colors.Red)
|
||||
sumaTotal = sumaTotal + cursorprueba.GetString("PE_COSTO_TOT")
|
||||
sumaTotal = NumberFormat2(sumaTotal, 0, 2, 2, False)
|
||||
' Log(NumberFormat2(sumaTotal, 0, 2, 2, False))
|
||||
Next
|
||||
cursorprueba.Close
|
||||
Return sumaTotal
|
||||
End Sub
|
||||
|
||||
Sub traeTotalClienteventa As Double
|
||||
Private sumaTotal As Double
|
||||
Private cursorprueba As Cursor = B4XPages.MainPage.skmt.ExecQuery2("Select PE_COSTO_TOT from pedido where PE_FOLIO = ? AND PE_CLIENTE <> 0", Array As String ("VENTA"))
|
||||
For i= 0 To cursorprueba.RowCount -1
|
||||
cursorprueba.Position = i
|
||||
' LogColor(cursorprueba.GetString("PE_COSTO_TOT"),Colors.Red)
|
||||
sumaTotal = sumaTotal + cursorprueba.GetString("PE_COSTO_TOT")
|
||||
sumaTotal = NumberFormat2(sumaTotal, 0, 2, 2, False)
|
||||
' Log(NumberFormat2(sumaTotal, 0, 2, 2, False))
|
||||
Next
|
||||
cursorprueba.Close
|
||||
Return sumaTotal
|
||||
End Sub
|
||||
|
||||
'Regresa un mapa con la información de la promo.
|
||||
'Regresa: {id, maxXcliente, maxRecurrente, maxPromos, historico,
|
||||
' productos={idProducto={idProducto, preciosimptos, precio, almacen, tipo, piezas, usuario, fecha, regalo, clasif}} 'Mapa con los productos de la promo y los datos de cada uno.
|
||||
|
||||
Reference in New Issue
Block a user