⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sal_qry_noinvoiceshiporder.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Sal_Qry_NoInvoiceShipOrder;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
  StdCtrls, ExtCtrls, ComCtrls, ToolWin, jpeg;

Type
  TFrm_Sal_Qry_NoInvoiceShipOrder = Class(TFrm_Base_Qry)
    AdoQry_MainShipType: TIntegerField;
    AdoQry_MainCustomerCode: TStringField;
    AdoQry_MainShipAddresSCode: TStringField;
    AdoQry_MainShipModeCode: TStringField;
    AdoQry_MainSaleEmployeeCode: TStringField;
    AdoQry_MainCurrencyCode: TStringField;
    AdoQry_MainPayTermCode: TStringField;
    AdoQry_MainInvoiceNo: TStringField;
    AdoQry_MainRemArk: TStringField;
    AdoQry_MainRemArk1: TStringField;
    AdoQry_MainCustomerName: TStringField;
    AdoQry_MainCustomerFalg: TStringField;
    AdoQry_MainSaleTypeFalg: TStringField;
    AdoQry_MainDeptName: TStringField;
    AdoQry_MainSaleDeptFalg: TStringField;
    AdoQry_MainSaleEmployeeName: TStringField;
    AdoQry_MainSaleEmployeeFalg: TStringField;
    AdoQry_MainCurrencyName: TStringField;
    AdoQry_MainCurrencyFalg: TStringField;
    AdoQry_MainSaleTermName: TStringField;
    AdoQry_MainPayTermFalg: TStringField;
    AdoQry_MainCreateEmployeeName: TStringField;
    AdoQry_MainCreateEmployeeFalg1: TStringField;
    AdoQry_MainShipModeName: TStringField;
    AdoQry_MainShipModeFalg: TStringField;
    AdoQry_MainShipAddressName: TStringField;
    AdoQry_MainShipAddressFalg: TStringField;
    AdoQry_MainInvBillId: TFloatField;
    AdoQry_MainInvBillNo: TStringField;
    AdoQry_MainWHCode: TStringField;
    AdoQry_MainWhPositionCode: TStringField;
    AdoQry_MainInvBillDate: TDateTimeField;
    AdoQry_MainInvBillMonth: TStringField;
    AdoQry_MaInBillTypeCode: TStringField;
    AdoQry_MaInBillType2Code: TStringField;
    AdoQry_MaInvendorCode: TStringField;
    AdoQry_MainEmployeeCode: TStringField;
    AdoQry_MainDeptCode: TStringField;
    AdoQry_MainPONO: TStringField;
    AdoQry_MainMONO: TStringField;
    AdoQry_MainInvBillValuation: TIntegerField;
    AdoQry_MainInvBillWHCHCK: TIntegerField;
    AdoQry_MainWH_EmployeeCode: TStringField;
    AdoQry_MainInvBillFINCHCK: TIntegerField;
    AdoQry_MainFin_EmployeeCode: TStringField;
    AdoQry_MainPRINTTIMES: TIntegerField;
    AdoQry_MainSaleType: TStringField;
    AdoQry_MainShiftType: TStringField;
    AdoQry_MainInvBillRemArk: TStringField;
    AdoQry_MainInvBillInfo: TStringField;
    AdoQry_MainOWhPositionCode: TStringField;
    AdoQry_MainInvBillStkChck: TIntegerField;
    AdoQry_MainStk_EmployeeCode: TStringField;
    AdoQry_MainInvBillTmpFlag: TIntegerField;
    AdoQry_MainOverPlan: TIntegerField;
    AdoQry_MainPOLineNo: TIntegerField;
    AdoQry_MainMoLineNO: TIntegerField;
    AdoQry_MainInvBillCreateTime: TDateTimeField;
    AdoQry_MainSfc_EmployeeCode: TStringField;
    AdoQry_MainSal_EmployeeCode: TStringField;
    AdoQry_MainWH_EmployeeCode2: TStringField;
    AdoQry_MainInvBilltaxrate: TFloatField;
    AdoQry_MainMpsSale: TIntegerField;
    AdoQry_MainopBill: TIntegerField;
    AdoQry_MainSysBill: TIntegerField;
    AdoQry_MainOldInvBillNo: TStringField;
    AdoQry_MainPriceAdjustBill: TIntegerField;
    AdoQry_MainWipWaster: TIntegerField;
    AdoQry_MainAmountAdjust: TIntegerField;
    AdoQry_MainTotalInvBillAmount: TFloatField;
    AdoQry_MainTotalInvBillNoTaxAmount: TFloatField;
    AdoQry_MainTotalInvBillnoTaxAmountc: TFloatField;
    AdoQry_MainTotalInvBillAmountc: TFloatField;
    AdoQry_MainExchRate: TFloatField;
    AdoQry_MainISMoUnitRequest: TIntegerField;
    AdoQry_MainISCredence: TIntegerField;
    AdoQry_MainShipstyle: TIntegerField;
    AdoQry_Maindeliverdate: TDateTimeField;
    AdoQry_MainDiSCountRate: TFloatField;
    AdoQry_MainDiSCountAmount: TFloatField;
    AdoQry_MainisreturnAmount: TIntegerField;
    AdoQry_Mainrelevantno: TStringField;
    AdoQry_Mainblueorred: TIntegerField;
    AdoQry_MainSourceno: TStringField;
    AdoQry_Mainprojectno: TStringField;
    procedure Act_LookExecute(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    CreateDateStArt,CreateDateend,CustomerCodeStArt,CustomerCodeend,SloNoStArt,SloNoend,
    SaleTypeCodeStArt,SaleTypeCodeend,SaleDeptCodeStArt,SaleDeptCodeend,
    SaleEmployeeCodeStArt,SaleEmployeeCodeend,PayTermCodeStArt,PayTermCodeend,CurrencyCodeStArt,CurrencyCodeend:String;
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Sal_Qry_NoInvoiceShipOrder: TFrm_Sal_Qry_NoInvoiceShipOrder;

implementation

uses Sys_Global, Sal_Qry_NoInvoiceShipOrder_C, Sal_Enter_ShipOrder;

{$R *.DFM}

{ TFrm_Sal_Qry_NoInvoiceShipOrder }

procedure TFrm_Sal_Qry_NoInvoiceShipOrder.InitForm(
  AdOConnection: TAdOConnection; ShowExtendColumn: Boolean);
var
  SqlText:String;
  AdoQuery:TAdoQuery;
begin
  inherited;
  Frm_Sys_Condition:= TFrm_Sal_Qry_NoInvoiceShipOrder_C.Create(self);
  act_filter.Execute;
  Frm_Sys_Condition.Release;
  Frm_Sys_Condition:=nil;
  CreatePanel(1,DBGridEh);
  AdoQuery:=TAdoQuery.Create(Self);
  AdoQuery.Connection :=DbConnect;
  SqlText:=' Select InvOutBill.*, '
          +' CustomerName,   '
          +' InvOutBill.CustomerCode+'' ''+ CustomerName as CustomerFalg, '
          +' InvOutBill.SaleType+'' ''+SaleType.SaleTypeName As SaleTypeFalg,'
          +' DeptName, '
          +' InvOutBill.DeptCode+'' ''+DeptName As SaleDeptFalg,'
          +' Employee.EmployeeName As SaleEmployeeName,'
          +' SaleEmployeeCode+'' ''+Employee.EmployeeName  As SaleEmployeeFalg,'
          +' CurrencyName, '
          +' InvOutBill.CurrencyCode+'' ''+CurrencyName As CurrencyFalg,   '
          //+' InvOutBill.TaxRate_Percent,'
          +' PayTerm.PayTermName  as SaleTermName, '
          +' InvOutBill.PayTermCode+'' ''+PayTermName As PayTermFalg, '
          +' tt.EmployeeName As CreateEmployeeName ,'
          +' Sal_EmployeeCode+'' ''+tt.EmployeeName As CreateEmployeeFalg1, '
          +' ShipModeName,  '
          +' InvOutBill.ShipModeCode+'' ''+ShipModeName  As ShipModeFalg, '
          +' ShipAddressName,  '
          +' InvOutBill.ShipAddresSCode+'' ''+ShipAddressName As ShipAddressFalg  '
          +' Into #NoInvoiceShipOrder'
          +' From InvOutBill  '
          +' left outer  Join Customer '
          +' On InvOutBill.CustomerCode=Customer.CustomerCode '
          +' left outer 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 ShipMode  '
          +' On InvOutBill.ShipModeCode=ShipMode.ShipModeCode   '
          +' left  Join SaleType   '
          +' On InvOutBill.SaleType=SaleType.SaleTypeCode  '
          +' Join CustomerShipAddress '
          +' On (InvOutBill.ShipAddresSCode=CustomerShipAddress.ShipAddresSCode '
          +' and InvOutBill.CustomerCode=CustomerShipAddress.CustomerCode ) '
          +'   Where (InvOutBill.InvBillDate Between '''+CreateDateStArt+''' And '''+CreateDateend+''')  And '
          +'         (InvOutBill.CustomerCode Between '''+CustomerCodeStArt+''' And '''+CustomerCodeend+''') And '
          +'         (InvOutBill.InvBillNo Between '''+SloNoStArt+''' And '''+SloNoend+''') And '
          +'         (InvOutBill.SaleType Between '''+SaleTypeCodeStArt+''' And '''+SaleTypeCodeend+''') And '
          +'         (InvOutBill.DeptCode Between '''+SaleDeptCodeStArt+''' And '''+SaleDeptCodeend+''') And '
          +'         (InvOutBill.SaleEmployeeCode Between '''+SaleEmployeeCodeStArt+''' And '''+SaleEmployeeCodeend+''') And '
          +'         (InvOutBill.PayTermCode Between '''+PayTermCodeStArt+''' And '''+PayTermCodeend+''') And '
          +'         (InvOutBill.CurrencyCode Between '''+CurrencyCodeStArt+''' And '''+CurrencyCodeend+''') And '
          +'         (IsNull(InvoiceNo,'''')='''') '
          +'         and BillTypeCode in (''0205'',''0206'') '
          +'         and Not Exists(select * from InvOutBillLine  '
          +'                         where InvOutBill.InvBillId=InvOutBillLine.InvBillId '
          +'                           and InvOutBillLine.InvBillQty<0 )  '
          +' Order By InvOutBill.CustomerCode, InvOutBill.InvBillDate,InvOutBill.InvBillNo ';
  ExecuteSql(AdoQry_Tmp,SqlText,1);
  SelectFromSQL:=' Select * From #NoInvoiceShipOrder ';
  //OrderByFields:=' CustomerFalg,falg ';
  Getdata;
  if ShowAnimate<>nil then ShowAnimate.Free;
    if ShowPanel<>nil then ShowPanel.Free;
end;

procedure TFrm_Sal_Qry_NoInvoiceShipOrder.Act_LookExecute(Sender: TObject);
begin
  inherited;
  Application.CreateForm(TFrm_Sal_Enter_ShipOrder,Frm_Sal_Enter_ShipOrder);
  Frm_Sal_Enter_ShipOrder.SetUserParam(Param1,Param2,Param3,Param4,Param5,Param6);
  Frm_Sal_Enter_ShipOrder.SetSysParam(UserCode,ModuleCode,MenuId,LoginDate);
  Frm_Sal_Enter_ShipOrder.InitForm(DBConnect,'Query',AdoQry_Main);
  Frm_Sal_Enter_ShipOrder.ShowModal;
end;

procedure TFrm_Sal_Qry_NoInvoiceShipOrder.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  Try
    ExecuteSql(AdoQry_tmp,'Drop Table #NoInvoiceShipOrder ',1);
  except
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -