📄 ordw00_01.pas.svn-base
字号:
tlbOrd500.Caption:=GetDBString('ORDW0001030'); //销售报价
tlbOrd510.Caption:=GetDBString('ORDW0001031'); //销售定单
tlbExit.Caption:=GetDBString('ORDW0001032'); //退出
lblClass.Caption:=GetDBString('ORDW0001033'); //客户类别
pnLists.Caption:=GetDBString('ORDW0001034'); //客户类别
qryMasterO500A_001.DisplayLabel:=GetDBString('ORDW0001035'); //报价单号
qryMasterO100_002.DisplayLabel:=GetDBString('ORDW0001036'); //报价类型
qryMasterO500A_003.DisplayLabel:=GetDBString('ORDW0001037'); //报价日期
qryMasterO500A_004.DisplayLabel:=GetDBString('ORDW0001038'); //报价状态
qryMasterH150_002.DisplayLabel:=GetDBString('ORDW0001039'); //销售员号
qryMasterH150_003.DisplayLabel:=GetDBString('ORDW0001040'); //销售员名
qryMasterG100_002.DisplayLabel:=GetDBString('ORDW0001041'); //币别编号
qryMasterG100_003.DisplayLabel:=GetDBString('ORDW0001042'); //币别名称
qryMasterO500A_008.DisplayLabel:=GetDBString('ORDW0001043'); //币别汇率
qryMasterG110_002.DisplayLabel:=GetDBString('ORDW0001044'); //付款方式
qryMasterO500A_010.DisplayLabel:=GetDBString('ORDW0001045'); //来源类型
qryMasterO500A_011.DisplayLabel:=GetDBString('ORDW0001046'); //来源单号
qryMasterO500A_012.DisplayLabel:=GetDBString('ORDW0001047'); //金额总计
qryMasterO500A_013.DisplayLabel:=GetDBString('ORDW0001048'); //折扣比率
qryMasterO500A_014.DisplayLabel:=GetDBString('ORDW0001049'); //折扣金额
qryMasterO500A_015.DisplayLabel:=GetDBString('ORDW0001050'); //特殊费用
qryMasterO500A_016.DisplayLabel:=GetDBString('ORDW0001051'); //应收金额
qryMasterO150_002.DisplayLabel:=GetDBString('ORDW0001052'); //客户编号
qryMasterO150_003.DisplayLabel:=GetDBString('ORDW0001053'); //客户名称
qryMasterO150_005.DisplayLabel:=GetDBString('ORDW0001054'); //电话号码
qryMasterO150_006.DisplayLabel:=GetDBString('ORDW0001055'); //传真号码
qryMasterO150_012.DisplayLabel:=GetDBString('ORDW0001056'); //客户址址
qryMasterO500A_018.DisplayLabel:=GetDBString('ORDW0001057'); //交货地址
qryMasterO500A_019.DisplayLabel:=GetDBString('ORDW0001058'); //提货方式
qryMasterO500A_020.DisplayLabel:=GetDBString('ORDW0001059'); //销售条款
qryMasterO500A_021.DisplayLabel:=GetDBString('ORDW0001060'); //备注说明
qryMasterO500A_022.DisplayLabel:=GetDBString('ORDW0001061'); //制单日期
qryMasterO500A_023.DisplayLabel:=GetDBString('ORDW0001062'); //制单人员
qryMasterO500A_024.DisplayLabel:=GetDBString('ORDW0001063'); //修改日期
qryMasterO500A_025.DisplayLabel:=GetDBString('ORDW0001064'); //修改人员
//报价状态(0=新建,1=报价,2=确认,3=取消,4=完成)
AStatus[0]:=GetDBString('ORDW0001065'); //新建
AStatus[1]:=GetDBString('ORDW0001067'); //确认
AStatus[2]:=GetDBString('ORDW0001066'); //报价
AStatus[3]:=GetDBString('ORDW0001069'); //完成
AStatus[4]:=GetDBString('ORDW0001068'); //取消
AStatus[5]:=GetDBString('ORDW0001077'); //执行
//提货方式(0=自提,1=送货,2=托运,3=邮寄,4=快递)
APick[0]:=GetDBString('ORDW0001070'); //自提
APick[1]:=GetDBString('ORDW0001071'); //送货
APick[2]:=GetDBString('ORDW0001072'); //托运
APick[3]:=GetDBString('ORDW0001073'); //邮寄
APick[4]:=GetDBString('ORDW0001074'); //快递
//来源类型(0=手工输入,1=来电记录)
AFrom[0]:=GetDBString('ORDW0001075'); //手工输入
AFrom[1]:=GetDBString('ORDW0001076'); //来电记录
ActAcr300.Caption:=GetDBString('ORDW0001080'); //销售发票查询
ActAcr500.Caption:=GetDBString('ORDW0001081'); //销售折扣维护
ActAcr510.Caption:=GetDBString('ORDW0001082'); //销售发票维护
end;
procedure TOrdW00_01Form.FormCreate(Sender: TObject);
begin
inherited;
//
end;
procedure TOrdW00_01Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
//
end;
procedure TOrdW00_01Form.BrowseEvent;
begin
inherited;
Ord500_02Form:=TOrd500_02Form.Create(Application);
Ord500_02Form.OpenData(qryMasterO500A_001.AsString);
Ord500_02Form.ShowModal;
end;
procedure TOrdW00_01Form.DeleteEvent;
var
ACode:String;
begin
inherited;
//0=新建,1=报价,2=确认,3=取消,4=完成,5=执行
if qryMaster.FieldByName('O500A_004').AsInteger<>0 then
begin
ShowMsg('UMS10000531'); //不允许删除非新建状态的销售报价单
Abort;
end;
ACode:=qryMaster.FieldByName('O500A_001').AsString;
SYSDM.qryQuery.Close;
SYSDM.qryQuery.SQL.Clear;
SYSDM.qryQuery.SQL.Add('delete from ORD500B where O500B_001='+''''+ACode+'''');
SYSDM.qryQuery.ExecSQL;
DeleteTableRecord(qryMaster,'ORD500A','O500A_001='+''''+ACode+'''');
end;
procedure TOrdW00_01Form.GetAllClass(ADataSet: TADODataSet;
AcbClass: TComboBox);
begin
inherited;
GetAllCustClass(adsLists,cbClass);
end;
procedure TOrdW00_01Form.InsertEvent;
begin
inherited;
Ord500_02Form:=TOrd500_02Form.Create(Application);
Ord500_02Form.OpenData('');
Ord500_02Form.ActInsert.Execute;
Ord500_02Form.ShowModal;
end;
procedure TOrdW00_01Form.ReportGetValue(const ParName: String;
var ParValue: Variant);
begin
inherited;
end;
procedure TOrdW00_01Form.SearchEvent;
var
AClassNo:Integer;
begin
inherited;
adsLists.Locate('FName',cbClass.Text,[]);
AClassNo:=adsLists.FieldByName('FNo').AsInteger;
qryMaster.DisableControls;
qryMaster.Close;
qryMaster.SQL.Clear;
qryMaster.SQL.Add('select A.*,');
qryMaster.SQL.Add(' B.O100_002,');
qryMaster.SQL.Add(' C.O150_002,C.O150_003,C.O150_005,C.O150_006,C.O150_012,');
qryMaster.SQL.Add(' D.G100_002,D.G100_003,');
qryMaster.SQL.Add(' E.G110_002');
qryMaster.SQL.Add('from ORD500A A,ORD100 B,ORD150 C,GLD100 D,GLD110 E');
qryMaster.SQL.Add('where A.O500A_002=B.O100_001 and A.O500A_017=C.O150_001 and A.O500A_007=D.G100_001 and A.O500A_009=E.G110_001');
qryMaster.SQL.Add(' and O500A_003>='+GetDateString(edtFromDate.Date)+' and O500A_003<='+GetDateString(edtToDate.Date));
if AClassNo<>0 then qryMaster.SQL.Add(' and O150_010='+IntToStr(AClassNo));
qryMaster.SQL.Add('order by A.O500A_001');
qryMaster.Open;
qryMaster.EnableControls;
end;
procedure TOrdW00_01Form.SetModuleName;
begin
inherited;
AModule:='ORD';
AProgramID:='ORD500';
end;
procedure TOrdW00_01Form.SetProgramRights;
var
ARights:String;
begin
inherited;
ARights:=GetRights('ORD500','ORD');
ActOpen.Enabled:=ARights[1]='Y';
ActInsert.Enabled:=ARights[2]='Y';
ActUpdate.Enabled:=ARights[3]='Y';
ActDelete.Enabled:=ARights[4]='Y';
ActPrint.Enabled:=ARights[5]='Y';
ActExport.Enabled:=ARights[6]='Y';
end;
procedure TOrdW00_01Form.UpdateEvent;
begin
inherited;
//0=新建,1=报价,2=确认,3=取消,4=完成,5=执行
if qryMaster.FieldByName('O500A_004').AsInteger<>0 then
begin
ShowMsg('UMS10000530'); //不允许修改非新建状态的销售报价单
Abort;
end;
Ord500_02Form:=TOrd500_02Form.Create(Application);
Ord500_02Form.OpenData(qryMasterO500A_001.AsString);
Ord500_02Form.ActUpdate.Execute;
Ord500_02Form.ShowModal;
end;
procedure TOrdW00_01Form.ActOrdS00Execute(Sender: TObject);
var
S:String;
begin
inherited;
S:=TAction(Sender).Name;
S:=copy(S,4,6);
CreateFormInPackage('T'+S+'_01Form',True);
end;
procedure TOrdW00_01Form.dbgMasterO500A_001DrawSummaryFooter(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; var AText: String;
var AAlignment: TAlignment; AFont: TFont; var AColor: TColor;
var ADone: Boolean);
begin
inherited;
AColor:=clWhite;
AText:=GetDBString('COM00004002')+IntToStr(ARecordCount); //记录总数:
end;
procedure TOrdW00_01Form.qryMasterO500A_004GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
begin
inherited;
if qryMaster.IsEmpty then Exit;
Text:=AStatus[Sender.AsInteger];
end;
procedure TOrdW00_01Form.qryMasterO500A_010GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
begin
inherited;
if qryMaster.IsEmpty then Exit;
Text:=AFrom[Sender.AsInteger];
end;
procedure TOrdW00_01Form.qryMasterO500A_019GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
begin
inherited;
if qryMaster.IsEmpty then Exit;
Text:=APick[Sender.AsInteger];
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -