<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="3.24.6" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="1776" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" ReportOptions.CreateDate="39057,5831791898" ReportOptions.Description.Text="" ReportOptions.LastChange="39554,6345926389" ScriptLanguage="PascalScript" ScriptText.Text="procedure cbxDateOnClick(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  Label1.Enabled := cbxDate.Checked;&#13;&#10;  Label2.Enabled := cbxDate.Checked;&#13;&#10;  DtBeg.Enabled := cbxDate.Checked;&#13;&#10;  DtEnd.Enabled := cbxDate.Checked;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure frxReportOnStartReport(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  TableClient.Close;&#13;&#10;  if dlgMain.ShowModal = mrOK then&#13;&#10;  begin&#13;&#10;    if cbxDate.Checked then&#13;&#10;    begin&#13;&#10;      TableClient.SQL.Strings[4] := 'AND CD.DELTADATE BETWEEN ''' + DateToStr(DtBeg.Date) + ''' AND ''' + DateToStr(DtEnd.Date) + '''';&#13;&#10;      TableClient.SQL.Strings[16] := TableClient.SQL.Strings[4];&#13;&#10;    end;&#13;&#10;    if cbxOrder.ItemIndex = 1 then&#13;&#10;      TableClient.SQL.Strings[25] := 'ORDER BY 4 DESC, 2';&#13;&#10;    TableClient.ParamByName('COUNTERTYPEID').Value := cbxCounterType.Items.Objects[cbxCounterType.ItemIndex];&#13;&#10;    TableClient.Open;&#13;&#10;&#13;&#10;    Memo8.Text := ' : &#34;' + cbxCounterType.Items.Strings[cbxCounterType.ItemIndex] + '&#34;';&#13;&#10;    if cbxDate.Checked then&#13;&#10;      Memo8.Text := Memo8.Text + '  :  ' + DateToStr(DtBeg.Date) + '  ' + DateToStr(DtEnd.Date);&#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;    TableClient.ParamByName('COUNTERTYPEID').Value := 0;&#13;&#10;    StopReport;&#13;&#10;  end;&#13;&#10;end;&#13;&#10;&#13;&#10;procedure dlgMainOnShow(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;  DtBeg.Date := Date; DtEnd.Date := Date;&#13;&#10;  with TableCounterType do&#13;&#10;  begin&#13;&#10;    Open;&#13;&#10;    if IsEmpty then&#13;&#10;    begin&#13;&#10;      btnOK.Enabled := false;&#13;&#10;      RaiseException('    !');&#13;&#10;    end;&#13;&#10;    First;&#13;&#10;    while not EOF do&#13;&#10;    begin&#13;&#10;      cbxCounterType.Items.AddObject(FieldByName('NAME').AsString, TObject(FieldByName('ID').AsInteger));&#13;&#10;      Next;&#13;&#10;    end;&#13;&#10;    cbxCounterType.ItemIndex := 0;&#13;&#10;  end;&#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end." OnStartReport="frxReportOnStartReport" PropData="044C656674023403546F70026C08446174617365747301010C3700000020446174615365743D22667278446174614865616465722220446174615365744E616D653D22C7E0E3EEEBEEE2EEEA20EEF2F7E5F2E02200010C2C00000020446174615365743D225461626C65436C69656E742220446174615365744E616D653D22CAEBE8E5EDF2FB2200010C3800000020446174615365743D225461626C65436F756E746572547970652220446174615365744E616D653D22C2E8E4FB20F1F7E5F2F7E8EAEEE2220000095661726961626C65730100055374796C650100">
  <TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
    <TfrxReportTitle Name="ReportTitle1" Height="37,7953" Left="0" Top="18,89765" Width="718,1107" Stretched="True">
      <TfrxMemoView Name="Memo2" Left="0" Top="0" Width="718,1107" Height="18,89765" StretchMode="smActualHeight" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" Text="[Заголовок отчета.&#34;Наименование отчета&#34;]"/>
      <TfrxMemoView Name="Memo8" Left="0" Top="18,89765" Width="718,1107" Height="18,89765" StretchMode="smActualHeight" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" Text=""/>
    </TfrxReportTitle>
    <TfrxPageFooter Name="PageFooter1" Height="18,89765" Left="0" Top="283,46475" Width="718,1107">
      <TfrxMemoView Name="Memo20" Left="336,37817" Top="0" Width="120,94496" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Date]"/>
      <TfrxMemoView Name="Memo21" Left="457,32313" Top="0" Width="102,04731" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="12" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[Time]"/>
      <TfrxMemoView Name="Memo22" Left="559,37044" Top="0" Width="158,74026" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Страница [Page#] из [TotalPages#]"/>
    </TfrxPageFooter>
    <TfrxPageHeader Name="PageHeader1" Height="18,89765" Left="0" Top="79,37013" Width="718,1107">
      <TfrxLineView Name="Line1" Left="0" Top="0" Width="0" Height="18,89765" Frame.Typ="1" Frame.Width="2"/>
      <TfrxLineView Name="Line7" Left="718,1107" Top="0" Width="0" Height="18,89765" Frame.Typ="1" Frame.Width="2"/>
      <TfrxLineView Name="Line9" Left="0" Top="18,89765" Width="718,1107" Height="0" Frame.Typ="4" Frame.Width="2"/>
      <TfrxMemoView Name="Memo5" Left="0" Top="0" Width="309,92146" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="7" HAlign="haCenter" ParentFont="False" Text="Ф. И. О."/>
      <TfrxMemoView Name="Memo10" Left="544,25232" Top="0" Width="173,85838" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="7" HAlign="haCenter" ParentFont="False" Text="Накопления"/>
      <TfrxMemoView Name="Memo6" Left="309,92146" Top="0" Width="234,33086" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="4" HAlign="haCenter" ParentFont="False" Text="Карта"/>
      <TfrxLineView Name="Line2" Left="0" Top="0" Width="718,1107" Height="0" Frame.Typ="4" Frame.Width="2"/>
    </TfrxPageHeader>
    <TfrxReportSummary Name="ReportSummary1" Height="18,89765" Left="0" Top="241,88992" Width="718,1107">
      <TfrxLineView Name="Line4" Left="0" Top="18,89765" Width="718,1107" Height="0" Frame.Typ="4" Frame.Width="2"/>
      <TfrxLineView Name="Line5" Left="718,1107" Top="0" Width="0" Height="18,89765" Frame.Typ="1" Frame.Width="2"/>
      <TfrxMemoView Name="Memo13" Left="0" Top="0" Width="544,25232" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-16" Font.Name="Arial" Font.Style="1" Frame.Typ="9" ParentFont="False" Text="Итого:"/>
      <TfrxLineView Name="Line3" Left="0" Top="0" Width="0" Height="18,89765" Frame.Typ="1" Frame.Width="2"/>
      <TfrxMemoView Name="Memo7" Left="544,25232" Top="0" Width="173,85838" Height="18,89765" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="1" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;Клиенты.&#34;SUMM&#34;&#62;,MasterData1) #n%2,3f]"/>
    </TfrxReportSummary>
    <TfrxIBXQuery Name="TableClient" UserName="" CloseDataSource="True" FieldAliases.Text="" SQL.Text="SELECT CL.NAME, UPPER(CL.NAME),&#13;&#10;       CAST('' AS VARCHAR(40)) AS VAL,&#13;&#10;       (&#13;&#10;        NULLTONUM((SELECT SUM(CD.DELTA) FROM COUNTERD CD WHERE CD.COUNTERID = CNR.ID&#13;&#10;&#13;&#10;                 ))) AS SUMM&#13;&#10;FROM COUNTER CNR JOIN CLIENTCOUNTER CCR ON&#13;&#10;                 CCR.COUNTERID = CNR.ID&#13;&#10;                 JOIN CLIENT CL ON&#13;&#10;                 CCR.CLIENTID = CL.ID&#13;&#10;WHERE CNR.COUNTERTYPEID = :COUNTERTYPEID&#13;&#10;UNION&#13;&#10;SELECT CL.NAME, UPPER(CL.NAME),&#13;&#10;       (SELECT C.VAL FROM CCARD C WHERE C.ID = CCC.CCARDID) AS VAL,&#13;&#10;       (&#13;&#10;        NULLTONUM((SELECT SUM(CD.DELTA) FROM COUNTERD CD WHERE CD.COUNTERID = CNR.ID&#13;&#10;&#13;&#10;                 ))) AS SUMM&#13;&#10;FROM COUNTER CNR JOIN CCARDCOUNTER CCC ON&#13;&#10;                 CNR.ID = CCC.COUNTERID&#13;&#10;                 JOIN CLIENTCARD CC ON&#13;&#10;                 CC.CCARDID = CCC.CCARDID&#13;&#10;                 JOIN CLIENT CL ON&#13;&#10;                 CC.CLIENTID = CL.ID&#13;&#10;WHERE CNR.COUNTERTYPEID = :COUNTERTYPEID&#13;&#10;ORDER BY 2, 4 DESC" PropData="0A506172616D657465727301010C2A000000204E616D653D22434F554E544552545950454944222044617461547970653D226674556E6B6E6F776E2200010C2A000000204E616D653D22434F554E544552545950454944222044617461547970653D226674556E6B6E6F776E220000"/>
    <TfrxMasterData Name="MasterData1" Height="22,67718" Left="0" Top="158,74026" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="TableClient" DataSetName="" PrintIfDetailEmpty="True" RowCount="0" Stretched="True">
      <TfrxMemoView Name="Memo1" Left="0" Top="0" Width="309,92146" Height="22,67718" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="13" ParentFont="False" VAlign="vaCenter" Text="[Клиенты.&#34;NAME&#34;]"/>
      <TfrxMemoView Name="Memo3" Left="544,25232" Top="0" Width="173,85838" Height="22,67718" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="14" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[Клиенты.&#34;SUMM&#34; #n%2,3f]"/>
      <TfrxMemoView Name="Memo4" Left="309,92146" Top="0" Width="234,33086" Height="22,67718" StretchMode="smMaxHeight" Font.Charset="1" Font.Color="-16777208" Font.Height="-17" Font.Name="Arial" Font.Style="0" Frame.Typ="15" ParentFont="False" VAlign="vaCenter" Text="[Клиенты.&#34;VAL&#34;]"/>
      <TfrxLineView Name="Line6" Left="0" Top="0" Width="0" Height="22,67718" StretchMode="smMaxHeight" Frame.Typ="1" Frame.Width="2"/>
      <TfrxLineView Name="Line8" Left="718,1107" Top="0" Width="0" Height="22,67718" StretchMode="smMaxHeight" Frame.Typ="1" Frame.Width="2"/>
    </TfrxMasterData>
  </TfrxReportPage>
  <TfrxDialogPage Name="dlgMain" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="0" Visible="False" BorderStyle="bsDialog" Caption="   " Height="203" Left="392" Top="227" Width="300" OnShow="dlgMainOnShow">
    <TfrxComboBoxControl Name="cbxCounterType" Left="84" Top="12" Width="145" Height="21" Color="-16777211" Items.Text="" Style="csDropDownList" ItemIndex="-1"/>
    <TfrxCheckBoxControl Name="cbxDate" Left="92" Top="40" Width="97" Height="17" Alignment="taLeftJustify" Caption=" :" Color="-16777201" OnClick="cbxDateOnClick"/>
    <TfrxDateEditControl Name="DtBeg" Left="44" Top="64" Width="89" Height="21" Enabled="False" Color="-16777211" Date="39328,7394298958" Time="39328,7394298958"/>
    <TfrxDateEditControl Name="DtEnd" Left="184" Top="64" Width="85" Height="21" Enabled="False" Color="-16777211" Date="39328,7394906597" Time="39328,7394906597"/>
    <TfrxLabelControl Name="Label1" Left="16" Top="68" Width="11" Height="13" Enabled="False" Caption=":" Color="-16777201"/>
    <TfrxLabelControl Name="Label2" Left="152" Top="68" Width="17" Height="13" Enabled="False" Caption=":" Color="-16777201"/>
    <TfrxIBXQuery Name="TableCounterType" UserName=" " CloseDataSource="True" FieldAliases.Text="" SQL.Text="SELECT *&#13;&#10;FROM COUNTERTYPE&#13;&#10;ORDER BY CODE" PropData="0A506172616D65746572730100"/>
    <TfrxComboBoxControl Name="cbxOrder" Left="96" Top="100" Width="133" Height="21" Color="-16777211" Items.Text="...&#13;&#10;" Style="csDropDownList" Text="..." ItemIndex="0"/>
    <TfrxButtonControl Name="btnOK" Left="64" Top="140" Width="75" Height="25" Caption="OK" ModalResult="1"/>
    <TfrxLabelControl Name="Label3" Left="8" Top="104" Width="80" Height="13" Caption=" :" Color="-16777201"/>
    <TfrxButtonControl Name="bntCancel" Left="160" Top="140" Width="75" Height="25" Cancel="True" Caption="" ModalResult="2"/>
  </TfrxDialogPage>
</TfrxReport>
