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

📄 pm_qry_poinvininvoicepay.pas

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

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Panel, Grids, DBGridEh, ActnList, Db, AdODB, ExtCtrls, ComCtrls,
  ToolWin, StdCtrls, jpeg;

Type
  TFrm_Pm_Qry_PoInvInInvoicePay = Class(TFrm_Base_Panel)
    DBGridEh1: TDBGridEh;
    AdoQry_Main: TAdoQuery;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    Label1: TLabel;
    Label2: TLabel;
    Cmb_Condition: TComboBox;
    DataSource1: TDataSource;
    lbl_Status: TLabel;
    act_run: TAction;
    ToolButton5: TToolButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure DBGridEh1CellClick(Column: TColumnEh);
    procedure act_runExecute(Sender: TObject);
    procedure Act_FilterExecute(Sender: TObject);
  private
    { Private declarations }
    lc_Name:string;
  public
  FMonth:string;
  procedure initform(AdoConnection:TAdoConnection);
    { Public declarations }
  end;

var
  Frm_Pm_Qry_PoInvInInvoicePay: TFrm_Pm_Qry_PoInvInInvoicePay;

implementation
uses Sys_Global,Pm_Qry_PoInvInInvoicePay_C;
{$R *.DFM}

{ TFrm_Pm_Qry_PoInvInInvoicePay }

procedure TFrm_Pm_Qry_PoInvInInvoicePay.initform(
  AdoConnection: TAdoConnection);
begin
  AdoQry_Main.Connection:=AdoConnection;
  cmb_Condition.Text:=cmb_Condition.Items[0];
  Act_Filter.Execute;
end;

procedure TFrm_Pm_Qry_PoInvInInvoicePay.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  Action:=cafree;
end;


procedure TFrm_Pm_Qry_PoInvInInvoicePay.DBGridEh1CellClick(
  Column: TColumnEh);
begin
  inherited;
  if AdoQry_Main.fieldbyname('POLINESTATUS').asinteger=6 then
  lbl_Status.Caption:='下达'
  else if AdoQry_Main.fieldbyname('POLINESTATUS').asinteger=7 then
  lbl_Status.Caption:='关闭'
  else
  lbl_Status.Caption:='未指定';
end;

procedure TFrm_Pm_Qry_PoInvInInvoicePay.act_runExecute(Sender: TObject);
var
  sql_txt,SQueryMonth,EQueryMonth:string;
begin
  inherited;
  SQueryMonth:=FMonth+'.01';
  EQueryMonth:=formatdatetime('YYYY.MM',strtodate(FMonth+'.01')+40)+'.01';
  sql_txt:='SELECT distinct PO.PcNo,'+
           '                 Vendor.VendorCode+'' ''+Vendor.VendorName as VendorCodeName,'+
           '                 InvInBill.WHCode,InvInBill.InvBillNo,ApInvOICE.ApInvOICENO,PayJournal.PayBillNO,'+
           '                 aaa.PONoTaxAmount,bbb.InvBillnotaxAmountc,ApInvOICE.ApInvOICEAmount,'+
           '                 ApInvOICE.ApPayedAmount,aaa.POLineDATE,InvInBill.InvBillDate,ApInvOICE.ApInvOICEDATE,'+
           '                 ApInvOICE.ApInvOICEINPUTDATE,aaa.POLINESTATUS'+
           '          FROM PO'+
           '            Left JOIN Vendor'+
           '              ON Vendor.VendorCode=PO.VendorCode'+
           '            Left Join ( SELECT distinct PONO,Polinestatus,ponotaxAmount,polinedate'+
           '                     FROM dbo.POline ) aaa'+
           '              ON aaa.PONO = PO.PONO'+
           '            Left JOIN InvInBill'+
           '              ON PO.PONO = InvInBill.PONO'+
           '            Left JOIN ApInvOICELINE'+
           '              ON ApInvOICELINE.InvBillid = InvInBill.InvBillId'+
           '            Left JOIN ApInvOICE'+
           '              ON ApInvOICE.ApInvOICEID = ApInvOICELINE.ApInvoiceId'+
           '            Left JOIN PayJournalLine'+
           '              ON PayJournalLine.ApInvoiceId = ApInvOICE.ApInvOICEID'+
           '            Left JOIN PayJournal'+
           '              ON PayJournal.PayJournalID = PayJournalLine.PayJournalId'+
           '            Left JOIN (select distinct InvBillId,InvBillNoTaxAmount,InvBillnotaxAmountc'+
           '                    From InvInBillline) bbb'+
           '              ON bbb.InvBillId = InvInBill.InvBillId'+
           '     WHERE (aaa.POLINESTATUS = 6) and'+
           '            (po.podate Between '''+SQueryMonth+''' and '+
           '            '''+EQueryMonth+''')';
  with AdoQry_Main do
  begin
    Close;
    sql.clear;
    sql.Add(sql_txt);
    Prepared;
    open;
  end;
  DBGridEh1.Refresh;
end;

procedure TFrm_Pm_Qry_PoInvInInvoicePay.Act_FilterExecute(Sender: TObject);
begin
  inherited;
  Frm_Pm_Qry_PoInvInInvoicePay_C:=TFrm_Pm_Qry_PoInvInInvoicePay_C.Create(Application);
  Frm_Pm_Qry_PoInvInInvoicePay_C.ShowModal;
end;

end.

⌨️ 快捷键说明

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