📄 qc_checkpsi.pas
字号:
unit Qc_CheckPsi;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls, jpeg;
Type
TFrm_Qc_CheckPsi = Class(TFrm_Base_Qry)
Label1: TLabel;
DBText1: TDBText;
private
{ Private declarations }
public
{ Public declarations }
procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
end;
var
Frm_Qc_CheckPsi: TFrm_Qc_CheckPsi;
implementation
uses Qc_CheckPsi_C;
{$R *.DFM}
procedure TFrm_Qc_CheckPsi.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
begin
PriceFields:='PoTaxPrice,';
AmountFields:='POnCheckQty,PReceivedQty0,PReceivedQty1,PReceivedQty2,';
if Param1='Stk' then
begin
Caption:='待检物料收发存数量金额帐';
Pnl_Title.Caption:='待检物料收发存数量金额帐';
end
else
begin
Caption:='待检物料收发存数量帐';
Pnl_Title.Caption:='待检物料收发存数量帐';
DBGridEh.Columns.Delete(13);
DBGridEh.Columns.Delete(11);
DBGridEh.Columns.Delete(9);
DBGridEh.Columns.Delete(7);
DBGridEh.Columns.Delete(5);
end;
inherited;
SelectFromSQL:=' Select OnCheckBillLine.ItemCode'
+',Item.ItemName'
+',OnCheckBillLine.ItemCode+'' ''+Item.ItemName As ItemCodeName'
+',Uom.UomName'
+',Sum(OnCheckBillLine.OnCheckQty) As AOnCheckQty'
+',Sum(Case When OnCheckBillLine.OnCheckStatus=0 Then OnCheckBillLine.ReceivedQty'
+' Else 0 end) As AreceivedQty0'
+',Sum(Case When OnCheckBillLine.OnCheckStatus=1 Then OnCheckBillLine.ReceivedQty'
+' Else 0 end) As AreceivedQty1'
+',Sum(Case When OnCheckBillLine.OnCheckStatus=1 Then OnCheckBillLine.OnCheckQty'
+'-OnCheckBillLine.ReceivedQty Else 0 end) As AreceivedQty2'
+',Case When Sum(OnCheckBillLine.OnCheckQty)=0 Then Null'
+' Else Sum(OnCheckBillLine.OnCheckQty*PoLine.PoTaxPrice)/Sum(OnCheckBillLine.OnCheckQty)'
+' end As PoTaxPrice'
+',Sum(OnCheckBillLine.OnCheckQty*PoLine.PoTaxPrice) As POnCheckQty'
+',Sum(Case When OnCheckBillLine.OnCheckStatus=0 Then OnCheckBillLine.ReceivedQty'
+'*PoLine.PoTaxPrice Else 0 end) As PReceivedQty0'
+',Sum(Case When OnCheckBillLine.OnCheckStatus=1 Then OnCheckBillLine.ReceivedQty'
+'*PoLine.PoTaxPrice Else 0 end) As PReceivedQty1'
+',Sum(Case When OnCheckBillLine.OnCheckStatus=1 Then (OnCheckBillLine.OnCheckQty'
+'-OnCheckBillLine.ReceivedQty)*PoLine.PoTaxPrice Else 0 end) As PReceivedQty2'
+',BillType.BillTypeName'
+' From OnCheckBillLine'
+' Join OnCheckBill On OnCheckBillLine.OnCheckBillId=OnCheckBill.OnCheckBillId'
+' Join BillType On OnCheckBill.BillTypeCode=BillType.BillTypeCode'
+' Left Join PoLine On OnCheckBillLine.PoLineNo=PoLine.PoLineNo'
+' And OnCheckBillLine.PoNo=PoLine.PoNo'
+' join Item on OnCheckBillLine.ItemCode=Item.ItemCode'
+' join Uom on Item.UomCode=Uom.UomCode';
OrderByFields:='ItemCode';
GroupByFields:='BillType.BillTypeName,OnCheckBillLine.ItemCode,Item.ItemName,Uom.UomName,PoLine.PoTaxPrice';
Frm_Sys_Condition:=TFrm_Qc_CheckPsi_C.Create(Self);
Act_Filter.Execute;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -