este es el codigo de lo que estoy realizando
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, lmdctrl, lmdstdcS, wwSpeedButton, wwDBNavigator,
wwclearpanel, wwdblook, lmdbtn, ToolWin, ComCtrls, Mask, wwdbedit,
lmdcombo, lmdextcS, jpeg, DBTables, DBISAMTb, Grids, DBGrids, DBISAMCt;
type
TF_Main = class(TForm)
ToolBar1: TToolBar;
BT_1: TLMDButton;
BT_2: TLMDButton;
BT_3: TLMDButton;
LMDButton2: TLMDButton;
N1_Code: TwwDBLookupCombo;
ED_N1: TwwDBEdit;
E_CODERES: TEdit;
Label3: TLabel;
LMDButton7: TLMDButton;
E_N1: TwwDBEdit;
N2_Code: TwwDBLookupCombo;
Label1: TLabel;
E_N2: TwwDBEdit;
E_N3: TwwDBEdit;
E_N6: TwwDBEdit;
ED_N2: TwwDBEdit;
N3_Code: TwwDBLookupCombo;
ED_N3: TwwDBEdit;
LMDButton10: TLMDButton;
N6_Code: TEdit;
E_DESCRIPCION: TEdit;
C_Tallas: TCheckBox;
Label2: TLabel;
E_Grupo: TEdit;
Label4: TLabel;
E_Departamento: TEdit;
E_Linea: TEdit;
E_Marca: TEdit;
E_TallaTamano: TEdit;
E_Moneda: TEdit;
E_Unidad: TEdit;
E_Origen: TEdit;
E_Modelo: TEdit;
E_Referencia: TEdit;
Label5: TLabel;
Label7: TLabel;
Label8: TLabel;
Label6: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
E_InformacionAdicional: TMemo;
GroupBox1: TGroupBox;
E_CostoAnterior: TEdit;
E_Pvp1: TEdit;
E_Pvp2: TEdit;
E_Pvp3: TEdit;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
procedure LMDButton6Click(Sender: TObject);
procedure LMDButton2Click(Sender: TObject);
procedure ProcedenChange(Sender: TObject);
procedure BT_1Click(Sender: TObject);
procedure LMDButton7Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure BT_2Click(Sender: TObject);
procedure BT_3Click(Sender: TObject);
procedure BT_4Click(Sender: TObject);
procedure N1_CodeChange(Sender: TObject);
procedure N2_CodeChange(Sender: TObject);
procedure N3_CodeChange(Sender: TObject);
procedure LMDButton10Click(Sender: TObject);
private
Public
end;
var
F_Main: TF_Main;
implementation
uses Unit3,DatosU, Unit2, Unit5, Unit6, Unit7, Unit8, Unit9, Unit10, Unit11;
Const
NPrecios = 6;
DecimalAllow = 2;
Type RegUnPrecio = Record
PorcUtil ,
PorcUtilEx : Boolean;
Utilidad ,
UtilidadEx ,
SinImpuesto ,
MtoImpuesto1 ,
MtoImpuesto2 ,
TotalPrecio ,
TotalPrecioEx: Currency;
TipoRound : Byte;
end;
RegCostos = Record
CodeCompra : String[50]; VImpuesto1 ,
VImpuesto2 : Boolean; CostoAnteriorBs ,
CostoAnteriorEx ,
CostoActualBs ,
CostoActualEx ,
CostoPromedioBs ,
CostoPromedioEx ,
MImpuesto1 ,
MImpuesto2 : Currency;
PorcentImp1 ,
Excento1 ,
PorcentImp2 ,
Excento2 : Boolean;
FechaVencimiento: TDateTime; NumeroDeLote : String[50]; Precios : Array[1..NPrecios] of RegUnPrecio;
end;
{$R *.DFM}
procedure TF_Main.LMDButton6Click(Sender: TObject);
begin
F_Maestro.ShowMOdal;
end;
procedure TF_Main.LMDButton2Click(Sender: TObject);
begin
F_Main.Close;
end;
procedure TF_Main.ProcedenChange(Sender: TObject);
Var Tipo : String;
begin
end;
procedure TF_Main.BT_1Click(Sender: TObject);
begin
F_NIvel_1.ShowModal;
end;
procedure TF_Main.LMDButton7Click(Sender: TObject);
begin
F_Config.ShowModal;
end;
procedure TF_Main.FormActivate(Sender: TObject);
Var Nivel : Integer;
Dira2 : String;
DirLocal : String;
begin
DATOS.T_Config.Active := True;
Dira2 := datos.T_Config.FieldByName('FNC_DIRA2').AsString;
DirLocal := datos.T_Config.FieldByName('FNC_DIRLOCAL').AsString;
DATOS.T_Nivel1.DatabaseName := Dira2;
DATOS.T_Nivel_2.DatabaseName := Dira2;
DATOS.T_Nivel_3.DatabaseName := Dira2;
DATOS.T_Inventario.DatabaseName := Dira2;
DATOS.T_Sfixed.DatabaseName := Dira2;
Datos.T_Sfixed.Active := True;
Datos.T_Nivel1.Active := True;
Datos.T_Nivel_2.Active := True;
Datos.T_Nivel_3.Active := True;
Datos.T_Inventario.Active := True;
Nivel := Datos.T_Config.FieldByName('FNC_NUM_NIVELES').AsInteger;
If Nivel = 1 then
begin
BT_1.Enabled := True;
BT_1.Caption := Datos.T_Config.FieldByName('FNC_NAME_NIVEL1').AsString;
E_N1.Visible := True;
N1_Code.Visible := True;
ED_N1.Visible := True;
end;
If Nivel = 2 then
begin
BT_1.Enabled := True;
BT_1.Caption := Datos.T_Config.FieldByName('FNC_NAME_NIVEL1').AsString;
BT_2.Enabled := True;
BT_2.Caption := Datos.T_Config.FieldByName('FNC_NAME_NIVEL2').AsString;
E_N1.Visible := True;
N1_Code.Visible := True;
ED_N1.Visible := True;
E_N2.Visible := True;
N2_Code.Visible := True;
ED_N2.Visible := True;
end;
If Nivel = 3 then
begin
BT_1.Enabled := True;
BT_1.Caption := Datos.T_Config.FieldByName('FNC_NAME_NIVEL1').AsString;
BT_2.Enabled := True;
BT_2.Caption := Datos.T_Config.FieldByName('FNC_NAME_NIVEL2').AsString;
BT_3.Enabled := True;
BT_3.Caption := Datos.T_Config.FieldByName('FNC_NAME_NIVEL3').AsString;
E_N1.Visible := True;
N1_Code.Visible := True;
ED_N1.Visible := True;
E_N2.Visible := True;
N2_Code.Visible := True;
ED_N2.Visible := True;
E_N3.Visible := True;
N3_Code.Visible := True;
ED_N3.Visible := True;
end;
end;
procedure TF_Main.BT_2Click(Sender: TObject);
begin
F_Nivel_2.ShowModal;
end;
procedure TF_Main.BT_3Click(Sender: TObject);
begin
F_Nivel_3.ShowModal;
end;
procedure TF_Main.BT_4Click(Sender: TObject);
begin
F_Nivel_4.ShowModal;
end;
procedure TF_Main.N1_CodeChange(Sender: TObject);
begin
E_CODERES.Text := N1_Code.Text;
end;
procedure TF_Main.N2_CodeChange(Sender: TObject);
begin
E_CODERES.Text := N1_Code.Text+N2_Code.Text;
end;
procedure TF_Main.N3_CodeChange(Sender: TObject);
begin
E_CODERES.Text := N1_Code.Text+N2_Code.Text+N3_Code.Text;
end;
procedure TF_Main.LMDButton10Click(Sender: TObject);
Var Tallas : Boolean;
begin
Datos.T_Inventario.Insert;
Datos.T_Inventario.FieldByName('FI_CODIGO').AsString := E_CODERES.Text;
Datos.T_Inventario.FieldByName('FI_DESCRIPCION').AsString := E_DESCRIPCION.Text;
Datos.T_Inventario.FieldByName('FI_DESCRIPCIONDETALLADA').AsString := E_InformacionAdicional.Text;
Datos.T_Inventario.FieldByName('FI_SUBCATEGORIA').AsString := E_Grupo.Text;
Datos.T_Inventario.FieldByName('FI_CATEGORIA').AsString := E_Departamento.Text;
Datos.T_Inventario.FieldByName('ZZCAMPO_003').AsString := E_Linea.Text;
Datos.T_Inventario.FieldByName('FI_REFERENCIA').AsString := E_Referencia.Text;
Datos.T_Inventario.FieldByName('FI_MARCA').AsString := E_Marca.Text;
Datos.T_Inventario.FieldByName('FI_MODELO').AsString := E_Modelo.Text;
Datos.T_Inventario.FieldByName('ZZCAMPO_002').AsString := E_TallaTamano.Text;
Datos.T_Inventario.FieldByName('FI_MONEDA').AsString := '1';
Datos.T_Inventario.FieldByName('FI_UNIDAD').AsString := E_Unidad.Text;
Datos.T_Inventario.FieldByName('FI_SUJETOACOMISION').AsBoolean := True;
Datos.T_Inventario.FieldByName('FI_STATUS').AsBoolean := True;
Datos.T_Inventario.FieldByName('FI_PESOPRODUCTO').AsCurrency := 0;
Datos.T_Inventario.FieldByName('FI_GARANTIA').AsInteger := 0;
Datos.T_Inventario.FieldByName('FI_DEPOSITOS').AsBoolean := True;
Datos.T_Inventario.FieldByName('FI_OFERTAS').AsBoolean := True;
Datos.T_Inventario.FieldByName('FI_VENCIMIENTOS').AsBoolean := False;
Datos.T_Inventario.FieldByName('FI_CLASIFICACION').AsInteger := 0;
If C_Tallas.Checked = True then
begin
Datos.T_Inventario.FieldByName('FI_MANEJOINVENTARIO').AsInteger := 1;
end ;
If C_Tallas.Checked = False then
begin
Datos.T_Inventario.FieldByName('FI_MANEJOINVENTARIO').AsInteger := 0;
end;
Datos.T_Inventario.FieldByName('FI_MANEJOINVENTARIO').AsInteger := 0;
Datos.T_Inventario.FieldByName('FI_SERIALES').AsBoolean := False;
Datos.T_Inventario.FieldByName('FI_INVENTARIOINICIALUNIDADES').AsCurrency := 0;
Datos.T_Inventario.FieldByName('FI_INVENTARIOINICIALCOSTO').AsCurrency := 0;
Datos.T_Inventario.FieldByName('FI_CAPACIDAD').AsCurrency := 0;
Datos.T_Inventario.FieldByName('FI_EXISTDECIMAL').AsBoolean := False;
Datos.T_Inventario.FieldByName('FI_COMPUESTOSERIALES').AsBoolean := False;
Datos.T_Inventario.Post;
******* esta es la rituna o procedimiento que necesito agregar, pero me arroja unos errores que no se como solventar
MessageDlg('PRODUCTO INCLUIDO GRACIAS',MtInformation,[MbOk],0)
end;
end.
si necesitan el proyecto completo, con gusto lo envio.
Saludos.
Alexander Medina
Maracay/venezuela