📄 sal_enter_passshiporderh.pas
字号:
unit Sal_Enter_PassShipOrderH;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Check_Head, Menus, Db, ActnList, AdODB, Grids, DBGridEh, StdCtrls,
ExtCtrls, ComCtrls, ToolWin, jpeg, ExtPrintReport;
Type
TFrm_Sal_Enter_PassShipOrderH = Class(TFrm_Base_Check_Head)
AdoQry_HeadInvBillId: TFloatField;
AdoQry_HeadInvBillNo: TStringField;
AdoQry_HeadWHCode: TStringField;
AdoQry_HeadWhPositionCode: TStringField;
AdoQry_HeadInvBillDate: TDateTimeField;
AdoQry_HeadInvBillMonth: TStringField;
AdoQry_HeadBillTypeCode: TStringField;
AdoQry_HeadBillType2Code: TStringField;
AdoQry_HeadVendorCode: TStringField;
AdoQry_HeadEmployeeCode: TStringField;
AdoQry_HeadDeptCode: TStringField;
AdoQry_HeadCUSTOMERCode: TStringField;
AdoQry_HeadCURRENCYCode: TStringField;
AdoQry_HeadPONO: TStringField;
AdoQry_HeadMONO: TStringField;
AdoQry_HeadInvBillValuation: TIntegerField;
AdoQry_HeadInvBillWHCHCK: TIntegerField;
AdoQry_HeadWH_EmployeeCode: TStringField;
AdoQry_HeadInvBillFINCHCK: TIntegerField;
AdoQry_HeadFin_EmployeeCode: TStringField;
AdoQry_HeadPRINTTIMES: TIntegerField;
AdoQry_HeadSaleType: TStringField;
AdoQry_HeadShiftType: TStringField;
AdoQry_HeadInvBillRemArk: TStringField;
AdoQry_HeadInvBillInfo: TStringField;
AdoQry_HeadOWhPositionCode: TStringField;
AdoQry_HeadInvBillStkChck: TIntegerField;
AdoQry_HeadStk_EmployeeCode: TStringField;
AdoQry_HeadInvBillTmpFlag: TIntegerField;
AdoQry_HeadOverPlan: TIntegerField;
AdoQry_HeadPOLineNo: TIntegerField;
AdoQry_HeadMoLineNO: TIntegerField;
AdoQry_HeadInvBillCreateTime: TDateTimeField;
AdoQry_HeadSfc_EmployeeCode: TStringField;
AdoQry_HeadSal_EmployeeCode: TStringField;
AdoQry_HeadWH_EmployeeCode2: TStringField;
AdoQry_HeadInvBilltaxrate: TFloatField;
AdoQry_HeadMpsSale: TIntegerField;
AdoQry_HeadopBill: TIntegerField;
AdoQry_HeadSysBill: TIntegerField;
AdoQry_HeadOldInvBillNo: TStringField;
AdoQry_HeadPriceAdjustBill: TIntegerField;
AdoQry_HeadWipWaster: TIntegerField;
AdoQry_HeadAmountAdjust: TIntegerField;
AdoQry_HeadShipType: TIntegerField;
AdoQry_HeadShipAddresSCode: TStringField;
AdoQry_HeadShipModeCode: TStringField;
AdoQry_HeadSaleEmployeeCode: TStringField;
AdoQry_HeadPayTermCode: TStringField;
AdoQry_HeadInvoiceNo: TStringField;
AdoQry_HeadRemArk: TStringField;
AdoQry_HeadRemArk1: TStringField;
AdoQry_HeadTotalInvBillAmount: TFloatField;
AdoQry_HeadTotalInvBillNoTaxAmount: TFloatField;
AdoQry_HeadTotalInvBillnoTaxAmountc: TFloatField;
AdoQry_HeadTotalInvBillAmountc: TFloatField;
AdoQry_HeadCustomerName: TStringField;
AdoQry_HeadSaleTypeName: TStringField;
AdoQry_HeadCustomerFalg: TStringField;
AdoQry_HeadDeptName: TStringField;
AdoQry_HeadDeptFalg: TStringField;
AdoQry_HeadWhName: TStringField;
AdoQry_HeadWhPositionName: TStringField;
AdoQry_HeadEmployeeName: TStringField;
AdoQry_HeadEmployeeFalg: TStringField;
AdoQry_HeadCurrencyName: TStringField;
AdoQry_HeadCurrencyFalg: TStringField;
AdoQry_HeadSaleTermName: TStringField;
AdoQry_HeadSaleTermFalg: TStringField;
AdoQry_HeadCreateEmployeeName: TStringField;
AdoQry_HeadEmployeeFalg1: TStringField;
AdoQry_HeadShipModeName: TStringField;
AdoQry_HeadShipModeFalg: TStringField;
AdoQry_HeadShipAddressName: TStringField;
AdoQry_HeadShipAddressFalg: TStringField;
AdoQry_HeadWh_EmployeeName: TStringField;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Act_LookExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
{ Public declarations }
end;
var
Frm_Sal_Enter_PassShipOrderH: TFrm_Sal_Enter_PassShipOrderH;
implementation
uses Sys_Global,Sal_Enter_PassShipOrder;
{$R *.DFM}
procedure TFrm_Sal_Enter_PassShipOrderH.InitForm(
AdOConnection: TAdOConnection; ReadOnly: Boolean);
var sqltext:string;
begin
Application.ProcessMessages;
inherited;
SqlText := ' Select InvOutBill.*,CustomerName,SaleType.SaleTypeName,'
+' InvOutBill.CustomerCode+'' ''+ CustomerName as CustomerFalg,'
+' DeptName,'
+' InvOutBill.DeptCode+'' ''+DeptName As DeptFalg, '
+' ee.EmployeeName as Wh_EmployeeName, '
+' Warehouse.WhName, '
+' WhPosition.WhPositionName, '
+' Employee.EmployeeName, '
+' SaleEmployeeCode+'' ''+Employee.EmployeeName As EmployeeFalg, '
+' CurrencyName,'
+' InvOutBill.CurrencyCode+'' ''+CurrencyName As CurrencyFalg, '
+' PayTerm.PayTermName as SaleTermName, '
+' InvOutBill.PayTermCode+'' ''+PayTermName As SaleTermFalg,'
+' tt.EmployeeName as CreateEmployeeName, '
+' Sal_EmployeeCode+'' ''+tt.EmployeeName As EmployeeFalg1, '
+' ShipModeName,'
+' InvOutBill.ShipModeCode+'' ''+ShipModeName As ShipModeFalg,'
+' ShipAddressName, '
+' InvOutBill.ShipAddresSCode+'' ''+ShipAddressName As ShipAddressFalg'
+' into #ShipOrderPass '
+' From InvOutBill left outer Join Customer '
+' On InvOutBill.CustomerCode=Customer.CustomerCode '
+' left outer Join Dept '
+' On InvOutBill.DeptCode=Dept.DeptCode '
+' left Join Warehouse on InvOutBill.WhCode=Warehouse.WhCode '
+' left Join WhPosition on (InvOutBill.WhCode=WhPosition.WhCode and InvOutBill.WhPositionCode=WhPosition.WhPositionCode) '
+' 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 and InvOutBill.CustomerCode=CustomerShipAddress.CustomerCode ) '
+' where exists (select * from InvOutBillLine where InvOutBillLIne.InvBillId=InvOutBill.InvBillId ) '
+' and BillTypeCode in (''0205'',''0206'') ';
ConditionUserDefine:=' ShipType In (0,1) ';
Executesql(AdoQry_Tmp,sqltext,1);
selectfromsql:='select * from #ShipOrderPass ';
Condition:=' InvBillWHCHCK=0 ';
OrderByFields := 'InvBillDate,InvBillNo ';
GetData;
// Executesql(AdoQry_Head,'select * from #ShipOrderPass where assess=0 Order by createdate,Shipno',0);
Frm_Check_Body:=TFrm_Sal_Enter_PassShipOrder.Create(Application);
end;
procedure TFrm_Sal_Enter_PassShipOrderH.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
try
Executesql(AdoQry_tmp,'drop table #ShipOrderPass ',1);
except
end;
end;
procedure TFrm_Sal_Enter_PassShipOrderH.Act_LookExecute(Sender: TObject);
begin
if AdoQry_Head.RecordCount=0 then exit;
inherited;
end;
procedure TFrm_Sal_Enter_PassShipOrderH.FormCreate(Sender: TObject);
begin
inherited;
// Tlbtn_Look.Action := Act_Check;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -