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

📄 sal_qry_backshiporder.pas

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

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_BackShipOrder = Class(TFrm_Base_Qry)
    AdoQry_MainCustomerCode: TStringField;
    AdoQry_MainCustomerName: TStringField;
    AdoQry_Maincustomerflag: TStringField;
    AdoQry_MainInvBillDate: TDateTimeField;
    AdoQry_MainSloNo: TStringField;
    AdoQry_MainSLoLineNo: TIntegerField;
    AdoQry_MainInvBillNo: TStringField;
    AdoQry_MainInvBillLineNo: TStringField;
    AdoQry_MainItemCode: TStringField;
    AdoQry_MainItemName: TStringField;
    AdoQry_MainItemFlag: TStringField;
    AdoQry_MainShipQty: TFloatField;
    AdoQry_MainWhCode: TStringField;
    AdoQry_MainwhName: TStringField;
    AdoQry_Mainwhflag: TStringField;
    AdoQry_MainWhPositionCode: TStringField;
    AdoQry_MainWhPositionName: TStringField;
    AdoQry_MainWhPositionflag: TStringField;
    AdoQry_MainBatchNo: TStringField;
    AdoQry_MainInvBillPrice: TFloatField;
    AdoQry_MainInvBillAmount: TFloatField;
    AdoQry_MainInvBillNOtaxPrice: TFloatField;
    AdoQry_MainInvBillNOtaxAmount: TFloatField;
    AdoQry_MainDiSCountRate: TFloatField;
    AdoQry_MainDiSCountAmount: TFloatField;
    AdoQry_MainSal_EmployeeCode: TStringField;
    AdoQry_MainEmployeeName: TStringField;
    AdoQry_MainEmployeeFlag: TStringField;
    AdoQry_MainSaleType: TStringField;
    AdoQry_MainSaleTypeName: TStringField;
    AdoQry_MainSaleTypeFlag: TStringField;
    AdoQry_MainDeptCode: TStringField;
    AdoQry_MainDeptName: TStringField;
    AdoQry_MainDeptFlag: TStringField;
    AdoQry_MainCurrencyCode: TStringField;
    AdoQry_MainCurrencyName: TStringField;
    AdoQry_MainCurrencyFlag: TStringField;
    AdoQry_MainInvBillTaxRate: TFloatField;
    AdoQry_MainCustomerPayTermCode: TStringField;
    AdoQry_MainPayTermName: TStringField;
    AdoQry_MainPayTermflag: TStringField;
    AdoQry_MainShipModeCode: TStringField;
    AdoQry_MainShipModeName: TStringField;
    AdoQry_MainShipModeflag: TStringField;
    AdoQry_MainShipAddresSCode: TStringField;
    AdoQry_MainShipAddressName: TStringField;
    AdoQry_MainShipAddressflag: TStringField;
    AdoQry_MainRemArk: TStringField;
    AdoQry_MainRemArk1: TStringField;
    AdoQry_MainInvBillWhChCk: TIntegerField;
    AdoQry_MainSaleEmployeeCode: TStringField;
    AdoQry_MainSaleEmployeeName: TStringField;
    AdoQry_MainSaleEmployeeFlag: TStringField;
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Sal_Qry_BackShipOrder: TFrm_Sal_Qry_BackShipOrder;

