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

📄 inv_valuationbillqry.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:

unit Inv_ValuationBillQry;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
  StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls, Mask;

Type
  TFrm_Inv_ValuationBillQry = Class(TFrm_Base_Qry)
    Label1: TLabel;
    DBText1: TDBText;
    Panel1: TPanel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    lbl_VendorCodeName: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Edt_BillNo: TEdit;
    MEdt_Date: TMaskEdit;
    Edt_RemArk: TEdit;
    Lbl_WhPosition: TLabel;
    Lbl_Pono: TLabel;
    Lbl_WhName: TLabel;
    Label9: TLabel;
    Lbl_BillTypeName: TLabel;
    procedure FormActivate(Sender: TObject);
    procedure Act_PreviewExecute(Sender: TObject);
  private
    InvBillNo,WHCode:string;
    InvBillTypeCode,RecTypeCode:string;
    { Private declarations }
  public
    { Public declarations }
    procedure Getvar(RInvBillNo,RWHCode,RInvBillTypeCode:string);
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override ;
  end;

var
  Frm_Inv_ValuationBillQry: TFrm_Inv_ValuationBillQry;
implementation

uses Inv_PurchaseInBillQry,Sys_Global,Inv_Global;

{$R *.DFM}

procedure TFrm_Inv_ValuationBillQry.Getvar(RInvBillNo,RWHCode,RInvBillTypeCode:string);
begin
  InvBillNo:=''''+RInvBillNo+'''';
  WHCode:=''''+RWHCode+'''';
  InvBillTypeCode:=''''+RInvBillTypeCode+'''';
  RecTypeCode:=RInvBillTypeCode;
end;

procedure TFrm_Inv_ValuationBillQry.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
begin
  inherited;
  AmountFields:='InvBillAmount,InvBillNoTaxAmount,';
  PriceFields:='InvBillNoTaxPrice,InvInBillLine,';
  SelectFromSQL:='  Select '
                 +'     InvInBill.InvBillDate,  '
                 +'     InvInBill.InvBillNo,   '
                 +'     BillType.BillTypeName, '
                 +'     Vendor.VendorCode+'' ''+Vendor.VendorName as VendorName  ,'
                 +'     InvInBill.PONo,'
                 +'     InvInBillLine.POLineNo,'
                 +'     InvInBillLine.Batchno,'
                 +'     InvInBillLine.BilllineremArk,'
                 +'     InvInBillLine.ItemCode+'' ''+Item.ItemName as ItemName,'
                 +'     Uom.UomName,'
                 +'     InvInBillLine.InvBillQty,'
                 +'     Warehouse.whCode+'' ''+Warehouse.whName  as  whName, '
                 +'     WhPosition.WhPositionCode,WhPosition.WhPositionName ,'
                 +'     InvInBill.InvBillRemArk, '
                 +'     InvInBillLine.InvBillNoTaxPrice,InvInBillLine.InvBillNoTaxAmount, '
                 +'     InvInBillLine.InvBillPrice,InvInBillLine.InvBillAmount '
                 +' From  InvInBillLine '
                 +'     Left Outer Join Item On  InvInBillLine.ItemCode=Item.ItemCode  '
                 +'     Left Outer Join Uom On  Item.UomCode=Uom.UomCode, '
                 +'     InvInBill '
                 +'     Left Outer Join BillType On InvInBill.BillTypeCode=BillType.BillTypeCode '
                 +'     Left Outer Join Dept On  InvInBill.DeptCode=Dept.DeptCode  '
                 +'     Left Outer Join Vendor On InvInBill.VendorCode=Vendor.VendorCode '
                 +'     left outer join Warehouse on InvInBill.whCode=Warehouse.whCode  '
                 +'     Left outer join WhPosition on InvInBill.whCode=WhPosition.WhPositionCode and  InvInBill.WhPositionCode=WhPosition.WhPositionCode '
                 +' where  '
                 +'  InvInBillLine.InvBillId=InvInBill.InvBillId '
                 +'   and InvInBill.InvBillNo='+InvBillNo
                 +'   and Warehouse.WHCode='+WHCode
                 +'   and InvInBill.BillTypeCode='+InvBillTypeCode
                 +'   and InvInBill.InvBillValuation=''1'' ';

   Orderbyfields:='';
   getdata;

   lbl_WhName.Caption:=AdoQry_Main.fieldbyname('whName').ASSTRING;  // 仓库
   lbl_WhPosition.Caption:=AdoQry_Main.fieldbyname('WhPositionCode').asstring+' '+AdoQry_Main.fieldbyname('WhPositionName').asstring; //货位
   edt_Billno.text:=AdoQry_Main.fieldbyname('InvBillNo').ASSTRING;//单据号
   lbl_VendorCodeName.Caption:=AdoQry_Main.fieldbyname('VendorName').ASSTRING; //供应商
   lbl_Pono.Caption:=AdoQry_Main.fieldbyname('Pono').ASSTRING;   //采购订单号
   MEdt_Date.text:=AdoQry_Main.fieldbyname('InvBilldate').asstring;//日期

   Edt_RemArk.text:=AdoQry_Main.fieldbyname('InvBillRemArk').ASSTRING; //备注
   Lbl_BillTypeName.Caption:=AdoQry_Main.fieldbyname('BillTypeName').ASSTRING; //单据类型
end;
procedure TFrm_Inv_ValuationBillQry.FormActivate(Sender: TObject);
begin
  inherited;
  ToolButton4.left:=ToolButton13.left+ToolButton4.Width;
end;

procedure TFrm_Inv_ValuationBillQry.Act_PreviewExecute(Sender: TObject);
begin
 // inherited;
 // BillPrint(AdoQry_Tmp.Connection,GetCode(Lbl_WhName.Caption),Edt_BillNo.text,Param1,ModuleCode,True,False,True,'');
end;

end.

⌨️ 快捷键说明

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