📄 sfc_mnin_p.pas
字号:
unit Sfc_MnIn_P;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Common, ExtCtrls, QuickRpt, Db, AdODB, Grids, DBGrids, StdCtrls,
Mask, DBCtrls, QrCtrls,printers;
Type
TFrm_Sfc_MnIn_P= Class(TFrm_Base_Common)
AdoQry_Head: TAdoQuery;
AdoQry_Line: TAdoQuery;
QuickRep1: TQuickRep;
DataSource1: TDataSource;
DetailBand1: TQRBand;
Label3: TLabel;
DataSource2: TDataSource;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRDBText12: TQRDBText;
QRDBText14: TQRDBText;
QRDBText15: TQRDBText;
QRShApe10: TQRShApe;
QRExpr2: TQRExpr;
QRShApe8: TQRShApe;
QRShApe9: TQRShApe;
QRShApe11: TQRShApe;
QRShApe3: TQRShApe;
QRDBText1: TQRDBText;
QRShApe12: TQRShApe;
QRDBText2: TQRDBText;
PageFooterBand1: TQRBand;
QRLabel15: TQRLabel;
QLWH_EmployeeCodea: TQRLabel;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QLEmployeeCodeA: TQRLabel;
QRSysData2: TQRSysData;
QLPageTot1: TQRLabel;
QRShApe4: TQRShApe;
QRShApe2: TQRShApe;
ColumnHeaderBand1: TQRBand;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel16: TQRLabel;
QRLabel18: TQRLabel;
QRLabel17: TQRLabel;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRShApe17: TQRShApe;
QLWHCode: TQRLabel;
QLWhPositionCode: TQRLabel;
QLDeptCode: TQRLabel;
QRLabel23: TQRLabel;
QLMONo: TQRLabel;
QLInvBillNo: TQRLabel;
QLInvBillDate: TQRLabel;
QRLabel10: TQRLabel;
QLBillCtrlCode: TQRLabel;
QLSysParamValueC: TQRLabel;
QRLabel8: TQRLabel;
QLClass: TQRLabel;
QRLabel9: TQRLabel;
qlWhEmployee: TQRLabel;
QRShApe15: TQRShApe;
QRShApe18: TQRShApe;
QRShApe20: TQRShApe;
QRShApe21: TQRShApe;
QRShApe22: TQRShApe;
QRShApe23: TQRShApe;
QRShApe25: TQRShApe;
QRShApe19: TQRShApe;
QRShApe16: TQRShApe;
QRShApe24: TQRShApe;
QRShApe7: TQRShApe;
SummAryBand1: TQRBand;
QRLabel19: TQRLabel;
QLWH_EmployeeCode: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QLEmployeeCode: TQRLabel;
QRSysData1: TQRSysData;
QLPageTot: TQRLabel;
QRLabel11: TQRLabel;
QRLbl_ReMArk: TQRLabel;
QRShApe1: TQRShApe;
procedure QRDBText2Print(sender: TObject; var Value: String);
private
{ Private declarations }
FWHCode,FBillNo:string;
FBillTypeCode:string;
FHtot:Double;
FHNoTaxtot:Double;
FH:Double;
FPreview:Boolean;
FModuleCode:string;
public
{ Public declarations }
procedure SetDBConnect(AdOConnection:TAdOConnection); Override;
procedure SetFormParam(FrmParam1,FrmParam2,FrmParam3,FrmParam4,FrmParam5,
FrmParam6:String);Override;
end;
var
Frm_Sfc_MnIn_P: TFrm_Sfc_MnIn_P;
implementation
uses Sys_Global;
{$R *.DFM}
procedure TFrm_Sfc_MnIn_P.SetFormParam(FrmParam1, FrmParam2, FrmParam3,
FrmParam4, FrmParam5, FrmParam6: String);
begin
inherited;
FBillNo:=lowercase(FrmParam1);
FWHCode:=lowercase(FrmParam2);
FBillTypeCode:=lowercase(FrmParam3);
FPreview:=(lowercase(FrmParam4)='preview');
FModuleCode:=lowercase(FrmParam5);
end;
procedure TFrm_Sfc_MnIn_P.SetDBConnect(AdOConnection:TAdOConnection);
var
tmpBillid:string;
sqltext:string;
begin
inherited;
AdoQry_Head.Connection:=AdoConnection;
AdoQry_Line.Connection:=AdoConnection;
with AdoQry_Tmp do
begin
Close;
SQL.clear;
SQL.Text:='Select SysParamValueC from SysParam Where SysParamCode=''Name0''';
open;
end;
QLSysParamValueC.Caption:=AdoQry_Tmp.fieldbyname('SysParamValueC').asstring;
with AdoQry_Tmp do
begin
Close;
SQL.clear;
SQL.Text:='Select BillCtrlCode,BillTypeName,BillColorDESC '+
'From BillType Where BillTypeCode=:FBillTypeCode';
Parameters.ParamByName('FBillTypeCode').Value:=FBillTypeCode;
open;
end;
QLBillCtrlCode.Caption:=AdoQry_Tmp.fieldbyname('BillCtrlCode').asstring;
QLSysParamValueC.Caption:=QLSysParamValueC.Caption+AdoQry_Tmp.fieldbyname('BillTypeName').asstring;
AdoQry_Head.Close;
AdoQry_Head.sql.text:=
' select B.WHCode,W.WHName,B.WhPositionCode,P.WhPositionName, '+
' B.InvBillNo,D.DeptCode,D.DeptName,B.OverPlan, '+
' B.InvBillDate,B.InvBillId,'+
' E.EmployeeName,F.EmployeeName as EmployeeName1,'+
' B.Mono,B.InvBillRemArk,B.InvBillValuation,b.InvBillWhChCk '+
' from InvInBill B '+
' left join Employee E on B.WH_EmployeeCode=E.EmployeeCode '+
' left join Employee F on B.Sfc_EmployeeCode=f.EmployeeCode, '+
' Warehouse W,WhPosition P,Dept D '+
' where B.WHCode=:WHCode and '+
' B.InvBillNo=:BillNo and '+
' B.WHCode=W.WHCode and '+
' B.WhPositionCode=P.WhPositionCode and '+
' B.WHCode=P.WHCode and '+
' B.DeptCode=D.DeptCode ';
AdoQry_Head.Parameters.ParamByName('WHCode').Value:=FWHCode;
AdoQry_Head.Parameters.ParamByName('BillNo').Value:=FBillNo;
AdoQry_Head.open;
TmpBillId:=AdoQry_Head.fieldbyname('InvBillId').asstring;
if AdoQry_Head.fieldbyname('OverPlan').asstring='1' then
QRLbl_ReMArk.Caption:='超订单'+' '+AdoQry_Head.fieldbyname('InvBillRemArk').asstring
else QRLbl_ReMArk.Caption:=AdoQry_Head.fieldbyname('InvBillRemArk').asstring;
sqltext:=' select L.InvBillLineno,L.ItemCode,I.ItemName,L.MoLineNo,U.UomName,'+
' M.MOQty,M.MoLineDate,L.InvBillSfcQty, L.InvBillQty,IB.ShiftType '+
' from InvInBillLine L,Item I,Uom U,MoLine M,InvInBill IB '+
' where L.InvBillId='+TmpBillId+' and '+
' IB.InvBillid=L.InvBillid and '+
' L.ItemCode=I.ItemCode and '+
' I.UomCode=U.UomCode and'+
' L.MOnO=M.Mono and '+
' L.MoLineno=M.MoLineno '+
' Order by InvBillLineno ';
with AdoQry_Line do
begin
Close;
SQL.clear;
SQL.Add(sqltext);
ExecSQL;
open;
end;
QLClass.Caption:=AdoQry_Line.fieldbyname('ShiftType').asstring;
QLWHCode.Caption:=AdoQry_Head.fieldbyname('WHCode').asstring+' '+
AdoQry_Head.fieldbyname('WHName').asstring;
QLWhPositionCode.Caption:=AdoQry_Head.fieldbyname('WhPositionCode').asstring+' '+
AdoQry_Head.fieldbyname('WhPositionName').asstring;
QLDeptCode.Caption:=AdoQry_Head.fieldbyname('DeptCode').asstring+' '+
AdoQry_Head.fieldbyname('DeptName').asstring;
QLMONo.Caption:=AdoQry_Head.fieldbyname('Mono').asstring;
qlWhEmployee.Caption:=AdoQry_Head.fieldbyname('EmployeeName').asstring;
QLInvBillNo.Caption:=AdoQry_Head.fieldbyname('InvBillno').asstring;
QLInvBillDate.Caption:=AdoQry_Head.fieldbyname('InvBillDate').asstring;
if AdoQry_Head.fieldbyname('EmployeeName').asstring='' then
QLWH_EmployeeCode.Caption:=''
else
begin
QLWH_EmployeeCode.Caption:=AdoQry_Head.fieldbyname('EmployeeName').asstring;
end;
QLWH_EmployeeCodeA.Caption:= QLWH_EmployeeCode.Caption;
IF AdoQry_Head.fieldbyname('EmployeeName1').asstring='' then
QLEmployeeCode.Caption:=''
else
begin
QLEmployeeCode.Caption:=AdoQry_Head.fieldbyname('EmployeeName1').asstring;
end;
QLEmployeeCodeA.Caption:=QLEmployeeCode.Caption;
if FPreview then
begin
QuickRep1.Prepare;
QLPageTot1.Caption:='页 共'+Trim(inttoStr(QuickRep1.QRPrinter.PageCount))+'页' ;
QLPageTot.Caption:=QLPageTot1.Caption;
QuickRep1.PreviewModal;
end
else
begin
QuickRep1.Prepare;
QLPageTot1.Caption:='页 共'+Trim(inttoStr(QuickRep1.QRPrinter.PageCount))+'页' ;
QLPageTot.Caption:=QLPageTot1.Caption;
QuickRep1.print;
end;
end;
procedure TFrm_Sfc_MnIn_P.QRDBText2Print(sender: TObject;
var Value: String);
begin
inherited;
if ((AdoQry_Head.fieldbyname('InvBillwhchck').asinteger=0) and (Value='0')) then
Value:='';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -