<?xml version="1.0" encoding="utf-8" standalone="no"?>
<TfrxReport Tag="1" Version="6.4.11" 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.LastChange="45169,7841949074" 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;&#13;&#10;begin&#13;&#10;&#13;&#10;end." StoreInDFM="False" OnReportPrint="frxReportOnReportPrint">
  <Datasets>
    <item DataSet="dados" DataSetName="dados"/>
    <item DataSet="fparametros" DataSetName="parametros"/>
  </Datasets>
  <Variables>
    <item Name=" externas"/>
    <item Name="Logo"/>
    <item Name="empresa"/>
    <item Name="setor"/>
    <item Name="produto"/>
    <item Name="grupo"/>
    <item Name="subgrupo"/>
    <item Name="marca"/>
    <item Name="modelo"/>
  </Variables>
  <TfrxDataPage Name="frxDataPage1" Height="1000" Left="0" Top="0" Width="1000"/>
  <TfrxReportPage Name="Page2" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="5" BottomMargin="5" ColumnWidth="0" ColumnPositions.Text="" Frame.Typ="0" MirrorMode="0" HGuides.Text="" VGuides.Text="" OnBeforePrint="Page2OnBeforePrint">
    <TfrxMasterData Name="MasterData2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="15,11812" Left="0" Top="287,24428" Width="718,1107" OnBeforePrint="MasterData2OnBeforePrint" ColumnWidth="0" ColumnGap="0" DataSet="dados" DataSetName="dados" RowCount="0" Stretched="True">
      <TfrxMemoView Name="Memo22" AllowVectorExport="True" Left="1,77953" Top="1,77953" Width="52,91342" Height="11,33859" DataField="codigo" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="[dados.&#34;codigo&#34;]"/>
      <TfrxMemoView Name="Memo23" AllowVectorExport="True" Left="55,7953" Top="1,77953" Width="381,73253" Height="11,33859" DataField="nome" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="[dados.&#34;nome&#34;]"/>
      <TfrxMemoView Name="Memo24" AllowVectorExport="True" Left="438,7483" Top="1,77953" Width="60,47248" Height="11,33859" DataField="saldo" 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" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[dados.&#34;saldo&#34;]"/>
      <TfrxMemoView Name="Memo25" AllowVectorExport="True" Left="501,44125" Top="1,77953" Width="68,03154" Height="11,33859" DataField="est_min" 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" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[dados.&#34;est_min&#34;]"/>
      <TfrxMemoView Name="Memo26" AllowVectorExport="True" Left="569,9295" Top="1,77953" Width="71,81107" Height="11,33859" DataField="qtde_compra" 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" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[dados.&#34;qtde_compra&#34;]"/>
      <TfrxMemoView Name="Memo27" AllowVectorExport="True" Left="644,62245" Top="1,77953" Width="71,81107" Height="11,33859" DataField="diferenca" 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" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[dados.&#34;diferenca&#34;]"/>
    </TfrxMasterData>
    <TfrxPageHeader Name="PageHeader2" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Frame.Typ="0" Height="207,87415" Left="0" Top="18,89765" Width="718,1107">
      <TfrxMemoView Name="Memo34" Align="baWidth" AllowVectorExport="True" Left="0" Top="0" Width="601,7248" Height="30,23624" Font.Charset="1" Font.Color="0" Font.Height="-16" Font.Name="Arial" Font.Style="1" Frame.Typ="0" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[parametros.&#34;fantasia&#34;]"/>
      <TfrxMemoView Name="dadoscodigo1" Align="baWidth" AllowVectorExport="True" Left="0" Top="42,35436" Width="601,7248" Height="18,89765" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="0" HAlign="haCenter" ParentFont="False" Text="NECESSIDADE DE COMPRA"/>
      <TfrxMemoView Name="Memo13" AllowVectorExport="True" Left="601,7248" Top="3" Width="113,3859" Height="22,67718" DataSet="Form_Necessidadedeproducao.dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="7" HAlign="haCenter" ParentFont="False" Text="Emissão:"/>
      <TfrxMemoView Name="Memo40" AllowVectorExport="True" Left="601,7248" Top="25,67718" Width="113,3859" Height="30,23624" DataSet="Form_Necessidadedeproducao.dados" DataSetName="dados" DisplayFormat.FormatStr="dd/mm/yyyy" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="3" HAlign="haCenter" ParentFont="False" Text="[Date]"/>
      <TfrxMemoView Name="Memo47" AllowVectorExport="True" Left="601,7248" Top="56,91342" Width="113,3859" Height="22,67714827" DataSet="Form_Necessidadedeproducao.dados" DataSetName="dados" DisplayFormat.FormatStr="hh:mm" DisplayFormat.Kind="fkDateTime" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Arial" Font.Style="1" Frame.Typ="11" HAlign="haCenter" ParentFont="False" Text="[Time]"/>
      <TfrxMemoView Name="Memo2" Align="baWidth" AllowVectorExport="True" Left="0" Top="86,92919" Width="718,1107" Height="15,11812" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" ParentFont="False" Text="Filtros:"/>
      <TfrxMemoView Name="Memo3" Align="baWidth" AllowVectorExport="True" Left="0" Top="105,82684" Width="718,1107" Height="7,55906" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="Empresa: [empresa]"/>
      <TfrxMemoView Name="Memo4" Align="baWidth" AllowVectorExport="True" Left="0" Top="115,72449" Width="718,1107" Height="11,33859" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="Setor: [setor]"/>
      <TfrxMemoView Name="Memo5" Align="baWidth" AllowVectorExport="True" Left="0" Top="128,28355" Width="718,1107" Height="11,33859" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="Grupo: [grupo]"/>
      <TfrxMemoView Name="Memo6" Align="baWidth" AllowVectorExport="True" Left="0" Top="141,62214" Width="718,1107" Height="11,33859" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="Subgrupo: [subgrupo]"/>
      <TfrxMemoView Name="Memo14" Align="baWidth" AllowVectorExport="True" Left="0" Top="155,74026" Width="718,1107" Height="11,33859" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="Marca: [marca]"/>
      <TfrxMemoView Name="Memo15" Align="baWidth" AllowVectorExport="True" Left="0" Top="169,07885" Width="718,1107" Height="11,33859" DataSet="dados" DataSetName="dados" Font.Charset="1" Font.Color="0" Font.Height="-9" Font.Name="Arial" Font.Style="0" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="Modelo: [modelo]"/>
      <TfrxMemoView Name="Memo16" AllowVectorExport="True" Left="2,23624" Top="194,75603" Width="52,91342" Height="11,33859" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="CÓDIGO"/>
      <TfrxMemoView Name="Memo17" AllowVectorExport="True" Left="56,25201" Top="194,75603" Width="381,73253" Height="11,33859" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" ParentFont="False" VAlign="vaCenter" Text="NOME"/>
      <TfrxMemoView Name="Memo18" AllowVectorExport="True" Left="439,20501" Top="194,75603" Width="60,47248" Height="11,33859" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="SALDO"/>
      <TfrxMemoView Name="Memo19" AllowVectorExport="True" Left="501,44125" Top="194,75603" Width="68,03154" Height="11,33859" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="EST. MÍN."/>
      <TfrxMemoView Name="Memo20" AllowVectorExport="True" Left="569,9295" Top="194,75603" Width="71,81107" Height="11,33859" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="COMP ABER"/>
      <TfrxMemoView Name="Memo21" AllowVectorExport="True" Left="644,62245" Top="194,75603" Width="71,81107" Height="11,33859" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Arial" Font.Style="1" Frame.Typ="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="NE COMPRA"/>
      <TfrxLineView Name="Line1" Align="baWidth" AllowVectorExport="True" Left="0" Top="206,65368" Width="718,1107" Height="0" Color="0" Frame.Typ="4"/>
    </TfrxPageHeader>
  </TfrxReportPage>
</TfrxReport>
