Legislacion Aduanera
Adodc1 compras
Adodc2 detalle_compras
Adodc4 repuestos
Adodc5 movimientos
Dim op As Integer, tot1 As Double, precio As Double
Sub calcular()
tot1 = 0
Adodc2.RecordSource = "select * from detalle_comp_rep where trim(str(cod_comp))='" + Trim(T7.Text) + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.Update
Adodc2.Recordset.MoveFirstWhile Not Adodc2.Recordset.EOF
tot1 = tot1 + Adodc2.Recordset("total_rep")
Adodc2.Recordset.MoveNext
Wend
T11.Text = tot1
End If
Adodc2.RecordSource = "select * from detalle_comp_rep where trim(str(cod_comp))='" + Trim(T7.Text) + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveLast
End If
End Sub
Sub limpiar()
T1.Text = ""
t2.Text = ""
T3.Text = ""T4.Text = ""
T5.Text = ""
T6.Text = ""
T7.Text = ""
T9.Text = ""
T10.Text = ""
T11.Text = ""
End Sub
Sub activar()
T7.Locked = False
T9.Locked = False
T10.Locked = False
T11.Locked = False
NUEVO.Enabled = False
MODIFICAR.Enabled = False
BUSCAR.Enabled = False
SALIR.Enabled = False
GUARDAR.Enabled = True
CANCELAR.Enabled = True
End Sub
Sub desactivar()
T7.Locked = TrueT9.Locked = True
T10.Locked = True
T11.Locked = True
NUEVO.Enabled = True
MODIFICAR.Enabled = True
BUSCAR.Enabled = True
SALIR.Enabled = True
GUARDAR.Enabled = False
CANCELAR.Enabled = False
End Sub
Private Sub BUSCAR_Click()
Frame4.Visible = True
Adodc2.RecordSource = "select * from detalle_comp_rep where trim(str(cod_comp))='" + Trim(T7.Text) + "'"
Adodc2.Refresh
End Sub
PrivateSub CANCELAR_Click()
FG = MsgBox("seguro de cancelar...", 4 + 32, "sistema")
If FG = 6 Then
Adodc2.RecordSource = "select * from detalle_comp_rep where trim(str(cod_comp))='" + Trim(T7.Text) + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveFirst
While Not Adodc2.Recordset.EOF
Adodc2.Recordset.Delete
Adodc2.Recordset.MoveNext
Wend
End If
limpiardesactivar
End If
End Sub
Private Sub Command10_Click()
'imprimir general
DataEnvironment6.Commands.Item(1).CommandText = "select * from compras_rep"
DataReport6.Show
DataEnvironment6.rsCommand1.Close
End Sub
Private Sub Command11_Click()
Frame6.Visible = False
End Sub
Private Sub Command12_Click()
'aceptar del modificar
Frame6.Visible = False
If Adodc1.Recordset.RecordCount > 0 Thenop = 2
T7.Text = Trim(Adodc1.Recordset("cod_comp"))
T8.Value = Trim(Adodc1.Recordset("fecha_comp"))
T9.Text = Trim(Adodc1.Recordset("num_fact_comp"))
T10.Text = Trim(Adodc1.Recordset("ruc_prov"))
T11.Text = Trim(Adodc1.Recordset("totales_comp"))
Adodc2.RecordSource = "select * from detalle_comp_rep where trim(str(cod_comp))='" + Trim(T7.Text) + "'"
Adodc2.Refresh
Adodc3.RecordSource ="select * from proveedores where ruc_prov ='" + Trim(T10.Text) + "'"
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
T1.Text = Adodc3.Recordset("ruc_prov")
t2.Text = Adodc3.Recordset("rsocial_prov")
T3.Text = Adodc3.Recordset("represent_prov")
T4.Text = Adodc3.Recordset("dir_prov")
T5.Text = Adodc3.Recordset("telf_cel_prov")
T6.Text = Adodc3.Recordset("telf_conv_prov")
End Ifactivar
T7.SetFocus
Label7.Enabled = False
CANCELAR.Enabled = False
End If
End Sub
Private Sub Command1_Click()
'cancelar del buscar
Frame4.Visible = False
End Sub
Private Sub Command13_Click()
'cancelar del imprimir
Frame5.Visible = False
End Sub
Private Sub Command14_Click()
calcular
End Sub
Private Sub Command2_Click()
Frame3.Visible = False
IfAdodc4.Recordset.RecordCount > 0 Then
Adodc2.Recordset.AddNew
Adodc2.Recordset("cod_comp") = Trim(T7.Text)
Adodc2.Recordset("cod_rep") = Adodc4.Recordset("cod_rep")
Adodc2.Recordset("nom_rep") = Adodc4.Recordset("nom_rep")
Adodc2.Recordset("cantidad_rep") = 0
Adodc2.Recordset("precio_rep") = Adodc4.Recordset("valor_rep")
Adodc2.Recordset("total_rep") = 0
Adodc2.Recordset.Update
DataGrid6.SetFocus
End If
End...
Regístrate para leer el documento completo.