unit U_CKProductBCPOutList;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView,
  cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView,
  cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView,
  cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu,
  cxGridPopupMenu, ADODB, DBClient, cxDropDownEdit, RM_Common, RM_Class,
  RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxCheckBox, Menus,
  MovePanel, RM_E_llPDF, cxCalendar;

type
  TfrmCKProductBCPOutList = class(TForm)
    ToolBar1: TToolBar;
    TBRafresh: TToolButton;
    TBPrint: TToolButton;
    TBClose: TToolButton;
    ADOQueryCmd: TADOQuery;
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    DataSource1: TDataSource;
    CDS_Main: TClientDataSet;
    Tv1: TcxGridDBTableView;
    cxGrid2Level1: TcxGridLevel;
    cxGrid2: TcxGrid;
    v2Column1: TcxGridDBColumn;
    v2Column3: TcxGridDBColumn;
    v2Column5: TcxGridDBColumn;
    v2Column6: TcxGridDBColumn;
    v1Column1: TcxGridDBColumn;
    v1Column2: TcxGridDBColumn;
    v1Column7: TcxGridDBColumn;
    v1Column6: TcxGridDBColumn;
    v1Column8: TcxGridDBColumn;
    v1Column9: TcxGridDBColumn;
    v1Column3: TcxGridDBColumn;
    RMXLSExport1: TRMXLSExport;
    v1Column4: TcxGridDBColumn;
    v1Column5: TcxGridDBColumn;
    v1Column10: TcxGridDBColumn;
    v1Column11: TcxGridDBColumn;
    PopupMenu1: TPopupMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    MovePanel2: TMovePanel;
    v1Column12: TcxGridDBColumn;
    DS_JuanPRT: TDataSource;
    cxGridPopupMenu2: TcxGridPopupMenu;
    ComboBox1: TComboBox;
    v1Column13: TcxGridDBColumn;
    v1Column14: TcxGridDBColumn;
    v1Column15: TcxGridDBColumn;
    v1Column16: TcxGridDBColumn;
    Panel4: TPanel;
    Label13: TLabel;
    Panel10: TPanel;
    Image2: TImage;
    RichEdit1: TRichEdit;
    v1Column17: TcxGridDBColumn;
    v1Column18: TcxGridDBColumn;
    v1Column19: TcxGridDBColumn;
    v1Column20: TcxGridDBColumn;
    v1Column21: TcxGridDBColumn;
    v1Column22: TcxGridDBColumn;
    v1Column23: TcxGridDBColumn;
    ADOQueryPrint: TADOQuery;
    RMDB_Main: TRMDBDataSet;
    RM2: TRMGridReport;
    //RMllPDFExport1: TRMllPDFExport;
    v1rkplace: TcxGridDBColumn;
    RMDBHZ: TRMDBDataSet;
    CDS_HZ: TClientDataSet;
    RM3: TRMGridReport;
    v1SOrddefstr1: TcxGridDBColumn;
    v1Column24: TcxGridDBColumn;
    v1Column25: TcxGridDBColumn;
    ToolButton4: TToolButton;
    Adoquery_Other: TADOQuery;
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure TBRafreshClick(Sender: TObject);
    procedure TBCloseClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure TBPrintClick(Sender: TObject);
    procedure N1Click(Sender: TObject);
    procedure N2Click(Sender: TObject);
    procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
      ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
      AShift: TShiftState; var AHandled: Boolean);
    procedure Tv1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Image2Click(Sender: TObject);
    procedure ToolButton4Click(Sender: TObject);
  private
        FLeft,FTop:Integer;
    procedure InitGrid();
    function  YSData(Order_Main10:TClientDataSet):Boolean;

    { Private declarations }
  public
    FCKNO:string;
    { Public declarations }
  end;

var
  frmCKProductBCPOutList: TfrmCKProductBCPOutList;

implementation
uses
  U_DataLink,U_Fun;

{$R *.dfm}


