📄 sal_enter_shiporder_p.pas
字号:
unit Sal_Enter_ShipOrder_P;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Common, Db, AdODB, QrCtrls, QuickRpt, ExtCtrls, StdCtrls;
Type
TFrm_Sal_Enter_ShipOrder_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;
SummAryBand1: TQRBand;
QRLabel1: TQRLabel;
QRL_Saler: TQRLabel;
QRLabel20: TQRLabel;
QRL_Asser: TQRLabel;
private
{ Private declarations }
public
procedure SetDBConnect(AdOConnection:TAdOConnection);Override;
procedure GetHeadData(AdoQuery:TAdoQuery;Edt_ShipNo,Status:String);
{ Public declarations }
end;
var
Frm_Sal_Enter_ShipOrder_P: TFrm_Sal_Enter_ShipOrder_P;
implementation
{$R *.DFM}
{ TFrm_Sal_Enter_SaleOrder_P }
procedure TFrm_Sal_Enter_ShipOrder_P.GetHeadData(AdoQuery: TAdoQuery; Edt_ShipNo,Status: String);
var
SqlText:String;
I:Integer;
begin
SqlText:=' Select InvOutBill.*,CustomerName,SaleType.SaleTypeName,'
+' InvOutBill.CustomerCode+'' ''+ CustomerName as CustomerFalg,'
// +' RemArk,InvOutBill.ShipAddresSCode,InvOutBill.ShipModeCode, CreateEmployeeCode,InvOutBill.PayTermCode, InvOutBill.CurrencyCode, CreateDate,ShipNo,SaleType, InvOutBill.SaleDeptCode,SaleEmployeeCode, '
+' DeptName,'
+' InvOutBill.DeptCode+'' ''+DeptName As DeptFalg, '
+' Employee.EmployeeName, '
+' SaleEmployeeCode+'' ''+Employee.EmployeeName As EmployeeFalg, '
+' CurrencyName,'
+' InvOutBill.CurrencyCode+'' ''+CurrencyName As CurrencyFalg, '
+' InvOutBill.InvBillTaxRate, '
+' PayTerm.PayTermName as SaleTermName, '
+' InvOutBill.PayTermCode+'' ''+PayTermName As SaleTermFalg,'
+' tt.EmployeeName, '
+' Sal_EmployeeCode+'' ''+tt.EmployeeName As EmployeeFalg1, '
+' Wh_EmployeeCode+'' '' + ee.EmployeeName as AssessorEmployeefalg, '
+' ShipModeName,'
+' InvOutBill.ShipModeCode+'' ''+ShipModeName As ShipModeFalg,'
+' ShipAddressName, '
+' InvOutBill.ShipAddresSCode+'' ''+ShipAddressName As ShipAddressFalg'
+' From InvOutBill left Join Customer '
+' On InvOutBill.CustomerCode=Customer.CustomerCode '
+' left Join Dept '
+' On InvOutBill.DeptCode=Dept.DeptCode '
+' left Join Employee '
+' On InvOutBill.SaleEmployeeCode=Employee.EmployeeCode '
+' left Join Currency '
+' On InvOutBill.CurrencyCode=Currency.CurrencyCode '
+' left Join PayTerm '
+' On InvOutBill.PayTermCode=PayTerm.PayTermCode '
+' left Join Employee tt '
+' On InvOutBill.Sal_EmployeeCode=tt.EmployeeCode '
+' left Join Employee ee '
+' On InvOutBill.Wh_EmployeeCode=ee.EmployeeCode '
+' 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;
Qrl_Saler.Caption := AdoQry_Tmp.fieldbyname('Employeefalg').AsString;
QrL_Asser.Caption := AdoQry_Tmp.fieldbyname('AssessorEmployeefalg').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.InvBillLineNo,InvOutBillLine.SloNo,'
+' InvOutBillLine.SloLineNo,BatchNo, '
+' InvOutBillLine.ItemCode,ItemName, '
+' UomName, '
+' InvOutBill.WhCode,WhName, '
+' InvOutBill.WhPositionCode,WhPositionName, '
+' InvBillQty, InvBillPrice,InvBillAmount,InvBillNoTaxPrice,InvBillNoTaxAmount, '
+' InvOutBillLine.DiSCountRate,InvOutBillLine.DiSCountAmount,BillLineRemArk '
+' Into #TmPmoQrep From InvOutBillLine '
+' Join InvOutBill on InvOutBillLIne.InvBillId=InvOutBill.InvBillId '
+' left Join Item '
+' On Item.ItemCode=InvOutBillLine.ItemCode '
+' left Join Uom '
+' On Item.UomCode=Uom.UomCode'
+' left Join Warehouse'
+' On InvOutBill.WhCode=Warehouse.WhCode'
+' left Join WhPosition '
+' On (WhPosition.WhPositionCode=InvOutBill.WhPositionCode)'
+' and (WhPosition.WhCode=InvOutBill.WhCode)'
+' 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_ShipOrder_P.SetDBConnect(
AdOConnection: TAdOConnection);
begin
inherited;
AdoQry_Main.Connection:=AdoConnection;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -