<?xml version="1.0" encoding="utf-8" standalone="no"?>
<TfrxReport Version="5.4.6" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.Author="unionsystem" ReportOptions.CreateDate="41561,8945570602" ReportOptions.Description.Text="" ReportOptions.Name="Venda por quadrante" ReportOptions.LastChange="42986,4352436458" ScriptLanguage="PascalScript" ScriptText.Text="&#13;&#10;function Ext1(Valor: Real): String;&#13;&#10;begin&#13;&#10;  // Linha 1&#13;&#10;&#13;&#10;  Result := Copy(Extenso(Valor), 0, 80);&#13;&#10;&#13;&#10;  while Length(Result) &#60;&#62; 80 do Result := Result + '*';&#13;&#10;end;&#13;&#10;&#13;&#10;function Ext2(Valor: Real): String;&#13;&#10;begin&#13;&#10;  // Linha 2&#13;&#10;&#13;&#10;  Result := Copy(Extenso(Valor), 81, 80);&#13;&#10;&#13;&#10;  while Length(Result) &#60;&#62; 80 do Result := Result + '*';&#13;&#10;end;&#13;&#10;&#13;&#10;function Ext3(Valor: Real): String;&#13;&#10;begin&#13;&#10;  // Linha 3&#13;&#10;&#13;&#10;  Result := Copy(Extenso(Valor), 162, 80);&#13;&#10;&#13;&#10;  while Length(Result) &#60;&#62; 80 do Result := Result + '*';&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;function Extenso(Valor: Real): String;&#13;&#10;&#13;&#10;function Mini(Valor: String): String;&#13;&#10;var&#13;&#10;  Texto : array[0..36] of string = (['A','UM', 'DOIS', 'TRES', 'QUATRO', 'CINCO', 'SEIS', 'SETE',&#13;&#10;                                   'OITO', 'NOVE', 'DEZ', 'ONZE', 'DOZE', 'TREZE', 'CATORZE',&#13;&#10;                                   'QUINZE', 'DEZESSEIS', 'DEZESSETE', 'DEZOITO', 'DEZENOVE',&#13;&#10;                                   'VINTE', 'TRINTA', 'QUARENTA', 'CINQÜENTA', 'SESSENTA',&#13;&#10;                                   'SETENTA', 'OITENTA', 'NOVENTA', 'CENTO', 'DUZENTOS',&#13;&#10;                                   'TREZENTOS', 'QUATROCENTOS', 'QUINHENTOS', 'SEISCENTOS', 'SETECENTOS', 'OITOCENTOS', 'NOVECENTOS']);&#13;&#10;begin&#13;&#10;  // Mini extenso&#13;&#10;&#13;&#10;  Result := '';&#13;&#10;&#13;&#10;  if Valor &#60;&#62; '000' then&#13;&#10;  begin&#13;&#10;    if StrToInt(Valor) &#60;= 20 then&#13;&#10;    begin&#13;&#10;      Result := Result + Texto[StrToInt(Valor)];&#13;&#10;    end&#13;&#10;    else&#13;&#10;    if (StrToInt(Valor) &#62; 20) and (StrToInt(Valor) &#60; 100) then&#13;&#10;    begin&#13;&#10;      if Copy(Valor, 2, 1) = '2' then Result := Result + Texto[20];&#13;&#10;      if Copy(Valor, 2, 1) = '3' then Result := Result + Texto[21];&#13;&#10;      if Copy(Valor, 2, 1) = '4' then Result := Result + Texto[22];&#13;&#10;      if Copy(Valor, 2, 1) = '5' then Result := Result + Texto[23];&#13;&#10;      if Copy(Valor, 2, 1) = '6' then Result := Result + Texto[24];&#13;&#10;      if Copy(Valor, 2, 1) = '7' then Result := Result + Texto[25];&#13;&#10;      if Copy(Valor, 2, 1) = '8' then Result := Result + Texto[26];&#13;&#10;      if Copy(Valor, 2, 1) = '9' then Result := Result + Texto[27];&#13;&#10;&#13;&#10;      if Copy(Valor, 3, 1) &#60;&#62; '0' then Result := Result + ' E ' + Texto[StrToInt(Copy(Valor, 3, 1))];&#13;&#10;    end&#13;&#10;    else&#13;&#10;    if StrToInt(Valor) &#62; 99 then&#13;&#10;    begin&#13;&#10;      if Valor = '100' then Result := Result + 'CEM' else&#13;&#10;      begin&#13;&#10;        if Copy(Valor, 1, 1) = '1' then Result := Result + Texto[28];&#13;&#10;        if Copy(Valor, 1, 1) = '2' then Result := Result + Texto[29];&#13;&#10;        if Copy(Valor, 1, 1) = '3' then Result := Result + Texto[30];&#13;&#10;        if Copy(Valor, 1, 1) = '4' then Result := Result + Texto[31];&#13;&#10;        if Copy(Valor, 1, 1) = '5' then Result := Result + Texto[32];&#13;&#10;        if Copy(Valor, 1, 1) = '6' then Result := Result + Texto[33];&#13;&#10;        if Copy(Valor, 1, 1) = '7' then Result := Result + Texto[34];&#13;&#10;        if Copy(Valor, 1, 1) = '8' then Result := Result + Texto[35];&#13;&#10;        if Copy(Valor, 1, 1) = '9' then Result := Result + Texto[36];&#13;&#10;      end;&#13;&#10;&#13;&#10;      if (StrToInt(Copy(Valor, 2, 2)) &#60;= 20) and (StrToInt(Copy(Valor, 2, 2)) &#62; 0) then&#13;&#10;      begin&#13;&#10;        Result := Result + ' E ' + Texto[StrToInt(Copy(Valor, 2, 2))];&#13;&#10;      end&#13;&#10;      else&#13;&#10;      if StrToInt(Copy(Valor, 2, 2)) &#62; 20 then&#13;&#10;      begin&#13;&#10;        if Copy(Valor, 2, 1) = '2' then Result := Result + ' E ' + Texto[20];&#13;&#10;        if Copy(Valor, 2, 1) = '3' then Result := Result + ' E ' + Texto[21];&#13;&#10;        if Copy(Valor, 2, 1) = '4' then Result := Result + ' E ' + Texto[22];&#13;&#10;        if Copy(Valor, 2, 1) = '5' then Result := Result + ' E ' + Texto[23];&#13;&#10;        if Copy(Valor, 2, 1) = '6' then Result := Result + ' E ' + Texto[24];&#13;&#10;        if Copy(Valor, 2, 1) = '7' then Result := Result + ' E ' + Texto[25];&#13;&#10;        if Copy(Valor, 2, 1) = '8' then Result := Result + ' E ' + Texto[26];&#13;&#10;        if Copy(Valor, 2, 1) = '9' then Result := Result + ' E ' + Texto[27];&#13;&#10;&#13;&#10;        if Copy(Valor, 3, 1) &#60;&#62; '0' then Result := Result + ' E ' + Texto[StrToInt(Copy(Valor, 3, 1))];&#13;&#10;      end;&#13;&#10;    end;&#13;&#10;  end;&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;var&#13;&#10;  ValorF: String;&#13;&#10;  Bilhao, Milhao, Milhar, Centena, Centavos: String;&#13;&#10;begin&#13;&#10;  // Verifico&#13;&#10;&#13;&#10;  if (Valor &#60; 0) or (Valor &#62; 999999999999.99) then&#13;&#10;  begin&#13;&#10;    Result := 'VALOR INVÁLIDO!!!';&#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;    // Formato o valor e jogo numa variável&#13;&#10;&#13;&#10;    ValorF := FormatFloat('###,###,###,###,##000000000000.00', Valor);&#13;&#10;&#13;&#10;    // Divido o valor formatado e jogo em variáveis&#13;&#10;&#13;&#10;    Bilhao   := Copy(ValorF, 0, 3);&#13;&#10;    Milhao   := Copy(ValorF, 5, 3);&#13;&#10;    Milhar   := Copy(ValorF, 9, 3);&#13;&#10;    Centena  := Copy(ValorF, 13, 3);&#13;&#10;    Centavos := '0' + Copy(ValorF, 17, 2);&#13;&#10;&#13;&#10;    Result := '';&#13;&#10;&#13;&#10;    if Mini(Bilhao) &#60;&#62; '' then&#13;&#10;    begin&#13;&#10;      if StrToInt(Bilhao) = 1 then Result := Result + Mini(Bilhao) + ' ' + 'BILHAO' else Result := Result + Mini(Bilhao) + ' ' + 'BILHOES';&#13;&#10;    end;&#13;&#10;&#13;&#10;    if Mini(Milhao) &#60;&#62; '' then&#13;&#10;    begin&#13;&#10;      if Mini(Bilhao) &#60;&#62; '' then Result := Result + ', ';&#13;&#10;&#13;&#10;      if StrToInt(Milhao) = 1 then Result := Result + Mini(Milhao) + ' ' + 'MILHAO' else Result := Result + Mini(Milhao) + ' ' + 'MILHOES';&#13;&#10;    end;&#13;&#10;&#13;&#10;    if Mini(Milhar) &#60;&#62; '' then&#13;&#10;    begin&#13;&#10;      if (Mini(Bilhao) &#60;&#62; '') or (Mini(Milhao) &#60;&#62; '') then Result := Result + ', ';&#13;&#10;&#13;&#10;      Result := Result + Mini(Milhar) + ' ' + 'MIL';&#13;&#10;    end;&#13;&#10;&#13;&#10;    if Mini(Centena) &#60;&#62; '' then&#13;&#10;    begin&#13;&#10;      if (Mini(Bilhao) &#60;&#62; '') or (Mini(Milhao) &#60;&#62; '') or (Mini(Milhar) &#60;&#62; '') then Result := Result + ', ';&#13;&#10;&#13;&#10;      Result := Result + Mini(Centena);&#13;&#10;    end;&#13;&#10;&#13;&#10;    if Trunc(Valor) &#62; 1 then Result := Result + ' REAIS' else if Trunc(Valor) = 1 then Result := Result + ' REAL';&#13;&#10;&#13;&#10;    if Mini(Centavos) &#60;&#62; '' then&#13;&#10;    begin&#13;&#10;      if (Mini(Bilhao) &#60;&#62; '') or (Mini(Milhao) &#60;&#62; '') or (Mini(Milhar) &#60;&#62; '') or (Mini(Centena) &#60;&#62; '') then Result := Result + ' E ';&#13;&#10;&#13;&#10;      Result := Result + Mini(Centavos) + ' CENTAVOS';&#13;&#10;    end;&#13;&#10;  end;&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;procedure Page1OnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10;    if &#60;Logo&#62; &#60;&#62; '' then&#13;&#10;      Picture1.picture.loadfromfile(&#60;Logo&#62;);&#13;&#10;end;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end.">
  <Datasets>
    <item DataSet="dados" DataSetName="dados"/>
    <item DataSet="fparametros" DataSetName="parametros"/>
  </Datasets>
  <Variables>
    <item Name=" externas"/>
    <item Name="logo"/>
    <item Name="mostravalor"/>
  </Variables>
  <TfrxDataPage Name="frxDataPage1" Height="1000" Left="0" Top="0" Width="1000"/>
  <TfrxReportPage Name="Page1" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" PrintIfEmpty="False" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page1OnBeforePrint">
    <TfrxMasterData Name="MasterData1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="16,99134" Left="0" Top="385,51206" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="dados" DataSetName="dados" PrintIfDetailEmpty="True" RowCount="0">
      <TfrxMemoView Name="dadosproduto" Left="79,37013" Top="1,77953" Width="253,22826591" Height="15,11812" DataField="produto" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[dados.&#34;produto&#34;]"/>
      <TfrxMemoView Name="Memo7" Left="340,1577" Top="1,77953" Width="94,48800591" Height="15,11812" DataField="quantidade" DataSet="dados" DataSetName="dados" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[dados.&#34;quantidade&#34;]"/>
      <TfrxMemoView Name="Memo8" Left="442,20501" Top="1,77953" Width="94,48800591" Height="15,11812" DataField="total" DataSet="dados" DataSetName="dados" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[dados.&#34;total&#34;]"/>
      <TfrxMemoView Name="Memo9" Left="548,03185" Top="1,77953" Width="94,48800591" Height="15,11812" DataField="media" DataSet="dados" DataSetName="dados" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[dados.&#34;media&#34;]"/>
    </TfrxMasterData>
    <TfrxPageHeader Name="PageHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="69,25201" Left="0" Top="177,63791" Width="718,1107" PrintOnFirstPage="False">
      <TfrxMemoView Name="Page" Left="546,81138" Top="34,57483" Width="166,29932" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="Página [Page] de [TotalPages#]"/>
      <TfrxMemoView Name="Date" Left="548,03185" Top="11,33859" Width="166,29932" Height="18,89765" DisplayFormat.FormatStr="dd mmmm yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[Date]"/>
    </TfrxPageHeader>
    <TfrxFooter Name="Footer1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="238,11039" Left="0" Top="480,00031" Width="718,1107">
      <TfrxSysMemoView Name="SysMemo1" Left="340,1577" Top="11,33859" Width="94,48825" Height="18,89765" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;dados.&#34;quantidade&#34;&#62;,MasterData1)]"/>
      <TfrxSysMemoView Name="SysMemo2" Left="442,20501" Top="11,33859" Width="94,48825" Height="18,89765" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;dados.&#34;total&#34;&#62;,MasterData1)]"/>
      <TfrxMemoView Name="Memo10" Left="200,31509" Top="11,33859" Width="128,50402" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" HAlign="haRight" ParentFont="False" Text="TOTAL GERAL:"/>
    </TfrxFooter>
    <TfrxPageFooter Name="PageFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,89765" Left="0" Top="778,58318" Width="718,1107">
      <TfrxMemoView Name="Memo22" Align="baWidth" Left="0" Top="1,77953" Width="718,1107" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="unionsystem sistemas - www.unionsystem.com.br"/>
    </TfrxPageFooter>
    <TfrxGroupHeader Name="GroupHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="56,69295" Left="0" Top="306,14193" Width="718,1107" Condition="dados.&#34;quadrante&#34;">
      <TfrxMemoView Name="dadosquadrante" Align="baWidth" Left="0" Top="11,55906" Width="718,1107" Height="18,89765" DataField="quadrante" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-12" Font.Name="Arial" Font.Style="1" Frame.Style="fsDot" Frame.Typ="4" ParentFont="False" Text="[dados.&#34;quadrante&#34;]"/>
      <TfrxMemoView Name="Memo1" Left="79,37013" Top="41,57483" Width="253,22851" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" ParentFont="False" Text="Produto"/>
      <TfrxMemoView Name="Memo2" Left="340,1577" Top="41,57483" Width="94,48825" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haRight" ParentFont="False" Text="Quantidade"/>
      <TfrxMemoView Name="Memo3" Left="442,20501" Top="41,57483" Width="94,48825" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haRight" ParentFont="False" Text="Valor"/>
      <TfrxMemoView Name="Memo6" Left="548,03185" Top="41,57483" Width="94,48825" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" HAlign="haRight" ParentFont="False" Text="Preço médio"/>
    </TfrxGroupHeader>
    <TfrxGroupFooter Name="GroupFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="30,23624" Left="0" Top="427,08689" Width="718,1107">
      <TfrxSysMemoView Name="SysMemo4" Left="340,1577" Top="2" Width="94,48825" Height="18,89765" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;dados.&#34;quantidade&#34;&#62;,MasterData1)]"/>
      <TfrxSysMemoView Name="SysMemo5" Left="442,20501" Top="2" Width="94,48825" Height="18,89765" DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;dados.&#34;total&#34;&#62;,MasterData1)]"/>
    </TfrxGroupFooter>
    <TfrxReportTitle Name="ReportTitle1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="136,06308" Left="0" Top="18,89765" Width="718,1107">
      <TfrxPictureView Name="Picture1" Left="3,77953" Top="3,77953" Width="223,50402" Height="105,66141" DataSet="dados" DataSetName="dados" HightQuality="False" Transparent="False" TransparentColor="16777215"/>
      <TfrxMemoView Name="parametrosrazao" Align="baCenter" Left="229,91744" Top="82,62987" Width="258,27582" Height="26,45671" DataSet="fparametros" DataSetName="parametros" Font.Charset="1" Font.Color="0" Font.Height="-19" Font.Name="Arial" Font.Style="1" HAlign="haCenter" ParentFont="False" Text="Vendas por quadrante"/>
      <TfrxLineView Name="Line1" Align="baWidth" Left="0" Top="120,94496" Width="718,1107" Height="0" Color="0" Frame.Typ="4"/>
      <TfrxMemoView Name="Memo4" Left="544,25232" Top="27,01577" Width="166,29932" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="Página [Page] de [TotalPages#]"/>
      <TfrxMemoView Name="Memo5" Left="545,47279" Top="3,77953" Width="166,29932" Height="18,89765" DisplayFormat.FormatStr="dd mmmm yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[Date]"/>
    </TfrxReportTitle>
  </TfrxReportPage>
</TfrxReport>
