mirror of
https://github.com/KeymonSoft/Guna_Picking.git
synced 2026-04-17 19:36:50 +00:00
515 lines
17 KiB
QBasic
515 lines
17 KiB
QBasic
B4A=true
|
|
Group=Default Group
|
|
ModulesStructureVersion=1
|
|
Type=Class
|
|
Version=11.8
|
|
@EndOfDesignText@
|
|
Sub Class_Globals
|
|
Private Root As B4XView 'ignore
|
|
Private xui As XUI 'ignore
|
|
Dim lb_folioselec As Label
|
|
Dim c As Cursor
|
|
Dim d As Cursor
|
|
Dim cl_picking As CustomListView
|
|
Private b_guardapicking As Button
|
|
Dim cmd As DBCommand
|
|
Dim reqManager As DBRequestManager
|
|
|
|
Private toast As BCToast
|
|
Private Capturing As Boolean
|
|
Private rp As RuntimePermissions
|
|
Private detector As JavaObject
|
|
Private camEx As CameraExClass
|
|
Private LastPreview As Long
|
|
Private IntervalBetweenPreviewsMs As Int = 100
|
|
Dim codigoencontrado As String
|
|
|
|
Private p_producto As Panel
|
|
Private l_nombreproducto As Label
|
|
Private et_catori_piezas As EditText
|
|
Private et_cantesc_piezas As EditText
|
|
Private et_catori_cajas As EditText
|
|
Private et_cantesc_cajas As EditText
|
|
Private et_cantesc_blister As EditText
|
|
Private et_catori_blister As EditText
|
|
Private btnStartStop As ImageView
|
|
Private et_codigo As EditText
|
|
Private l_ordenamiento As Label
|
|
Dim posision As Int = 0
|
|
Private Panel6 As Panel
|
|
Private pnlPreview As Panel
|
|
Private B_cerrar As Button
|
|
Private b_entradamanual As Button
|
|
Private p_entradamaual As Panel
|
|
Private et_entradamanual As EditText
|
|
Private b_cancelar As Button
|
|
Private b_terminar As Button
|
|
Dim sDate,sTime As String
|
|
Private l_totales As Label
|
|
Private l_faltantes As Label
|
|
Private l_porcentaje As Label
|
|
Private l_fecha As Label
|
|
Private btnStartStop2 As ImageView
|
|
Dim delanteatras As Int
|
|
End Sub
|
|
|
|
'You can add more parameters here.
|
|
Public Sub Initialize As Object
|
|
Return Me
|
|
End Sub
|
|
|
|
'This event will be called once, before the page becomes visible.
|
|
Private Sub B4XPage_Created (Root1 As B4XView)
|
|
Root = Root1
|
|
Root.LoadLayout("picking")
|
|
'load the layout to Root
|
|
|
|
reqManager.Initialize(Me, Starter.DBReqServer)
|
|
|
|
'camara
|
|
Panel6.Width = Root.Width
|
|
Panel6.Height= Root.Height
|
|
Panel6.Visible = False
|
|
toast.Initialize(Root)
|
|
StopCamera
|
|
B4XPages.SetTitle(Me, "Barcode Example")
|
|
CreateDetector (Array("AZTEC", "CODE_128", "CODE_39", "CODE_93", "CODABAR", "DATA_MATRIX", "EAN_13", "EAN_8", "ITF", "PDF417", "QR_CODE", "UPC_A", "UPC_E"))
|
|
|
|
End Sub
|
|
|
|
Sub B4XPage_Appear
|
|
btnStartStop2.Visible = False
|
|
c = Starter.skmt.ExecQuery("SELECT CUENTA FROM CUENTAA WHERE ESTATUS = 1")
|
|
c.Position = 0
|
|
Log(c.RowCount)
|
|
If c.RowCount >= 1 Then
|
|
b_cancelar.Visible = False
|
|
lb_folioselec.Text = c.GetString("CUENTA")
|
|
btnStartStop2.Visible = True
|
|
d = Starter.skmt.ExecQuery("SELECT FECHACONSULTA FROM FECHA")
|
|
d.Position = 0
|
|
l_fecha.Text = d.GetString("FECHACONSULTA")
|
|
d.Close
|
|
Else
|
|
b_cancelar.Visible = True
|
|
btnStartStop2.Visible = False
|
|
lb_folioselec.Text = B4XPages.MainPage.seleccion.folioactual
|
|
l_fecha.Text = B4XPages.MainPage.seleccion.fechabusqueda
|
|
End If
|
|
|
|
c.Close
|
|
|
|
p_producto.Visible = False
|
|
c = Starter.skmt.ExecQuery("SELECT CAT_DF_ID, CAT_DF_NOMBRE, CAT_DF_RUTA, CAT_DF_RUTAO, CAT_DF_PIEZAS, CAT_DF_CAJAS, CAT_DF_BLISTER FROM CAT_DETALLEFOLIO WHERE CAT_DF_ESTATUS = 0 ORDER BY 3")
|
|
d = Starter.skmt.ExecQuery("SELECT CAT_DF_ID, CAT_DF_NOMBRE, CAT_DF_RUTA, CAT_DF_RUTAO, CAT_DF_PIEZAS, CAT_DF_CAJAS, CAT_DF_BLISTER FROM CAT_DETALLEFOLIO")
|
|
Log(c.RowCount)
|
|
l_faltantes.Text = d.RowCount - c.RowCount + 1
|
|
l_totales.text = d.RowCount
|
|
l_porcentaje.Text = NumberFormat2((l_faltantes.Text * 100)/l_totales.Text,1,2,2,True)
|
|
If c.RowCount = 1 Then
|
|
c.Position = 0
|
|
l_ordenamiento.Text = c.GetString("CAT_DF_RUTAO")
|
|
et_codigo.Text = c.GetString("CAT_DF_ID")
|
|
l_nombreproducto.Text = c.GetString("CAT_DF_NOMBRE")
|
|
et_catori_piezas.Text = c.GetString("CAT_DF_PIEZAS")
|
|
et_catori_cajas.Text = c.GetString("CAT_DF_CAJAS")
|
|
et_catori_blister.Text = c.GetString("CAT_DF_BLISTER")
|
|
et_cantesc_piezas.Text = c.GetString("CAT_DF_PIEZAS")
|
|
et_cantesc_cajas.Text = c.GetString("CAT_DF_CAJAS")
|
|
et_cantesc_blister.Text = c.GetString("CAT_DF_BLISTER")
|
|
b_guardapicking.Text = "Terminar picking"
|
|
Else If c.RowCount > 1 Then
|
|
Log(c.RowCount)
|
|
c.Position = 0
|
|
l_ordenamiento.Text = c.GetString("CAT_DF_RUTAO")
|
|
et_codigo.Text = c.GetString("CAT_DF_ID")
|
|
l_nombreproducto.Text = c.GetString("CAT_DF_NOMBRE")
|
|
et_catori_piezas.Text = c.GetString("CAT_DF_PIEZAS")
|
|
et_catori_cajas.Text = c.GetString("CAT_DF_CAJAS")
|
|
et_catori_blister.Text = c.GetString("CAT_DF_BLISTER")
|
|
et_cantesc_piezas.Text = c.GetString("CAT_DF_PIEZAS")
|
|
et_cantesc_cajas.Text = c.GetString("CAT_DF_CAJAS")
|
|
et_cantesc_blister.Text = c.GetString("CAT_DF_BLISTER")
|
|
b_guardapicking.Text = "Guardar"
|
|
Else
|
|
Msgbox2Async("No existen datos de la ruta: "& B4XPages.MainPage.seleccion.folioactual &" del almacen: "& B4XPages.MainPage.almacen.almacenselec,"Atención","Aceptar","","",Null, False)
|
|
Wait For Msgbox_Result (result As Int)
|
|
If result=DialogResponse.POSITIVE Then
|
|
B4XPages.ShowPage("seleccion")
|
|
End If
|
|
End If
|
|
c.Close
|
|
'
|
|
p_producto.Visible = True 'PARA PRUEBAS
|
|
|
|
End Sub
|
|
|
|
'camara
|
|
|
|
Private Sub B4XPage_Disappear
|
|
If Panel6.Visible = True Then
|
|
Panel6.Visible = False
|
|
StopCamera
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Sub btnStartStop_Click
|
|
delanteatras = 1
|
|
If Capturing = False Then
|
|
Panel6.Visible = True
|
|
StartCamera
|
|
Else
|
|
Panel6.Visible = False
|
|
StopCamera
|
|
End If
|
|
End Sub
|
|
|
|
Sub btnStartStop2_Click
|
|
delanteatras = 2
|
|
If Capturing = False Then
|
|
Panel6.Visible = True
|
|
StartCamera
|
|
Else
|
|
Panel6.Visible = False
|
|
StopCamera
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub B_cerrar_Click
|
|
If et_codigo.Text.Length = 0 Then
|
|
Panel6.Visible = False
|
|
StopCamera
|
|
btnFlash2_Click
|
|
Else
|
|
Panel6.Visible = False
|
|
StopCamera
|
|
et_codigo_EnterPressed
|
|
btnFlash2_Click
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub StopCamera
|
|
' et_codigo.Text = ""
|
|
Capturing = False
|
|
pnlPreview.Visible = False
|
|
If camEx.IsInitialized Then
|
|
camEx.Release
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub StartCameraShared
|
|
pnlPreview.Visible = True
|
|
Capturing = True
|
|
End Sub
|
|
|
|
Private Sub FoundBarcode (msg As String)
|
|
' et_codigo.Text = msg
|
|
toast.Show($"Found [Color=Red][b][plain]${msg}[/plain][/b][/Color]"$)
|
|
Log(msg)
|
|
codigoencontrado = msg
|
|
' If et_codigo.Text.Length > 1 Then
|
|
B_cerrar_Click
|
|
' End If
|
|
End Sub
|
|
|
|
Private Sub StartCamera
|
|
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
|
|
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
|
|
If Result = False Then
|
|
toast.Show("No permission!")
|
|
Return
|
|
End If
|
|
StartCameraShared
|
|
camEx.Initialize(pnlPreview, False, Me, "Camera1")
|
|
Wait For Camera1_Ready (Success As Boolean)
|
|
If Success Then
|
|
camEx.SetContinuousAutoFocus
|
|
camEx.CommitParameters
|
|
camEx.StartPreview
|
|
btnFlash_Click
|
|
Else
|
|
toast.Show("Error opening camera")
|
|
StopCamera
|
|
End If
|
|
End Sub
|
|
|
|
Sub btnFlash_Click
|
|
Dim f() As Float = camEx.GetFocusDistances
|
|
Log(f(0) & ", " & f(1) & ", " & f(2))
|
|
Dim flashModes As List = camEx.GetSupportedFlashModes
|
|
If flashModes.IsInitialized = False Then
|
|
ToastMessageShow("Flash not supported.", False)
|
|
Return
|
|
End If
|
|
Dim flash As String = "torch"
|
|
' LogColor(flash,Colors.Red)
|
|
' camEx.SetFlashMode(flash)
|
|
ToastMessageShow(flash, False)
|
|
camEx.CommitParameters
|
|
End Sub
|
|
|
|
Sub btnFlash2_Click
|
|
Dim f() As Float = camEx.GetFocusDistances
|
|
Log(f(0) & ", " & f(1) & ", " & f(2))
|
|
Dim flashModes As List = camEx.GetSupportedFlashModes
|
|
If flashModes.IsInitialized = False Then
|
|
ToastMessageShow("Flash not supported.", False)
|
|
Return
|
|
End If
|
|
Dim flash As String = "off"
|
|
' LogColor(flash,Colors.Red)
|
|
camEx.SetFlashMode("off")
|
|
ToastMessageShow(flash, False)
|
|
camEx.CommitParameters
|
|
End Sub
|
|
|
|
Private Sub CreateDetector (Codes As List)
|
|
Dim ctxt As JavaObject
|
|
ctxt.InitializeContext
|
|
Dim builder As JavaObject
|
|
builder.InitializeNewInstance("com/google/android/gms/vision/barcode/BarcodeDetector.Builder".Replace("/", "."), Array(ctxt))
|
|
Dim barcodeClass As String = "com/google/android/gms/vision/barcode/Barcode".Replace("/", ".")
|
|
Dim barcodeStatic As JavaObject
|
|
barcodeStatic.InitializeStatic(barcodeClass)
|
|
Dim format As Int
|
|
For Each formatName As String In Codes
|
|
format = Bit.Or(format, barcodeStatic.GetField(formatName))
|
|
Next
|
|
builder.RunMethod("setBarcodeFormats", Array(format))
|
|
detector = builder.RunMethod("build", Null)
|
|
Dim operational As Boolean = detector.RunMethod("isOperational", Null)
|
|
If operational = False Then
|
|
toast.Show("Failed to create detector")
|
|
End If
|
|
btnStartStop.Enabled = operational
|
|
End Sub
|
|
|
|
Private Sub Camera1_Preview (data() As Byte)
|
|
If DateTime.Now > LastPreview + IntervalBetweenPreviewsMs Then
|
|
'Dim n As Long = DateTime.Now
|
|
Dim frameBuilder As JavaObject
|
|
Dim bb As JavaObject
|
|
bb = bb.InitializeStatic("java.nio.ByteBuffer").RunMethod("wrap", Array(data))
|
|
frameBuilder.InitializeNewInstance("com/google/android/gms/vision/Frame.Builder".Replace("/", "."), Null)
|
|
|
|
'New Code
|
|
Dim In As InputStream
|
|
In.InitializeFromBytesArray(camEx.PreviewImageToJpeg(data, 100), 0, data.Length)
|
|
Dim bmp As Bitmap
|
|
'Log(TestPnl.Top)
|
|
' TestPnl.Top = 40dip
|
|
' TestPnl.Width = pnlPreview.Width
|
|
bmp.Initialize2(In)
|
|
bmp = bmp.Rotate(90)
|
|
bmp = bmp.Crop(0, bmp.Height * .3, bmp.Width, bmp.Height * .3)
|
|
'bmp = bmp.Resize(bmp.Width, bmp.Height * .8, True)
|
|
'QrTestPnl.SetBitmap(bmp)
|
|
'Dim B As Bitmap = camEx.PreviewImageToJpeg(data, 100)
|
|
'bmp.Rotate(270)
|
|
|
|
frameBuilder.RunMethod("setBitmap", Array(bmp)) 'instead of the setImageData line
|
|
'frameBuilder.RunMethod("setBitmap", Array(TestPnl.GetBitmap)) 'instead of the setImageData line
|
|
'End of new code
|
|
|
|
|
|
|
|
|
|
'Old Code
|
|
' Dim cs As CameraSize = camEx.GetPreviewSize
|
|
' frameBuilder.RunMethod("setImageData", Array(bb, cs.Width, cs.Height, 842094169))
|
|
|
|
|
|
Dim frame As JavaObject = frameBuilder.RunMethod("build", Null)
|
|
Dim SparseArray As JavaObject = detector.RunMethod("detect", Array(frame))
|
|
LastPreview = DateTime.Now
|
|
Dim Matches As Int = SparseArray.RunMethod("size", Null)
|
|
If Matches > 0 Then
|
|
Dim barcode As JavaObject = SparseArray.RunMethod("valueAt", Array(0))
|
|
Dim raw As String = barcode.GetField("rawValue")
|
|
FoundBarcode(raw)
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
'fin camara
|
|
|
|
Private Sub et_codigo_EnterPressed
|
|
If delanteatras = 1 Then
|
|
|
|
If et_codigo.Text = codigoencontrado Then
|
|
p_producto.Visible = True
|
|
btnFlash2_Click
|
|
Else If et_codigo.Text = codigoencontrado Then
|
|
MsgboxAsync("Escanea el codigo nuevamente.","Atención")
|
|
btnFlash2_Click
|
|
End If
|
|
|
|
Else If delanteatras = 2 Then
|
|
|
|
d = Starter.skmt.ExecQuery2("SELECT * FROM CAT_DETALLEFOLIO WHERE CAT_DF_ID = ? AND CAT_DF_ESTATUS = ?",Array As String (codigoencontrado,1))
|
|
Log(d.RowCount)
|
|
If d.RowCount > 0 Then
|
|
d.Position = 0
|
|
et_codigo.Text = codigoencontrado
|
|
p_producto.Visible = True
|
|
l_ordenamiento.Text = d.GetString("CAT_DF_RUTAO")
|
|
et_codigo.Text = d.GetString("CAT_DF_ID")
|
|
l_nombreproducto.Text = d.GetString("CAT_DF_NOMBRE")
|
|
et_catori_piezas.Text = d.GetString("CAT_DF_PIEZAS")
|
|
et_catori_cajas.Text = d.GetString("CAT_DF_CAJAS")
|
|
et_catori_blister.Text = d.GetString("CAT_DF_BLISTER")
|
|
et_cantesc_piezas.Text = d.GetString("CAT_DF_PIEZAS")
|
|
et_cantesc_cajas.Text = d.GetString("CAT_DF_CAJAS")
|
|
et_cantesc_blister.Text = d.GetString("CAT_DF_BLISTER")
|
|
b_guardapicking.Text = "Guardar"
|
|
Else
|
|
MsgboxAsync("El codigo aun no ha sido escaneado","Atencion.")
|
|
End If
|
|
d.Close
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub b_entradamanual_Click
|
|
If p_producto.Visible Then
|
|
p_entradamaual.Visible = False
|
|
Else If p_entradamaual.Visible Then
|
|
p_entradamaual.Visible = False
|
|
Else
|
|
p_entradamaual.Visible = True
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub et_entradamanual_EnterPressed
|
|
If et_codigo.Text = et_entradamanual.Text Then
|
|
p_producto.Visible = True
|
|
p_entradamaual.Visible = False
|
|
et_entradamanual.Text = ""
|
|
Else
|
|
MsgboxAsync("Por favor captura el codigo correcto.","Atención")
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub b_cancelar_Click
|
|
Starter.skmt.ExecNonQuery("delete from CUENTAA")
|
|
B4XPages.ShowPage("seleccion")
|
|
End Sub
|
|
|
|
Private Sub b_guardapicking_Click
|
|
|
|
DateTime.DateFormat = "dd/MM/yyyy"
|
|
DateTime.Timeformat = "HH:mm:ss"
|
|
sDate=DateTime.Date(DateTime.Now)
|
|
sTime=DateTime.Time(DateTime.Now)
|
|
|
|
If b_guardapicking.Text = "Terminar picking" Then
|
|
If p_producto.Visible Then
|
|
Dim bopiezas As Int
|
|
Dim bocajas As Int
|
|
Dim boblister As Int
|
|
bopiezas = et_catori_piezas.Text - et_cantesc_piezas.Text
|
|
bocajas = et_catori_cajas.Text - et_cantesc_cajas.Text
|
|
boblister = et_catori_blister.Text - et_cantesc_blister.Text
|
|
Log(bopiezas)
|
|
|
|
Private CAJASPIEZAS As Int
|
|
Private BLISTERPIEZAS As Int
|
|
Private totalpiezas As Int
|
|
Private preciototal As Float
|
|
Private precioorden As Float
|
|
Private cantidadbo As Int
|
|
Private preciobo As Float
|
|
|
|
c = Starter.skmt.ExecQuery2("SELECT CAJASPIEZAS, BLISTERPIEZAS, PRECIO FROM CAT_CONVERSION WHERE ID = ? AND NOMBRE = ?", Array As String(et_codigo.Text, l_nombreproducto.Text))
|
|
Log(et_codigo.Text&" , "& l_nombreproducto.Text)
|
|
d = Starter.skmt.ExecQuery2("SELECT CANTIDAD FROM CAT_DETALLEFOLIO WHERE CAT_DF_ID = ? AND CAT_DF_NOMBRE = ?",Array As String(et_codigo.Text, l_nombreproducto.Text))
|
|
d.Position = 0
|
|
c.Position = 0
|
|
CAJASPIEZAS = c.GetString("CAJASPIEZAS") * et_cantesc_cajas.Text
|
|
BLISTERPIEZAS = c.GetString("BLISTERPIEZAS") * et_cantesc_blister.Text
|
|
Log("Cajas a piezas es = "&CAJASPIEZAS)
|
|
Log("blister a piezas es = "&BLISTERPIEZAS)
|
|
totalpiezas = CAJASPIEZAS + BLISTERPIEZAS + et_cantesc_piezas.Text
|
|
Log("total piezas es = "&totalpiezas)
|
|
preciototal = c.GetString("PRECIO")* totalpiezas
|
|
Log("total precio = "& preciototal)
|
|
precioorden = c.GetString("PRECIO") * d.GetString("CANTIDAD")
|
|
cantidadbo = d.GetString("CANTIDAD") - totalpiezas
|
|
preciobo = cantidadbo * c.GetString("PRECIO")
|
|
c.Close
|
|
d.Close
|
|
|
|
' Starter.skmt.ExecNonQuery2("UPDATE CUENTAA SET ESTATUS = ? WHERE CUENTA = ?",Array As String (0,lb_folioselec.Text))
|
|
Starter.skmt.ExecNonQuery2("UPDATE CAT_FOLIOS SET CAT_FOLIO_FINAL = ? WHERE CAT_FOLIO = ? ", Array As String((sDate&" "&sTime), lb_folioselec.Text))
|
|
Starter.skmt.ExecNonQuery2("UPDATE CAT_DETALLEFOLIO SET CAT_DF_ESTATUS = ?, CAT_DF_PIEZAS_ESC = ?, CAT_DF_CAJAS_ESC = ?, CAT_DF_BLISTER_ESC = ?, PIEZASTOTAL = ?, PRECIOTOTAL = ?, PRECIOORDEN = ?, CANTIDADBO = ?, PRECIOBO = ? WHERE CAT_DF_NOMBRE = ? and CAT_DF_ID = ?",Array As String(1, et_cantesc_piezas.Text, et_cantesc_cajas.Text, et_cantesc_blister.Text, totalpiezas, preciototal, precioorden,cantidadbo, preciobo ,l_nombreproducto.Text, et_codigo.Text))
|
|
posision = posision + 1
|
|
p_producto.Visible = False
|
|
b_cancelar.Visible = False
|
|
B4XPages.ShowPage("termino")
|
|
End If
|
|
|
|
Else
|
|
|
|
If p_producto.Visible Then
|
|
Dim bopiezas As Int
|
|
Dim bocajas As Int
|
|
Dim boblister As Int
|
|
bopiezas = et_catori_piezas.Text - et_cantesc_piezas.Text
|
|
bocajas = et_catori_cajas.Text - et_cantesc_cajas.Text
|
|
boblister = et_catori_blister.Text - et_cantesc_blister.Text
|
|
Log(bopiezas)
|
|
|
|
Private CAJASPIEZAS As Int
|
|
Private BLISTERPIEZAS As Int
|
|
Private totalpiezas As Int
|
|
Private preciototal As Float
|
|
Private precioorden As Float
|
|
Private cantidadbo As Int
|
|
Private preciobo As Float
|
|
|
|
c = Starter.skmt.ExecQuery2("SELECT CAJASPIEZAS, BLISTERPIEZAS, PRECIO FROM CAT_CONVERSION WHERE ID = ? AND NOMBRE = ?", Array As String(et_codigo.Text, l_nombreproducto.Text))
|
|
d = Starter.skmt.ExecQuery2("SELECT CANTIDAD FROM CAT_DETALLEFOLIO WHERE CAT_DF_ID = ? AND CAT_DF_NOMBRE = ?",Array As String(et_codigo.Text, l_nombreproducto.Text))
|
|
d.Position = 0
|
|
If c.RowCount > 0 Then
|
|
c.Position = 0
|
|
CAJASPIEZAS = c.GetString("CAJASPIEZAS") * et_cantesc_cajas.Text
|
|
BLISTERPIEZAS = c.GetString("BLISTERPIEZAS") * et_cantesc_blister.Text
|
|
Log("Cajas a piezas es = "&CAJASPIEZAS)
|
|
Log("blister a piezas es = "&BLISTERPIEZAS)
|
|
totalpiezas = CAJASPIEZAS + BLISTERPIEZAS + et_cantesc_piezas.Text
|
|
Log("total piezas es = "&totalpiezas)
|
|
preciototal = c.GetString("PRECIO")* totalpiezas
|
|
Log("total precio = "& preciototal)
|
|
precioorden = c.GetString("PRECIO") * d.GetString("CANTIDAD")
|
|
cantidadbo = d.GetString("CANTIDAD") - totalpiezas
|
|
preciobo = cantidadbo * c.GetString("PRECIO")
|
|
c.Close
|
|
d.Close
|
|
Else
|
|
|
|
End If
|
|
Starter.skmt.ExecNonQuery2("UPDATE CUENTAA SET ESTATUS = ? WHERE CUENTA = ?",Array As String (1,lb_folioselec.Text))
|
|
Starter.skmt.ExecNonQuery2("UPDATE CAT_DETALLEFOLIO SET CAT_DF_ESTATUS = ?, CAT_DF_PIEZAS_ESC = ?, CAT_DF_CAJAS_ESC = ?, CAT_DF_BLISTER_ESC = ?, PIEZASTOTAL = ?, PRECIOTOTAL = ?, PRECIOORDEN = ?, CANTIDADBO = ?, PRECIOBO = ? WHERE CAT_DF_NOMBRE = ? and CAT_DF_ID = ?",Array As String(1, et_cantesc_piezas.Text, et_cantesc_cajas.Text, et_cantesc_blister.Text, totalpiezas, preciototal, precioorden,cantidadbo, preciobo ,l_nombreproducto.Text, et_codigo.Text))
|
|
posision = posision + 1
|
|
p_producto.Visible = False
|
|
b_cancelar.Visible = False
|
|
B4XPage_Appear
|
|
|
|
|
|
Else
|
|
|
|
End If
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub b_regresar_Click
|
|
c = Starter.skmt.ExecQuery("SELECT ALMACEN FROM CUENTAA")
|
|
c.Position = 0
|
|
B4XPages.MainPage.seleccion.almacen = c.GetString("ALMACEN")
|
|
c.Close
|
|
B4XPages.ShowPage("seleccion")
|
|
End Sub
|