procedure TfrmCKProductBCPOutList.FormDestroy(Sender: TObject);
begin
  frmCKProductBCPOutList:=nil;
end;


procedure TfrmCKProductBCPOutList.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action:=caFree;
end;

procedure TfrmCKProductBCPOutList.InitGrid();
begin
  try
    ADOQueryMain.DisableControls;
    with ADOQueryMain do
    begin
      Filtered:=False;
      Close;
      sql.Clear;
      SQL.Add('select A.*,B.OrderNo,B.conNO,isnull(C.PRTCodeName,B.MPRTCodeName) MPRTCodeName,isnull(B.MPRTSpec,C.PRTSpec) MPRTSpec,B.MprtkuanNo,C.PrtkuanNo,C.PRTColor');
      sql.Add(',C.SOrddefstr1,C.SOrddefstr4,C.SOrddefstr6,isnull(B.MPRTMF,C.PRTMF) MPRTMF,isnull(B.MPRTKZ,C.PRTKZ) MPRTKZ,D.MJXH,C.MDPrice PRTPrice,C.PRTHX ');
      sql.Add(',C.SOrddefstr4,D.MJQty3,D.MJQty4');
      sql.Add(',khconNo=(select Top 1 KHConNo from JYOrderCon_Main JCM where JCM.ConNo=B.OrderNo)');
      sql.Add(',isnull(customerNoName,B.OrderNo) KHName');
      sql.Add(',D.mjstr4 as AOrdDefStr1,cast(D.MJXH as varchar) as MJXHM ');
      sql.add('from CK_BanCP_CR A ');
      Sql.add(' inner join JYOrder_Main B on B.MainId=A.MainId');
      Sql.add(' inner join JYOrder_Sub C on C.mainID=A.mainID and C.SubId=A.SubId');
      Sql.add(' inner join WFB_MJJY D on D.MJId=A.MJId');
      sql.add(' where A.CKOrdNo='''+trim(FCKNO)+''' ');
      SQL.Add(' and A.CRFlag=''出库'' ');
      Open;
      //ShowMessage(SQL.Text);
    end;
    SCreateCDS20(ADOQueryMain,CDS_Main);
    SInitCDSData20(ADOQueryMain,CDS_Main);
  finally
    ADOQueryMain.EnableControls;
  end;
end;

procedure TfrmCKProductBCPOutList.TBRafreshClick(Sender: TObject);
begin
  InitGrid();
end;

procedure TfrmCKProductBCPOutList.TBCloseClick(Sender: TObject);
begin
  WriteCxGrid('仓库出库列表',Tv1,'成品仓库');
  Close;
end;

procedure TfrmCKProductBCPOutList.FormShow(Sender: TObject);
begin
  ReadCxGrid('仓库出库列表',Tv1,'成品仓库');
  TBPrint.Visible:=true;
  ComboBox1.Visible:=true;
  ToolButton4.Visible:=true;
  InitGrid();
end;

procedure TfrmCKProductBCPOutList.TBPrintClick(Sender: TObject);
var
  fPrintFile,fPrintFile10,FMainID,FConNo:String;
begin
  if CDS_Main.IsEmpty then Exit;
  IF trim(ComboBox1.Text)='' then  exit;
  if CDS_Main.Locate('SSel',True,[])=False then
  begin
    Application.MessageBox('没有选择数据','提示',0);
    Exit;
  end;
  with ADOQueryCmd do
  begin
    Close;
    sql.Clear;
    sql.Add('delete TBSubID where DName='''+Trim(DCode)+'''');
    ExecSQL;
  end;
  with ADOQueryCmd do
  begin
    Close;
    sql.Clear;
    sql.Add('SELECT * FROM TBSubID where 1=2 ');
    open;
  end;
  FMainID:='';
  CDS_Main.DisableControls;
  try
    ADOQueryCmd.Connection.BeginTrans;
    with CDS_Main do
    begin
      First;
      while not Eof do
      begin
        If Fieldbyname('Ssel').AsBoolean then
        begin
          IF FMainID='' then
          begin
            FMainID:=Trim(CDS_Main.fieldbyname('mainID').AsString);
          end
          else
          begin
            if ComboBox1.ItemIndex<>1 then
            begin
              IF Trim(CDS_Main.fieldbyname('mainID').AsString)<>FMainID then
              begin
                application.MessageBox('选择的不是同一个指示单，不能一起打印！','提示信息',0);
                ADOQueryCmd.Connection.RollbackTrans;
                EnableControls;
                exit;
              end;
            end
          end;
          IF FConNo='' then
          begin
            FConNo:=Trim(CDS_Main.fieldbyname('ConNO').AsString);
          end
          else
          begin
            if ComboBox1.ItemIndex=1 then
            begin
              IF Trim(CDS_Main.fieldbyname('ConNO').AsString)<>FconNo then
              begin
                application.MessageBox('选择的不是同一个合同号，不能一起打印！','提示信息',0);
                ADOQueryCmd.Connection.RollbackTrans;
                EnableControls;
                exit;
              end;
            end;
          end;
          ADOQueryCmd.append;
          ADOQueryCmd.fieldbyname('SubId').Value:=Trim(CDS_Main.fieldbyname('MJID').AsString);
          ADOQueryCmd.fieldbyname('Dname').Value:=Trim(DCode);
          ADOQueryCmd.post;
        end;
        Next;
      end;
    end;
    ADOQueryCmd.Connection.CommitTrans;
  except
    ADOQueryCmd.Connection.RollbackTrans;
  end;
  CDS_Main.EnableControls;

  IF (trim(ComboBox1.Text)='出货确认书(二)') then
  begin
    with ADOQueryTemp do
    begin
      Close;
      sql.Clear;
      sql.add('exec P_Print_CKMD3 ');
      sql.add('@mainID='+quotedstr(Trim('')));
      sql.add(',@DName='+quotedstr(Trim(DCode)));
      Open;
    end;
    SCreateCDS20(ADOQueryTemp,CDS_HZ);
    SInitCDSData20(ADOQueryTemp,CDS_HZ);
  end else
  begin
    with ADOQueryTemp do
    begin
      Close;
      sql.Clear;
      sql.add('exec P_Print_CKMD ');
      sql.add('@mainID='+quotedstr(Trim('')));
      sql.add(',@DName='+quotedstr(Trim(DCode)));
      Open;
    end;
    SCreateCDS20(ADOQueryTemp,CDS_HZ);
    SInitCDSData20(ADOQueryTemp,CDS_HZ);
  end;
  fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+Trim(ComboBox1.Text)+'.rmf' ;
  if FileExists(fPrintFile) then
  begin
    RM3.LoadFromFile(fPrintFile);
    RM3.ShowReport;
  end
  else
  begin
    Application.MessageBox(PChar('没有找'+fPrintFile),'提示',0);
  end;
end;

procedure TfrmCKProductBCPOutList.N1Click(Sender: TObject);
begin
  SelOKNo(CDS_Main,True);
end;

procedure TfrmCKProductBCPOutList.N2Click(Sender: TObject);
begin
  SelOKNo(CDS_Main,False);
end;

function TfrmCKProductBCPOutList.YSData(Order_Main10:TClientDataSet):Boolean;
var
  CRID,YFID,PriceUnit,OrderUnit,FComTaiTou,FromSubID:String;
  fprice,huilv:double;
begin
  Result:=False;
  fprice:=0;
  with Order_Main10 do
  begin
    begin
      with ADOQueryTemp do
      begin
        Close;
        SQL.Clear;
        sql.Add('select Top 1 *,fPrice=dbo.F_Get_Order_Price(MainID,subID) from JYOrder_Sub Where subID='''+Trim(Order_Main10.fieldbyname('subID').AsString)+'''');
        Open;
      end;
      IF not ADOQueryTemp.IsEmpty then
      begin
        PriceUnit:=Trim(ADOQueryTemp.fieldbyname('PriceUnit').AsString);
        OrderUnit:=Trim(ADOQueryTemp.fieldbyname('OrderUnit').AsString);
        fPrice:= ADOQueryTemp.fieldbyname('fPrice').AsFloat;
        huilv:= ADOQueryTemp.fieldbyname('huilv').AsFloat;
      end;
      IF huilv=0 then huilv:=1;
      with ADOQueryTemp do
      begin
        Close;
        SQL.Clear;
        sql.Add('select * from YF_Money_KC where FactoryName='''+Trim(Order_Main10.fieldbyname('KHName').AsString)+'''');
        Open;
      end;
      if ADOQueryTemp.IsEmpty=False then
      begin
        CRID:=ADOQueryTemp.fieldbyname('CRID').AsString;
      end else
      begin
        with ADOQueryCmd do
        begin
          Close;
          sql.Clear;
          sql.Add('Update YF_Money_CRID set CRID=CRID+1');
          sql.Add('select * from YF_Money_CRID ');
          Open;
        end;
        CRID:=ADOQueryCmd.fieldbyname('CRID').AsString;
        with ADOQueryCmd do
        begin
          Close;
          SQL.Clear;
          sql.Add('select * from YF_Money_KC where 1=2');
          Open;
        end;
        with ADOQueryCmd do
        begin
          Append;
          FieldByName('CRID').Value:=StrToInt(CRID);
          FieldByName('FactoryName').Value:=Trim(Order_Main10.fieldbyname('KHName').AsString);
          FieldByName('ZdyStr1').Value:='应收收';
          Post;
        end;
      end;
      with ADOQueryTemp do
      begin
        Close;
        sql.Clear;
        sql.Add(' select * from YF_Money_CR where FactoryName='''+Trim(Order_Main10.fieldbyname('KHName').AsString)+'''');
        sql.Add(' and mainID='''+Trim(Order_Main10.fieldbyname('mainID').AsString)+'''');
        sql.Add(' and subID='''+Trim(Order_Main10.fieldbyname('subID').AsString)+'''');
        sql.Add(' and CPCKNo='''+Trim(Order_Main10.fieldbyname('CKOrdNo').AsString)+'''');
        sql.Add(' and CRTime='''+FormatDateTime('yyyy-MM-dd',Order_Main10.fieldbyname('CRTime').AsDateTime)+'''') ;
        sql.Add(' and YFName=''销售金额'' ');
        Open;
      end;
      if ADOQueryTemp.IsEmpty then
      begin
        if GetLSNo(ADOQueryCmd,YFID,'CS','YF_Money_CR',3,1)=False then
        begin
          Application.MessageBox('取成品应收最大号失败!','提示',0);
          Exit;
        end;
        with ADOQueryCmd do
        begin
          Close;
          sql.Clear;
          sql.Add('select * from YF_Money_CR where 1<>1');
          Open;
        end;
        with ADOQueryCmd do
        begin
          Append;
          FieldByName('YFID').Value:=Trim(YFID);
          FieldByName('YFTypeId').Value:=Trim(Order_Main10.fieldbyname('mainID').AsString);
          FieldByName('CRID').Value:=StrToInt(CRID);
          FieldByName('Filler').Value:=Trim(DName);
          FieldByName('CRType').Value:='应收款登记';
          FieldByName('CRFlag').Value:='应收收';
          FieldByName('QtyFlag').Value:=1;
          FieldByName('FactoryName').Value:=Trim(Order_Main10.fieldbyname('KHName').AsString);
          FieldByName('CPCKNo').Value:=Trim(Order_Main10.fieldbyname('CKOrdNo').AsString);
          FieldByName('CRTime').Value:=Trim(FormatDateTime('yyyy-MM-dd',Order_Main10.fieldbyname('CRTime').AsDateTime));
          FieldByName('YFType').Value:='自动生成';
          FieldByName('Price').Value:=fprice;
          FieldByName('HuiLv').Value:=huilv;
          FieldByName('BZType').Value:=Trim(PriceUnit);
          FieldByName('QtyUnit').Value:=Trim(OrderUnit);
          FieldByName('ComTaiTou').Value:=Trim(FComTaiTou);
          FieldByName('YFName').Value:='销售金额';
          FieldByName('MainId').Value:=Trim(Order_Main10.fieldbyname('Mainid').AsString);
          FieldByName('subID').Value:=Trim(Order_Main10.fieldbyname('subID').AsString);
          FieldByName('status').Value:='0';
          Post;
        end;
      end  else
      begin
        YFID:=Trim(ADOQueryTemp.fieldbyname('YFID').AsString);
      end;
      IF uppercase(OrderUnit)='KG' then
      begin
        with ADOQueryCmd do
        begin
          Close;
          sql.Clear;
          sql.Add('update YF_Money_CR Set Qty=(select isnull(Sum(B.MJMaoZ),0) from CK_BanCP_CR A,WFB_MJJY B where A.MJID=B.MJID and A.CKOrdNo=YF_Money_CR.CPCKNo');
          SQL.Add(' and A.MainID=YF_Money_CR.MainID and A.subID=YF_Money_CR.subID and A.CRtime=YF_Money_CR.CRTime and A.CRType=''销售出库'') ');
          sql.Add(',PS=(select isnull(count(A.mainID),0) from CK_BanCP_CR A where A.maiNID=YF_Money_CR.maiNID and A.subID=YF_Money_CR.subID and A.CKOrdNo=YF_Money_CR.CPCKNo ');
          SQL.Add(' and A.CRtime=YF_Money_CR.CRTime and A.CRType=''销售出库'')  ');
          sql.Add(',Qty1=(select isnull(Sum(B.MJQty2),0) from CK_BanCP_CR A,WFB_MJJY B where A.MJID=B.MJID and  A.MainID=YF_Money_CR.MainID and A.CKOrdNo=YF_Money_CR.CPCKNo ');
          SQL.Add(' and A.subID=YF_Money_CR.subID and A.CRtime=YF_Money_CR.CRTime and A.CRType=''销售出库'') ');
          sql.Add(' where YFID='''+Trim(YFID)+'''');
          ExecSQL;
        end;
      end
      else
      begin
        with ADOQueryCmd do
        begin
          Close;
          sql.Clear;
          sql.Add('update YF_Money_CR Set Qty=(select isnull(Sum(A.Qty),0) from CK_BanCP_CR A where A.MainID=YF_Money_CR.MainID and A.CKOrdNo=YF_Money_CR.CPCKNo ');
          SQL.Add('and A.subID=YF_Money_CR.subID and A.CRtime=YF_Money_CR.CRTime and A.CRType=''销售出库'') ');
          sql.Add(',PS=(select isnull(count(A.mainID),0) from CK_BanCP_CR A where A.maiNID=YF_Money_CR.maiNID and A.CKOrdNo=YF_Money_CR.CPCKNo ');
          SQL.ADD(' and A.subID=YF_Money_CR.subID and A.CRtime=YF_Money_CR.CRTime and A.CRType=''销售出库'')  ');
          sql.Add(',Qty1=(select isnull(Sum(B.MJQty2),0) from CK_BanCP_CR A,WFB_MJJY B where A.MJID=B.MJID and A.CKOrdNo=YF_Money_CR.CPCKNo ');
          SQL.Add(' and  A.MainID=YF_Money_CR.MainID and A.subID=YF_Money_CR.subID and A.CRtime=YF_Money_CR.CRTime and A.CRType=''销售出库'') ');
          sql.Add(' where YFID='''+Trim(YFID)+'''');
          ExecSQL;
        end;
      end;
      with ADOQueryCmd do
      begin
        Close;
        sql.Clear;
        sql.Add('Update YF_Money_CR Set Money=Price*Qty,BBMoney=Price*Qty*HuiLv');
        sql.Add(' where YFID='''+Trim(YFID)+'''');
        ExecSQL;
      end;
      with ADOQueryTemp do
      begin
        Close;
        sql.Clear;
        sql.Add('select * from YF_Money_CR where YFId='''+Trim(YFID)+'''');
        Open;
      end;
      if ADOQueryTemp.FieldByName('Qty').Value=0 then
      begin
        with ADOQueryCmd do
        begin
          Close;
          sql.Clear;
          sql.Add('delete from YF_Money_CR where YFID='''+Trim(YFID)+'''');
          ExecSQL;
        end;
      end;
      //Next;
    end;
  end;
  Result:=True;
end;

procedure TfrmCKProductBCPOutList.Tv1CellDblClick(
  Sender: TcxCustomGridTableView;
  ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
  AShift: TShiftState; var AHandled: Boolean);
begin
  Panel4.Visible:=true;
  Panel4.Left:=FLeft;
  Panel4.Top:=FTop+110;
  Panel10.Caption:=Trim(TV1.Controller.FocusedColumn.Caption);
  RichEdit1.Text:=CDS_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString;
  application.ProcessMessages;
end;

procedure TfrmCKProductBCPOutList.Tv1MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  FLeft:=X;
  FTop:=Y;
end;

procedure TfrmCKProductBCPOutList.Image2Click(Sender: TObject);
begin
 Panel4.Visible:=False;
end;

procedure TfrmCKProductBCPOutList.ToolButton4Click(Sender: TObject);
var
  fPrintFile,fPrintFile10,FMainID,FConNO:String;
begin
  if CDS_Main.IsEmpty then Exit;
  IF trim(ComboBox1.Text)='' then exit;
  if CDS_Main.Locate('SSel',True,[])=False then
  begin
    Application.MessageBox('没有选择数据','提示',0);
    Exit;
  end;
  with ADOQueryCmd do
  begin
    Close;
    sql.Clear;
    sql.Add('delete TBSubID where DName='''+Trim(DCode)+'''');
    ExecSQL;
  end;
  with ADOQueryCmd do
  begin
    Close;
    sql.Clear;
    sql.Add('SELECT * FROM TBSubID where 1=2 ');
    open;
  end;
  FMainID:='';
  CDS_Main.DisableControls;
  try
    ADOQueryCmd.Connection.BeginTrans;
    with CDS_Main do
    begin
      First;
      while not Eof do
      begin
        If Fieldbyname('Ssel').AsBoolean then
        begin
          IF FConNo='' then
          begin
            FConNo:=Trim(CDS_Main.fieldbyname('ConNO').AsString);
          end
          else
          begin
            IF Trim(CDS_Main.fieldbyname('ConNO').AsString)<>FconNo then
            begin
              application.MessageBox('选择的不是同一个合同号，不能一起打印！','提示信息',0);
              ADOQueryCmd.Connection.RollbackTrans;
              EnableControls;
              exit;
            end;
          end;
          ADOQueryCmd.append;
          ADOQueryCmd.fieldbyname('SubId').Value:=Trim(CDS_Main.fieldbyname('MJID').AsString);
          ADOQueryCmd.fieldbyname('Dname').Value:=Trim(DCode);
          ADOQueryCmd.post;
        end;
        Next;
      end;
    end;
    ADOQueryCmd.Connection.CommitTrans;
  except
    ADOQueryCmd.Connection.RollbackTrans;
  end;
  CDS_Main.EnableControls;
  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.add('exec P_Print_CKMD_HZ ');
    sql.add('@mainID='+quotedstr(Trim('')));
    sql.add(',@DName='+quotedstr(Trim(DCode)));
    //sql.add(',@flag=''0'' ');
    Open;
  end;
  SCreateCDS20(ADOQueryTemp,CDS_HZ);
  SInitCDSData20(ADOQueryTemp,CDS_HZ);
  fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\出货单.rmf' ;
  if FileExists(fPrintFile) then
  begin
    RM3.LoadFromFile(fPrintFile);
    RM3.ShowReport;
  end
  else
  begin
    Application.MessageBox(PChar('没有找'+fPrintFile),'提示',0);
  end;
end;

end.
