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

📄 acpcomm.pas.svn-base

📁 这是一个功能齐全的,代码完整的ERP企业信息管理系统,现在上传和大家分享
💻 SVN-BASE
字号:
unit AcpComm;

interface
uses
  Classes, SysUtils, Controls, Windows, Forms, ComCtrls, CommCtrl, DBGrids,
  Messages, Graphics, ADODB, ActiveX, SYSDATA, Dialogs, atScript, CommFun,
  atPascal, Variants, StdCtrls, DB;

type

PAccountInfo = ^TAccountInfo;
TAccountInfo = record
  ACustNo:integer;      //客户编号
  ACurrNo:integer;      //币别编号
  AInOut:integer;       //收支类型
  ABillNo:Integer;      //顺序单号
  ADate:TDateTime;      //日期
  AAmount:Double;       //金额
end;

//取得采购价格和总额折扣函数:
procedure GetSalePrice(AOrderInfo:TOrderInfo; var APriceInfo:TPriceInfo);

//加入采购产品
procedure AddItemLine(AOrderInfo:TOrderInfo;AItemInfo:TItemInfo;ADataSet:TADODataSet;AType:String='UPD');

procedure GetAccountInfo(ACode:String;AType:string;AMode:string;var AAccountInfo:TAccountInfo;AOrderType:Integer);
implementation
//实现函数和过程的代码

//取得采购价格和总额折扣函数:
procedure GetSalePrice(AOrderInfo:TOrderInfo; var APriceInfo:TPriceInfo);
begin


end;

//加入采购产品
procedure AddItemLine(AOrderInfo:TOrderInfo;AItemInfo:TItemInfo;ADataSet:TADODataSet;AType:String='UPD');
var
  APriceInfo:TPriceInfo;
begin
  //取得产品价格
  GetSalePrice(AOrderInfo,APriceInfo);
  if not (ADataSet.State in [dsInsert,dsEdit]) then
    if (ADataSet.IsEmpty) or (AType='ADD') then ADataSet.Append else ADataSet.Edit;
  ADataSet.FieldByName('FItemNo').Value:=AItemInfo.ItemNo;
  ADataSet.FieldByName('FItemID').Value:=AItemInfo.ItemID;
  ADataSet.FieldByName('FItemName').Value:=AItemInfo.ItemName;
  ADataSet.FieldByName('FItemSpec').Value:=AItemInfo.ItemSpec;
  ADataSet.FieldByName('FUnitNo').Value:=AItemInfo.UnitNo;
  ADataSet.FieldByName('FUnitID').Value:=AItemInfo.UnitID;
  ADataSet.FieldByName('FUnitName').Value:=AItemInfo.UnitName;
  ADataSet.FieldByName('FQty').Value:=AOrderInfo.OrderQty;
  ADataSet.FieldByName('FPrice').Value:=APriceInfo.StdPrice;
  ADataSet.FieldByName('FAmount').Value:=APriceInfo.OrderAmt;
  ADataSet.FieldByName('FDisRate').Value:=APriceInfo.DisRate;
  ADataSet.FieldByName('FDisAmt').Value:=APriceInfo.DisAmt;
  ADataSet.FieldByName('FNetAmt').Value:=APriceInfo.NetAmt;
  ADataSet.FieldByName('FTax').Value:=0;
  ADataSet.FieldByName('FTaxAmt').Value:=0;
  ADataSet.FieldByName('FAcrAmt').Value:=APriceInfo.NetAmt;
  ADataSet.FieldByName('FDate').Value:=AOrderInfo.OrderDate;
  ADataSet.FieldByName('FFactDate').Value:=null;
  ADataSet.FieldByName('FReceQty').Value:=null;
  ADataSet.FieldByName('FPlace').Value:=null;
  ADataSet.FieldByName('FFromID').Value:=null;
  ADataSet.FieldByName('FLineNo').Value:=null;
  ADataSet.FieldByName('FRemark').Value:=null;
  ADataSet.FieldByName('FIsBySum').Value:=APriceInfo.IsBySum;
  ADataSet.FieldByName('FUnitRate').Value:=GetUnitRate(AOrderInfo.CustNo,AItemInfo.ItemNo,AItemInfo.UnitNo);
  if AType='UPD' then Exit;
  ADataSet.Post;
end;
procedure GetAccountInfo(ACode:String;AType:string;AMode:string;var AAccountInfo:TAccountInfo;AOrderType:Integer);
begin
//销售发票
  if AType='ACR510' then
  begin
    if (AMode='UPD') or (AMode='DEL') then
    begin
      SYSDM.qryQuery.Close;
      SYSDM.qryQuery.SQL.Clear;
      SYSDM.qryQuery.SQL.Add('select * from CSH610 where C610_010='+''''+ACode+''''+' and C610_012=1');
      SYSDM.qryQuery.Open;
      if not SYSDM.qryQuery.Eof then
        AAccountInfo.ABillNo:=SYSDM.qryQuery.FieldByName('C610_011').Value
      else
          AAccountInfo.ABillNo:=0;
    end;
    SYSDM.qryQuery.Close;
    SYSDM.qryQuery.SQL.Clear;
    SYSDM.qryQuery.SQL.Add('select * from ACR510A where A510A_001='+''''+ACode+'''');
    SYSDM.qryQuery.Open;
    AAccountInfo.ADate:=SYSDM.qryQuery.FieldByName('A510A_004').Value;
    AAccountInfo.AAmount:=SYSDM.qryQuery.FieldByName('A510A_009').Value;
    if AOrderType=1 then
      AAccountInfo.AAmount:=AAccountInfo.AAmount*-1;
    AAccountInfo.ACustNo:=SYSDM.qryQuery.FieldByName('A510A_012').Value;
    AAccountInfo.ACurrNo:=SYSDM.qryQuery.FieldByName('A510A_007').Value;
    AAccountInfo.AInOut:=1;
  end;
//采购发票
  if AType='ACP510' then
  begin
    if (AMode='UPD') or (AMode='DEL') then
    begin
      SYSDM.qryQuery.Close;
      SYSDM.qryQuery.SQL.Clear;
      SYSDM.qryQuery.SQL.Add('select * from CSH610 where C610_010='+''''+ACode+''''+' and C610_012=2');
      SYSDM.qryQuery.Open;
      if not SYSDM.qryQuery.Eof then
        AAccountInfo.ABillNo:=SYSDM.qryQuery.FieldByName('C610_011').Value
      else
          AAccountInfo.ABillNo:=0;
    end;
    SYSDM.qryQuery.Close;
    SYSDM.qryQuery.SQL.Clear;
    SYSDM.qryQuery.SQL.Add('select * from ACP510A where A510A_001='+''''+ACode+'''');
    SYSDM.qryQuery.Open;
    AAccountInfo.ADate:=SYSDM.qryQuery.FieldByName('A510A_004').Value;
    AAccountInfo.AAmount:=SYSDM.qryQuery.FieldByName('A510A_009').Value;
    //这里可能存在BUG
    if AOrderType=1 then
      AAccountInfo.AAmount:=AAccountInfo.AAmount*-1;
    AAccountInfo.ACustNo:=SYSDM.qryQuery.FieldByName('A510A_012').Value;
    AAccountInfo.ACurrNo:=SYSDM.qryQuery.FieldByName('A510A_007').Value;
    AAccountInfo.AInOut:=1;
  end;
end;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -