<?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.CreateDate="41418,6406834028" ReportOptions.Description.Text="" ReportOptions.LastChange="44504,4758270486" ScriptLanguage="PascalScript" ScriptText.Text="procedure HideFields(VlrTagPri:Array of integer);&#13;&#10;  procedure HideObjectBand(Band:TfrxBand; VlrTag:Array of integer);&#13;&#10;    var i:integer;&#13;&#10;    var TagArr: String;&#13;&#10;  begin&#13;&#10;    TagArr := '';&#13;&#10;    for i := 0 to Length(VlrTagPri) -1 do&#13;&#10;    begin&#13;&#10;       TagArr := TagArr + IntToStr(VlrTag[I]);&#13;&#10;    end;&#13;&#10;&#13;&#10;    with Band do&#13;&#10;      for i:=0 to Objects.Count-1 do&#13;&#10;        if (Objects[i] is TfrxMemoView) then&#13;&#10;           TfrxMemoView(Objects[i]).Visible:= Pos(IntToStr((TfrxMemoView(Objects[i]).Tag)), TagArr) = 0;&#13;&#10;  end;&#13;&#10;begin&#13;&#10;  HideObjectBand(CabecalhoPagina, VlrTagPri);&#13;&#10;  HideObjectBand(MDPrincipal, VlrTagPri);&#13;&#10;  HideObjectBand(DD, VlrTagPri);&#13;&#10;  HideObjectBand(SDD, VlrTagPri);&#13;&#10;  HideObjectBand(DDSim, VlrTagPri);&#13;&#10;  HideObjectBand(ResumoRelatorio, VlrTagPri);&#13;&#10;&#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10;{&#13;&#10;  Set('DtIni',StrToDate('01/05/2013'));&#13;&#10;  Set('DtFin',StrToDate('24/05/2013'));&#13;&#10;  Set('CodFun','''''');&#13;&#10;  Set('CodCli','0');&#13;&#10;  Set('CodIte','0');&#13;&#10;  Set('CodEmp','0');&#13;&#10;  Set('CodGru','0');&#13;&#10;  Set('NotDev','1');&#13;&#10;  Set('SEspDoc','''''');&#13;&#10;  Set('TipoDoc','1');&#13;&#10;&#13;&#10;  Set('CodEmpresa','1');&#13;&#10;  Set('Filtros','''nenhum''');&#13;&#10;  Set('RelReferencia','''2F00''');&#13;&#10;  Set('Tipo','2');&#13;&#10;}&#13;&#10;&#13;&#10;  if &#60;ComAut&#62; then&#13;&#10;  begin&#13;&#10;    LblCodFun.Text := 'Cód.';&#13;&#10;    LblNomeFun.Text := ' Nome';&#13;&#10;    Titulo.Text := 'Comissão de Autônomo - [TituloTipoRel]';&#13;&#10;    Memo18.Text := ' Nome: ';&#13;&#10;    Memo12.Text := 'Comissão de Autônomo - [TituloTipoRel]';&#13;&#10;  end;&#13;&#10;&#13;&#10;  if &#60;PagRel&#62; &#60;&#62; 2 then&#13;&#10;  begin&#13;&#10;     {Checagem de dados - Não remova as linhas abaixo}&#13;&#10;     QPrincipal.Open;&#13;&#10;     if QPrincipal.IsEmpty then&#13;&#10;     begin&#13;&#10;        CreateError('Não exitem registros para os filtros selecionados.');&#13;&#10;     end;&#13;&#10;     {fim}&#13;&#10;  end;&#13;&#10;&#13;&#10;  if &#60;PagRel&#62; = 2 then&#13;&#10;  begin&#13;&#10;     QPrincipal_R2.Open;&#13;&#10;     if QPrincipal_R2.IsEmpty then&#13;&#10;     begin&#13;&#10;        CreateError('Não exitem registros para os filtros selecionados.');&#13;&#10;     end;&#13;&#10;  end;&#13;&#10;&#13;&#10;  case &#60;Tipo&#62; of&#13;&#10;   0:begin&#13;&#10;       Set('TituloTipoRel','''Analítico''');&#13;&#10;       LblTotCusto.Visible:=False;&#13;&#10;       HideFields([3]);&#13;&#10;       DD.Free;&#13;&#10;       SDD.Free;&#13;&#10;       SSDFooter.Free;&#13;&#10;     end;&#13;&#10;   1:begin //Sintético&#13;&#10;       Set('TituloTipoRel','''Sintético''');&#13;&#10;       QItem.Free;&#13;&#10;       QSubItem.Free;&#13;&#10;       HideFields([1,2,3]);&#13;&#10;     end;&#13;&#10;   2:begin //Sintético por Doc.&#13;&#10;       Set('TituloTipoRel','''Sintético por Documento''');&#13;&#10;       MDPrincipal.StartNewPage:=True;&#13;&#10;       DDSim.Free;&#13;&#10;       QItemSim.Free;&#13;&#10;       DD.Visible:=True;&#13;&#10;       SDD.Visible:=True;&#13;&#10;       SSDFooter.Visible:=True;&#13;&#10;     end;&#13;&#10;  end;&#13;&#10;&#13;&#10;  if &#60;ResTot&#62; = 1 then&#13;&#10;  begin&#13;&#10;     DDSim.Visible:= False;&#13;&#10;     DD.Visible   := False;&#13;&#10;     SDD.Visible  := False;&#13;&#10;  end&#13;&#10;  else&#13;&#10;  begin&#13;&#10;     DDSim.Visible:= True;&#13;&#10;     DD.Visible   := True;&#13;&#10;     SDD.Visible  := True;&#13;&#10;  end;&#13;&#10;&#13;&#10;  if &#60;PagRel&#62; = 2 then&#13;&#10;  begin&#13;&#10;     Page1.Visible:= False;&#13;&#10;     Page2.Visible:= True;&#13;&#10;  end;&#13;&#10;end.">
  <Datasets>
    <item DataSet="QEmpresa" DataSetName="QEmpresa"/>
    <item DataSet="QItem" DataSetName="QItem"/>
    <item DataSet="QItemSim" DataSetName="QItemSim"/>
    <item DataSet="QPrincipal" DataSetName="QPrincipal"/>
    <item DataSet="QSubItem" DataSetName="QSubItem"/>
    <item DataSet="QTotal" DataSetName="QTotal"/>
    <item DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2"/>
  </Datasets>
  <Variables>
    <item Name="CodEmpresa" Value="1"/>
    <item Name="Filtros" Value="'Período de 17/11/16 à 17/11/16; '"/>
    <item Name="RelReferencia" Value="'2F00'"/>
    <item Name="DtIni" Value="42691"/>
    <item Name="DtFin" Value="42691"/>
    <item Name="CodFun" Value="''"/>
    <item Name="CodCli" Value="0"/>
    <item Name="CodIte" Value="0"/>
    <item Name="CodEmp" Value="0"/>
    <item Name="CodGru" Value="0"/>
    <item Name="NotDev" Value="0"/>
    <item Name="TipoDoc" Value="2"/>
    <item Name="ResTot" Value="0"/>
    <item Name="SEspDoc" Value="''"/>
    <item Name="Tipo" Value="2"/>
    <item Name="CliConvenio" Value="0"/>
    <item Name="PagRel" Value="1"/>
    <item Name="ComAut"/>
  </Variables>
  <TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000">
    <TfrxADOQuery Name="QPrincipal" UserName="QPrincipal" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="declare &#13;&#10;        @DtIni date = :DtIni ,&#13;&#10;        @DtFin date = :DtFin ,&#13;&#10;        @CodFun varchar(3) = :CodFun,&#13;&#10;        @CodCli int = :CodCli ,&#13;&#10;        @CodIte int = :CodIte ,&#13;&#10;        @CodEmp int = :CodEmp ,&#13;&#10;        @CodGru int = :CodGru ,&#13;&#10;        @NotDev int = :NotDev ,&#13;&#10;        @EspDoc varchar(255) = :SEspDoc,&#13;&#10;        @TipoDoc int = :TipoDoc,&#13;&#10;        @ComAut bit = :ComAut; -- Comissão de Autônomo            &#13;&#10;          &#13;&#10;select &#13;&#10;FUN_CODIGO as CodFuncionario, &#13;&#10;FUN_NOMFUN as NomeFuncionario,&#13;&#10;sum(Round(ftd.FTD_TOTITE * ftd.FTD_FATDES,2)) AS TotalVenda,&#13;&#10;--ite.ITE_DESCRI, &#13;&#10;sum(case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;else ftd.ftd_valorcomiss end) Comissao,&#13;&#10;sum(round(ftd.FTD_QTDITE * ftd.FTD_PRECUS, 2)) as TotalCusto,    &#13;&#10;sum(round((ftd.FTD_TOTITE * ftd.FTD_FATDES) - (ftd.FTD_QTDITE * ftd.FTD_PRECUS), 2)) as TotLucro,&#13;&#10;sum(round(((ftd.FTD_QTDITE)) * COALESCE(&#13;&#10;  case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;  else ftd.ftd_valorcomiss end,0),2)) as VlrComissao,&#13;&#10;dbo.fn_CALCULA_PRECO_MARGEM(@CodEmp,sum(ftd.FTD_TOTITE * ftd.FTD_FATDES),sum(FTD.FTD_QTDITE * FTD.FTD_PRECUS),0) AS MLucro&#13;&#10;&#13;&#10;from fatdet ftd&#13;&#10;left join CADITE ite on ftd.FTD_CODITE = ite.ITE_CODIGO&#13;&#10;left outer join cadfun fun on ftd.FTD_CODVEN = fun.FUN_CODIGO&#13;&#10;left outer join fatger ftg on ftd.FTD_CODEMP = ftg.FTG_CODEMP and&#13;&#10;                              ftd.FTD_NUMCAX = ftg.FTG_NUMCAX and&#13;&#10;                              ftd.FTD_NUMDOC = ftg.FTG_NUMDOC and&#13;&#10;                              ftd.FTD_ESPDOC = ftg.FTG_ESPDOC and&#13;&#10;                              ftd.FTD_SEQCAI = ftg.FTG_SEQCAI&#13;&#10;LEFT JOIN cademp EMP ON EMP.EMP_CODIGO = FTD.FTD_CODEMP&#13;&#10;left join cadcfo ON cadcfo.CFO_CODIGO  = ftd.FTD_CFOPPR    &#13;&#10;&#13;&#10;where (ftd.FTD_CANCEL &#60;&#62; 'S' )&#13;&#10;and ((@TipoDoc=2) or (Coalesce(FTG_CONSIG,0) = @TipoDoc))   &#13;&#10;and (cast(ftd.FTD_DTAENT as date) between @DtIni and @DtFin )&#13;&#10;and ((@CodFun='') or (ftd.FTD_CODVEN = @CodFun))&#13;&#10;and ((@CodCli=0 ) or (ftg.FTG_CODCLI = @CodCli))&#13;&#10;and ((@CodIte=0 ) or (ftd.FTD_CODITE = @CodIte))&#13;&#10;and ((@CodEmp=0 ) or (ftd.FTD_CODEMP = @CodEmp)) &#13;&#10;and ((@CodGru=0 ) or (ite.ITE_CODGRU = @CodGru ))&#13;&#10;AND ((@NotDev=1 ) or (NOT COALESCE(cadcfo.CFO_TIPOOPERACAO,'') in  (1,2))) --nao filtrar notas de devol.&#13;&#10;and ((@EspDoc='') or (patindex('%'+FTD_ESPDOC+'%',@EspDoc)&#62;0))&#13;&#10;and (coalesce (FTG.FTG_DOCCON,0) = 0)               &#13;&#10;group by FUN_CODIGO, FUN_NOMFUN          &#13;&#10;order by FUN_CODIGO  " CommandTimeout="3000" LockType="ltReadOnly" PropData="05704C65667402200470546F70038C000A506172616D65746572730101063C204E616D653D224474496E69222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B4474496E69262336323B220001063C204E616D653D22447446696E222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B447446696E262336323B2200010640204E616D653D22436F6446756E222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B436F6446756E262336323B2200010641204E616D653D22436F64436C69222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64436C69262336323B2200010641204E616D653D22436F64497465222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64497465262336323B2200010641204E616D653D22436F64456D70222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D70262336323B2200010641204E616D653D22436F64477275222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64477275262336323B2200010641204E616D653D224E6F74446576222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B4E6F74446576262336323B2200010642204E616D653D2253457370446F63222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B53457370446F63262336323B2200010643204E616D653D225469706F446F63222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B5469706F446F63262336323B2200010641204E616D653D22436F6D417574222044617461547970653D226674426F6F6C65616E222045787072657373696F6E3D22262336303B436F6D417574262336323B220000"/>
    <TfrxADOQuery Name="QEmpresa" UserName="QEmpresa" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="select emp_nomemp &#13;&#10;from cademp &#13;&#10;where EMP_CODIGO=:CodEmpresa" CommandTimeout="1800" LockType="ltReadOnly" PropData="05704C65667402200470546F7002140A506172616D657465727301010649204E616D653D22436F64456D7072657361222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D7072657361262336323B220000"/>
    <TfrxADOQuery Name="QSubItem" UserName="QSubItem" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" Master="QItem" IgnoreDupParams="False" SQL.Text="declare &#13;&#10;        @DtIni date = :DtIni ,&#13;&#10;        @DtFin date = :DtFin ,&#13;&#10;        @CodCli int = :CodCli ,&#13;&#10;        @CodIte int = :CodIte ,&#13;&#10;        @CodEmp int = :CodEmp ,&#13;&#10;        @CodGru int = :CodGru ,&#13;&#10;        @NotDev int = :NotDev ,&#13;&#10;&#13;&#10;        @NCaixa varchar(2) = :NCaixa,&#13;&#10;        @NDoc   int        = :NDocumento,&#13;&#10;        @EspDoc varchar(2) = :EspDocumento,&#13;&#10;        @TipoDoc int = :TipoDoc                &#13;&#10;        &#13;&#10;select &#13;&#10;FTD_NUMCAX ,&#13;&#10;FTD_NUMDOC ,&#13;&#10;FTD_ESPDOC ,&#13;&#10;&#13;&#10;ite.ITE_DESCRI as Item_Descricao, &#13;&#10;Round(ftd.FTD_TOTITE * ftd.FTD_FATDES,2) AS TotalVenda,&#13;&#10;Round(ftd.FTD_PRECUS * ftd.FTD_QTDITE,2) AS TotalCusto,    &#13;&#10;case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;else ftd.ftd_valorcomiss end Comissao,&#13;&#10;&#13;&#10;round((ftd.FTD_TOTITE * ftd.FTD_FATDES) - (ftd.FTD_QTDITE * ftd.FTD_PRECUS), 2) as TotLucro,&#13;&#10;&#13;&#10;round(((ftd.FTD_QTDITE)) * COALESCE(&#13;&#10;  case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;  else ftd.ftd_valorcomiss end,0),2) as VlrComissao,&#13;&#10;  &#13;&#10;dbo.fn_CALCULA_PRECO_MARGEM(FTD.FTD_CODEMP,(ftd.FTD_TOTITE * ftd.FTD_FATDES),(FTD.FTD_QTDITE * FTD.FTD_PRECUS),0) AS Margem_Lucro&#13;&#10;&#13;&#10;from fatdet ftd&#13;&#10;left join CADITE ite on ftd.FTD_CODITE = ite.ITE_CODIGO&#13;&#10;left outer join cadfun fun on ftd.FTD_CODVEN = fun.FUN_CODIGO&#13;&#10;left outer join fatger ftg on ftd.FTD_CODEMP = ftg.FTG_CODEMP and&#13;&#10;                              ftd.FTD_NUMCAX = ftg.FTG_NUMCAX and&#13;&#10;                              ftd.FTD_NUMDOC = ftg.FTG_NUMDOC and&#13;&#10;                              ftd.FTD_ESPDOC = ftg.FTG_ESPDOC and&#13;&#10;                              ftd.FTD_SEQCAI = ftg.FTG_SEQCAI&#13;&#10;left join cadcfo ON cadcfo.CFO_CODIGO  = ftd.FTD_CFOPPR                                    &#13;&#10;where (ftd.FTD_CANCEL &#60;&#62; 'S' )&#13;&#10;and ((@TipoDoc=2) or (Coalesce(FTG_CONSIG,0) = @TipoDoc)) &#13;&#10;and (cast(ftd.FTD_DTAENT as date) between @DtIni and @DtFin )&#13;&#10;and ((@CodIte=0 ) or (ftd.FTD_CODITE = @CodIte))&#13;&#10;and ((@CodGru=0 ) or (ite.ITE_CODGRU = @CodGru ))&#13;&#10;AND ((@NotDev=1 ) or (NOT COALESCE(cadcfo.CFO_TIPOOPERACAO,'') in  (1,2))) --nao filtrar notas de devol.&#13;&#10;and FTD_NUMCAX=@NCaixa&#13;&#10;and FTD_NUMDOC=@NDoc  &#13;&#10;and FTD_ESPDOC=@EspDoc&#13;&#10;and (coalesce (FTG.FTG_DOCCON,0) = 0)    &#13;&#10;order by FUN_CODIGO, FTD_DTAENT desc, FTD_NUMDOC,FTD_ESPDOC" CommandTimeout="1800" LockType="ltReadOnly" PropData="05704C65667403C5000470546F7003B2000A506172616D65746572730101063C204E616D653D224474496E69222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B4474496E69262336323B220001063C204E616D653D22447446696E222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B447446696E262336323B2200010641204E616D653D22436F64436C69222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64436C69262336323B2200010641204E616D653D22436F64497465222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64497465262336323B2200010641204E616D653D22436F64456D70222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D70262336323B2200010641204E616D653D22436F64477275222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64477275262336323B2200010641204E616D653D224E6F74446576222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B4E6F74446576262336323B2200010622204E616D653D224E4361697861222044617461547970653D226674537472696E672200010627204E616D653D224E446F63756D656E746F222044617461547970653D226674496E74656765722200010628204E616D653D22457370446F63756D656E746F222044617461547970653D226674537472696E672200010643204E616D653D225469706F446F63222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B5469706F446F63262336323B220000"/>
    <TfrxADOQuery Name="QItem" UserName="QItem" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" Master="QPrincipal" IgnoreDupParams="False" SQL.Text="declare &#13;&#10;        @DtIni date = :DtIni ,&#13;&#10;        @DtFin date = :DtFin ,&#13;&#10;        @CodFun varchar(3) = :CodFuncionario,&#13;&#10;        @CodCli int = :CodCli ,&#13;&#10;        @CodIte int = :CodIte ,&#13;&#10;        @CodEmp int = :CodEmp ,&#13;&#10;        @CodGru int = :CodGru ,&#13;&#10;        @NotDev int = :NotDev ,&#13;&#10;        @EspDoc varchar(255) = :SEspDoc,&#13;&#10;        @TipoDoc int = :TipoDoc    &#13;&#10;&#13;&#10;select&#13;&#10;FUN_CODIGO CodFuncionario,&#13;&#10;FUN_NOMFUN as Funcionario, &#13;&#10;ftd.FTD_NUMDOC as NDocumento, &#13;&#10;ftd.FTD_ESPDOC as EspDocumento, &#13;&#10;FTD_NUMCAX as NCaixa,&#13;&#10;ftd.FTD_DTAENT as DtEntrada, &#13;&#10;sum(Round(ftd.FTD_TOTITE * ftd.FTD_FATDES,2)) AS TotalVenda,&#13;&#10;sum(case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;else ftd.ftd_valorcomiss end) Comissao,&#13;&#10;&#13;&#10;sum(round((ftd.FTD_TOTITE * ftd.FTD_FATDES) - (ftd.FTD_QTDITE * ftd.FTD_PRECUS), 2)) as TotLucro,&#13;&#10;&#13;&#10;    sum(round(((ftd.FTD_QTDITE)) * COALESCE(&#13;&#10;  case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;  else ftd.ftd_valorcomiss end,0),2)) as VlrComissao,      &#13;&#10;  &#13;&#10;dbo.fn_CALCULA_PRECO_MARGEM(@CodEmp,sum(ftd.FTD_TOTITE * ftd.FTD_FATDES),sum(FTD.FTD_QTDITE * FTD.FTD_PRECUS),0) AS Margem_Lucro&#13;&#10;&#13;&#10;from fatdet ftd&#13;&#10;left join CADITE ite on ftd.FTD_CODITE = ite.ITE_CODIGO&#13;&#10;left outer join cadfun fun on ftd.FTD_CODVEN = fun.FUN_CODIGO&#13;&#10;left outer join fatger ftg on ftd.FTD_CODEMP = ftg.FTG_CODEMP and&#13;&#10;                              ftd.FTD_NUMCAX = ftg.FTG_NUMCAX and&#13;&#10;                              ftd.FTD_NUMDOC = ftg.FTG_NUMDOC and&#13;&#10;                              ftd.FTD_ESPDOC = ftg.FTG_ESPDOC and&#13;&#10;                              ftd.FTD_SEQCAI = ftg.FTG_SEQCAI&#13;&#10;LEFT JOIN cademp EMP ON EMP.EMP_CODIGO = FTD.FTD_CODEMP&#13;&#10;left join cadcfo ON cadcfo.CFO_CODIGO  = ftd.FTD_CFOPPR      &#13;&#10;&#13;&#10;where (ftd.FTD_CANCEL &#60;&#62; 'S' )&#13;&#10;and ((@TipoDoc=2) or (Coalesce(FTG_CONSIG,0) = @TipoDoc)) &#13;&#10;and (cast(ftd.FTD_DTAENT as date) between @DtIni and @DtFin )&#13;&#10;and ((@CodFun='') or (ftd.FTD_CODVEN = @CodFun))&#13;&#10;and ((@CodCli=0 ) or (ftg.FTG_CODCLI = @CodCli))&#13;&#10;and ((@CodIte=0 ) or (ftd.FTD_CODITE = @CodIte))&#13;&#10;and ((@CodEmp=0 ) or (ftd.FTD_CODEMP = @CodEmp)) &#13;&#10;and ((@CodGru=0 ) or (ite.ITE_CODGRU = @CodGru ))&#13;&#10;AND ((@NotDev=1 ) or (NOT COALESCE(cadcfo.CFO_TIPOOPERACAO,'') in  (1,2))) --nao filtrar notas de devol.&#13;&#10;and ((@EspDoc='') or (patindex('%'+FTD_ESPDOC+'%',@EspDoc)&#62;0))&#13;&#10;and (coalesce (FTG.FTG_DOCCON,0) = 0)    &#13;&#10;group by FUN_CODIGO, FUN_NOMFUN, ftd.FTD_NUMDOC, ftd.FTD_ESPDOC, ftd.FTD_DTAENT , FTD_NUMCAX&#13;&#10;order by FUN_CODIGO, FTD_DTAENT desc, FTD_NUMDOC,FTD_ESPDOC  " CommandTimeout="1800" LockType="ltReadOnly" PropData="05704C65667402700470546F7003B4000A506172616D65746572730101063C204E616D653D224474496E69222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B4474496E69262336323B220001063C204E616D653D22447446696E222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B447446696E262336323B220001062A204E616D653D22436F6446756E63696F6E6172696F222044617461547970653D226674537472696E672200010641204E616D653D22436F64436C69222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64436C69262336323B2200010641204E616D653D22436F64497465222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64497465262336323B2200010641204E616D653D22436F64456D70222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D70262336323B2200010641204E616D653D22436F64477275222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64477275262336323B2200010641204E616D653D224E6F74446576222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B4E6F74446576262336323B2200010642204E616D653D2253457370446F63222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B53457370446F63262336323B2200010643204E616D653D225469706F446F63222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B5469706F446F63262336323B220000"/>
    <TfrxADOQuery Name="QItemSim" UserName="QItemSim" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" Master="QPrincipal" IgnoreDupParams="False" SQL.Text="declare &#13;&#10;        @DtIni date = :DtIni ,&#13;&#10;        @DtFin date = :DtFin ,&#13;&#10;        @CodFun varchar(3) = :CodFuncionario,            &#13;&#10;        @CodCli int = :CodCli ,&#13;&#10;        @CodIte int = :CodIte ,&#13;&#10;        @CodEmp int = :CodEmp ,&#13;&#10;        @CodGru int = :CodGru ,&#13;&#10;        @NotDev int = :NotDev,&#13;&#10;        @TipoDoc int = :TipoDoc  &#13;&#10;&#13;&#10;select distinct&#13;&#10;FUN_CODIGO as CodFun,  &#13;&#10;FTD_NUMCAX as NCaixa,&#13;&#10;FTD_NUMDOC as NDocumento,&#13;&#10;FTD_ESPDOC as EspDocumento,&#13;&#10;ftd.FTD_DTAENT as DtEntrada, &#13;&#10;ite.ITE_DESCRI as Item_Descricao, &#13;&#10;Round(ftd.FTD_TOTITE * ftd.FTD_FATDES,2) AS TotalVenda,&#13;&#10;case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;else ftd.ftd_valorcomiss end Comissao,&#13;&#10;&#13;&#10;round((ftd.FTD_TOTITE * ftd.FTD_FATDES) - (ftd.FTD_QTDITE * ftd.FTD_PRECUS), 2) as TotLucro,&#13;&#10;&#13;&#10;round(((ftd.FTD_QTDITE)) * COALESCE(&#13;&#10;  case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;  else ftd.ftd_valorcomiss end,0),2) as VlrComissao,&#13;&#10;  &#13;&#10;dbo.fn_CALCULA_PRECO_MARGEM(FTD.FTD_CODEMP,(ftd.FTD_TOTITE * ftd.FTD_FATDES),(FTD.FTD_QTDITE * FTD.FTD_PRECUS),0) AS Margem_Lucro&#13;&#10;&#13;&#10;from fatdet ftd&#13;&#10;left join CADITE ite on ftd.FTD_CODITE = ite.ITE_CODIGO&#13;&#10;left outer join cadfun fun on ftd.FTD_CODVEN = fun.FUN_CODIGO&#13;&#10;left outer join fatger ftg on ftd.FTD_CODEMP = ftg.FTG_CODEMP and&#13;&#10;                              ftd.FTD_NUMCAX = ftg.FTG_NUMCAX and&#13;&#10;                              ftd.FTD_NUMDOC = ftg.FTG_NUMDOC and&#13;&#10;                              ftd.FTD_ESPDOC = ftg.FTG_ESPDOC and&#13;&#10;                              ftd.FTD_SEQCAI = ftg.FTG_SEQCAI&#13;&#10;left join cadcfo ON cadcfo.CFO_CODIGO  = ftd.FTD_CFOPPR                                    &#13;&#10;&#13;&#10;where (ftd.FTD_CANCEL &#60;&#62; 'S' )&#13;&#10;and ((@TipoDoc=2) or (Coalesce(FTG_CONSIG,0) = @TipoDoc)) &#13;&#10;and (cast(ftd.FTD_DTAENT as date) between @DtIni and @DtFin )&#13;&#10;and ((@CodFun='') or (ftd.FTD_CODVEN = @CodFun))&#13;&#10;and ((@CodIte=0 ) or (ftd.FTD_CODITE = @CodIte))&#13;&#10;and ((@CodGru=0 ) or (ite.ITE_CODGRU = @CodGru ))&#13;&#10;AND ((@NotDev=1 ) or (NOT COALESCE(cadcfo.CFO_TIPOOPERACAO,'') in  (1,2))) --nao filtrar notas de devol.&#13;&#10;and (coalesce (FTG.FTG_DOCCON,0) = 0)    &#13;&#10;order by FUN_CODIGO, FTD_DTAENT desc, FTD_NUMDOC,FTD_ESPDOC" CommandTimeout="1800" LockType="ltReadOnly" PropData="05704C65667402700470546F70025E0A506172616D65746572730101063C204E616D653D224474496E69222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B4474496E69262336323B220001063C204E616D653D22447446696E222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B447446696E262336323B220001062A204E616D653D22436F6446756E63696F6E6172696F222044617461547970653D226674537472696E672200010641204E616D653D22436F64436C69222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64436C69262336323B2200010641204E616D653D22436F64497465222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64497465262336323B2200010641204E616D653D22436F64456D70222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D70262336323B2200010641204E616D653D22436F64477275222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64477275262336323B2200010641204E616D653D224E6F74446576222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B4E6F74446576262336323B2200010643204E616D653D225469706F446F63222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B5469706F446F63262336323B220000"/>
    <TfrxLineView Name="Line1" Left="140" Top="192" Width="56" Height="0" Color="0" ArrowEnd="True" Diagonal="True"/>
    <TfrxLineView Name="Line2" Left="59" Top="140" Width="52" Height="-32" Color="0" ArrowEnd="True" Diagonal="True"/>
    <TfrxLineView Name="Line3" Left="59" Top="166" Width="52" Height="24" Color="0" ArrowEnd="True" Diagonal="True"/>
    <TfrxADOQuery Name="QTotal" UserName="QTotal" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="declare &#13;&#10;        @DtIni date = :DtIni ,&#13;&#10;        @DtFin date = :DtFin ,&#13;&#10;        @CodFun varchar(3) = :CodFun,&#13;&#10;        @CodCli int = :CodCli ,&#13;&#10;        @CodIte int = :CodIte ,&#13;&#10;        @CodEmp int = :CodEmp ,&#13;&#10;        @CodGru int = :CodGru ,&#13;&#10;        @NotDev int = :NotDev ,&#13;&#10;        @EspDoc varchar(255) = :SEspDoc,&#13;&#10;        @TipoDoc int = :TipoDoc                                &#13;&#10;        &#13;&#10;select&#13;&#10;sum(Round(ftd.FTD_TOTITE * ftd.FTD_FATDES,2)) AS TotalVenda,&#13;&#10; sum(case COALESCE(ftd.FTD_PERCCOMISS,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;else ftd.ftd_valorcomiss end) Comissao,&#13;&#10;sum(round((ftd.FTD_TOTITE * ftd.FTD_FATDES) - (ftd.FTD_QTDITE * ftd.FTD_PRECUS), 2)) as TotLucro,&#13;&#10;sum(round(((ftd.FTD_QTDITE)) * COALESCE(&#13;&#10;  case COALESCE(ftd.ftd_valorcomiss,0) when 0 then COALESCE(ftd.ftd_valorcomiss,0)&#13;&#10;  else ftd.ftd_valorcomiss end,0),2)) as VlrComissao,&#13;&#10;dbo.fn_CALCULA_PRECO_MARGEM(@CodEmp,sum(ftd.FTD_TOTITE * ftd.FTD_FATDES),sum(FTD.FTD_QTDITE * FTD.FTD_PRECUS),0) AS MLucro&#13;&#10;&#13;&#10;from fatdet ftd&#13;&#10;left join CADITE ite on ftd.FTD_CODITE = ite.ITE_CODIGO&#13;&#10;left outer join cadfun fun on ftd.FTD_CODVEN = fun.FUN_CODIGO&#13;&#10;left outer join fatger ftg on ftd.FTD_CODEMP = ftg.FTG_CODEMP and&#13;&#10;                              ftd.FTD_NUMCAX = ftg.FTG_NUMCAX and&#13;&#10;                              ftd.FTD_NUMDOC = ftg.FTG_NUMDOC and&#13;&#10;                              ftd.FTD_ESPDOC = ftg.FTG_ESPDOC and&#13;&#10;                              ftd.FTD_SEQCAI = ftg.FTG_SEQCAI&#13;&#10;LEFT JOIN cademp EMP ON EMP.EMP_CODIGO = FTD.FTD_CODEMP&#13;&#10;left join cadcfo ON cadcfo.CFO_CODIGO  = ftd.FTD_CFOPPR    &#13;&#10;&#13;&#10;where (ftd.FTD_CANCEL &#60;&#62; 'S' )&#13;&#10;and ((@TipoDoc=2) or (Coalesce(FTG_CONSIG,0) = @TipoDoc)) &#13;&#10;and (cast(ftd.FTD_DTAENT as date) between @DtIni and @DtFin )&#13;&#10;and ((@CodFun='') or (ftd.FTD_CODVEN = @CodFun))&#13;&#10;and ((@CodCli=0 ) or (ftg.FTG_CODCLI = @CodCli))&#13;&#10;and ((@CodIte=0 ) or (ftd.FTD_CODITE = @CodIte))&#13;&#10;and ((@CodEmp=0 ) or (ftd.FTD_CODEMP = @CodEmp)) &#13;&#10;and ((@CodGru=0 ) or (ite.ITE_CODGRU = @CodGru ))&#13;&#10;AND ((@NotDev=1 ) or (NOT COALESCE(cadcfo.CFO_TIPOOPERACAO,'') in  (1,2))) --nao filtrar notas de devol.&#13;&#10;and ((@EspDoc='') or (patindex('%'+FTD_ESPDOC+'%',@EspDoc)&#62;0))&#13;&#10;and (coalesce (FTG.FTG_DOCCON,0) = 0)    " CommandTimeout="3000" LockType="ltReadOnly" PropData="05704C6566740308010470546F70027C0A506172616D65746572730101063C204E616D653D224474496E69222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B4474496E69262336323B220001063C204E616D653D22447446696E222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B447446696E262336323B2200010640204E616D653D22436F6446756E222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B436F6446756E262336323B2200010641204E616D653D22436F64436C69222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64436C69262336323B2200010641204E616D653D22436F64497465222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64497465262336323B2200010641204E616D653D22436F64456D70222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D70262336323B2200010641204E616D653D22436F64477275222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64477275262336323B2200010641204E616D653D224E6F74446576222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B4E6F74446576262336323B2200010642204E616D653D2253457370446F63222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B53457370446F63262336323B2200010643204E616D653D225469706F446F63222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B5469706F446F63262336323B220000"/>
    <TfrxADOQuery Name="QPrincipal_R2" UserName="QPrincipal_R2" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="declare &#13;&#10;        @DtIni date = :DtIni ,&#13;&#10;        @DtFin date = :DtFin ,&#13;&#10;        @CodFun varchar(3) = :CodFun,&#13;&#10;        @CodCli int = :CodCli ,&#13;&#10;        @CodIte int = :CodIte ,&#13;&#10;        @CodEmp int = :CodEmp ,&#13;&#10;        @CodGru int = :CodGru ,&#13;&#10;        @EspDoc varchar(255) = :SEspDoc  &#13;&#10;select *&#13;&#10;  from vw_sim_comiss_ven &#13;&#10;&#13;&#10; where (cast(FTG_DTAENT as date) between @DtIni and @DtFin ) and     &#13;&#10;       ((@CodFun='') or (FUN_CODIGO = @CodFun)) and     &#13;&#10;       ((@CodCli=0 ) or (FTG_CODCLI = @CodCli)) and  &#13;&#10;       ((@CodIte=0 ) or (FTD_CODITE = @CodIte)) and  &#13;&#10;       ((@CodEmp=0 ) or (FTD_CODEMP = @CodEmp)) and   &#13;&#10;       ((@CodGru=0 ) or (ITE_CODGRU = @CodGru )) and&#13;&#10;       ((@EspDoc='') or (patindex('%'+FTG_ESPDOC+'%',@EspDoc)&#62;0))  &#13;&#10;  &#13;&#10; order by FUN_CODIGO, FUN_NOMFUN, FTG_NUMDOC, FTG_DTAENT, MVC_DTAMOV, ITE_DESCRI          " CommandTimeout="3000" LockType="ltReadOnly" PropData="05704C65667402200470546F700358010A506172616D65746572730101063C204E616D653D224474496E69222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B4474496E69262336323B220001063C204E616D653D22447446696E222044617461547970653D22667444617465222045787072657373696F6E3D22262336303B447446696E262336323B2200010640204E616D653D22436F6446756E222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B436F6446756E262336323B2200010641204E616D653D22436F64436C69222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64436C69262336323B2200010641204E616D653D22436F64497465222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64497465262336323B2200010641204E616D653D22436F64456D70222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64456D70262336323B2200010641204E616D653D22436F64477275222044617461547970653D226674496E7465676572222045787072657373696F6E3D22262336303B436F64477275262336323B2200010642204E616D653D2253457370446F63222044617461547970653D226674537472696E67222045787072657373696F6E3D22262336303B53457370446F63262336323B220000"/>
  </TfrxDataPage>
  <TfrxReportPage Name="Page1" Font.Charset="1" Font.Color="0" Font.Height="-13" Font.Name="Courier New" Font.Style="0" PaperWidth="210" PaperHeight="297" PaperSize="9" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
    <TfrxReportTitle Name="TituloRelatorio" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="68,91342" Left="0" Top="16" Width="718,1107" Stretched="True">
      <TfrxMemoView Name="Titulo" Align="baWidth" Left="0" Top="18,8976378" Width="517,79561" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Courier New" Font.Style="1" ParentFont="False" VAlign="vaCenter" Text="Comissão de Vendedor - [TituloTipoRel]"/>
      <TfrxMemoView Name="RelReferencia" Align="baRight" Left="517,79561" Top="19" Width="200,31509" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[IIF(&#60;RelReferencia&#62;='','','(Ref.:'+&#60;RelReferencia&#62;+')')]"/>
      <TfrxMemoView Name="Filtros" Align="baWidth" Left="56,69295" Top="38,67718" Width="661,41775" Height="30,23624" StretchMode="smMaxHeight" Font.Charset="0" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[&#60;Filtros&#62;]"/>
      <TfrxMemoView Name="LblFiltros" Align="baLeft" Left="0" Top="38,67718" Width="56,69295" Height="30,23624" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="Filtros:"/>
      <TfrxMemoView Name="NomeEmpresa" Align="baWidth" Left="0" Top="0" Width="517,79561" Height="18,89765" DataField="EMP_NOMEMP" DataSet="QEmpresa" DataSetName="QEmpresa" Font.Charset="0" Font.Color="0" Font.Height="-13" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QEmpresa.&#34;EMP_NOMEMP&#34;]"/>
      <TfrxMemoView Name="Emissao" Align="baRight" Left="517,79561" Top="0" Width="200,31509" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="Emissão: [DATE] [Time]"/>
    </TfrxReportTitle>
    <TfrxPageHeader Name="CabecalhoPagina" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="41,5748178" Left="0" Top="104" Width="718,1107">
      <TfrxMemoView Name="LblValor" Align="baRight" Left="325,03958" Top="0" Width="79,37013" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Valor"/>
      <TfrxMemoView Name="LblMLucro" Tag="1" Align="baRight" Left="404,40971" Top="0" Width="75,5906" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="M. Lucro"/>
      <TfrxMemoView Name="LblVlrComissao" Align="baRight" Left="638,74057" Top="0" Width="79,37013" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Vlr. Comissão"/>
      <TfrxMemoView Name="LblTotLucro" Tag="1" Align="baRight" Left="480,00031" Top="0" Width="79,37013" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Tot. Lucro"/>
      <TfrxMemoView Name="LblCodFun" Align="baLeft" Left="0" Top="0" Width="37,7953" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Cod. Func."/>
      <TfrxMemoView Name="LblNomeFun" Align="baWidth" Left="37,7953" Top="0" Width="219,21274" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Funcionário"/>
      <TfrxMemoView Name="LblComissao" Tag="1" Align="baRight" Left="559,37044" Top="0" Width="79,37013" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="  Comissão"/>
      <TfrxMemoView Name="Memo5" Align="baLeft" Left="139,84261" Top="26,45671" Width="86,92919" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haCenter" ParentFont="False" Text="Data"/>
      <TfrxMemoView Name="Memo6" Align="baLeft" Left="0" Top="26,45671" Width="18,89765" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-12" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text=""/>
      <TfrxMemoView Name="Memo7" Align="baLeft" Left="18,89765" Top="26,45671" Width="120,94496" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haCenter" ParentFont="False" Text="Doc./Espécie Doc."/>
      <TfrxMemoView Name="Memo8" Align="baWidth" Left="226,7718" Top="26,45671" Width="491,3389" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-12" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text=""/>
      <TfrxMemoView Name="LblTotCusto" Tag="3" Align="baRight" Left="257,00804" Top="0" Width="68,03154" Height="26,45671" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="Tot. Custo"/>
    </TfrxPageHeader>
    <TfrxReportSummary Name="ResumoRelatorio" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,89765" Left="0" Top="364" Width="718,1107">
      <TfrxMemoView Name="Memo3" Align="baWidth" Left="0" Top="0" Width="241,88992" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" ParentFont="False" Text="Totais Gerais"/>
      <TfrxMemoView Name="RS_VlrComissao" Align="baRight" Left="638,74057" Top="0" Width="79,37013" Height="15,11812" DataField="VlrComissao" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[QTotal.&#34;VlrComissao&#34;]"/>
      <TfrxMemoView Name="RS_Comissao" Tag="2" Align="baRight" Left="559,37044" Top="0" Width="79,37013" Height="15,11812" DataField="Comissao" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[QTotal.&#34;Comissao&#34;]"/>
      <TfrxMemoView Name="RS_TotLucro" Tag="2" Align="baRight" Left="480,00031" Top="0" Width="79,37013" Height="15,11812" DataField="TotLucro" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[QTotal.&#34;TotLucro&#34;]"/>
      <TfrxMemoView Name="RS_MLucro" Tag="2" Align="baRight" Left="400,63018" Top="0" Width="79,37013" Height="15,11812" DataField="MLucro" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[QTotal.&#34;MLucro&#34;]"/>
      <TfrxMemoView Name="QTotalTotalVenda" Align="baRight" Left="321,26005" Top="0" Width="79,37013" Height="15,11812" DataField="TotalVenda" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[QTotal.&#34;TotalVenda&#34;]"/>
      <TfrxMemoView Name="Memo10" Tag="3" Align="baRight" Left="241,88992" Top="0" Width="79,37013" Height="15,11812" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="4" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;QSubItem.&#34;TotalCusto&#34;&#62;,SDD)]"/>
    </TfrxReportSummary>
    <TfrxPageFooter Name="RodapePagina" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Font.Charset="1" Font.Color="0" Font.Height="-12" Font.Name="Arial" Font.Style="0" Height="15,11812" Left="0" ParentFont="False" Top="404" Width="718,1107">
      <TfrxSysMemoView Name="TotalPaginas" Align="baRight" Left="612,28386" Top="0,13385827" Width="105,82684" Height="15,11812" Font.Charset="0" Font.Color="0" Font.Height="-12" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[PAGE#]/[TOTALPAGES#]"/>
    </TfrxPageFooter>
    <TfrxMasterData Name="MDPrincipal" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,8976378" Left="0" Top="164" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="QPrincipal" DataSetName="QPrincipal" PrintIfDetailEmpty="True" RowCount="0">
      <TfrxMemoView Name="MD_Valor" Align="baRight" Left="321,26005" Top="0" Width="79,37013" Height="18,89765" DataField="TotalVenda" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;TotalVenda&#34;]"/>
      <TfrxMemoView Name="MD_MLucro" Tag="1" Align="baRight" Left="400,63018" Top="0" Width="79,37013" Height="18,89765" DataField="MLucro" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;MLucro&#34;]"/>
      <TfrxMemoView Name="MD_TotLucro" Tag="1" Align="baRight" Left="480,00031" Top="0" Width="79,37013" Height="18,89765" DataField="TotLucro" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;TotLucro&#34;]"/>
      <TfrxMemoView Name="MD_VlrComissao" Align="baRight" Left="638,74057" Top="0" Width="79,37013" Height="18,89765" DataField="VlrComissao" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;VlrComissao&#34;]"/>
      <TfrxMemoView Name="MD_PorComissao" Tag="1" Align="baRight" Left="559,37044" Top="0" Width="79,37013" Height="18,89765" DataField="Comissao" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;Comissao&#34;]"/>
      <TfrxMemoView Name="CodFun" Align="baLeft" Left="0" Top="0" Width="37,7953" Height="18,89765" DataField="CodFuncionario" DataSet="QPrincipal" DataSetName="QPrincipal" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;CodFuncionario&#34;]"/>
      <TfrxMemoView Name="NomeFun" Align="baWidth" Left="37,7953" Top="0" Width="204,09462" Height="18,89765" DataField="NomeFuncionario" DataSet="QPrincipal" DataSetName="QPrincipal" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;NomeFuncionario&#34;]"/>
      <TfrxMemoView Name="Memo11" Tag="3" Align="baRight" Left="241,88992" Top="0" Width="79,37013" Height="18,89765" DataSet="QPrincipal" DataSetName="QPrincipal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="12" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[QPrincipal.&#34;TotalCusto&#34;]"/>
    </TfrxMasterData>
    <TfrxDetailData Name="DD" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,89765" Left="0" Top="244" Visible="False" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="QItem" DataSetName="QItem" PrintIfDetailEmpty="True" RowCount="0">
      <TfrxMemoView Name="DD_NDoc" Align="baLeft" Left="18,89765" Top="0" Width="120,94496" Height="15,11812" DataSet="QItem" DataSetName="QItem" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QItem.&#34;NDocumento&#34;] - [QItem.&#34;EspDocumento&#34;]"/>
      <TfrxMemoView Name="DtEntrada" Align="baLeft" Left="139,84261" Top="0" Width="86,92919" Height="15,11812" DataField="DtEntrada" DataSet="QItem" DataSetName="QItem" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haCenter" ParentFont="False" Text="[QItem.&#34;DtEntrada&#34;]"/>
      <TfrxMemoView Name="DD_Valor" Align="baRight" Left="321,26005" Top="0" Width="79,37013" Height="15,11812" DataField="TotalVenda" DataSet="QItem" DataSetName="QItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItem.&#34;TotalVenda&#34;]"/>
      <TfrxMemoView Name="DD_MLucro" Tag="1" Align="baRight" Left="400,63018" Top="0" Width="79,37013" Height="15,11812" DataField="Margem_Lucro" DataSet="QItem" DataSetName="QItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItem.&#34;Margem_Lucro&#34;]"/>
      <TfrxMemoView Name="DD_TotLucro" Tag="1" Align="baRight" Left="480,00031" Top="0" Width="79,37013" Height="15,11812" DataField="TotLucro" DataSet="QItem" DataSetName="QItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItem.&#34;TotLucro&#34;]"/>
      <TfrxMemoView Name="DD_PorComissao" Tag="1" Align="baRight" Left="559,37044" Top="0" Width="79,37013" Height="15,11812" DataField="Comissao" DataSet="QItem" DataSetName="QItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItem.&#34;Comissao&#34;]"/>
      <TfrxMemoView Name="DD_VlrComissao" Align="baRight" Left="638,74057" Top="0" Width="79,37013" Height="15,11812" DataField="VlrComissao" DataSet="QItem" DataSetName="QItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItem.&#34;VlrComissao&#34;]"/>
      <TfrxMemoView Name="Memo2" Align="baLeft" Left="0" Top="0" Width="18,89765" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" ParentFont="False" Text=""/>
    </TfrxDetailData>
    <TfrxSubdetailData Name="SDD" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,89765" Left="0" Top="284" Visible="False" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="QSubItem" DataSetName="QSubItem" PrintIfDetailEmpty="True" RowCount="0">
      <TfrxMemoView Name="Descricao" Align="baWidth" Left="37,7953" Top="0" Width="204,09462" Height="15,11812" DataField="Item_Descricao" DataSet="QSubItem" DataSetName="QSubItem" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QSubItem.&#34;Item_Descricao&#34;]"/>
      <TfrxMemoView Name="SDD_Valor" Align="baRight" Left="321,26005" Top="0" Width="79,37013" Height="15,11812" DataField="TotalVenda" DataSet="QSubItem" DataSetName="QSubItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QSubItem.&#34;TotalVenda&#34;]"/>
      <TfrxMemoView Name="SDD_MLucro" Tag="1" Align="baRight" Left="400,63018" Top="0" Width="79,37013" Height="15,11812" DataField="Margem_Lucro" DataSet="QSubItem" DataSetName="QSubItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QSubItem.&#34;Margem_Lucro&#34;]"/>
      <TfrxMemoView Name="SDD_TotLucro" Tag="1" Align="baRight" Left="480,00031" Top="0" Width="79,37013" Height="15,11812" DataField="TotLucro" DataSet="QSubItem" DataSetName="QSubItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QSubItem.&#34;TotLucro&#34;]"/>
      <TfrxMemoView Name="SDD_PorComissao" Tag="1" Align="baRight" Left="559,37044" Top="0" Width="79,37013" Height="15,11812" DataField="Comissao" DataSet="QSubItem" DataSetName="QSubItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QSubItem.&#34;Comissao&#34;]"/>
      <TfrxMemoView Name="SDD_VlrComissao" Align="baRight" Left="638,74057" Top="0" Width="79,37013" Height="15,11812" DataField="VlrComissao" DataSet="QSubItem" DataSetName="QSubItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QSubItem.&#34;VlrComissao&#34;]"/>
      <TfrxMemoView Name="Memo1" Align="baLeft" Left="0" Top="0" Width="37,7953" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" ParentFont="False" Text=""/>
      <TfrxMemoView Name="Memo9" Align="baRight" Left="241,88992" Top="0" Width="79,37013" Height="15,11812" DataSet="QSubItem" DataSetName="QSubItem" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QSubItem.&#34;TotalCusto&#34;]"/>
    </TfrxSubdetailData>
    <TfrxFooter Name="SSDFooter" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,89765" Left="0" Top="324" Visible="False" Width="718,1107" PrintChildIfInvisible="True"/>
    <TfrxDetailData Name="DDSim" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="18,89765" Left="0" Top="204" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="QItemSim" DataSetName="QItemSim" RowCount="0">
      <TfrxMemoView Name="DDSim_NDocumento" Align="baLeft" Left="18,89765" Top="0" Width="60,47248" Height="15,11812" DataField="NDocumento" DataSet="QItemSim" DataSetName="QItemSim" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QItemSim.&#34;NDocumento&#34;]"/>
      <TfrxMemoView Name="DDSim_DtEntrada" Align="baLeft" Left="79,37013" Top="0" Width="71,81107" Height="15,11812" DataField="DtEntrada" DataSet="QItemSim" DataSetName="QItemSim" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QItemSim.&#34;DtEntrada&#34;]"/>
      <TfrxMemoView Name="DDSim_TotalVenda" Align="baRight" Left="321,26005" Top="0" Width="79,37013" Height="15,11812" DataField="TotalVenda" DataSet="QItemSim" DataSetName="QItemSim" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItemSim.&#34;TotalVenda&#34;]"/>
      <TfrxMemoView Name="DDSim_Margem_Lucro" Tag="1" Align="baRight" Left="400,63018" Top="0" Width="79,37013" Height="15,11812" DataField="Margem_Lucro" DataSet="QItemSim" DataSetName="QItemSim" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItemSim.&#34;Margem_Lucro&#34;]"/>
      <TfrxMemoView Name="DDSim_TotLucro" Tag="1" Align="baRight" Left="480,00031" Top="0" Width="79,37013" Height="15,11812" DataField="TotLucro" DataSet="QItemSim" DataSetName="QItemSim" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItemSim.&#34;TotLucro&#34;]"/>
      <TfrxMemoView Name="DDSim_Comissao" Tag="1" Align="baRight" Left="559,37044" Top="0" Width="79,37013" Height="15,11812" DataField="Comissao" DataSet="QItemSim" DataSetName="QItemSim" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItemSim.&#34;Comissao&#34;]"/>
      <TfrxMemoView Name="DDSim_VlrComissao" Align="baRight" Left="638,74057" Top="0" Width="79,37013" Height="15,11812" DataField="VlrComissao" DataSet="QItemSim" DataSetName="QItemSim" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QItemSim.&#34;VlrComissao&#34;]"/>
      <TfrxMemoView Name="Memo4" Align="baLeft" Left="0" Top="0" Width="18,89765" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" ParentFont="False" Text=""/>
      <TfrxMemoView Name="DDSim_Item_Descricao" Align="baWidth" Left="151,1812" Top="0" Width="170,07885" Height="15,11812" DataField="Item_Descricao" DataSet="QItemSim" DataSetName="QItemSim" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QItemSim.&#34;Item_Descricao&#34;]"/>
    </TfrxDetailData>
  </TfrxReportPage>
  <TfrxReportPage Name="Page2" Visible="False" 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" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="102,92919" Left="0" Top="18,89765" Width="718,1107" Stretched="True">
      <TfrxMemoView Name="Memo12" Align="baWidth" Left="0" Top="18,8976378" Width="517,79561" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-15" Font.Name="Courier New" Font.Style="1" ParentFont="False" VAlign="vaCenter" Text="Comissão de Vendedor - [TituloTipoRel]"/>
      <TfrxMemoView Name="Memo13" Align="baRight" Left="517,79561" Top="19" Width="200,31509" Height="18,89765" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[IIF(&#60;RelReferencia&#62;='','','(Ref.:'+&#60;RelReferencia&#62;+')')]"/>
      <TfrxMemoView Name="Memo14" Align="baWidth" Left="56,69295" Top="38,67718" Width="661,41775" Height="30,23624" StretchMode="smMaxHeight" Font.Charset="0" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[&#60;Filtros&#62;]"/>
      <TfrxMemoView Name="Memo15" Align="baLeft" Left="0" Top="38,67718" Width="56,69295" Height="30,23624" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="Filtros:"/>
      <TfrxMemoView Name="Memo16" Align="baWidth" Left="0" Top="0" Width="517,79561" Height="18,89765" DataField="EMP_NOMEMP" DataSet="QEmpresa" DataSetName="QEmpresa" Font.Charset="0" Font.Color="0" Font.Height="-13" Font.Name="Courier New" Font.Style="0" ParentFont="False" Text="[QEmpresa.&#34;EMP_NOMEMP&#34;]"/>
      <TfrxMemoView Name="Memo17" Align="baRight" Left="517,79561" Top="0" Width="200,31509" Height="15,11812" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="Emissão: [DATE] [Time]"/>
      <TfrxMemoView Name="Memo29" Left="0" Top="71,81107" Width="718,1107" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text=""/>
    </TfrxReportTitle>
    <TfrxMasterData Name="MasterData1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="26,4566978" Left="0" Top="291,02381" Width="718,1107" ColumnWidth="0" ColumnGap="0" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" PrintIfDetailEmpty="True" RowCount="0">
      <TfrxMemoView Name="QPrincipal_R2FTG_NUMDOC" Left="0" Top="3,77953" Width="75,5906" Height="13,98425197" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[QPrincipal_R2.&#34;FTG_NUMDOC&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2FTG_ESPDOC" Left="75,5906" Top="3,77953" Width="41,57483" Height="13,98425197" DataField="FTG_ESPDOC" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[QPrincipal_R2.&#34;FTG_ESPDOC&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2FTG_DTAENT" Left="117,16543" Top="3,77953" Width="71,81107" Height="13,98425197" DataField="FTG_DTAENT" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[QPrincipal_R2.&#34;FTG_DTAENT&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2ITE_DESCRI" Left="188,9765" Top="3,77953" Width="230,55133" Height="13,98425197" DataField="ITE_DESCRI" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[QPrincipal_R2.&#34;ITE_DESCRI&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2MVC_BASCON" Left="487,63018" Top="3,77953" Width="113,38582677" Height="13,98425197" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QPrincipal_R2.&#34;MVC_BASCOM&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2VALCOM" Left="601,01608" Top="3,77953" Width="113,38582677" Height="13,98425197" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QPrincipal_R2.&#34;VALCOM&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2PERCOMISS" Left="419,83488" Top="3,77953" Width="68,03149606" Height="13,98425197" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[QPrincipal_R2.&#34;PERCOMISS&#34;]"/>
    </TfrxMasterData>
    <TfrxReportSummary Name="ReportSummary1" 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">
      <TfrxMemoView Name="Memo35" Left="0" Top="11" Width="487,55937" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text=" Totais Gerais:"/>
      <TfrxMemoView Name="Memo37" Tag="2" Left="601,01608" Top="11" Width="113,38582677" Height="15,11812" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;QPrincipal_R2.&#34;VALCOM&#34;&#62;,MasterData1)]"/>
      <TfrxMemoView Name="Memo28" Tag="2" Left="487,63018" Top="11" Width="113,38582677" Height="15,11812" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;QPrincipal_R2.&#34;MVC_BASCOM&#34;&#62;,MasterData1)]"/>
    </TfrxReportSummary>
    <TfrxPageFooter Name="PageFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Font.Charset="1" Font.Color="0" Font.Height="-12" Font.Name="Arial" Font.Style="0" Height="18,89765" Left="0" ParentFont="False" Top="480,00031" Width="718,1107">
      <TfrxSysMemoView Name="SysMemo1" Align="baRight" Left="612,28386" Top="0,13385827" Width="105,82684" Height="15,11812" Font.Charset="0" Font.Color="0" Font.Height="-12" Font.Name="Courier New" Font.Style="0" HAlign="haRight" ParentFont="False" Text="[PAGE#]/[TOTALPAGES#]"/>
    </TfrxPageFooter>
    <TfrxGroupHeader Name="GroupHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="30,23624" Left="0" Top="238,11039" Width="718,1107" Condition="QPrincipal_R2.&#34;FUN_CODIGO&#34;">
      <TfrxMemoView Name="Memo18" Left="0" Top="5,77953" Width="117,16543" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" ParentFont="False" Text="Funcionario:"/>
      <TfrxMemoView Name="QPrincipal_R2FUN_CODIGO" Left="117,16543" Top="5,77953" Width="71,81107" Height="15,11812" DataField="FUN_CODIGO" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[QPrincipal_R2.&#34;FUN_CODIGO&#34;]"/>
      <TfrxMemoView Name="QPrincipal_R2FUN_NOMFUN" Left="188,9765" Top="5,77953" Width="529,1342" Height="15,11812" DataField="FUN_NOMFUN" DataSet="QPrincipal_R2" DataSetName="QPrincipal_R2" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Arial" Font.Style="0" ParentFont="False" Text="[QPrincipal_R2.&#34;FUN_NOMFUN&#34;]"/>
    </TfrxGroupHeader>
    <TfrxGroupFooter Name="GroupFooter1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="26,45671" Left="0" Top="340,1577" Width="718,1107">
      <TfrxMemoView Name="Memo25" Tag="2" Left="601,01608" Top="9,77953" Width="113,38582677" Height="15,11812" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;QPrincipal_R2.&#34;VALCOM&#34;&#62;,MasterData1)]"/>
      <TfrxMemoView Name="Memo26" Tag="2" Left="487,63018" Top="9,77953" Width="113,38582677" Height="15,11812" DataSet="QTotal" DataSetName="QTotal" DisplayFormat.FormatStr="%2.2n" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="[SUM(&#60;QPrincipal_R2.&#34;MVC_BASCOM&#34;&#62;,MasterData1)]"/>
      <TfrxMemoView Name="Memo27" Left="0" Top="9,77953" Width="487,55937" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text=" Totais:"/>
    </TfrxGroupFooter>
    <TfrxPageHeader Name="PageHeader1" FillType="ftBrush" FillGap.Top="0" FillGap.Left="0" FillGap.Bottom="0" FillGap.Right="0" Height="34,01577" Left="0" Top="143,62214" Width="718,1107">
      <TfrxMemoView Name="Memo19" Left="0" Top="6,55906" Width="117,16543" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Documento"/>
      <TfrxMemoView Name="Memo20" Left="117,16543" Top="6,55906" Width="71,81107" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Data Doc."/>
      <TfrxMemoView Name="Memo21" Left="188,75603" Top="6,55906" Width="230,55133" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" ParentFont="False" Text="Produto"/>
      <TfrxMemoView Name="Memo22" Left="487,29159" Top="6,55906" Width="113,38582677" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Valor Recebido"/>
      <TfrxMemoView Name="Memo23" Left="601,01608" Top="6,55906" Width="117,16535677" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="Valor Comissão "/>
      <TfrxMemoView Name="Memo24" Left="418,96877" Top="6,55906" Width="68,03154" Height="15,11812" Font.Charset="1" Font.Color="-16777208" Font.Height="-11" Font.Name="Courier New" Font.Style="1" Frame.Typ="8" HAlign="haRight" ParentFont="False" Text="% Comissão"/>
    </TfrxPageHeader>
  </TfrxReportPage>
</TfrxReport>
