?? sj_ywkccx.pas
字號:
{*******************************************************}
{ }
{ 庫存查詢 }
{ }
{ 中軟金馬公司版權(quán)所有。2002.12前 }
{ }
{ 編制:中軟金馬郵資票品項目開發(fā)組 }
{ }
{ }
{*******************************************************}
(*
省級集郵品,省級集郵票,省級零枚票,省級市場購入票
地市集郵品,地市集郵票,地市市場購入票.省級綜合查詢
*)
(*
修改記錄:
1、在界面上增加年度、票品類別(大類)、小類、特征的查詢條件
2、最下面增加一個合計行,志號處顯示合計、票品名稱處顯示:記錄數(shù):XX
3、查詢結(jié)果鎖定:志號、票品名稱、庫房名稱、進價
4、查詢結(jié)果順序:志號、票品名稱、庫房名稱(無合計)、進價(無合計)、數(shù)量、面值(無合計)、
庫存核算價(無合計)、銷價(無合計)、進價金額、面值金額、庫存核算價金額、銷價金額、折扣(無合計)、
結(jié)算價(無合計)、庫位(無合計)
霍鐵明 2002年12月9日
*)
unit SJ_YWKCCX;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, DBGrids, Buttons, ExtCtrls, StdCtrls, ActnList, Db, DBTables,
ComCtrls, ImgList, Spin, RXCtrls, SqlStrings, RxQuery, DBGridExport,
Menus, FieldComboBox, Mask, ToolEdit, CurrEdit, EHGrids,
DBGridEh;
type
TFrm_YWKCCX = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
ActionList1: TActionList;
Act_sel: TAction;
Act_rtn: TAction;
DS_kc: TDataSource;
Panel2: TPanel;
rxLbl_Title: TRxLabel;
DWMC: TLabel;
RxQry_KC: TRxQuery;
RxQry_Tmp: TRxQuery;
RxQry_KCPPDM: TStringField;
RxQry_KCKWH: TStringField;
RxQry_KCTS: TFloatField;
RxQry_KCKFMC: TStringField;
RxQry_KCTMC: TStringField;
RxQry_KCZH: TStringField;
RxQry_KCJJ: TFloatField;
RxQry_KCXJ: TFloatField;
RxQry_KCZK: TFloatField;
RxQry_KCJSJ: TFloatField;
rg_ZHMC: TRadioGroup;
chk_MHCX: TCheckBox;
edt_ZHMC: TEdit;
Label3: TLabel;
fcb_PPLB: TFieldComboBox;
bbtn_Quit: TBitBtn;
bbtn_Find: TBitBtn;
L_MC: TLabel;
cb_XJ: TComboBox;
fcb_KFMC: TFieldComboBox;
fcb_PPMC: TFieldComboBox;
RG_KC: TRadioGroup;
chk_BHKC: TCheckBox;
bbtn_Print: TBitBtn;
se_ND: TSpinEdit;
Label5: TLabel;
fcb_DL: TFieldComboBox;
Label6: TLabel;
fcb_TZ: TFieldComboBox;
chk_ND: TCheckBox;
RxQry_KCMZ: TFloatField;
RxQry_KCKCHSJ: TFloatField;
RxQry_KCJJJE: TFloatField;
RxQry_KCMZJE: TFloatField;
RxQry_KCKCHSJJE: TFloatField;
RxQry_KCSJJE: TFloatField;
dbgEh_KC: TDBGridEh;
procedure Act_selExecute(Sender: TObject);
procedure Act_rtnExecute(Sender: TObject);
procedure RxQry_KCAfterOpen(DataSet: TDataSet);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure RxQry_KCJJGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure fcb_PPLBChange(Sender: TObject);
procedure fcb_KFMCChange(Sender: TObject);
procedure bbtn_PrintClick(Sender: TObject);
procedure fcb_DLChange(Sender: TObject);
procedure se_NDChange(Sender: TObject);
procedure chk_NDClick(Sender: TObject);
procedure RxQry_KCMZGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure RxQry_KCKCHSJGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure RxQry_KCJJJEGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure RxQry_KCMZJEGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure RxQry_KCKCHSJJEGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure RxQry_KCSJJEGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
procedure dbgEh_KCGetFooterParams(Sender: TObject; DataCol,
Row: Integer; Column: TColumnEh; AFont: TFont;
var Background: TColor; var Alignment: TAlignment;
State: TGridDrawState; var Text: string);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function Show_YWKCCX(io_typ: TIO_TYPE): boolean;
var
Frm_YWKCCX: TFrm_YWKCCX;
implementation
uses
datas,pub;
var
vl_Io_Type: TIO_TYPE;
{$R *.DFM}
{-------------------------------------------------------------------------------}
{從INI文件文件讀取并設(shè)置DbGrid列寬}
procedure TFrm_YWKCCX.FormCreate(Sender: TObject);
begin
GetAllColWidth(Self);
se_ND.Text:= FormatDateTime('yyyy', GetSysDate);
end;
{-------------------------------------------------------------------------------}
{庫存查詢公共模塊}
function Show_YWKCCX(io_typ: TIO_TYPE): boolean;
begin
Result:= false;
with TFrm_YWKCCX.Create(Application) do
begin
vl_Io_Type:= io_typ;
Caption:= '郵資票品管理信息系統(tǒng)';
rxLbl_Title.Caption:= pCaption[integer(vl_Io_Type)] + '庫存查詢';
DWMC.Caption:= '使用單位:' + VG_UnitName;
try
{刷新庫房名稱}
fcb_KFMC.ClearAll;
with RxQry_Tmp do
begin
Close;
case vl_Io_Type of
io_jyp:
begin
SQL.Text:= ' select DISTINCT b.KFMC, b.KFDM from TYS_JYPPKC a, TGS_KFB b, TGS_KFRYDZB c'#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by b.KFDM';
end;
io_txp:
begin
SQL.Text:= ' select DISTINCT b.KFMC, b.KFDM from TYS_TXPPKC a, TGS_KFB b, TGS_KFRYDZB c'#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by b.KFDM';
end;
io_yp:
begin
SQL.Text:= ' select DISTINCT b.KFMC, b.KFDM from TYS_YPPKC a, TGS_KFB b, TGS_KFRYDZB c '#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by b.KFDM';
end;
io_grp:
begin
SQL.Text:= ' select DISTINCT b.KFMC, b.KFDM from TYS_GRPPKC a, TGS_KFB b, TGS_KFRYDZB c '#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by b.KFDM';
end;
end;
Open;
while not Eof do
begin
fcb_KFMC.Items.Add(Fields[0].AsString);
fcb_KFMC.FieldItems.Add(Fields[1].AsString);
Next;
end;
fcb_KFMC.ItemIndex:= 0;
fcb_KFMCChange(nil);
end;
{刷新票品價格}
cb_XJ.Items.Clear;
with RxQry_Tmp do
begin
Close;
case vl_Io_Type of
io_jyp:
begin
SQL.Text:= ' select DISTINCT a.XJ from TYS_JYPPKC a, TGS_KFB b, TGS_KFRYDZB c'#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by a.XJ';
end;
io_txp:
begin
SQL.Text:= ' select DISTINCT a.XJ from TYS_TXPPKC a, TGS_KFB b, TGS_KFRYDZB c'#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by a.XJ';
end;
io_yp:
begin
SQL.Text:= ' select DISTINCT a.XJ from TYS_YPPKC a, TGS_KFB b, TGS_KFRYDZB c '#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by a.XJ';
end;
io_grp:
begin
SQL.Text:= 'select DISTINCT a.XJ from TYS_GRPPKC a, TGS_KFB b, TGS_KFRYDZB c '#10#13
+ ' where a.KFDM=b.KFDM and a.KFDM=c.KFDM and c.YGDM= ' + QuotedStr(VG_USERID) + ' order by a.XJ';
end;
end;
Open;
while not Eof do
begin
cb_XJ.Items.Add(Fields[0].AsString);
Next;
end;
end;
Act_selExecute(nil);
except
Application.MessageBox('不能打開 <庫存信息表>', '提示', MB_OK + 48);
Exit;
end;
result:= ShowModal = MB_OK;
free;
end;
end;
{-------------------------------------------------------------------------------}
{如果為集郵品,DbGridEh中面值、庫存核算價、面值金額、庫存核算價金額字段不顯示}
procedure TFrm_YWKCCX.FormShow(Sender: TObject);
var
i: Integer;
begin
if vl_Io_Type = io_yp then
for i:= 0 to dbgEh_KC.Columns.Count - 1 do
if (dbgEh_KC.Columns[i].FieldName = 'MZ') or (dbgEh_KC.Columns[i].FieldName = 'KCHSJ')
or (dbgEh_KC.Columns[i].FieldName = 'MZJE') or (dbgEh_KC.Columns[i].FieldName = 'KCHSJJE') then
dbgEh_KC.Columns[i].Visible:= False;
end;
{-------------------------------------------------------------------------------}
{年度復(fù)選框單擊}
procedure TFrm_YWKCCX.chk_NDClick(Sender: TObject);
begin
fcb_KFMCChange(nil);
end;
{-------------------------------------------------------------------------------}
{年度改變}
procedure TFrm_YWKCCX.se_NDChange(Sender: TObject);
begin
fcb_KFMCChange(nil);
end;
{-------------------------------------------------------------------------------}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -