mirror of
https://github.com/KeymonSoft/Guna_Preventa_BAT.git
synced 2026-04-21 14:49:15 +00:00
VERSION PARA PACHUCA Y GUADALAJARA BAT
This commit is contained in:
@@ -2423,6 +2423,17 @@ Sub vent
|
|||||||
Else If DiferenciaDias > c.GetInt("CAT_CL_DIASCREDITO") + 8 Then
|
Else If DiferenciaDias > c.GetInt("CAT_CL_DIASCREDITO") + 8 Then
|
||||||
MsgboxAsync($"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")}"$, "Atención")
|
MsgboxAsync($"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")}"$, "Atención")
|
||||||
End If
|
End If
|
||||||
|
Else If ALMACEN = 88 Or ALMACEN = 92 Then
|
||||||
|
If DiferenciaDias <= c.GetInt("CAT_CL_DIASCREDITO") +1 Then
|
||||||
|
' MsgboxAsync($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio")
|
||||||
|
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)
|
||||||
|
Wait For Msgbox_Result (resultado As Int)
|
||||||
|
If resultado = DialogResponse.POSITIVE Then
|
||||||
|
gestionar
|
||||||
|
End If
|
||||||
|
Else If DiferenciaDias > c.GetInt("CAT_CL_DIASCREDITO") +1 Then
|
||||||
|
MsgboxAsync($"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")}"$, "Atención")
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
If DiferenciaDias <= c.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
If DiferenciaDias <= c.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
||||||
' MsgboxAsync($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio")
|
' MsgboxAsync($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio")
|
||||||
@@ -3475,9 +3486,64 @@ Sub B_IMP_Click
|
|||||||
Else
|
Else
|
||||||
Impresion
|
Impresion
|
||||||
End If
|
End If
|
||||||
Else If ALMACEN = 88 Or ALMACEN = 94 Then
|
Else If ALMACEN = 94 Then
|
||||||
|
|
||||||
Impresion4
|
Impresion4
|
||||||
|
Else If ALMACEN = 88 Then
|
||||||
|
c=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO, CAT_CL_LIMITECREDITO, IFNULL(CONFIRMADO,0) AS CONFIRMADO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||||
|
c.Position = 0
|
||||||
|
|
||||||
|
If c.GetString("CAT_CL_BCREDITO") = 0 Then
|
||||||
|
Impresion2
|
||||||
|
|
||||||
|
Else If c.GetString("CAT_CL_BCREDITO") = 1 Then
|
||||||
|
If c.GetString("CONFIRMADO") = 0 Then
|
||||||
|
|
||||||
|
Msgbox2Async("La entrega sera a credito o de contado?" , "Atención", "Credito", "Contado", "", LoadBitmap(File.DirAssets,"alert2.png"), False)
|
||||||
|
Wait For Msgbox_Result (resultado As Int)
|
||||||
|
If resultado = DialogResponse.POSITIVE Then
|
||||||
|
Dim creditocod As Cursor = Starter.skmt.ExecQuery("SELECT CODIGO FROM CODIGOS_CREDITO WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
|
Log(creditocod.RowCount)
|
||||||
|
If creditocod.RowCount > 0 Then
|
||||||
|
creditocod.Position = 0
|
||||||
|
Dim cs As CSBuilder
|
||||||
|
cs.Initialize
|
||||||
|
|
||||||
|
' 1. Iniciamos el constructor y definimos el tamaño general más grande (ej. 20)
|
||||||
|
cs.Size(16).Append("Proporciona el siguiente codigo al cliente '")
|
||||||
|
|
||||||
|
' 2. Activamos Negrita (Bold) para el código
|
||||||
|
cs.Bold.Append(creditocod.GetString("CODIGO")).Pop ' .Pop cierra la negrita
|
||||||
|
|
||||||
|
' 3. Continuamos con el texto normal y cerramos todo
|
||||||
|
cs.Append("' para su entrega").PopAll
|
||||||
|
|
||||||
|
' 4. Pasamos el objeto 'cs' en lugar del texto plano
|
||||||
|
Msgbox2Async(cs, "Atención", "Ok", "", "", LoadBitmap(File.DirAssets,"alert2.png"), False)
|
||||||
|
Wait For Msgbox_Result (resultado As Int)
|
||||||
|
If resultado = DialogResponse.POSITIVE Then
|
||||||
|
Starter.skmt.ExecNonQuery("Update kmt_info3 set CONFIRMADO = 1 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
|
Starter.skmt.ExecNonQuery("Update CODIGOS_CREDITO set BANDERA = 1 WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
|
|
||||||
|
Impresion2
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Impresion2
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Else If resultado = DialogResponse.CANCEL Then
|
||||||
|
Starter.skmt.ExecNonQuery("Update kmt_info3 set CONFIRMADO = 1 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
|
Impresion2
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Impresion2
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Else If ALMACEN = 92 Then
|
||||||
|
Impresion2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else If ALMACEN = 81 Or ALMACEN = 102 Then
|
Else If ALMACEN = 81 Or ALMACEN = 102 Then
|
||||||
|
|
||||||
c=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO, CAT_CL_LIMITECREDITO, IFNULL(CONFIRMADO,0) AS CONFIRMADO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
c=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO, CAT_CL_LIMITECREDITO, IFNULL(CONFIRMADO,0) AS CONFIRMADO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||||
@@ -3625,7 +3691,7 @@ Sub Impresion4
|
|||||||
|
|
||||||
Printer1.WriteString("--------------------PREVENTA--------------------" & eLINEFEED)
|
Printer1.WriteString("--------------------PREVENTA--------------------" & eLINEFEED)
|
||||||
' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show.
|
' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show.
|
||||||
s=skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, IFNULL(PE_RECALCULO,0) AS PE_RECALCULO, length(PE_COSTOU) as L_COSTOU, length(Ifnull(PE_RECALCULO,0)) as L_COSTOREC, PE_CANT * PE_COSTOU AS PE_COSTO_TOT, PE_CANT * IFNULL(PE_RECALCULO,0) AS PE_COSTO_TOTREC, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT, length(PE_CANT * IFNULL(PE_RECALCULO,0)) as L_COSTO_TOTREC, PE_PROID, PE_CEDIS, PE_RECCANT FROM PEDIDO WHERE PE_CEDIS = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0' order by PE_PROID", Array As String(Subs.traeAlmacen))
|
s=skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, IFNULL(PE_RECALCULO,0) AS PE_RECALCULO, length(PE_COSTOU) as L_COSTOU, length(Ifnull(PE_RECALCULO,0)) as L_COSTOREC, PE_CANT * PE_COSTOU AS PE_COSTO_TOT, PE_CANT * IFNULL(PE_RECALCULO,0) AS PE_COSTO_TOTREC, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT, length(PE_CANT * IFNULL(PE_RECALCULO,0)) as L_COSTO_TOTREC, PE_PROID, PE_CEDIS, PE_RECCANT FROM PEDIDO WHERE PE_CEDIS = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0' AND PE_CANT > 0 order by PE_PROID", Array As String(Subs.traeAlmacen))
|
||||||
If S.RowCount>0 Then
|
If S.RowCount>0 Then
|
||||||
For i=0 To S.RowCount -1
|
For i=0 To S.RowCount -1
|
||||||
S.Position=i
|
S.Position=i
|
||||||
@@ -3719,7 +3785,7 @@ Sub Impresion4
|
|||||||
|
|
||||||
totalpromos = 0
|
totalpromos = 0
|
||||||
totalpromostotal = 0
|
totalpromostotal = 0
|
||||||
s=skmt.ExecQuery("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0' order by PE_CEDIS, PE_COSTOU")
|
s=skmt.ExecQuery("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0' AND PE_CANT > 0 order by PE_CEDIS, PE_COSTOU")
|
||||||
If S.RowCount>0 Then
|
If S.RowCount>0 Then
|
||||||
' Printer1.WriteString("------------------PROMOCIONES-------------------" & eLINEFEED)
|
' Printer1.WriteString("------------------PROMOCIONES-------------------" & eLINEFEED)
|
||||||
For i=0 To S.RowCount -1
|
For i=0 To S.RowCount -1
|
||||||
@@ -3825,6 +3891,7 @@ Sub Impresion4
|
|||||||
Printer1.WriteString("----------COMPROBANTE FISCAL, SOLO ES-----------" & eLINEFEED)
|
Printer1.WriteString("----------COMPROBANTE FISCAL, SOLO ES-----------" & eLINEFEED)
|
||||||
Printer1.WriteString("------------------INFORMATIVO-------------------" & eLINEFEED)
|
Printer1.WriteString("------------------INFORMATIVO-------------------" & eLINEFEED)
|
||||||
Printer1.WriteString("------------------------------------------------" & eLINEFEED)
|
Printer1.WriteString("------------------------------------------------" & eLINEFEED)
|
||||||
|
Printer1.WriteString("------------------------------------------------" & eLINEFEED)
|
||||||
If ALMACEN = 81 Then
|
If ALMACEN = 81 Then
|
||||||
|
|
||||||
Dim creditocod2 As Cursor = Starter.skmt.ExecQuery("SELECT BANDERA FROM CODIGOS_CREDITO WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
Dim creditocod2 As Cursor = Starter.skmt.ExecQuery("SELECT BANDERA FROM CODIGOS_CREDITO WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
@@ -4463,12 +4530,187 @@ Sub Impresion3
|
|||||||
' printer.Close
|
' printer.Close
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
'Sub Impresion2
|
||||||
|
' c=skmt.ExecQuery("select USUARIO from usuarioa")
|
||||||
|
' c.Position=0
|
||||||
|
' usuario = c.GetString("USUARIO")
|
||||||
|
' DateTime.DateFormat = "dd/MM/yyyy"
|
||||||
|
'' DateTime.DateFormat = "MM/dd/yyyy"
|
||||||
|
' sDate=DateTime.Date(DateTime.Now)
|
||||||
|
' sTime=DateTime.Time(DateTime.Now)
|
||||||
|
' c.Close
|
||||||
|
'' c=Starter.skmt.ExecQuery2("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION =?", Array As String ("SUCURSAL"))
|
||||||
|
'' c.Position = 0
|
||||||
|
'' sucursal = c.GetString("CAT_VA_VALOR")
|
||||||
|
'' c.Close
|
||||||
|
' Public Const eLINEFEED As String = "" & Chr(0x0D) & Chr(0x0A)
|
||||||
|
' ProgressDialogShow("Imprimiendo, un momento ...")
|
||||||
|
' Printer1.DisConnect
|
||||||
|
' If Not(Printer1.IsConnected) Then
|
||||||
|
'' If logger Then Log("conectando 1")
|
||||||
|
' Printer1.Connect
|
||||||
|
' Private cont As Int = 0
|
||||||
|
' Do While Not(impresoraConectada)
|
||||||
|
' Sleep(1000)
|
||||||
|
' cont = cont + 1
|
||||||
|
' If cont = 7 Then Printer1.Connect 'Tratamos de reconectar
|
||||||
|
' If cont > 15 Then impresoraConectada = True
|
||||||
|
' Loop
|
||||||
|
' Sleep(500)
|
||||||
|
' impresoraConectada = False
|
||||||
|
' Else
|
||||||
|
'' If logger Then Log("conectando 2")
|
||||||
|
' Printer1.Connect
|
||||||
|
' Private cont As Int = 0
|
||||||
|
' Do While Not(impresoraConectada) Or Not(Printer1.IsConnected)
|
||||||
|
' Sleep(1000)
|
||||||
|
' cont = cont + 1
|
||||||
|
' If cont = 2 Then Printer1.Connect
|
||||||
|
' If cont > 4 Then impresoraConectada = True
|
||||||
|
' Loop
|
||||||
|
' Sleep(500)
|
||||||
|
' impresoraConectada = False
|
||||||
|
' End If
|
||||||
|
'
|
||||||
|
' TAMANO = 0
|
||||||
|
' ESPACIO = 21
|
||||||
|
' BLANCO = " "
|
||||||
|
'' Dim bmp As Bitmap
|
||||||
|
'' bmp.InitializeResize(File.DirAssets, "guna.png", 192, 192, True) 'ignore
|
||||||
|
'' Dim myimage As AnImage = Printer1.ImageToBWIMage(bmp)
|
||||||
|
''
|
||||||
|
'' myimage = Printer1.DitherImage2D(myimage, 128)
|
||||||
|
''
|
||||||
|
'' myimage= Printer1.PackImage(myimage)
|
||||||
|
'' Printer1.WriteString(eLINEFEED) ' nudge the printer to show the user something is happening
|
||||||
|
'' Printer1.WriteString(Printer1.REVERSE)
|
||||||
|
''
|
||||||
|
'' Printer1.PrintImage(myimage)
|
||||||
|
'' Printer1.WriteString(Printer1.UNREVERSE)
|
||||||
|
'
|
||||||
|
' 'Printer1.Justify = 1
|
||||||
|
' 'printer.Initialize(cmp20.OutputStream)
|
||||||
|
'' Printer1.WriteString("DISTRIBUIDORA ROCHA TULA PACHUCA" & eLINEFEED)
|
||||||
|
' Printer1.WriteString("RFC: DRT-110316-9J1" & eLINEFEED)
|
||||||
|
'' Printer1.WriteString(sucursal & eLINEFEED)
|
||||||
|
' Printer1.WriteString(sDate & eLINEFEED)
|
||||||
|
' Printer1.WriteString(sTime & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Vendedor:" & usuario & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Tienda: " & La_nombre.Text & eLINEFEED)
|
||||||
|
' Printer1.WriteString("ID.Cliente: " & la_cuenta.Text & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Calle: " & la_Calle.Text & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Colonia: " & la_col.Text & eLINEFEED)
|
||||||
|
'' Printer1.WriteString("C.P.: " & la_cp.Text & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Entre calle1: " & l_entre1.Text & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Entre Calle2: " & l_entre2.Text & eLINEFEED)
|
||||||
|
'
|
||||||
|
' Printer1.WriteString("-----------PREVENTA-----------" & eLINEFEED)
|
||||||
|
' ' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show.
|
||||||
|
' s=skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_CEDIS <> ? AND LENGTH(PE_CEDIS) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PROID", Array As String("DUR"))
|
||||||
|
' If S.RowCount>0 Then
|
||||||
|
' For i=0 To S.RowCount -1
|
||||||
|
' S.Position=i
|
||||||
|
' If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then
|
||||||
|
' Printer1.WriteString(s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
'
|
||||||
|
' Else
|
||||||
|
'
|
||||||
|
' Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
' TAMANO = s.GetLong("L_CANT") + TAMANO
|
||||||
|
' TAMANO = s.GetLong("L_COSTOU") + TAMANO
|
||||||
|
' TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO
|
||||||
|
'
|
||||||
|
' ESPACIO = ESPACIO - TAMANO
|
||||||
|
'
|
||||||
|
' For E=0 To ESPACIO -1
|
||||||
|
' BLANCO = " " & BLANCO
|
||||||
|
' Next
|
||||||
|
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & eLINEFEED )
|
||||||
|
' TAMANO = 0
|
||||||
|
' ESPACIO = 21
|
||||||
|
' BLANCO = " "
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
' s.Close
|
||||||
|
' Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
' s=skmt.ExecQuery("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE LENGTH(PE_CEDIS) > 3 AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_COSTOU")
|
||||||
|
' If S.RowCount>0 Then
|
||||||
|
' Printer1.WriteString("------------PROMOS------------" & eLINEFEED)
|
||||||
|
' For i=0 To S.RowCount -1
|
||||||
|
' S.Position=i
|
||||||
|
' If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then
|
||||||
|
' Printer1.WriteString(s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
'
|
||||||
|
' Else
|
||||||
|
'
|
||||||
|
' Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
' TAMANO = s.GetLong("L_CANT") + TAMANO
|
||||||
|
' TAMANO = s.GetLong("L_COSTOU") + TAMANO
|
||||||
|
' TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO
|
||||||
|
'
|
||||||
|
' ESPACIO = ESPACIO - TAMANO
|
||||||
|
'
|
||||||
|
' For E=0 To ESPACIO -1
|
||||||
|
' BLANCO = " " & BLANCO
|
||||||
|
' Next
|
||||||
|
' Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & eLINEFEED )
|
||||||
|
' TAMANO = 0
|
||||||
|
' ESPACIO = 21
|
||||||
|
' BLANCO = " "
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
' End If
|
||||||
|
' s.Close
|
||||||
|
'
|
||||||
|
' s=skmt.ExecQuery("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
||||||
|
' s.Position =0
|
||||||
|
' ' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then
|
||||||
|
' ' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")))
|
||||||
|
' ' End If
|
||||||
|
' Printer1.WriteString("Subtotal Preventa: $" & s.GetString("TOTAL") & eLINEFEED)
|
||||||
|
' s.Close
|
||||||
|
' c= skmt.ExecQuery("select sum(PE_CANT) as PC_NOART 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
|
||||||
|
' Printer1.WriteString("Total Articulos: " & c.GetString("PC_NOART") & eLINEFEED)
|
||||||
|
' c.Close
|
||||||
|
' s=skmt.ExecQuery("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
||||||
|
' s.Position =0
|
||||||
|
' ' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then
|
||||||
|
' ' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")))
|
||||||
|
' ' End If
|
||||||
|
' Printer1.WriteString("Descuento: $" & 150 & eLINEFEED)
|
||||||
|
' Printer1.WriteString("Total Preventa: $" & (s.GetString("TOTAL") -150 )& eLINEFEED)
|
||||||
|
'
|
||||||
|
' Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
' Printer1.WriteString("------------------------------" & eLINEFEED)
|
||||||
|
' Printer1.WriteString("ENTREGA EN :" & eLINEFEED)
|
||||||
|
' Printer1.WriteString(la_Calle.Text & eLINEFEED)
|
||||||
|
' Printer1.WriteString("----ESTE TICKET NO ES UN -----" & eLINEFEED)
|
||||||
|
' Printer1.WriteString("--COMPROBANTE FISCAL, SOLO ES-" & eLINEFEED)
|
||||||
|
' Printer1.WriteString("--------INFORMATIVO-----------" & eLINEFEED)
|
||||||
|
' Printer1.WriteString("------------------------------" & eLINEFEED)
|
||||||
|
' Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
'
|
||||||
|
' Sleep(1000)
|
||||||
|
' Printer1.DisConnect
|
||||||
|
'
|
||||||
|
' ProgressDialogHide
|
||||||
|
'' printer.Flush
|
||||||
|
' ' printer.Close
|
||||||
|
'End Sub
|
||||||
|
|
||||||
Sub Impresion2
|
Sub Impresion2
|
||||||
|
Dim pedinow As Cursor = skmt.ExecQuery("select * FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_FUTURO = '0' ")
|
||||||
|
If pedinow.RowCount > 0 Then
|
||||||
|
' Mandapedido
|
||||||
|
|
||||||
c=skmt.ExecQuery("select USUARIO from usuarioa")
|
c=skmt.ExecQuery("select USUARIO from usuarioa")
|
||||||
c.Position=0
|
c.Position=0
|
||||||
usuario = c.GetString("USUARIO")
|
usuario = c.GetString("USUARIO")
|
||||||
DateTime.DateFormat = "dd/MM/yyyy"
|
|
||||||
' DateTime.DateFormat = "MM/dd/yyyy"
|
' DateTime.DateFormat = "MM/dd/yyyy"
|
||||||
|
DateTime.DateFormat = "dd/MM/yyyy"
|
||||||
sDate=DateTime.Date(DateTime.Now)
|
sDate=DateTime.Date(DateTime.Now)
|
||||||
sTime=DateTime.Time(DateTime.Now)
|
sTime=DateTime.Time(DateTime.Now)
|
||||||
c.Close
|
c.Close
|
||||||
@@ -4521,9 +4763,15 @@ Sub Impresion2
|
|||||||
' Printer1.PrintImage(myimage)
|
' Printer1.PrintImage(myimage)
|
||||||
' Printer1.WriteString(Printer1.UNREVERSE)
|
' Printer1.WriteString(Printer1.UNREVERSE)
|
||||||
|
|
||||||
'Printer1.Justify = 1
|
' Printer1.Justify = 1
|
||||||
'printer.Initialize(cmp20.OutputStream)
|
' printer.Initialize(cmp20.OutputStream)
|
||||||
' Printer1.WriteString("DISTRIBUIDORA ROCHA TULA PACHUCA" & eLINEFEED)
|
Printer1.WriteString("Centro de atencion a Clientes Bat" & eLINEFEED)
|
||||||
|
Printer1.WriteString("Telefono: 800 400 5000" & eLINEFEED)
|
||||||
|
Printer1.WriteString(eLINEFEED)
|
||||||
|
Printer1.WriteString(eLINEFEED)
|
||||||
|
|
||||||
|
|
||||||
|
Printer1.WriteString("DISTRIBUIDORA ROCHA TULA PACHUCA" & eLINEFEED)
|
||||||
Printer1.WriteString("RFC: DRT-110316-9J1" & eLINEFEED)
|
Printer1.WriteString("RFC: DRT-110316-9J1" & eLINEFEED)
|
||||||
' Printer1.WriteString(sucursal & eLINEFEED)
|
' Printer1.WriteString(sucursal & eLINEFEED)
|
||||||
Printer1.WriteString(sDate & eLINEFEED)
|
Printer1.WriteString(sDate & eLINEFEED)
|
||||||
@@ -4536,44 +4784,110 @@ Sub Impresion2
|
|||||||
' Printer1.WriteString("C.P.: " & la_cp.Text & eLINEFEED)
|
' Printer1.WriteString("C.P.: " & la_cp.Text & eLINEFEED)
|
||||||
Printer1.WriteString("Entre calle1: " & l_entre1.Text & eLINEFEED)
|
Printer1.WriteString("Entre calle1: " & l_entre1.Text & eLINEFEED)
|
||||||
Printer1.WriteString("Entre Calle2: " & l_entre2.Text & eLINEFEED)
|
Printer1.WriteString("Entre Calle2: " & l_entre2.Text & eLINEFEED)
|
||||||
|
|
||||||
Printer1.WriteString("-----------PREVENTA-----------" & eLINEFEED)
|
Printer1.WriteString("----------PREVENTA-----------" & eLINEFEED)
|
||||||
' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show.
|
' aqui es donde esta el pedo de julieta de los descuentos quitar el precio2 pero meter un if para saber si es ruta especial o es normal o que show.
|
||||||
s=skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE PE_CEDIS <> ? AND LENGTH(PE_CEDIS) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PROID", Array As String("DUR"))
|
s=skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, IFNULL(PE_RECALCULO,0) AS PE_RECALCULO, length(PE_COSTOU) as L_COSTOU, length(Ifnull(PE_RECALCULO,0)) as L_COSTOREC, PE_CANT * PE_COSTOU AS PE_COSTO_TOT, PE_CANT * IFNULL(PE_RECALCULO,0) AS PE_COSTO_TOTREC, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT, length(PE_CANT * IFNULL(PE_RECALCULO,0)) as L_COSTO_TOTREC, PE_PROID, PE_CEDIS, PE_RECCANT FROM PEDIDO WHERE PE_CEDIS = ? AND PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0' AND PE_CANT > 0 order by PE_PROID", Array As String(Subs.traeAlmacen))
|
||||||
If S.RowCount>0 Then
|
If S.RowCount>0 Then
|
||||||
For i=0 To S.RowCount -1
|
For i=0 To S.RowCount -1
|
||||||
S.Position=i
|
S.Position=i
|
||||||
If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then
|
If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then
|
||||||
Printer1.WriteString(s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
' Printer1.WriteString(s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
If s.GetInt("PE_RECALCULO") = 0 Then
|
||||||
Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
TAMANO = s.GetLong("L_CANT") + TAMANO
|
TAMANO = s.GetLong("L_CANT") + TAMANO
|
||||||
TAMANO = s.GetLong("L_COSTOU") + TAMANO
|
TAMANO = s.GetLong("L_COSTOU") + TAMANO
|
||||||
TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO
|
TAMANO = s.GetLong("L_COSTO_TOT") + TAMANO
|
||||||
|
|
||||||
|
ESPACIO = ESPACIO - TAMANO
|
||||||
|
|
||||||
|
For E=0 To ESPACIO -1
|
||||||
|
BLANCO = " " & BLANCO
|
||||||
|
Next
|
||||||
|
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & eLINEFEED& eLINEFEED )
|
||||||
|
TAMANO = 0
|
||||||
|
ESPACIO = 21
|
||||||
|
BLANCO = " "
|
||||||
|
Else if s.GetInt("PE_CANT") = s.GetInt("PE_RECCANT") Then
|
||||||
|
Printer1.WriteString(s.GetString("PE_CANT") & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
TAMANO = s.GetLong("L_CANT") + TAMANO
|
||||||
|
TAMANO = s.GetLong("L_COSTOREC") + TAMANO
|
||||||
|
TAMANO = s.GetLong("L_COSTO_TOTREC") + TAMANO
|
||||||
|
|
||||||
|
ESPACIO = ESPACIO - TAMANO
|
||||||
|
|
||||||
ESPACIO = ESPACIO - TAMANO
|
For E=0 To ESPACIO -1
|
||||||
|
BLANCO = " " & BLANCO
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim descpro As Cursor = Starter.skmt.ExecQuery($"SELECT CAT_PD_RANGO, CAT_PD_DESCUENTO, CAT_PD_RANGO2 FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '${s.GetString("PE_PRONOMBRE")}') AND INSTR(',' || CAT_PD_TIER || ',' , ',${Subs.traeTipoCliente},') > 0 "$)
|
||||||
|
descpro.Position = 0
|
||||||
|
|
||||||
|
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_RECALCULO") & " $" & s.GETSTRING("PE_COSTO_TOTREC") & eLINEFEED & eLINEFEED )
|
||||||
|
|
||||||
|
Log(s.GetString("PE_PRONOMBRE"))
|
||||||
|
Log(descpro.GetDouble("CAT_PD_DESCUENTO"))
|
||||||
|
Printer1.WriteString(BLANCO & "PL $" & s.GETSTRING("PE_COSTOU") & " Desc.: " & descpro.GetDouble("CAT_PD_DESCUENTO")&"%" & eLINEFEED & eLINEFEED)
|
||||||
|
TAMANO = 0
|
||||||
|
ESPACIO = 21
|
||||||
|
BLANCO = " "
|
||||||
|
Else if s.GetInt("PE_CANT") <> s.GetInt("PE_RECCANT") Then
|
||||||
|
Log(s.GetInt("PE_RECCANT"))
|
||||||
|
Log(s.GetInt("PE_CANT"))
|
||||||
|
Log("aqui")
|
||||||
|
Printer1.WriteString(s.GetString("PE_RECCANT") & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
TAMANO = s.GetLong("L_CANT") + TAMANO
|
||||||
|
TAMANO = s.GetLong("L_COSTOREC") + TAMANO
|
||||||
|
TAMANO = s.GetLong("L_COSTO_TOTREC") + TAMANO
|
||||||
|
|
||||||
|
ESPACIO = ESPACIO - TAMANO
|
||||||
|
|
||||||
For E=0 To ESPACIO -1
|
For E=0 To ESPACIO -1
|
||||||
BLANCO = " " & BLANCO
|
BLANCO = " " & BLANCO
|
||||||
Next
|
Next
|
||||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & eLINEFEED )
|
|
||||||
TAMANO = 0
|
' Con descuento
|
||||||
ESPACIO = 21
|
Dim descpro As Cursor = Starter.skmt.ExecQuery($"SELECT CAT_PD_RANGO, CAT_PD_DESCUENTO, CAT_PD_RANGO2 FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '${s.GetString("PE_PRONOMBRE")}') AND INSTR(',' || CAT_PD_TIER || ',' , ',${Subs.traeTipoCliente},') > 0 "$)
|
||||||
BLANCO = " "
|
descpro.Position = 0
|
||||||
|
|
||||||
|
Printer1.WriteString(BLANCO & s.GETSTRING("PE_RECCANT") & " X $" & s.GETSTRING("PE_RECALCULO") & " $" & NumberFormat2((s.GETSTRING("PE_RECCANT") * s.GETSTRING("PE_RECALCULO")),1,2,2,False) & eLINEFEED & eLINEFEED )
|
||||||
|
Printer1.WriteString(BLANCO & "PL $" & s.GETSTRING("PE_COSTOU") & " Desc.: " & descpro.GetDouble("CAT_PD_DESCUENTO")&"%" & eLINEFEED & eLINEFEED)
|
||||||
|
|
||||||
|
Private subTot As String = (s.GETSTRING("PE_CANT")-s.GETSTRING("PE_RECCANT")) * s.GETSTRING("PE_COSTOU")
|
||||||
|
TAMANO = s.GetLong("L_CANT") + TAMANO
|
||||||
|
TAMANO = s.GetLong("L_COSTOREC") + TAMANO
|
||||||
|
TAMANO = subTot + TAMANO
|
||||||
|
|
||||||
|
ESPACIO = ESPACIO - TAMANO
|
||||||
|
|
||||||
|
For E=0 To ESPACIO -1
|
||||||
|
BLANCO = " " & BLANCO
|
||||||
|
Next
|
||||||
|
' Sin decuento
|
||||||
|
Printer1.WriteString((s.GETSTRING("PE_CANT")-s.GETSTRING("PE_RECCANT")) & " " & s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
||||||
|
Printer1.WriteString(BLANCO & (s.GETSTRING("PE_CANT")-s.GETSTRING("PE_RECCANT")) & " X $" & s.GETSTRING("PE_COSTOU") & " $" & NumberFormat2(subTot,1,2,2,False) & eLINEFEED & eLINEFEED )
|
||||||
|
|
||||||
|
|
||||||
|
TAMANO = 0
|
||||||
|
ESPACIO = 21
|
||||||
|
BLANCO = " "
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
s.Close
|
s.Close
|
||||||
Printer1.WriteString(" " & eLINEFEED)
|
' Printer1.WriteString(" " & eLINEFEED)
|
||||||
s=skmt.ExecQuery("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE LENGTH(PE_CEDIS) > 3 AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_COSTOU")
|
|
||||||
|
totalpromos = 0
|
||||||
|
totalpromostotal = 0
|
||||||
|
s=skmt.ExecQuery("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS FROM PEDIDO WHERE LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0' AND PE_CANT > 0 order by PE_CEDIS, PE_COSTOU")
|
||||||
If S.RowCount>0 Then
|
If S.RowCount>0 Then
|
||||||
Printer1.WriteString("------------PROMOS------------" & eLINEFEED)
|
' Printer1.WriteString("------------------PROMOCIONES-------------------" & eLINEFEED)
|
||||||
For i=0 To S.RowCount -1
|
For i=0 To S.RowCount -1
|
||||||
S.Position=i
|
S.Position=i
|
||||||
If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then
|
If s.GetString("PE_CEDIS") = s.GetString("PE_PROID") Then
|
||||||
Printer1.WriteString(s.GetString("PE_PRONOMBRE") & eLINEFEED)
|
' Printer1.WriteString("* " & s.GetString("PE_PRONOMBRE") &" *" & eLINEFEED)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
@@ -4587,7 +4901,29 @@ Sub Impresion2
|
|||||||
For E=0 To ESPACIO -1
|
For E=0 To ESPACIO -1
|
||||||
BLANCO = " " & BLANCO
|
BLANCO = " " & BLANCO
|
||||||
Next
|
Next
|
||||||
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & eLINEFEED )
|
Printer1.WriteString(BLANCO & s.GETSTRING("PE_CANT") & " X $" & s.GETSTRING("PE_COSTOU") & " $" & s.GETSTRING("PE_COSTO_TOT") & eLINEFEED )
|
||||||
|
|
||||||
|
|
||||||
|
Dim coloressaldo As Cursor=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_CLASIFICADOR2,0) AS CAT_CL_CLASIFICADOR2 from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||||
|
coloressaldo.Position = 0
|
||||||
|
|
||||||
|
If coloressaldo.GetString("CAT_CL_CLASIFICADOR2") = "LP222_D" Then
|
||||||
|
|
||||||
|
Dim precioprom As Cursor = Starter.skmt.ExecQuery($"SELECT CAT_LISTAPRECIO AS CAT_GP_PRECIO FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '${s.GetString("PE_PRONOMBRE")}' "$)
|
||||||
|
Else
|
||||||
|
Dim precioprom As Cursor = Starter.skmt.ExecQuery($"SELECT CAT_GP_PRECIO FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '${s.GetString("PE_PRONOMBRE")}' "$)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If precioprom.RowCount > 0 Then
|
||||||
|
precioprom.Position = 0
|
||||||
|
Log (precioprom.GETSTRING("CAT_GP_PRECIO"))
|
||||||
|
Log (s.GETSTRING("PE_COSTOU"))
|
||||||
|
If NumberFormat2(precioprom.GETSTRING("CAT_GP_PRECIO"),0.,2,2,False) <> NumberFormat2(s.GETSTRING("PE_COSTOU"),0.,2,2,False) Then
|
||||||
|
|
||||||
|
Printer1.WriteString(BLANCO & "PL $" & precioprom.GETSTRING("CAT_GP_PRECIO") & " Desc.: " & NumberFormat2(((( precioprom.GETSTRING("CAT_GP_PRECIO")-s.GETSTRING("PE_COSTOU"))*100)/precioprom.GETSTRING("CAT_GP_PRECIO")),0.,2,2,False) &"%" & eLINEFEED & eLINEFEED)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
TAMANO = 0
|
TAMANO = 0
|
||||||
ESPACIO = 21
|
ESPACIO = 21
|
||||||
BLANCO = " "
|
BLANCO = " "
|
||||||
@@ -4597,26 +4933,53 @@ Sub Impresion2
|
|||||||
End If
|
End If
|
||||||
s.Close
|
s.Close
|
||||||
|
|
||||||
s=skmt.ExecQuery("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
' s=skmt.ExecQuery("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_FUTURO = '0'")
|
||||||
s.Position =0
|
' s.Position =0
|
||||||
' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then
|
' ' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then
|
||||||
' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")))
|
' ' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")))
|
||||||
' End If
|
' ' End If
|
||||||
Printer1.WriteString("Subtotal Preventa: $" & s.GetString("TOTAL") & eLINEFEED)
|
' Printer1.WriteString("Subtotal Preventa: $" & s.GetString("TOTAL") & eLINEFEED)
|
||||||
s.Close
|
'' Printer1.WriteString("Subtotal Preventa: $" & Subs.calculaTotalConPromoXRango(Subs.traeCliente) & eLINEFEED)
|
||||||
c= skmt.ExecQuery("select sum(PE_CANT) as PC_NOART 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
|
' c= skmt.ExecQuery("select sum(PE_CANT) as PC_NOART from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_FUTURO = '0'")
|
||||||
Printer1.WriteString("Total Articulos: " & c.GetString("PC_NOART") & eLINEFEED)
|
' C.Position=0
|
||||||
c.Close
|
' Printer1.WriteString("Total Articulos: " & c.GetString("PC_NOART") & eLINEFEED)
|
||||||
s=skmt.ExecQuery("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
' c.Close
|
||||||
s.Position =0
|
' Dim s3 As Cursor =skmt.ExecQuery("select IFNULL(SUM(PE_COSTO_TOT),0) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and IFNULL(PE_RECALCULO,0) = 0 and PE_FUTURO = '0'")
|
||||||
' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then
|
' s3.Position =0
|
||||||
' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")))
|
' S2=skmt.ExecQuery("select IFNULL(SUM(PE_RECALCULOTOT),0) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and IFNULL(PE_RECALCULO,0) <> 0 and PE_FUTURO = '0'")
|
||||||
' End If
|
' S2.Position =0
|
||||||
Printer1.WriteString("Descuento: $" & 150 & eLINEFEED)
|
'
|
||||||
Printer1.WriteString("Total Preventa: $" & (s.GetString("TOTAL") -150 )& eLINEFEED)
|
' If NumberFormat2((s3.GetString("TOTAL") + S2.GetString("TOTAL")),0,2,2,False) <> s.GetString("TOTAL") Then
|
||||||
|
'
|
||||||
|
' Printer1.WriteString("Descuento: $" & NumberFormat2( (s.GetString("TOTAL") - Subs.calculaTotalConPromoXRango2(Subs.traeCliente)),0,2,2,False)& eLINEFEED)
|
||||||
|
' End If
|
||||||
|
' ' If s.GetString("TOTAL") - s.GetString("TOTAL2") <> 0 Then
|
||||||
|
' ' Printer1.WriteString("Descuento: $" & (s.GetString("TOTAL2") - s.GetString("TOTAL")))
|
||||||
|
' ' End If
|
||||||
|
'' Printer1.WriteString("Descuento: $" & 150 & eLINEFEED)
|
||||||
|
'' Printer1.WriteString("Total Preventa: $" & NumberFormat2((s3.GetString("TOTAL") + S2.GetString("TOTAL")),0,2,2,False)& eLINEFEED)
|
||||||
|
' Printer1.WriteString("Total Preventa: $" & NumberFormat2(Subs.calculaTotalConPromoXRango2(Subs.traeCliente),0,2,2,False)& eLINEFEED)
|
||||||
|
|
||||||
Printer1.WriteString(" " & eLINEFEED)
|
Printer1.WriteString("Subtotal Preventa: $" & NumberFormat2(Subs.calculaTotalConPromoXRango3(Subs.traeCliente),0,2,2,False)& eLINEFEED)
|
||||||
|
If NumberFormat2(Subs.calculaTotalConPromoXRango3(Subs.traeCliente),0,2,2,False) <> NumberFormat2(Subs.calculaTotalConPromoXRango2(Subs.traeCliente),0,2,2,False) Then
|
||||||
|
Printer1.WriteString("Descuento: $" & NumberFormat2( (Subs.calculaTotalConPromoXRango3(Subs.traeCliente) - Subs.calculaTotalConPromoXRango2(Subs.traeCliente)),0,2,2,False)& eLINEFEED)
|
||||||
|
' Printer1.WriteString("Descuento %: " & NumberFormat2( (((Subs.calculaTotalConPromoXRango3(Subs.traeCliente) - Subs.calculaTotalConPromoXRango2(Subs.traeCliente))*100)/NumberFormat2(Subs.calculaTotalConPromoXRango3(Subs.traeCliente),0,2,2,False)),0,2,2,False)& eLINEFEED)
|
||||||
|
End If
|
||||||
|
Printer1.WriteString("Total Preventa: $" & NumberFormat2(Subs.calculaTotalConPromoXRango2(Subs.traeCliente),0,2,2,False)& eLINEFEED)
|
||||||
|
Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
|
||||||
|
Private contadocredito As Cursor = Starter.skmt.ExecQuery($"SELECT BANDERA FROM CODIGOS_CREDITO WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA) "$)
|
||||||
|
If contadocredito.RowCount > 0 Then
|
||||||
|
contadocredito.Position = 0
|
||||||
|
If contadocredito.getstring("BANDERA") = "1" Then
|
||||||
|
Printer1.WriteString("Tipo de entrega: CREDITO"&eLINEFEED)
|
||||||
|
Else
|
||||||
|
Printer1.WriteString("Tipo de entrega: CONTADO"& eLINEFEED)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Printer1.WriteString(" " & eLINEFEED)
|
||||||
Printer1.WriteString("------------------------------" & eLINEFEED)
|
Printer1.WriteString("------------------------------" & eLINEFEED)
|
||||||
Printer1.WriteString("ENTREGA EN :" & eLINEFEED)
|
Printer1.WriteString("ENTREGA EN :" & eLINEFEED)
|
||||||
Printer1.WriteString(la_Calle.Text & eLINEFEED)
|
Printer1.WriteString(la_Calle.Text & eLINEFEED)
|
||||||
@@ -4624,14 +4987,38 @@ Sub Impresion2
|
|||||||
Printer1.WriteString("--COMPROBANTE FISCAL, SOLO ES-" & eLINEFEED)
|
Printer1.WriteString("--COMPROBANTE FISCAL, SOLO ES-" & eLINEFEED)
|
||||||
Printer1.WriteString("--------INFORMATIVO-----------" & eLINEFEED)
|
Printer1.WriteString("--------INFORMATIVO-----------" & eLINEFEED)
|
||||||
Printer1.WriteString("------------------------------" & eLINEFEED)
|
Printer1.WriteString("------------------------------" & eLINEFEED)
|
||||||
|
Printer1.WriteString("------------------------------" & eLINEFEED)
|
||||||
Printer1.WriteString(" " & eLINEFEED)
|
Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
|
||||||
|
|
||||||
|
If ALMACEN = 81 Or ALMACEN = 88 Then
|
||||||
|
|
||||||
|
Dim creditocod2 As Cursor = Starter.skmt.ExecQuery("SELECT BANDERA FROM CODIGOS_CREDITO WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
|
If creditocod2.RowCount > 0 Then
|
||||||
|
creditocod2.Position = 0
|
||||||
|
If creditocod2.GetString("BANDERA") = "1" Then
|
||||||
|
Dim creditocod As Cursor = Starter.skmt.ExecQuery("SELECT CODIGO FROM CODIGOS_CREDITO WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
|
creditocod.Position = 0
|
||||||
|
Printer1.WriteString("---------CODIGO: "& creditocod.GetString("CODIGO")& "---------" & eLINEFEED)
|
||||||
|
Printer1.WriteString("------------------------------" & eLINEFEED)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Printer1.WriteString(" " & eLINEFEED)
|
||||||
|
|
||||||
Sleep(1000)
|
Sleep(1000)
|
||||||
Printer1.DisConnect
|
Printer1.DisConnect
|
||||||
|
|
||||||
ProgressDialogHide
|
ProgressDialogHide
|
||||||
|
End If
|
||||||
' printer.Flush
|
' printer.Flush
|
||||||
' printer.Close
|
' printer.Close
|
||||||
|
Sleep(1000)
|
||||||
|
Dim pedifutu As Cursor = skmt.ExecQuery("select * FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_FUTURO = '1' ")
|
||||||
|
If pedifutu.RowCount > 0 Then
|
||||||
|
Impresion5
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub Impresion
|
Sub Impresion
|
||||||
|
|||||||
@@ -1347,6 +1347,11 @@ Sub cargar_Click
|
|||||||
cmd.Parameters = Array As Object(ALMACEN, e_ruta.text)
|
cmd.Parameters = Array As Object(ALMACEN, e_ruta.text)
|
||||||
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "traeFechaFotosGuna")
|
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "traeFechaFotosGuna")
|
||||||
|
|
||||||
|
cmd.Initialize
|
||||||
|
cmd.Name = "select_HIST_ENCUESTA_BAT"
|
||||||
|
cmd.Parameters = Array As Object(ALMACEN, e_ruta.text)
|
||||||
|
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "HIST_ENCUESTABAT")
|
||||||
|
|
||||||
cmd.Initialize
|
cmd.Initialize
|
||||||
cmd.Name = "traecodigosGUNA"
|
cmd.Name = "traecodigosGUNA"
|
||||||
cmd.Parameters = Array As Object(e_ruta.text, ALMACEN)
|
cmd.Parameters = Array As Object(e_ruta.text, ALMACEN)
|
||||||
@@ -1617,6 +1622,138 @@ End Sub
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Sub JobDone2(Job As HttpJob)
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "carga_encuesta" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim CAT_EP_ID As String = records(RESULT.COLUMNS.GET("CAT_EP_ID"))
|
||||||
|
Dim CAT_EP_IDTIPOPREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_IDTIPOPREGUNTA"))
|
||||||
|
Dim CAT_CE_DESCRIPCION As String = records(RESULT.COLUMNS.GET("CAT_CE_DESCRIPCION"))
|
||||||
|
Dim CAT_EP_PREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_PREGUNTA"))
|
||||||
|
Dim CAT_EP_RES1_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES1_PRED"))
|
||||||
|
Dim CAT_EP_RES2_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES2_PRED"))
|
||||||
|
Dim CAT_EP_RES3_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES3_PRED"))
|
||||||
|
Dim CAT_EP_ORDEN_PREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_ORDEN_PREGUNTA"))
|
||||||
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_ENCUESTA_PREGUNTA (CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA ) VALUES (?,?,?,?,?,?,?,?)", Array As Object (CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "valida_pedido" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim CUANTOSP As Int = records(RESULT.Columns.Get("CUANTOSP"))
|
||||||
|
If cuantos_pedido < = CUANTOSP Then
|
||||||
|
datos_iguales = "ok"
|
||||||
|
S_CP.Text = "INFO OK"
|
||||||
|
B_OK_PAS.Text = "OK"
|
||||||
|
Else
|
||||||
|
If Starter.marcaCel <> "Sony" Then ToastMessageShow("No se cargo bien la info P. Sync Nuevamente" & CUANTOSP & " " & cuantos_pedido, True)
|
||||||
|
S_CP.Text = "ENVIAR DATOS (K-2)"
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "valida_pedidoc" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim CUANTOSC As Int = records(RESULT.Columns.Get("CUANTOSC"))
|
||||||
|
If cuantos_pedidosc = CUANTOSC Then
|
||||||
|
datos_iguales = "ok"
|
||||||
|
Else
|
||||||
|
If Starter.marcaCel <> "Sony" Then ToastMessageShow("No se cargo bien la info C. Sync Nuevamente" & CUANTOSC & " " & cuantos_pedidosc, True)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "valida_noventa" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim CUANTOSN As Int = records(RESULT.Columns.Get("CUANTOSN"))
|
||||||
|
If cuantos_noventa = CUANTOSN Then
|
||||||
|
datos_iguales = "ok"
|
||||||
|
Else
|
||||||
|
If Starter.marcaCel <> "Sony" Then ToastMessageShow("No se cargo bien la info N. Sync Nuevamente" & CUANTOSN & " " & cuantos_noventa, True)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "ins_pedido" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
PB2.Progress = PB2.Progress + 5
|
||||||
|
S_CP.Text = "SUBIENDO"
|
||||||
|
Next
|
||||||
|
PB2.Progress = 100
|
||||||
|
S_CP.Text = "ENVIANDO"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "version" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from VERSION")
|
||||||
|
Dim CAT_VE_VERSION As String = records(RESULT.Columns.Get("CAT_VE_VERSION"))
|
||||||
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object (CAT_VE_VERSION))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "count_cli" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
COUNT_CLIE = records(RESULT.Columns.Get("COUNT_CLIE"))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "ruta" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim VALIDO As String = records(RESULT.Columns.Get("VALIDO"))
|
||||||
|
If VALIDO = "OK" Then
|
||||||
|
cargar.Visible = True
|
||||||
|
Subir.Visible = True
|
||||||
|
inv.Visible = True
|
||||||
|
connecta.Visible = False
|
||||||
|
If conn = "1" Then
|
||||||
|
ToastMessageShow("Existe Conexión con el Servidor." , True)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
cargar.Visible = False
|
||||||
|
Subir.Visible = False
|
||||||
|
inv.Visible = False
|
||||||
|
connecta.Visible = False
|
||||||
|
ToastMessageShow("Ruta invalida." , True)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "usuario" Then 'query tag
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim name2 As String = records(RESULT.Columns.Get("VALIDO"))
|
||||||
|
Next
|
||||||
|
If name2 = "OK" Then
|
||||||
|
PASO = 1
|
||||||
|
End If
|
||||||
|
P1.Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
Sub JobDone(Job As HttpJob)
|
Sub JobDone(Job As HttpJob)
|
||||||
B4XPages.MainPage.reqManager.trackNext(Job)
|
B4XPages.MainPage.reqManager.trackNext(Job)
|
||||||
Log("JOBDONE PRINCIPAL")
|
Log("JOBDONE PRINCIPAL")
|
||||||
@@ -1651,7 +1788,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
If n = "OKActivo" Then
|
If n = "OKActivo" Then
|
||||||
Dim cmd As DBCommand
|
Dim cmd As DBCommand
|
||||||
cmd.Initialize
|
cmd.Initialize
|
||||||
cmd.Name = "select_ruta_GV2_70_19"
|
cmd.Name = "select_ruta_GV2_70_21"
|
||||||
cmd.Parameters = Array As Object(ALMACEN,e_ruta.text, usuario)
|
cmd.Parameters = Array As Object(ALMACEN,e_ruta.text, usuario)
|
||||||
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "ruta")
|
B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "ruta")
|
||||||
'Log("Usuario guardado en BD es 'Valido'")
|
'Log("Usuario guardado en BD es 'Valido'")
|
||||||
@@ -1716,6 +1853,17 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Job.JobName = "DBRequest" Then
|
||||||
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
|
If RESULT.Tag = "HIST_ENCUESTABAT" Then 'query tag
|
||||||
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from HIST_ENCUESTA_BAT")
|
||||||
|
For Each records() As Object In RESULT.Rows
|
||||||
|
Dim HIST_EB_CLIENTE As String = records(RESULT.Columns.Get("HIST_EB_CLIENTE"))
|
||||||
|
Starter.skmt.ExecNonQuery2("INSERT INTO HIST_ENCUESTA_BAT(CLIENTE) VALUES (?)", Array As Object (HIST_EB_CLIENTE))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
If Job.JobName = "DBRequest" Then
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
If RESULT.Tag = "select_abonosp_todos" Then 'query tag
|
If RESULT.Tag = "select_abonosp_todos" Then 'query tag
|
||||||
@@ -1750,6 +1898,8 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
JobDone2(Job)
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
If Job.JobName = "DBRequest" Then
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
@@ -2213,18 +2363,6 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' If Job.JobName = "DBRequest" Then
|
|
||||||
' Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
' If RESULT.Tag = "CAT_VERIFICACION" Then 'query tag
|
|
||||||
' For Each records() As Object In RESULT.Rows
|
|
||||||
' Dim CAT_VE_IDPROD As String = records(RESULT.Columns.Get("CAT_VE_IDPROD"))
|
|
||||||
' Dim CAT_VE_NOMBRE As String = records(RESULT.Columns.Get("CAT_VE_NOMBRE"))
|
|
||||||
' Dim CAT_VE_ORDEN As String = records(RESULT.Columns.Get("CAT_VE_ORDEN"))
|
|
||||||
' B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_VERIFICACION(CAT_VE_IDPROD, CAT_VE_NOMBRE, CAT_VE_ORDEN) VALUES (?,?,?)", Array As Object (CAT_VE_IDPROD, CAT_VE_NOMBRE, CAT_VE_ORDEN))
|
|
||||||
' Next
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
If Job.JobName = "DBRequest" Then
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
If RESULT.Tag = "marcas_rutas" Then 'query tag
|
If RESULT.Tag = "marcas_rutas" Then 'query tag
|
||||||
@@ -2235,31 +2373,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' 'CUOTAS
|
|
||||||
' If Job.JobName = "DBRequest" Then
|
|
||||||
' Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
' If RESULT.Tag = "CUOTAS" Then 'query tag
|
|
||||||
' For Each records() As Object In RESULT.Rows
|
|
||||||
' Dim HC_RUTA As String = records(RESULT.Columns.Get("HC_RUTA"))
|
|
||||||
' Dim HC_CUOTA1 As String = records(RESULT.Columns.Get("HC_CUOTA1"))
|
|
||||||
' Dim HC_CUOTA2 As String = records(RESULT.Columns.Get("HC_CUOTA2"))
|
|
||||||
' Dim HC_CUOTA3 As String = records(RESULT.Columns.Get("HC_CUOTA3"))
|
|
||||||
' Dim HC_CUOTA4 As String = records(RESULT.Columns.Get("HC_CUOTA4"))
|
|
||||||
' Dim HC_CUOTA5 As String = records(RESULT.Columns.Get("HC_CUOTA5"))
|
|
||||||
' Dim HC_CUOTA6 As String = records(RESULT.Columns.Get("HC_CUOTA6"))
|
|
||||||
' Dim HC_META1 As String = records(RESULT.Columns.Get("HC_META1"))
|
|
||||||
' Dim HC_META2 As String = records(RESULT.Columns.Get("HC_META2"))
|
|
||||||
' Dim HC_META3 As String = records(RESULT.Columns.Get("HC_META3"))
|
|
||||||
' Dim HC_META4 As String = records(RESULT.Columns.Get("HC_META4"))
|
|
||||||
' Dim HC_META5 As String = records(RESULT.Columns.Get("HC_META5"))
|
|
||||||
' Dim HC_META6 As String = records(RESULT.Columns.Get("HC_META6"))
|
|
||||||
' B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO HIST_CUOTAS(HC_RUTA, HC_CUOTA1,HC_CUOTA2,HC_CUOTA3,HC_CUOTA4,HC_CUOTA5,HC_CUOTA6,HC_META1,HC_META2,HC_META3,HC_META4,HC_META5,HC_META6) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (HC_RUTA, HC_CUOTA1,HC_CUOTA2,HC_CUOTA3,HC_CUOTA4,HC_CUOTA5,HC_CUOTA6,HC_META1,HC_META2,HC_META3,HC_META4,HC_META5,HC_META6))
|
|
||||||
' Next
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
'COMISIONES
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
If Job.JobName = "DBRequest" Then
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
If RESULT.Tag = "COMISIONES" Then 'query tag
|
If RESULT.Tag = "COMISIONES" Then 'query tag
|
||||||
@@ -2391,7 +2505,6 @@ Sub JobDone(Job As HttpJob)
|
|||||||
PB2.Progress = 100
|
PB2.Progress = 100
|
||||||
S_CP.Text = "LISTO"
|
S_CP.Text = "LISTO"
|
||||||
End If
|
End If
|
||||||
' If Starter.marcaCel <> "Sony" Then ToastMessageShow("Productos Actualizados." , True)
|
|
||||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||||
' B4XPage_Appear
|
' B4XPage_Appear
|
||||||
img2.Visible=False
|
img2.Visible=False
|
||||||
@@ -2423,11 +2536,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
CAT_GP_ALMACEN = 60
|
CAT_GP_ALMACEN = 60
|
||||||
End If
|
End If
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV))
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV))
|
||||||
' If CAT_GP_ID.StartsWith("PRO") Then LogColor($"Metemos promo a gunaprod - ${CAT_GP_ID}, |${CAT_GP_TIPO}|"$, Colors.red)
|
|
||||||
' If CAT_GP_TIPO = "PROMOS" Then
|
|
||||||
' LogColor($"Agregamos Promo a gunaprod2 - ${CAT_GP_ID}, ${CAT_GP_NOMBRE}"$, Colors.Red)
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD2(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV))
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD2(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG, CAT_GP_ALMACEN,CAT_GP_TIPOPROD,CAT_PA_BSEGMENTA,CAT_PA_SEGMENTAV))
|
||||||
' End If
|
|
||||||
Next
|
Next
|
||||||
If PB2.Progress = 0 Then
|
If PB2.Progress = 0 Then
|
||||||
PB2.Progress = 30
|
PB2.Progress = 30
|
||||||
@@ -2438,7 +2547,6 @@ Sub JobDone(Job As HttpJob)
|
|||||||
PB2.Progress = 100
|
PB2.Progress = 100
|
||||||
S_CP.Text = "LISTO"
|
S_CP.Text = "LISTO"
|
||||||
End If
|
End If
|
||||||
' If Starter.marcaCel <> "Sony" Then ToastMessageShow("Promociones Actualizados." , True)
|
|
||||||
Listo4=1
|
Listo4=1
|
||||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||||
' B4XPage_Appear
|
' B4XPage_Appear
|
||||||
@@ -2481,14 +2589,11 @@ Sub JobDone(Job As HttpJob)
|
|||||||
S_CP.Text = "LISTO"
|
S_CP.Text = "LISTO"
|
||||||
'Log("3")
|
'Log("3")
|
||||||
End If
|
End If
|
||||||
' If Starter.marcaCel <> "Sony" Then ToastMessageShow("Promociones especiales Actualizados." , True)
|
|
||||||
Listo4=1
|
Listo4=1
|
||||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||||
' B4XPage_Appear
|
|
||||||
img2.Visible=False
|
img2.Visible=False
|
||||||
EJECUTANDO=0
|
EJECUTANDO=0
|
||||||
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
||||||
' B4XPage_Appear
|
|
||||||
img2.Visible=False
|
img2.Visible=False
|
||||||
EJECUTANDO=0
|
EJECUTANDO=0
|
||||||
End If
|
End If
|
||||||
@@ -2523,11 +2628,9 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
Listo3 =1
|
Listo3 =1
|
||||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||||
' B4XPage_Appear
|
|
||||||
img2.Visible=False
|
img2.Visible=False
|
||||||
EJECUTANDO=0
|
EJECUTANDO=0
|
||||||
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
|
||||||
' B4XPage_Appear
|
|
||||||
img2.Visible=False
|
img2.Visible=False
|
||||||
EJECUTANDO=0
|
EJECUTANDO=0
|
||||||
End If
|
End If
|
||||||
@@ -2558,9 +2661,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
PB1.Progress = 100
|
PB1.Progress = 100
|
||||||
S_CH.Text = "LISTO"
|
S_CH.Text = "LISTO"
|
||||||
End If
|
End If
|
||||||
' If Starter.marcaCel <> "Sony" Then ToastMessageShow("Venta historico Actualizado." , True)
|
|
||||||
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
If Listo1 =1 And Listo2 =1 And Listo3 = 1 And Listo4 = 1 Then
|
||||||
' B4XPage_Appear
|
|
||||||
img2.Visible=False
|
img2.Visible=False
|
||||||
EJECUTANDO=0
|
EJECUTANDO=0
|
||||||
End If
|
End If
|
||||||
@@ -2580,7 +2681,6 @@ Sub JobDone(Job As HttpJob)
|
|||||||
Dim HVD_FECHA As String = records(RESULT.Columns.Get("HVD_FECHA"))
|
Dim HVD_FECHA As String = records(RESULT.Columns.Get("HVD_FECHA"))
|
||||||
Dim HVD_NUM_TICKET As String = records(RESULT.Columns.Get("HVD_NUM_TICKET"))
|
Dim HVD_NUM_TICKET As String = records(RESULT.Columns.Get("HVD_NUM_TICKET"))
|
||||||
Dim HVD_CODPROMO As String = records(RESULT.Columns.Get("HVD_CODPROMO"))
|
Dim HVD_CODPROMO As String = records(RESULT.Columns.Get("HVD_CODPROMO"))
|
||||||
' Log(HVD_CLIENTE&"--"&HVD_PRONOMBRE&"--"&HVD_CANT&"--"&HVD_COSTO_TOT)
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO hist_ventastodos(HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT, HVD_FECHA, HVD_NUM_TICKET,HVD_CODPROMO) VALUES (?,?,?,?,?,?,?)", Array As Object (HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT,HVD_FECHA, HVD_NUM_TICKET,HVD_CODPROMO))
|
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO hist_ventastodos(HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT, HVD_FECHA, HVD_NUM_TICKET,HVD_CODPROMO) VALUES (?,?,?,?,?,?,?)", Array As Object (HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT,HVD_FECHA, HVD_NUM_TICKET,HVD_CODPROMO))
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -2609,142 +2709,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "carga_encuesta" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
Dim CAT_EP_ID As String = records(RESULT.COLUMNS.GET("CAT_EP_ID"))
|
|
||||||
Dim CAT_EP_IDTIPOPREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_IDTIPOPREGUNTA"))
|
|
||||||
Dim CAT_CE_DESCRIPCION As String = records(RESULT.COLUMNS.GET("CAT_CE_DESCRIPCION"))
|
|
||||||
Dim CAT_EP_PREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_PREGUNTA"))
|
|
||||||
Dim CAT_EP_RES1_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES1_PRED"))
|
|
||||||
Dim CAT_EP_RES2_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES2_PRED"))
|
|
||||||
Dim CAT_EP_RES3_PRED As String = records(RESULT.COLUMNS.GET("CAT_EP_RES3_PRED"))
|
|
||||||
Dim CAT_EP_ORDEN_PREGUNTA As String = records(RESULT.COLUMNS.GET("CAT_EP_ORDEN_PREGUNTA"))
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_ENCUESTA_PREGUNTA (CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA ) VALUES (?,?,?,?,?,?,?,?)", Array As Object (CAT_EP_ID ,CAT_EP_IDTIPOPREGUNTA ,CAT_CE_DESCRIPCION ,CAT_EP_PREGUNTA ,CAT_EP_RES1_PRED ,CAT_EP_RES2_PRED ,CAT_EP_RES3_PRED ,CAT_EP_ORDEN_PREGUNTA))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "valida_pedido" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
Dim CUANTOSP As Int = records(RESULT.Columns.Get("CUANTOSP"))
|
|
||||||
' Log(cuantos_pedido)
|
|
||||||
' Log(CUANTOSP)
|
|
||||||
If cuantos_pedido < = CUANTOSP Then
|
|
||||||
' ToastMessageShow("rojo val ok 1 cuantosp." , True)
|
|
||||||
datos_iguales = "ok"
|
|
||||||
S_CP.Text = "INFO OK"
|
|
||||||
B_OK_PAS.Text = "OK"
|
|
||||||
Else
|
|
||||||
If Starter.marcaCel <> "Sony" Then ToastMessageShow("No se cargo bien la info P. Sync Nuevamente" & CUANTOSP & " " & cuantos_pedido, True)
|
|
||||||
S_CP.Text = "ENVIAR DATOS (K-2)"
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "valida_pedidoc" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
Dim CUANTOSC As Int = records(RESULT.Columns.Get("CUANTOSC"))
|
|
||||||
If cuantos_pedidosc = CUANTOSC Then
|
|
||||||
' ToastMessageShow("rojo val ok 1 cuantosp." , True)
|
|
||||||
datos_iguales = "ok"
|
|
||||||
Else
|
|
||||||
If Starter.marcaCel <> "Sony" Then ToastMessageShow("No se cargo bien la info C. Sync Nuevamente" & CUANTOSC & " " & cuantos_pedidosc, True)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "valida_noventa" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
Dim CUANTOSN As Int = records(RESULT.Columns.Get("CUANTOSN"))
|
|
||||||
If cuantos_noventa = CUANTOSN Then
|
|
||||||
' ToastMessageShow("rojo val ok 1 cuantosp." , True)
|
|
||||||
datos_iguales = "ok"
|
|
||||||
Else
|
|
||||||
If Starter.marcaCel <> "Sony" Then ToastMessageShow("No se cargo bien la info N. Sync Nuevamente" & CUANTOSN & " " & cuantos_noventa, True)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "ins_pedido" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
PB2.Progress = PB2.Progress + 5
|
|
||||||
S_CP.Text = "SUBIENDO"
|
|
||||||
Next
|
|
||||||
PB2.Progress = 100
|
|
||||||
S_CP.Text = "ENVIANDO"
|
|
||||||
'Log("5")
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "version" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from VERSION")
|
|
||||||
Dim CAT_VE_VERSION As String = records(RESULT.Columns.Get("CAT_VE_VERSION"))
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object (CAT_VE_VERSION))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "count_cli" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
COUNT_CLIE = records(RESULT.Columns.Get("COUNT_CLIE"))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "ruta" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
Dim VALIDO As String = records(RESULT.Columns.Get("VALIDO"))
|
|
||||||
If VALIDO = "OK" Then
|
|
||||||
cargar.Visible = True
|
|
||||||
Subir.Visible = True
|
|
||||||
inv.Visible = True
|
|
||||||
connecta.Visible = False
|
|
||||||
If conn = "1" Then
|
|
||||||
ToastMessageShow("Existe Conexión con el Servidor." , True)
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
cargar.Visible = False
|
|
||||||
Subir.Visible = False
|
|
||||||
inv.Visible = False
|
|
||||||
connecta.Visible = False
|
|
||||||
ToastMessageShow("Ruta invalida." , True)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
|
||||||
If RESULT.Tag = "usuario" Then 'query tag
|
|
||||||
For Each records() As Object In RESULT.Rows
|
|
||||||
Dim name2 As String = records(RESULT.Columns.Get("VALIDO"))
|
|
||||||
Next
|
|
||||||
If name2 = "OK" Then
|
|
||||||
PASO = 1
|
|
||||||
End If
|
|
||||||
P1.Visible = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
If Job.JobName = "DBRequest" Then
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
@@ -2758,15 +2723,7 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Job.JobName = "DBRequest" Then
|
If Job.JobName = "DBRequest" Then
|
||||||
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
Dim RESULT As DBResult = B4XPages.MainPage.reqManager.HandleJob(Job)
|
||||||
' If RESULT.Tag = "folio" Then 'query tag
|
|
||||||
' For Each records() As Object In RESULT.Rows
|
|
||||||
' Dim FOLIO As String = records(RESULT.Columns.Get("FOLIO"))
|
|
||||||
' B4XPages.MainPage.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FOLIO"))
|
|
||||||
' B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("FOLIO",FOLIO))
|
|
||||||
' Next
|
|
||||||
' End If
|
|
||||||
|
|
||||||
If RESULT.Tag = "hist_pro2265" Then 'query tag
|
If RESULT.Tag = "hist_pro2265" Then 'query tag
|
||||||
Starter.skmt.ExecNonQuery("delete from HIST_PRO2265")
|
Starter.skmt.ExecNonQuery("delete from HIST_PRO2265")
|
||||||
For Each records() As Object In RESULT.Rows
|
For Each records() As Object In RESULT.Rows
|
||||||
@@ -2838,11 +2795,9 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
If B4XPages.MainPage.reqManager.reqsList.IsInitialized Then
|
If B4XPages.MainPage.reqManager.reqsList.IsInitialized Then
|
||||||
LogColor($"REQUESTS: ${B4XPages.MainPage.reqManager.reqsList.Size}"$, Colors.red)
|
LogColor($"REQUESTS: ${B4XPages.MainPage.reqManager.reqsList.Size}"$, Colors.red)
|
||||||
' Log($"CARGA=${CARGA}"$)
|
|
||||||
If B4XPages.MainPage.reqManager.reqsList.Size = 0 And CARGA = "SUBIR" Then
|
If B4XPages.MainPage.reqManager.reqsList.Size = 0 And CARGA = "SUBIR" Then
|
||||||
t1.Enabled = False
|
t1.Enabled = False
|
||||||
t1.Initialize("T1", 3000) ' 1000 = 1 second
|
t1.Initialize("T1", 3000) ' 1000 = 1 second
|
||||||
' Log(999)
|
|
||||||
If contadorSubir < 3 Then ' Si no hacen click en el boton de OK despues de "Enviar", se puede quedar en loop el timer T1.
|
If contadorSubir < 3 Then ' Si no hacen click en el boton de OK despues de "Enviar", se puede quedar en loop el timer T1.
|
||||||
t1.Enabled = True
|
t1.Enabled = True
|
||||||
Log("TIMER ENABLED")
|
Log("TIMER ENABLED")
|
||||||
@@ -2993,6 +2948,10 @@ Log("--------> BORRAMOS")
|
|||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from noventa")
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from noventa")
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from COMENTARIOS")
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from COMENTARIOS")
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from CAT_PROMOS_DESCUENTOS")
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from CAT_PROMOS_DESCUENTOS")
|
||||||
|
|
||||||
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from HIST_ENCUESTA_BAT")
|
||||||
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from ENCUESTAS_BAT")
|
||||||
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from TELEFONO")
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from TELEFONO")
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from ATIENDE")
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from ATIENDE")
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from PLAN_LEALTAD")
|
B4XPages.MainPage.skmt.ExecNonQuery("delete from PLAN_LEALTAD")
|
||||||
|
|||||||
@@ -865,30 +865,30 @@ Sub b_prodMenos_Click
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim c7 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS = 'DUR'")
|
' Dim c7 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS = 'DUR'")
|
||||||
If c7.RowCount > 0 Then
|
' If c7.RowCount > 0 Then
|
||||||
c7.Position = 0
|
' c7.Position = 0
|
||||||
|
'
|
||||||
Dim totaldev As Double = c7.GetString("PC_MONTO")
|
' Dim totaldev As Double = c7.GetString("PC_MONTO")
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
|
' Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS <> 'DUR' ")
|
||||||
|
' If c6.RowCount > 0 Then
|
||||||
|
' c6.Position = 0
|
||||||
|
'
|
||||||
|
' Dim totalprod As Double = c6.GetString("PC_MONTO")
|
||||||
|
'
|
||||||
|
' End If
|
||||||
|
|
||||||
Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS <> 'DUR' ")
|
' Log(totaldev &" " & totalprod)
|
||||||
If c6.RowCount > 0 Then
|
' If totalprod = 0 Then
|
||||||
c6.Position = 0
|
' B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
||||||
|
' MsgboxAsync("Las devloluciones se elimanron por que no hay venta.","Atención")
|
||||||
Dim totalprod As Double = c6.GetString("PC_MONTO")
|
' Else If totalprod < (totaldev * -1) Then
|
||||||
|
' B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
||||||
End If
|
' MsgboxAsync("Las devloluciones se elimanron por que el monto de la devolucion es mayor al monto de la venta.","Atención")
|
||||||
|
' End If
|
||||||
Log(totaldev &" " & totalprod)
|
|
||||||
If totalprod = 0 Then
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
|
||||||
MsgboxAsync("Las devloluciones se elimanron por que no hay venta.","Atención")
|
|
||||||
Else If totalprod < (totaldev * -1) Then
|
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
|
||||||
MsgboxAsync("Las devloluciones se elimanron por que el monto de la devolucion es mayor al monto de la venta.","Atención")
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
' LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red)
|
' LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red)
|
||||||
@@ -1163,30 +1163,30 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim c7 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS = 'DUR'")
|
' Dim c7 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS = 'DUR'")
|
||||||
If c7.RowCount > 0 Then
|
' If c7.RowCount > 0 Then
|
||||||
c7.Position = 0
|
' c7.Position = 0
|
||||||
|
'
|
||||||
Dim totaldev As Double = c7.GetString("PC_MONTO")
|
' Dim totaldev As Double = c7.GetString("PC_MONTO")
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS <> 'DUR' ")
|
' Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS <> 'DUR' ")
|
||||||
If c6.RowCount > 0 Then
|
' If c6.RowCount > 0 Then
|
||||||
c6.Position = 0
|
' c6.Position = 0
|
||||||
|
'
|
||||||
Dim totalprod As Double = c6.GetString("PC_MONTO")
|
' Dim totalprod As Double = c6.GetString("PC_MONTO")
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
|
'
|
||||||
If totalprod = 0 Then
|
' If totalprod = 0 Then
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
' B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
||||||
MsgboxAsync("Las devloluciones se elimanron por que no hay venta.","Atención")
|
' MsgboxAsync("Las devloluciones se elimanron por que no hay venta.","Atención")
|
||||||
Else If totalprod < totaldev Then
|
' Else If totalprod < totaldev Then
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
' B4XPages.MainPage.skmt.ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'")
|
||||||
MsgboxAsync("Las devloluciones se elimanron por que el monto de la devolucion es mayor al monto de la venta.","Atención")
|
' MsgboxAsync("Las devloluciones se elimanron por que el monto de la devolucion es mayor al monto de la venta.","Atención")
|
||||||
End If
|
' End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -2374,81 +2374,81 @@ End Sub
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub l_prodX_LongClick
|
'Private Sub l_prodX_LongClick
|
||||||
If tipo_venta <> "PREVENTA_FUTURA" Then
|
' If tipo_venta <> "PREVENTA_FUTURA" Then
|
||||||
|
'
|
||||||
|
'
|
||||||
Log(l_total.Text)
|
' Log(l_total.Text)
|
||||||
c = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) AND PE_CEDIS <> 'DUR'")
|
' c = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) AND PE_CEDIS <> 'DUR'")
|
||||||
|
'
|
||||||
If c.RowCount > 0 Then
|
' If c.RowCount > 0 Then
|
||||||
C.Position = 0
|
' C.Position = 0
|
||||||
|
'
|
||||||
If c.GetString("PC_MONTO") > 0 Then
|
' If c.GetString("PC_MONTO") > 0 Then
|
||||||
|
'
|
||||||
|
'
|
||||||
Dim cs As CSBuilder
|
' Dim cs As CSBuilder
|
||||||
cs.Initialize
|
' cs.Initialize
|
||||||
Dim Index As Int = clv_prods_ll.GetItemFromView(Sender)
|
' Dim Index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||||
Private p0 As B4XView = clv_prods_ll.GetPanel(Index)
|
' Private p0 As B4XView = clv_prods_ll.GetPanel(Index)
|
||||||
Private p As B4XView = p0.GetView(0)
|
' Private p As B4XView = p0.GetView(0)
|
||||||
Private cant1 As B4XView = p.GetView(2).GetView(2)
|
' Private cant1 As B4XView = p.GetView(2).GetView(2)
|
||||||
Private PRDOX As B4XView = p.GetView(1)
|
' Private PRDOX As B4XView = p.GetView(1)
|
||||||
Dim Index As Int = clv_prods_ll.GetItemFromView(Sender)
|
' Dim Index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||||
' Log(clv_prods_ll.GetValue(index))
|
'' Log(clv_prods_ll.GetValue(index))
|
||||||
|
'
|
||||||
Log(cant1.Text)
|
' Log(cant1.Text)
|
||||||
Dim prodx1() As String=Regex.Split(CRLF,PRDOX.Text)
|
' Dim prodx1() As String=Regex.Split(CRLF,PRDOX.Text)
|
||||||
Dim prodx3() As String=Regex.Split("\$",prodx1(1))
|
' Dim prodx3() As String=Regex.Split("\$",prodx1(1))
|
||||||
Log(prodx1(1))
|
' Log(prodx1(1))
|
||||||
|
'
|
||||||
preciodev = prodx3(1)
|
' preciodev = prodx3(1)
|
||||||
nombredev = prodx1(0)
|
' nombredev = prodx1(0)
|
||||||
|
'
|
||||||
Dim dev As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select IFNULL(CAT_GP_DEV, 0) AS CAT_GP_DEV, CAT_GP_PRECIO from CAT_GUNAPROD where CAT_GP_NOMBRE = '${prodx1(0)}'"$)
|
' Dim dev As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select IFNULL(CAT_GP_DEV, 0) AS CAT_GP_DEV, CAT_GP_PRECIO from CAT_GUNAPROD where CAT_GP_NOMBRE = '${prodx1(0)}'"$)
|
||||||
dev.Position = 0
|
' dev.Position = 0
|
||||||
If dev.GetInt("CAT_GP_DEV") = 1 Then
|
' If dev.GetInt("CAT_GP_DEV") = 1 Then
|
||||||
|
'
|
||||||
|
'
|
||||||
c.GetString("PC_MONTO")
|
' c.GetString("PC_MONTO")
|
||||||
|
'
|
||||||
|
'
|
||||||
If c.GetString("PC_MONTO") < dev.GetInt("CAT_GP_PRECIO") Then
|
' If c.GetString("PC_MONTO") < dev.GetInt("CAT_GP_PRECIO") Then
|
||||||
MsgboxAsync("El monto de venta es menor al precio de este producto","Atención")
|
' MsgboxAsync("El monto de venta es menor al precio de este producto","Atención")
|
||||||
Log(1)
|
' Log(1)
|
||||||
Else
|
' Else
|
||||||
p_devo.Visible = True
|
' p_devo.Visible = True
|
||||||
p_devo.Height = Root.Height
|
' p_devo.Height = Root.Height
|
||||||
p_devo.Width = Root.Width
|
' p_devo.Width = Root.Width
|
||||||
l_proddev.Text = prodx1(0)
|
' l_proddev.Text = prodx1(0)
|
||||||
|
'
|
||||||
|
'
|
||||||
Dim devo As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select SUM(IFNULL(PE_CANT,0)) as suma from PEDIDO where PE_PRONOMBRE = '${prodx1(0)}' AND PE_CEDIS = 'DUR'"$)
|
' Dim devo As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select SUM(IFNULL(PE_CANT,0)) as suma from PEDIDO where PE_PRONOMBRE = '${prodx1(0)}' AND PE_CEDIS = 'DUR'"$)
|
||||||
devo.Position = 0
|
' devo.Position = 0
|
||||||
|
'
|
||||||
l_cantdev.Text = devo.GetInt("suma")
|
' l_cantdev.Text = devo.GetInt("suma")
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
Else If dev.GetInt("CAT_GP_DEV") = 0 Then
|
' Else If dev.GetInt("CAT_GP_DEV") = 0 Then
|
||||||
MsgboxAsync("El producto no se puede devolver","Atención")
|
' MsgboxAsync("El producto no se puede devolver","Atención")
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
Else
|
' Else
|
||||||
MsgboxAsync("El Cliente no tiene venta para meter devoluciones","Atención")
|
' MsgboxAsync("El Cliente no tiene venta para meter devoluciones","Atención")
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub b_acep_dev_Click
|
Private Sub b_acep_dev_Click
|
||||||
@@ -2456,56 +2456,56 @@ Private Sub b_acep_dev_Click
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub b_devmenos_Click
|
Private Sub b_devmenos_Click
|
||||||
If NumberFormat2((l_cantdev.Text - 1),0,0,0, False) >= 0 Then
|
' If NumberFormat2((l_cantdev.Text - 1),0,0,0, False) >= 0 Then
|
||||||
|
'
|
||||||
Dim dev2 As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID from CAT_GUNAPROD where CAT_GP_NOMBRE = '${nombredev}'"$)
|
' Dim dev2 As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID from CAT_GUNAPROD where CAT_GP_NOMBRE = '${nombredev}'"$)
|
||||||
dev2.Position = 0
|
' dev2.Position = 0
|
||||||
l_cantdev.Text = NumberFormat2((l_cantdev.Text - 1),0,0,0, False)
|
' l_cantdev.Text = NumberFormat2((l_cantdev.Text - 1),0,0,0, False)
|
||||||
If B4XPages.MainPage.tipo_venta = "PREVENTA_FUTURA" Then
|
' If B4XPages.MainPage.tipo_venta = "PREVENTA_FUTURA" Then
|
||||||
' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,1)
|
'' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,1)
|
||||||
Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,1,1)
|
' Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,1,1)
|
||||||
Else
|
' Else
|
||||||
Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,0,1)
|
' Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,0,1)
|
||||||
' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,0)
|
'' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,0)
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub b_devmas_Click
|
Private Sub b_devmas_Click
|
||||||
|
|
||||||
Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS <> 'DUR' ")
|
' Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) and PE_CEDIS <> 'DUR' ")
|
||||||
If c6.RowCount > 0 Then
|
' If c6.RowCount > 0 Then
|
||||||
c6.Position = 0
|
' c6.Position = 0
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
Log(((l_cantdev.Text + 1)* preciodev))
|
' Log(((l_cantdev.Text + 1)* preciodev))
|
||||||
If c6.GetString("PC_MONTO")- ((l_cantdev.Text + 1)* preciodev) >= 0 Then
|
' If c6.GetString("PC_MONTO")- ((l_cantdev.Text + 1)* preciodev) >= 0 Then
|
||||||
Dim dev2 As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID from CAT_GUNAPROD where CAT_GP_NOMBRE = '${nombredev}'"$)
|
' Dim dev2 As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID from CAT_GUNAPROD where CAT_GP_NOMBRE = '${nombredev}'"$)
|
||||||
dev2.Position = 0
|
' dev2.Position = 0
|
||||||
l_cantdev.Text = NumberFormat2((l_cantdev.Text + 1),0,0,0, False)
|
' l_cantdev.Text = NumberFormat2((l_cantdev.Text + 1),0,0,0, False)
|
||||||
|
'
|
||||||
If B4XPages.MainPage.tipo_venta = "PREVENTA_FUTURA" Then
|
' If B4XPages.MainPage.tipo_venta = "PREVENTA_FUTURA" Then
|
||||||
' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,1)
|
'' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,1)
|
||||||
Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,1,1)
|
' Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,1,1)
|
||||||
Else
|
' Else
|
||||||
Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,0,1)
|
' Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1,0,1)
|
||||||
' Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1)
|
'' Subs.actualizaProducto( "DUR", (preciodev * -1), l_cantdev.Text, nombredev, dev2.GetString("CAT_GP_ID"), clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,1)
|
||||||
' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,0)
|
'' Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.Text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta,0,0)
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
Else
|
' Else
|
||||||
MsgboxAsync("El monto de venta es menor al precio de este producto","Atención")
|
' MsgboxAsync("El monto de venta es menor al precio de este producto","Atención")
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
|
'
|
||||||
End If
|
' End If
|
||||||
|
'
|
||||||
|
'
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -2516,7 +2516,7 @@ End Sub
|
|||||||
Private Sub cb_descuento_CheckedChange(Checked As Boolean)
|
Private Sub cb_descuento_CheckedChange(Checked As Boolean)
|
||||||
Log(Sender.As(CheckBox).Tag)
|
Log(Sender.As(CheckBox).Tag)
|
||||||
If Sender.As(CheckBox).Checked Then
|
If Sender.As(CheckBox).Checked Then
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery($"UPDATE pedido SET PE_DESC = 1 WHERE PE_CLIENTE In (select cuenta from cuentaa) AND PE_PROID = '${Sender.As(CheckBox).Tag}' AND PE_CEDIS = '${Subs.traeAlmacen}'"$)
|
B4XPages.MainPage.skmt.ExecNonQuery($"UPDATE pedido SET PE_DESC = 1, PE_RECALCULO = NULL, PE_RECALCULOTOT = NULL, PE_RECCEDIS = NULL, PE_RECCANT = NULL WHERE PE_CLIENTE In (select cuenta from cuentaa) AND PE_PROID = '${Sender.As(CheckBox).Tag}' AND PE_CEDIS = '${Subs.traeAlmacen}'"$)
|
||||||
Else
|
Else
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery($"UPDATE pedido SET PE_DESC = 0 WHERE PE_CLIENTE In (select cuenta from cuentaa) AND PE_PROID = '${Sender.As(CheckBox).Tag}' AND PE_CEDIS = '${Subs.traeAlmacen}'"$)
|
B4XPages.MainPage.skmt.ExecNonQuery($"UPDATE pedido SET PE_DESC = 0 WHERE PE_CLIENTE In (select cuenta from cuentaa) AND PE_PROID = '${Sender.As(CheckBox).Tag}' AND PE_CEDIS = '${Subs.traeAlmacen}'"$)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ Version=12.8
|
|||||||
#Region Project Attributes
|
#Region Project Attributes
|
||||||
#ApplicationLabel: Guna Preventa
|
#ApplicationLabel: Guna Preventa
|
||||||
#VersionCode: 1
|
#VersionCode: 1
|
||||||
#VersionName: 6.03.02
|
#VersionName: 6.03.05
|
||||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||||
#SupportedOrientations: portrait
|
#SupportedOrientations: portrait
|
||||||
#CanInstallToExternalStorage: False
|
#CanInstallToExternalStorage: False
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ ModuleBookmarks30=
|
|||||||
ModuleBookmarks31=
|
ModuleBookmarks31=
|
||||||
ModuleBookmarks32=
|
ModuleBookmarks32=
|
||||||
ModuleBookmarks4=
|
ModuleBookmarks4=
|
||||||
ModuleBookmarks5=8122
|
ModuleBookmarks5=8509
|
||||||
ModuleBookmarks6=
|
ModuleBookmarks6=
|
||||||
ModuleBookmarks7=
|
ModuleBookmarks7=
|
||||||
ModuleBookmarks8=
|
ModuleBookmarks8=
|
||||||
@@ -97,6 +97,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=6,8,9,10,11
|
ModuleClosedNodes8=6,8,9,10,11
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=C_Principal,Subir_Click,745,6,C_Cliente,b_guadarenc_Click,8450,6,C_Principal,connecta_LongClick,2850,0,C_Principal,connecta_Click,2936,0,C_Principal,JobDone,1638,0,C_Cliente,B4XPage_CloseRequest,3253,0,C_Cliente,gest_Click,2118,6,C_Cliente,B4XPage_Appear,589,0,Diseñador Visual,cliente.bal,-100,4,C_Cliente,B4XPage_Created,547,0
|
NavigationStack=C_Cliente,B4XPage_Appear,1259,0,C_Cliente,vent,2419,1,C_Cliente,B_IMP_Click,3484,0,C_Cliente,PDFGENERAR,7568,0,C_Principal,cargar_Click,1417,0,C_Productos,lv_catalogos_ItemClick,409,0,cPDF,initFontsInfos,161,0,C_Cliente,Mandapedido,3918,0,C_Cliente,Impresion4,3604,0,C_Cliente,Impresion2,4700,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=29,2,18,30,5,28
|
VisibleModules=29,2,18,30,5,28,19,24
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="gunav2.keymon.com.mx"
|
package="gunav2.keymon.com.mx"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="6.03.02"
|
android:versionName="6.03.05"
|
||||||
android:installLocation="internalOnly">
|
android:installLocation="internalOnly">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="30"/>
|
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="30"/>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user