📄 ord500_02.pas.svn-base
字号:
SetDBGridB;
wwDBGrid1.ColumnByName('FItemID').DisplayLabel:=GetDBString('ORD50002070'); //产品编号
wwDBGrid1.ColumnByName('FItemName').DisplayLabel:=GetDBString('ORD50002071'); //产品名称
wwDBGrid1.ColumnByName('FItemSpec').DisplayLabel:=GetDBString('ORD50002072'); //规格型号
wwDBGrid1.ColumnByName('FUnitID').DisplayLabel:=GetDBString('ORD50002073'); //单位编号
wwDBGrid1.ColumnByName('FUnitName').DisplayLabel:=GetDBString('ORD50002074'); //单位名称
wwDBGrid1.ColumnByName('FQty').DisplayLabel:=GetDBString('ORD50002075'); //销售数量
wwDBGrid1.ColumnByName('FPrice').DisplayLabel:=GetDBString('ORD50002076'); //销售单价
wwDBGrid1.ColumnByName('FAmount').DisplayLabel:=GetDBString('ORD50002079'); //销售金额
wwDBGrid1.ColumnByName('FDisRate').DisplayLabel:=GetDBString('ORD50002077'); //折扣比率
wwDBGrid1.ColumnByName('FDisAmt').DisplayLabel:=GetDBString('ORD50002078'); //折扣金额
wwDBGrid1.ColumnByName('FNetAmt').DisplayLabel:=GetDBString('ORD50002051'); //折后总额
wwDBGrid1.ColumnByName('FTax').DisplayLabel:=GetDBString('ORD50002080'); //销售税率
wwDBGrid1.ColumnByName('FTaxAmt').DisplayLabel:=GetDBString('ORD50002081'); //销售税额
wwDBGrid1.ColumnByName('FAcrAmt').DisplayLabel:=GetDBString('ORD50002082'); //应收金额
wwDBGrid1.ColumnByName('FDate').DisplayLabel:=GetDBString('ORD50002083'); //需求日期
wwDBGrid1.ColumnByName('FFactDate').DisplayLabel:=GetDBString('ORD50002084'); //实际日期
wwDBGrid1.ColumnByName('FReceQty').DisplayLabel:=GetDBString('ORD50002085'); //发货数量
wwDBGrid1.ColumnByName('FPlace').DisplayLabel:=GetDBString('ORD50002086'); //交货地址
wwDBGrid1.ColumnByName('FRemark').DisplayLabel:=GetDBString('ORD50002087'); //备注说明
adsOrd500BFItemID.DisplayLabel:=GetDBString('ORD50002070'); //产品编号
adsOrd500BFItemName.DisplayLabel:=GetDBString('ORD50002071'); //产品名称
adsOrd500BFItemSpec.DisplayLabel:=GetDBString('ORD50002072'); //规格型号
adsOrd500BFUnitID.DisplayLabel:=GetDBString('ORD50002073'); //单位编号
adsOrd500BFUnitName.DisplayLabel:=GetDBString('ORD50002074'); //单位名称
adsOrd500BFQty.DisplayLabel:=GetDBString('ORD50002075'); //销售数量
adsOrd500BFPrice.DisplayLabel:=GetDBString('ORD50002076'); //销售单价
adsOrd500BFAmount.DisplayLabel:=GetDBString('ORD50002079'); //销售金额
adsOrd500BFDisRate.DisplayLabel:=GetDBString('ORD50002077'); //折扣比率
adsOrd500BFDisAmt.DisplayLabel:=GetDBString('ORD50002078'); //折扣金额
adsOrd500BFNetAmt.DisplayLabel:=GetDBString('ORD50002051'); //折后总额
adsOrd500BFTax.DisplayLabel:=GetDBString('ORD50002080'); //销售税率
adsOrd500BFTaxAmt.DisplayLabel:=GetDBString('ORD50002081'); //销售税额
adsOrd500BFAcrAmt.DisplayLabel:=GetDBString('ORD50002082'); //应收金额
adsOrd500BFDate.DisplayLabel:=GetDBString('ORD50002083'); //需求日期
adsOrd500BFFactDate.DisplayLabel:=GetDBString('ORD50002084'); //实际日期
adsOrd500BFReceQty.DisplayLabel:=GetDBString('ORD50002085'); //发货数量
adsOrd500BFPlace.DisplayLabel:=GetDBString('ORD50002086'); //交货地址
adsOrd500BFRemark.DisplayLabel:=GetDBString('ORD50002087'); //备注说明
qryOrd150O150_002.DisplayLabel:=GetDBString('ORD50002088'); //客户编号
qryOrd150O150_003.DisplayLabel:=GetDBString('ORD50002089'); //客户名称
qryOrd150O150_004.DisplayLabel:=GetDBString('ORD50002090'); //客户简称
qryOrd150O150_005.DisplayLabel:=GetDBString('ORD50002091'); //电话号码
qryOrd150O150_006.DisplayLabel:=GetDBString('ORD50002092'); //传真号码
qryOrd150O120_002.DisplayLabel:=GetDBString('ORD50002093'); //所属地区
qryOrd150O150_012.DisplayLabel:=GetDBString('ORD50002094'); //客户地址
qryOrd150O151_002.DisplayLabel:=GetDBString('ORD50002095'); //联系人员
qryOrd150O151_003.DisplayLabel:=GetDBString('ORD50002096'); //部门名称
qryOrd150O151_004.DisplayLabel:=GetDBString('ORD50002097'); //职务名称
qryOrd152O152_002.DisplayLabel:=GetDBString('ORD50002098'); //交货地点
qryOrd152O120_002.DisplayLabel:=GetDBString('ORD50002099'); //所属地区
qryOrd152O152_004.DisplayLabel:=GetDBString('ORD50002100'); //交货地址
qryOrd152O152_005.DisplayLabel:=GetDBString('ORD50002101'); //邮政编码
qryOrd152O152_006.DisplayLabel:=GetDBString('ORD50002102'); //电话号码
qryOrd152O152_007.DisplayLabel:=GetDBString('ORD50002103'); //传真号码
qryOrd152O151_002.DisplayLabel:=GetDBString('ORD50002104'); //联系人员
qryOrd152O151_003.DisplayLabel:=GetDBString('ORD50002105'); //部门名称
qryOrd152O151_004.DisplayLabel:=GetDBString('ORD50002106'); //职务名称
qryOrd160O160_002.DisplayLabel:=GetDBString('ORD50002107'); //条款编号
qryOrd160O160_003.DisplayLabel:=GetDBString('ORD50002108'); //条款名称
qryItemsI150_002.DisplayLabel:=GetDBString('ORD50002109'); //产品编号
qryItemsI150_003.DisplayLabel:=GetDBString('ORD50002110'); //产品名称
qryItemsI150_004.DisplayLabel:=GetDBString('ORD50002111'); //规格型号
qryItemsI140_002.DisplayLabel:=GetDBString('ORD50002112'); //单位编号
qryItemsI140_003.DisplayLabel:=GetDBString('ORD50002113'); //单位名称
qryChargeI150_002.DisplayLabel:=qryItemsI150_002.DisplayLabel; //产品编号
qryChargeI150_003.DisplayLabel:=qryItemsI150_003.DisplayLabel; //产品名称
qryChargeI150_004.DisplayLabel:=qryItemsI150_004.DisplayLabel; //规格型号
qryChargeI140_002.DisplayLabel:=qryItemsI140_002.DisplayLabel; //单位编号
qryChargeI140_003.DisplayLabel:=qryItemsI140_003.DisplayLabel; //单位名称
qryInv140I140_002.DisplayLabel:=GetDBString('ORD50002114'); //单位编号
qryInv140I140_003.DisplayLabel:=GetDBString('ORD50002115'); //单位名称
wwDBGrid2.ColumnByName('FItemID').DisplayLabel:=GetDBString('ORD50002116'); //项目编号
wwDBGrid2.ColumnByName('FItemName').DisplayLabel:=GetDBString('ORD50002117'); //项目名称
wwDBGrid2.ColumnByName('FAmount').DisplayLabel:=GetDBString('ORD50002118'); //金额
wwDBGrid2.ColumnByName('FRemark').DisplayLabel:=GetDBString('ORD50002119'); //备注
PageControl1.ActivePageIndex:=0;
PageControl2.ActivePageIndex:=0;
//报价类型
cbType.Clear;
qryOrd100.Close;
qryOrd100.Open;
while not qryOrd100.Eof do
begin
cbType.Items.Add(qryOrd100.FieldByName('O100_002').AsString);
qryOrd100.Next;
end;
qryOrd100.First;
cbType.ItemIndex:=0;
//报价状态(0=新建,1=确认,2=报价,3=完成,4=取消)
AStatus[0]:=GetDBString('ORD50002120'); //新建
AStatus[1]:=GetDBString('ORD50002122'); //确认
AStatus[2]:=GetDBString('ORD50002121'); //报价
AStatus[3]:=GetDBString('ORD50002124'); //完成
AStatus[4]:=GetDBString('ORD50002123'); //取消
AStatus[5]:=GetDBString('ORD50002149'); //执行
Action1.Caption:=AStatus[1]; //确定
Action2.Caption:=AStatus[2]; //报价
Action3.Caption:=AStatus[3]; //完成
Action4.Caption:=AStatus[4]; //取消
//提货方式(0=自提,1=送货,2=托运,3=邮寄,4=快递)
APick[0]:=GetDBString('ORD50002125'); //自提
APick[1]:=GetDBString('ORD50002126'); //送货
APick[2]:=GetDBString('ORD50002127'); //托运
APick[3]:=GetDBString('ORD50002128'); //邮寄
APick[4]:=GetDBString('ORD50002129'); //快递
cbPick.Clear;
cbPick.Items.Add(APick[0]);
cbPick.Items.Add(APick[1]);
cbPick.Items.Add(APick[2]);
cbPick.Items.Add(APick[3]);
cbPick.Items.Add(APick[4]);
cbPick.ItemIndex:=0;
//币别名称
cbCurr.Clear;
qryGld100.Close;
qryGld100.Open;
while not qryGld100.Eof do
begin
cbCurr.Items.Add(qryGld100.FieldByName('G100_003').AsString);
qryGld100.Next;
end;
qryGld100.First;
cbCurr.ItemIndex:=0;
//付款方式
cbPayment.Clear;
qryGld110.Close;
qryGld110.Open;
while not qryGld110.Eof do
begin
cbPayment.Items.Add(qryGld110.FieldByName('G110_002').AsString);
qryGld110.Next;
end;
qryGld110.First;
cbPayment.ItemIndex:=0;
//来源类型(0=手工输入,1=来电记录)
AFrom[0]:=GetDBString('ORD50002130'); //手工输入
AFrom[1]:=GetDBString('ORD50002131'); //来电记录
cbFrom.Clear;
cbFrom.Items.Add(AFrom[0]);
cbFrom.Items.Add(AFrom[1]);
cbFrom.ItemIndex:=0;
qryOrd153.FieldByName('I150_002').DisplayLabel:=GetDBString('ORD50002132'); //产品编号
qryOrd153.FieldByName('I150_003').DisplayLabel:=GetDBString('ORD50002133'); //产品名称
qryOrd153.FieldByName('O153_003').DisplayLabel:=GetDBString('ORD50002134'); //机身编号
qryOrd153.FieldByName('I150_004').DisplayLabel:=GetDBString('ORD50002135'); //规格型号
qryOrd153.FieldByName('I120_003').DisplayLabel:=GetDBString('ORD50002136'); //产品类别
qryOrd153.FieldByName('O150_002').DisplayLabel:=GetDBString('ORD50002137'); //制造商号
qryOrd153.FieldByName('O150_003').DisplayLabel:=GetDBString('ORD50002138'); //制造商名
tsProduct.Caption:=GetDBString('ORD50002139'); //产品信息
// tsDate.Caption:=GetDBString('ORD50002141'); //保养信息
lblItem.Caption:=GetDBString('ORD50002142'); //产品编号
lblMacNo.Caption:=GetDBString('ORD50002143'); //机身编号
lblModel.Caption:=GetDBString('ORD50002144'); //规格型号
lblItemClass.Caption:=GetDBString('ORD50002145'); //产品类别
lblMaker.Caption:=GetDBString('ORD50002146'); //制造商号
lblMakerName.Caption:=GetDBString('ORD50002147'); //制造商名
end;
procedure TOrd500_02Form.FormCreate(Sender: TObject);
begin
inherited;
ATableName:='ORD500A';
AFieldName:='O500A_001';
qryHrm150.Open;
qryOrd150.Open;
qryOrd151.Open;
qryOrd152.Open;
qryOrd160.Open;
qryInv140.Open;
qryItems.Open;
qryCharge.Open;
qryOrd153.Open;
AKeyEvent:=OnKeyDown;
end;
procedure TOrd500_02Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
qryGld100.Close;
qryGld110.Close;
qryHrm150.Close;
qryOrd100.Close;
qryOrd150.Close;
qryOrd152.Close;
qryOrd160.Close;
qryInv140.Close;
qryItems.Close;
qryCharge.Close;
qryOrd153.Close;
end;
procedure TOrd500_02Form.DeleteEvent;
var
ACode:String;
begin
inherited;
//0=新建,1=确认,2=报价,3=完成,4=取消,5=执行
if ADOQuery1.FieldByName('O500A_004').AsInteger<>0 then
begin
ShowMsg('UMS10000531'); //不允许删除非新建状态的销售报价单
Abort;
end;
ACode:=ADOQuery1.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(ADOQuery1,'ORD500A','O500A_001='+''''+ACode+'''');
end;
procedure TOrd500_02Form.GetDataInfo;
var
ACustNo,ASaleNo,AItemNo:Integer;
begin
inherited;
edtCode.Text:=ADOQuery1.FieldByName('O500A_001').AsString; //报价单号
qryOrd100.Locate('O100_001',ADOQuery1.FieldByName('O500A_002').Value,[]);
cbType.ItemIndex:=cbType.Items.IndexOf(qryOrd100.FieldByName('O100_002').AsString); //报价类型
edtDate.Date:=ADOQuery1.FieldByName('O500A_003').Value; //报价日期
edtStatus.Text:=AStatus[ADOQuery1.FieldByName('O500A_004').AsInteger]; //报价状态(0=新建,1=确认,2=报价,3=完成,4=取消)
edtPerson.Text:='';
edtPersonName.Text:='';
ASaleNo:=ADOQuery1.FieldByName('O500A_005').AsInteger;
if qryHrm150.Locate('H150_001',ASaleNo,[]) then
begin
edtPerson.Text:=qryHrm150.FieldByName('H150_002').AsString; //销售人员
edtPersonName.Text:=qryHrm150.FieldByName('H150_003').AsString;
end;
//币别编号
qryGld100.Locate('G100_001',ADOQuery1.FieldByName('O500A_007').Value,[]);
cbCurr.ItemIndex:=cbCurr.Items.IndexOf(qryGld100.FieldByName('G100_003').AsString);
edtRate.Text:=ADOQuery1.FieldByName('O500A_008').AsString; //币别汇率
qryGld110.Locate('G110_001',ADOQuery1.FieldByName('O500A_009').Value,[]);
cbPayment.ItemIndex:=cbPayment.Items.IndexOf(ADOQuery1.FieldByName('G110_002').AsString); //付款方式
cbFrom.ItemIndex:=ADOQuery1.FieldByName('O500A_010').AsInteger; //来源类型
edtMacNo.Text:=ADOQuery1.FieldByName('O500A_011').AsString; //机身编号
edtAmount.Text:=ADOQuery1.FieldByName('O500A_012').AsString; //金额总计
edtDisRate.Text:=ADOQuery1.FieldByName('O500A_013').AsString; //折扣比率
edtDiscount.Text:=ADOQuery1.FieldByName('O500A_014').AsString; //折扣金额
edtSumCharge.Text:=ADOQuery1.FieldByName('O500A_015').AsString; //特殊费用
edtNetAmt.Text:=ADOQuery1.FieldByName('O500A_016').AsString; //应收金额
ACustNo:=ADOQuery1.FieldByName('O500A_017').Value;
qryOrd150.Locate('O150_001',ACustNo,[]); //客户编号
edtCust.Text:=qryOrd150.FieldByName('O150_002').AsString; //客户编号
edtCustName.Text:=qryOrd150.FieldByName('O150_003').AsString; //客户名称
edtAddress.Text:=qryOrd150.FieldByName('O150_012').AsString; //客户地址
edtPhone.Text:=qryOrd150.FieldByName('O150_005').AsString; //电话号码
edtFax.Text:=qryOrd150.FieldByName('O150_006').AsString; //传真号码
edtContact.Text:=qryOrd150.FieldByName('O151_002').AsString; //联系人员
edtDept.Text:=qryOrd150.FieldByName('O151_003').AsString; //部门名称
edtPosit.Text:=qryOrd150.FieldByName('O151_004').AsString; //职务名称
cbPick.ItemIndex:=ADOQuery1.FieldByName('O500A_019').AsInteger; //提货方式(0=自提,1=送货,2=托运,3=邮寄,4=快递)
memTerm.Text:=ADOQuery1.FieldByName('O500A_020').AsString; //销售条款
memRemark.Text:=ADOQuery1.FieldByName('O500A_021').AsString; //备注说明
edtCreateDate.Text:=ADOQuery1.FieldByName('O500A_022').AsString; //制单日期
edtCreateBy.Text:=ADOQuery1.FieldByName('O500A_023').AsString; //制单人员
edtUpdateDate.Text:=ADOQuery1.FieldByName('O500A_024').AsString; //修改日期
edtUpdateBy.Text:=ADOQuery1.FieldByName('O500A_025').AsString; //修改人员
UpDown1.Position:=ADOQuery1.FieldByName('O500A_027').AsInteger; //优先级别
edtReporter.Text:=ADOQuery1.FieldByName('FReporter').AsString; //报价人员
edtReporterName.Text:=ADOQuery1.FieldByName('FReporterName').AsString; //人员名称
GetCustPlaceInfo;
qryOrd152.Locate('O152_002',ADOQuery1.FieldByName('O500A_018').AsString,[]); //交货地址
edtPlace.Text:=qryOrd152.FieldByName('O152_002').AsString; //交货地址
edtRegion.Text:=qryOrd152.FieldByName('O120_002').AsString; //所属地区
edtPlaceAddress.Text:=qryOrd152.FieldByName('O152_004').AsString;
edtPlacePhone.Text:=qryOrd152.FieldByName('O152_006').AsString;
edtPlaceFax.Text:=qryOrd152.FieldByName('O152_007').AsString;
edtPlaceContact.Text:=qryOrd152.FieldByName('O151_002').AsString;
edtPlaceDept.Text:=qryOrd152.FieldByName('O151_003').AsString;
edtPlacePosit.Text:=qryOrd152.FieldByName('O151_004').AsString;
if not (ADOQuery1.FieldByName('O500A_026').Value='') then
begin
if qryOrd151.Locate('O151_001;O151_002',VarArrayOf([qryOrd150O150_001.value,ADOQuery1O500A_026.value]),[]) then
begin
edtPlaceContact.Text:=qryOrd151.FieldByName('O151_002').AsString;
edtPlaceDept.Text:=qryOrd151.FieldByName('O151_003').AsString;
edtPlacePhone.Text:=qryOrd151.FieldByName('O151_005').AsString;
edtPlaceFax.Text:=qryOrd151.FieldByName('O151_006').AsString;
edtPlacePosit.Text:=qryOrd151.FieldByName('O151_004').AsString;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -