📄 sal_enter_backshiporder_p.pas
字号:
unit Sal_Enter_BackShipOrder_P;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Common, Db, AdODB, QrCtrls, QuickRpt, ExtCtrls, StdCtrls;
Type
TFrm_Sal_Enter_BackShipOrder_P = Class(TFrm_Base_Common)
QR: TQuickRep;
ColumnHeaderBand1: TQRBand;
QRShApe1: TQRShApe;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRSysData1: TQRSysData;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QLbl_CreateDate: TQRLabel;
QLbl_CustomerCode: TQRLabel;
QLbl_SloNo: TQRLabel;
QLbl_CustomerName: TQRLabel;
Qlbl_SaleType: TQRLabel;
Qlbl_RemArk: TQRLabel;
QLbl_Pages: TQRLabel;
QRLabel11: TQRLabel;
QRSysData2: TQRSysData;
QRShApe3: TQRShApe;
QRShApe4: TQRShApe;
QRShApe5: TQRShApe;
QRShApe6: TQRShApe;
QRShApe7: TQRShApe;
QRShApe8: TQRShApe;
QRLbl_Title: TQRLabel;
Qrlbl_Caption: TQRLabel;
QrLbl_IsoCode: TQRLabel;
PrinterSetupDialog1: TPrinterSetupDialog;
AdoQry_Main: TAdoQuery;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRShApe2: TQRShApe;
QRShApe10: TQRShApe;
QRShApe9: TQRShApe;
QRShApe11: TQRShApe;
QRShApe12: TQRShApe;
QRShApe13: TQRShApe;
QRShApe14: TQRShApe;
private
{ Private declarations }
public
procedure SetDBConnect(AdOConnection:TAdOConnection);Override;
procedure GetHeadData(AdoQuery:TAdoQuery;Edt_ShipNo,Status:String);
{ Public declarations }
end;
var
Frm_Sal_Enter_BackShipOrder_P: TFrm_Sal_Enter_BackShipOrder_P;
implementation
{$R *.DFM}
{ TFrm_Sal_Enter_SaleOrder_P }
procedure TFrm_Sal_Enter_BackShipOrder_P.GetHeadData(AdoQuery: TAdoQuery; Edt_ShipNo,Status: String);
var
SqlText:String;
I:Integer;
begin
SqlText:=' Select InvOutBill.* ,Customer.CustomerName,Dept.DeptName,'
+' Employee.EmployeeName, SaleType.SaleTypeName,'
+' Currency.CurrencyName,PayTerm.PayTermName,'
+' Employee.EmployeeName As CreateEmployeeName,'
+' ShipMode.ShipModeName,CustomerShipAddress.ShipAddressName '
+' From InvOutBill '
+' Left Join Customer '
+' On InvOutBill.CustomerCode=Customer.CustomerCode '
+' Left Join Dept '
+' On InvOutBill.DeptCode=Dept.DeptCode '
+' Left Join Employee '
+' On InvOutBill.Sal_EmployeeCode=Employee.EmployeeCode '
+' left Join Currency '
+' On InvOutBill.CurrencyCode=Currency.CurrencyCode '
+' left Join PayTerm '
+' On InvOutBill.PayTermCode=PayTerm.PayTermCode '
+' Left Join ShipMode '
+' On InvOutBill.ShipModeCode=ShipMode.ShipModeCode '
+' left Join SaleType '
+' On InvOutBill.SaleType=SaleType.SaleTypeCode '
+' left Join CustomerShipAddress '
+' On InvOutBill.ShipAddresSCode=CustomerShipAddress.ShipAddresSCode '
+' where InvOutBill.InvBillNo= '''+Trim(Edt_ShipNo)+''' ';
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:='select SysParamValueC From SysParam Where Upper(SysParamCode)='''+UpperCase('Name0')+'''';
AdoQry_Tmp.Open;
QrLbl_Title.Caption:=AdoQry_Tmp.fieldbyname('SysParamValueC').AsString;
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:='Select ReportName1,ISOCode1 From ReportCtrl Where SysMenuID='''+MenuId+'''';
AdoQry_Tmp.Open;
QrLbl_Caption.Caption:=AdoQry_Tmp.fieldbyname('ReportName1').AsString;
QrLbl_IsoCode.Caption:=AdoQry_Tmp.fieldbyname('ISOCode1').AsString;
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.clear;
AdoQry_Tmp.SQL.Text := SqlText;
AdoQry_Tmp.Open;
QLbl_CreateDate.Caption:=AdoQry_Tmp.fieldbyname('InvBillDate').AsString;
QLbl_SloNo.Caption:=AdoQry_Tmp.fieldbyname('InvBillNo').AsString;
Qlbl_SaleType.Caption:=AdoQry_Tmp.fieldbyname('SaleTypeName').AsString;
QLbl_CustomerCode.Caption:=AdoQry_Tmp.fieldbyname('CustomerCode').AsString;
QLbl_CustomerName.Caption:=AdoQry_Tmp.fieldbyname('CustomerName').AsString;
Qlbl_RemArk.Caption:=AdoQry_Tmp.fieldbyname('RemArk').AsString;
SqlText:=' Select InvOutBill.InvBillNo,InvOutBillLine.* ,Item.ItemName,Uom.UomName,'
+' Warehouse.WhName,WhPosition.WhPositionName '
+' Into #TmPmoQrep From InvOutBillLine '
+' Join InvOutBill on InvOutBillLIne.InvBillId=InvOutBill.InvBillId '
+' Left Join Item '
+' On InvOutBillLine.ItemCode=Item.ItemCode '
+' Left Join Uom '
+' On Item.UomCode=Uom.UomCode '
+' Left Join Warehouse '
+' On InvOutBill.WhCode=Warehouse.WhCode '
+' left Join WhPosition '
+' On (InvOutBill.WhCode=WhPosition.WhCode '
+' And InvOutBill.WhPositionCode=WhPosition.WhPositionCode) '
+' where InvBillNo= '''+Trim(Edt_ShipNo)+''' ' ;
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:=SqlText;
AdoQry_Tmp.ExecSQL; //建立临时表
SqlText:=' Select * From #TmPmoQrep ';
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:=SqlText;
AdoQry_Tmp.Open;
Qr.Prepare;
QLbl_Pages.Caption:=IntToStr(Qr.PageNumber);
SqlText:=' Drop Table #TmPmoQrep ';
try
AdoQry_Main.Close;
AdoQry_Main.SQL.Text:=SqlText;
AdoQry_Main.ExecSQL;
except
end;
If Status='Preview' Then
Qr.PreviewModal
Else
Qr.Print;
Qr.Free;
end;
procedure TFrm_Sal_Enter_BackShipOrder_P.SetDBConnect(
AdOConnection: TAdOConnection);
begin
inherited;
AdoQry_Main.Connection:=AdoConnection;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -