⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ordw01_01.pas.svn-base

📁 这是一个功能齐全的,代码完整的ERP企业信息管理系统,现在上传和大家分享
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
  tlbOrd510.Caption:=GetDBString('ORDW0101031');  //销售定单
  tlbExit.Caption:=GetDBString('ORDW0101032');  //退出

  lblClass.Caption:=GetDBString('ORDW0101033');  //客户类别
  pnLists.Caption:=GetDBString('ORDW0101034');  //客户类别

  qryMasterO510A_001.DisplayLabel:=GetDBString('ORDW0101035');  //销售单号
  qryMasterO100_002.DisplayLabel:=GetDBString('ORDW0101036');  //销售类型
  qryMasterO510A_003.DisplayLabel:=GetDBString('ORDW0101037');  //销售日期
  qryMasterO510A_004.DisplayLabel:=GetDBString('ORDW0101038');  //定单状态
  qryMasterH150_002.DisplayLabel:=GetDBString('ORDW0101039');  //销售员号
  qryMasterH150_003.DisplayLabel:=GetDBString('ORDW0101040');  //销售员名
  qryMasterG100_002.DisplayLabel:=GetDBString('ORDW0101041');  //币别编号
  qryMasterG100_003.DisplayLabel:=GetDBString('ORDW0101042');  //币别名称
  qryMasterO510A_008.DisplayLabel:=GetDBString('ORDW0101043');  //币别汇率
  qryMasterG110_002.DisplayLabel:=GetDBString('ORDW0101044');  //付款方式
  qryMasterO510A_010.DisplayLabel:=GetDBString('ORDW0101045');  //来源类型
  qryMasterO510A_011.DisplayLabel:=GetDBString('ORDW0101046');  //来源单号
  qryMasterO510A_012.DisplayLabel:=GetDBString('ORDW0101047');  //金额总计
  qryMasterO510A_013.DisplayLabel:=GetDBString('ORDW0101048');  //折扣比率
  qryMasterO510A_014.DisplayLabel:=GetDBString('ORDW0101049');  //折扣金额
  qryMasterO510A_015.DisplayLabel:=GetDBString('ORDW0101050');  //特殊费用
  qryMasterO510A_016.DisplayLabel:=GetDBString('ORDW0101051');  //应收金额
  qryMasterO150_002.DisplayLabel:=GetDBString('ORDW0101052');  //客户编号
  qryMasterO150_003.DisplayLabel:=GetDBString('ORDW0101053');  //客户名称
  qryMasterO150_005.DisplayLabel:=GetDBString('ORDW0101054');  //电话号码
  qryMasterO150_006.DisplayLabel:=GetDBString('ORDW0101055');  //传真号码
  qryMasterO150_012.DisplayLabel:=GetDBString('ORDW0101056');  //客户址址
  qryMasterO510A_018.DisplayLabel:=GetDBString('ORDW0101057');  //交货地址
  qryMasterO510A_019.DisplayLabel:=GetDBString('ORDW0101058');  //提货方式
  qryMasterO510A_020.DisplayLabel:=GetDBString('ORDW0101059');  //销售条款
  qryMasterO510A_021.DisplayLabel:=GetDBString('ORDW0101060');  //备注说明
  qryMasterO510A_022.DisplayLabel:=GetDBString('ORDW0101061');  //制单日期
  qryMasterO510A_023.DisplayLabel:=GetDBString('ORDW0101062');  //制单人员
  qryMasterO510A_024.DisplayLabel:=GetDBString('ORDW0101063');  //修改日期
  qryMasterO510A_025.DisplayLabel:=GetDBString('ORDW0101064');  //修改人员

  //定单状态(0=新建,1=执行,2=发货,3=取消,4=锁定,5=完成)
  AStatus[0]:=GetDBString('ORDW0101065');  //新建
  AStatus[1]:=GetDBString('ORDW0101066');  //执行
  AStatus[2]:=GetDBString('ORDW0101067');  //发货
  AStatus[3]:=GetDBString('ORDW0101068');  //取消
  AStatus[4]:=GetDBString('ORDW0101069');  //锁定
  AStatus[5]:=GetDBString('ORDW0101077');  //完成

  //提货方式(0=自提,1=送货,2=托运,3=邮寄,4=快递)
  APick[0]:=GetDBString('ORDW0101070');  //自提
  APick[1]:=GetDBString('ORDW0101071');  //送货
  APick[2]:=GetDBString('ORDW0101072');  //托运
  APick[3]:=GetDBString('ORDW0101073');  //邮寄
  APick[4]:=GetDBString('ORDW0101074');  //快递

  //来源类型(0=手工输入,1=销售报价,2=销售合同)
  AFrom[0]:=GetDBString('ORDW0101075');  //手工输入
  AFrom[1]:=GetDBString('ORDW0101076');  //销售报价
  AFrom[2]:=GetDBString('ORDW0101078');  //销售合同

  ActAcr300.Caption:=GetDBString('ORDW0101081');  //销售发票查询
  ActAcr500.Caption:=GetDBString('ORDW0101082');  //销售折扣维护
  ActAcr510.Caption:=GetDBString('ORDW0101083');  //销售发票维护
end;

procedure TOrdW01_01Form.FormCreate(Sender: TObject);
begin
  inherited;
//
end;

procedure TOrdW01_01Form.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
//
end;

procedure TOrdW01_01Form.BrowseEvent;
begin
  inherited;
  Ord510_02Form:=TOrd510_02Form.Create(Application);
  Ord510_02Form.OpenData(qryMasterO510A_001.AsString);
  Ord510_02Form.ShowModal;
end;

procedure TOrdW01_01Form.DeleteEvent;
var
  ACode:String;
begin
  inherited;
  //0=新建,1=执行,2=发货,3=取消,4=锁定,5=完成
  if qryMaster.FieldByName('O510A_004').AsInteger<>0 then
  begin
    ShowMsg('UMS10000533');  //不允许删除非新建状态的销售定单
    Abort;
  end;
  ACode:=qryMaster.FieldByName('O510A_001').AsString;
  //更新报价单的状态,当销售定单删除时,删除前调用
  UpdataOrd500(ACode);
  //删除销售定单
  SYSDM.qryQuery.Close;
  SYSDM.qryQuery.SQL.Clear;
  SYSDM.qryQuery.SQL.Add('delete from ORD510B where O510B_001='+''''+ACode+'''');
  SYSDM.qryQuery.ExecSQL;
  DeleteTableRecord(qryMaster,'ORD510A','O510A_001='+''''+ACode+'''');
end;

procedure TOrdW01_01Form.GetAllClass(ADataSet: TADODataSet;
  AcbClass: TComboBox);
begin
  inherited;
  GetAllCustClass(adsLists,cbClass);
end;

procedure TOrdW01_01Form.InsertEvent;
begin
  inherited;
  Ord510_02Form:=TOrd510_02Form.Create(Application);
  Ord510_02Form.OpenData('');
  Ord510_02Form.ActInsert.Execute;
  Ord510_02Form.ShowModal;
end;

procedure TOrdW01_01Form.ReportGetValue(const ParName: String;
  var ParValue: Variant);
begin
  inherited;

end;

procedure TOrdW01_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 ORD510A A,ORD100 B,ORD150 C,GLD100 D,GLD110 E');
  qryMaster.SQL.Add('where A.O510A_002=B.O100_001 and A.O510A_017=C.O150_001 and A.O510A_007=D.G100_001 and A.O510A_009=E.G110_001');
  qryMaster.SQL.Add('      and O510A_003>='+GetDateString(edtFromDate.Date)+' and O510A_003<='+GetDateString(edtToDate.Date));
  if AClassNo<>0 then qryMaster.SQL.Add(' and O150_010='+IntToStr(AClassNo));
  qryMaster.SQL.Add('order by A.O510A_001');
  qryMaster.Open;
  qryMaster.EnableControls;
end;

procedure TOrdW01_01Form.SetModuleName;
begin
  inherited;
  AModule:='ORD';
  AProgramID:='ORD510';
end;

procedure TOrdW01_01Form.SetProgramRights;
var
  ARights:String;
begin
  inherited;
  ARights:=GetRights('ORD510','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 TOrdW01_01Form.UpdateEvent;
begin
  inherited;
  //0=新建,1=执行,2=发货,3=取消,4=锁定,5=完成
  if qryMaster.FieldByName('O510A_004').AsInteger<>0 then
  begin
    ShowMsg('UMS10000532');  //不允许修改非新建状态的销售定单
    Abort;
  end;
  Ord510_02Form:=TOrd510_02Form.Create(Application);
  Ord510_02Form.OpenData(qryMasterO510A_001.AsString);
  Ord510_02Form.ActUpdate.Execute;
  Ord510_02Form.ShowModal;
end;

procedure TOrdW01_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 TOrdW01_01Form.dbgMasterO510A_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 TOrdW01_01Form.qryMasterO510A_004GetText(Sender: TField;
  var Text: String; DisplayText: Boolean);
begin
  inherited;
  if qryMaster.IsEmpty then Exit;
  Text:=AStatus[Sender.AsInteger];
end;

procedure TOrdW01_01Form.qryMasterO510A_010GetText(Sender: TField;
  var Text: String; DisplayText: Boolean);
begin
  inherited;
  if qryMaster.IsEmpty then Exit;
  Text:=AFrom[Sender.AsInteger];
end;

procedure TOrdW01_01Form.qryMasterO510A_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 + -