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

📄 purw00_01.pas.svn-base

📁 这是一个功能齐全的,代码完整的ERP企业信息管理系统,现在上传和大家分享
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
  qryMasterP510A_001.DisplayLabel:=GetDBString('PURW0001034');  //采购单号
  qryMasterP100_002.DisplayLabel:=GetDBString('PURW0001035');  //采购类型
  qryMasterP510A_003.DisplayLabel:=GetDBString('PURW0001036');  //采购日期
  qryMasterP510A_004.DisplayLabel:=GetDBString('PURW0001037');  //定单状态
  qryMasterH150_002.DisplayLabel:=GetDBString('PURW0001038');  //采购员号
  qryMasterH150_003.DisplayLabel:=GetDBString('PURW0001039');  //采购员名
  qryMasterG100_002.DisplayLabel:=GetDBString('PURW0001040');  //币别编号
  qryMasterG100_003.DisplayLabel:=GetDBString('PURW0001041');  //币别名称
  qryMasterP510A_008.DisplayLabel:=GetDBString('PURW0001042');  //币别汇率
  qryMasterG110_002.DisplayLabel:=GetDBString('PURW0001043');  //付款方式
  qryMasterP510A_010.DisplayLabel:=GetDBString('PURW0001044');  //来源类型
  qryMasterP510A_011.DisplayLabel:=GetDBString('PURW0001045');  //来源单号
  qryMasterP510A_012.DisplayLabel:=GetDBString('PURW0001046');  //金额总计
  qryMasterP510A_013.DisplayLabel:=GetDBString('PURW0001047');  //折扣比率
  qryMasterP510A_014.DisplayLabel:=GetDBString('PURW0001048');  //折扣金额
  qryMasterP510A_015.DisplayLabel:=GetDBString('PURW0001049');  //特殊费用
  qryMasterP510A_016.DisplayLabel:=GetDBString('PURW0001050');  //应收金额
  qryMasterO150_002.DisplayLabel:=GetDBString('PURW0001051');  //供应商号
  qryMasterO150_003.DisplayLabel:=GetDBString('PURW0001052');  //供应商名
  qryMasterO150_005.DisplayLabel:=GetDBString('PURW0001053');  //电话号码
  qryMasterO150_006.DisplayLabel:=GetDBString('PURW0001054');  //传真号码
  qryMasterO150_012.DisplayLabel:=GetDBString('PURW0001055');  //厂商址址
  qryMasterP510A_018.DisplayLabel:=GetDBString('PURW0001056');  //交货地址
  qryMasterP510A_019.DisplayLabel:=GetDBString('PURW0001057');  //提货方式
  qryMasterP510A_020.DisplayLabel:=GetDBString('PURW0001058');  //采购条款
  qryMasterP510A_021.DisplayLabel:=GetDBString('PURW0001059');  //备注说明
  qryMasterP510A_022.DisplayLabel:=GetDBString('PURW0001060');  //制单日期
  qryMasterP510A_023.DisplayLabel:=GetDBString('PURW0001061');  //制单人员
  qryMasterP510A_024.DisplayLabel:=GetDBString('PURW0001062');  //修改日期
  qryMasterP510A_025.DisplayLabel:=GetDBString('PURW0001063');  //修改人员

  //定单状态(0=新建,1=核准,2=执行,3=收货,4=完成,5=取消)
  AStatus[0]:=GetDBString('PURW0001064');  //新建
  AStatus[1]:=GetDBString('PURW0001065');  //核准
  AStatus[2]:=GetDBString('PURW0001066');  //执行
  AStatus[3]:=GetDBString('PURW0001067');  //收货
  AStatus[4]:=GetDBString('PURW0001068');  //完成
  AStatus[5]:=GetDBString('PURW0001069');  //取消

  //提货方式(0=自提,1=送货,2=托运,3=邮寄,4=快递)
  APick[0]:=GetDBString('PURW0001070');  //自提
  APick[1]:=GetDBString('PURW0001071');  //送货
  APick[2]:=GetDBString('PURW0001072');  //托运
  APick[3]:=GetDBString('PURW0001073');  //邮寄
  APick[4]:=GetDBString('PURW0001074');  //快递

  //来源类型(0=手工输入,1=采购申请,2=采购合同,3=销售定单)
  AFrom[0]:=GetDBString('PURW0001075');  //手工输入
  AFrom[1]:=GetDBString('PURW0001076');  //采购申请
  AFrom[2]:=GetDBString('PURW0001077');  //采购合同
  AFrom[3]:=GetDBString('PURW0001078');  //销售定单

  ActAcp300.Caption:=GetDBString('PURW0001079');  //采购发票查询
  ActAcp500.Caption:=GetDBString('PURW0001080');  //采购折扣维护
  ActAcp510.Caption:=GetDBString('PURW0001081');  //采购发票维护
end;

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

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

procedure TPurW00_01Form.BrowseEvent;
begin
  inherited;
  Pur510_02Form:=TPur510_02Form.Create(Application);
  Pur510_02Form.OpenData(qryMasterP510A_001.AsString);
  Pur510_02Form.ShowModal;
end;

procedure TPurW00_01Form.DeleteEvent;
var
  ACode:String;
begin
  inherited;
  //0=新建,1=核准,2=执行,3=收货,4=完成,5=取消
  if qryMaster.FieldByName('P510A_004').AsInteger<>0 then
  begin
    ShowMsg('UMS10000551');  //不允许删除非新建状态的采购定单
    Abort;
  end;
  ACode:=qryMaster.FieldByName('P510A_001').AsString;
  SYSDM.qryQuery.Close;
  SYSDM.qryQuery.SQL.Clear;
  SYSDM.qryQuery.SQL.Add('delete from PUR510B where P510B_001='+''''+ACode+'''');
  SYSDM.qryQuery.ExecSQL;
  DeleteTableRecord(qryMaster,'PUR510A','P510A_001='+''''+ACode+'''');
end;

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

procedure TPurW00_01Form.InsertEvent;
begin
  inherited;
  Pur510_02Form:=TPur510_02Form.Create(Application);
  Pur510_02Form.OpenData('');
  Pur510_02Form.ActInsert.Execute;
  Pur510_02Form.ShowModal;
end;

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

end;

procedure TPurW00_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.P100_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 PUR510A A,PUR100 B,ORD150 C,GLD100 D,GLD110 E');
  qryMaster.SQL.Add('where A.P510A_002=B.P100_001 and A.P510A_017=C.O150_001 and A.P510A_007=D.G100_001 and A.P510A_009=E.G110_001');
  qryMaster.SQL.Add('      and P510A_003>='+GetDateString(edtFromDate.Date)+' and P510A_003<='+GetDateString(edtToDate.Date));
  if AClassNo<>0 then qryMaster.SQL.Add(' and O150_010='+IntToStr(AClassNo));
  qryMaster.SQL.Add('order by A.P510A_001');
  qryMaster.Open;
  qryMaster.EnableControls;
end;

procedure TPurW00_01Form.SetModuleName;
begin
  inherited;
  AModule:='PUR';
  AProgramID:='PUR510';
end;

procedure TPurW00_01Form.SetProgramRights;
var
  ARights:String;
begin
  inherited;
  ARights:=GetRights('PUR510','PUR');
  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 TPurW00_01Form.UpdateEvent;
begin
  inherited;
  //0=新建,1=核准,2=执行,3=收货,4=完成,5=取消
  if qryMaster.FieldByName('P510A_004').AsInteger<>0 then
  begin
    ShowMsg('UMS10000532');  //不允许修改非新建状态的销售定单
    Abort;
  end;
  Pur510_02Form:=TPur510_02Form.Create(Application);
  Pur510_02Form.OpenData(qryMasterP510A_001.AsString);
  Pur510_02Form.ActUpdate.Execute;
  Pur510_02Form.ShowModal;
end;

procedure TPurW00_01Form.ActPurS00Execute(Sender: TObject);
var
  S:String;
begin
  inherited;
  S:=TAction(Sender).Name;
  S:=copy(S,4,6);
  CreateFormInPackage('T'+S+'_01Form',True);
end;

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

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

procedure TPurW00_01Form.qryMasterP510A_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 + -