implementation
 uses Sys_Global;
{$R *.DFM}
procedure TFrm_Sal_Qry_BackShipOrder.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
var sqltext:string;
begin
  Application.ProcessMessages;
  inherited;
  SelectFromSQL:='Select Customer.CustomerCode,InvOutBill.ShipType,'
                +' Customer.CustomerName,Customer.CustomerCode+'' ''+Customer.CustomerName As customerflag, '
                +' InvOutBill.InvBillDate,InvOutBillLine.SloNo,InvOutBillLine.SLoLineNo, '
                +' InvOutBill.InvBillNo,InvBillLineNo,InvOutBillLine.ItemCode,Item.ItemName, '
                +' Item.ItemCode+'' ''+Item.ItemName As ItemFlag,InvOutBillLine.InvBillQty As ShipQty, '
                +' InvOutBill.WhCode,Warehouse.whName,Warehouse.whCode+'' ''+Warehouse.whName as whflag, '
                +' InvOutBill.WhPositionCode,WhPosition.WhPositionName,WhPosition.WhPositionCode+'' ''+WhPosition.WhPositionName as WhPositionflag, '
                +' InvOutBillLine.BatchNo,InvOutBillLine.InvBillPrice,InvOutBillLine.InvBillAmount,InvOutBillLine.InvBillNOtaxPrice,InvOutBillLine.InvBillNOtaxAmount, '
                +' InvOutBillLine.DiSCountRate,InvOutBillLine.DiSCountAmount,InvOutBill.Sal_EmployeeCode,Employee.EmployeeName,Employee.EmployeeCode+'' ''+Employee.EmployeeName As EmployeeFlag, '
                +' InvOutBill.SaleType,SaleType.SaleTypeName,SaleType.SaleTypeCode+'' ''+SaleType.SaleTypeName As SaleTypeFlag, '
                +' InvOutBill.DeptCode, Dept.DeptName,Dept.DeptCode+'' ''+Dept.DeptName As DeptFlag,InvOutBill.CurrencyCode,Currency.CurrencyName,Currency.CurrencyCode+'' ''+Currency.CurrencyName As CurrencyFlag, '
                +' InvOutBill.InvBillTaxRate,Customer.CustomerPayTermCode,PayTerm.PayTermName, '
                +' PayTerm.PayTermCode+'' ''+PayTerm.PayTermName as PayTermflag, '
                +' InvOutBill.ShipModeCode,ShipMode.ShipModeName, ShipMode.ShipModeCode+'' ''+ShipMode.ShipModeName as ShipModeflag, '
                +' InvOutBill.ShipAddresSCode,customerShipAddress.ShipAddressName,customerShipAddress.ShipAddresSCode+'' ''+customerShipAddress.ShipAddressName as ShipAddressflag, '
                +' InvOutBill.RemArk,InvOutBill.RemArk1, '
                +' InvOutBill.InvBillWhChCk,'
                +' InvOutBill.SaleEmployeeCode,Employee1.EmployeeName As SaleEmployeeName,Employee1.EmployeeCode+'' ''+Employee1.EmployeeName As SaleEmployeeFlag '
                +' From '
                +' InvOutBill '
                +' Join InvOutBillLine On InvOutBill.InvBillID=InvOutBillLine.InvBillID '
                +' Left Join Item On InvOutBillLine.ItemCode=Item.ItemCode '
                +' left Join SaleType On SaleType.SaleTypeCode=InvOutBill.SaleType '
                +' Left Join Customer On Customer.CustomerCode=InvOutBill.CustomerCode '
                +' Left Join Employee On Employee.EmployeeCode=InvOutBill.Sal_EmployeeCode '
                +' Left Join PayTerm On PayTerm.PayTermCode=Customer.CustomerPayTermCode '
                +' Left Join Warehouse On Warehouse.WhCode=InvOutBill.WhCode '
                +' Left Join WhPosition On WhPosition.WhPositionCode=InvOutBill.WhPositionCode '
                +'  And  WhPosition.WhCode=InvOutBill.WhCode '
                +' Left Join Dept On InvOutBill.DeptCode=Dept.DeptCode '
                +' Left Join Currency On InvOutBill.CurrencyCode=Currency.CurrencyCode '
                +' Left Join ShipMode On InvOutBill.ShipModeCode=ShipMode.ShipModeCode '
                +' Left Join customerShipAddress On InvOutBill.ShipAddresSCode=customerShipAddress.ShipAddresSCode '
                +' Left Join Employee Employee1 On Employee1.EmployeeCode=InvOutBill.SaleEmployeeCode ';
  conditionUserDefine:='   exists (select * from InvOutBillLine where InvOutBillLIne.InvBillId=InvOutBill.InvBillId )   '
                +'   and BillTypeCode In (''0205'',''0206'') '
                      +' And InvOutBill.ShipType=2 ';
  condition:=' InvBillDate<=  '+quotedstr(formatdatetime('yyyy.mm.dd',strtodatetime(GetServerDateTime(dbconnect))-30));
  Orderbyfields:='customerCode,InvBillDate';
  Executesql(AdoQry_Main,sqltext,1);
  //Executesql(AdoQry_Main,'select * from #tmpBackShipOrderQry',0);
  getdata;

  lbl_Condition.Caption:='退货日期<='+formatdatetime('yyyy.mm.dd',strtodatetime(GetServerDateTime(dbconnect))-30);

end;
procedure TFrm_Sal_Qry_BackShipOrder.FormDestroy(Sender: TObject);
begin
  inherited;
 Frm_Sal_Qry_BackShipOrder:=nil;
end;

end.

⌨️ 快捷键说明

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