Subida de objetivos de agente funcionando sobre facturas de cliente

git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES2/trunk@151 b2cfbe5a-eba1-4a0c-8b32-7feea0a119f2
This commit is contained in:
roberto 2012-02-13 18:26:36 +00:00
parent 2c9ef7e0be
commit 507b9f15a6
22 changed files with 1505 additions and 506 deletions

View File

@ -54,58 +54,58 @@
<DelphiCompile Include="Base.dpk">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\Modulos\Gestor de informes\adortl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxDataD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxEditorsD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxExportD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxExtEditorsD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxGridD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxIntl6D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxIntlPrintSys3D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxLibraryD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\cxPageControlD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\DataAbstract_Core_D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dbrtl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dclIndyCore.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\designide.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dsnap.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dxCoreD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dxGDIPlusD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dxPSCoreD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\dxThemeD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\GUISDK_D11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\IndyCore.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\IndyProtocols.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\IndySystem.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Jcl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JclVcl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JSDialog100.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvCmpD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvCoreD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvCtrlsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvDlgsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvMMD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvNetD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvPageCompsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvStdCtrlsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\JvSystemD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\pckMD5.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\pckUCDataConnector.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\pckUserControl_RT.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\PngComponentsD10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\PNG_D10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\RemObjects_Core_D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\RemObjects_Indy_D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\rtl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\TB2k_D10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\tbx_d10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\vcl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\vclactnband.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\vcldb.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\vcljpg.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\VclSmp.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\vclx.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\xmlrtl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\adortl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxDataD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxEditorsD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxExportD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxExtEditorsD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxGridD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxIntl6D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxIntlPrintSys3D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxLibraryD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\cxPageControlD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\DataAbstract_Core_D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dbrtl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dclIndyCore.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\designide.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dsnap.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dxCoreD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dxGDIPlusD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dxPSCoreD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\dxThemeD11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\GUISDK_D11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\IndyCore.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\IndyProtocols.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\IndySystem.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\Jcl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JclVcl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JSDialog100.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvCmpD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvCoreD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvCtrlsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvDlgsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvMMD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvNetD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvPageCompsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvStdCtrlsD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\JvSystemD11R.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\pckMD5.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\pckUCDataConnector.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\pckUserControl_RT.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\PngComponentsD10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\PNG_D10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\RemObjects_Core_D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\RemObjects_Indy_D11.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\rtl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\TB2k_D10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\tbx_d10.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\vcl.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\vclactnband.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\vcldb.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\vcljpg.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\VclSmp.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\vclx.dcp" />
<DCCReference Include="..\Modulos\Gestor de informes\Views\xmlrtl.dcp" />
<DCCReference Include="..\Modulos\Impresiones\Data\uDataModuleImpresiones.pas">
<Form>DataModuleImpresiones</Form>
<DesignClass>TDataModule</DesignClass>

View File

@ -1,7 +1,7 @@
MAINICON ICON "C:\Codigo\Resources\Iconos\Factuges.ico"
1 VERSIONINFO
FILEVERSION 4,1,9,0
PRODUCTVERSION 4,1,9,0
FILEVERSION 4,2,1,0
PRODUCTVERSION 4,2,1,0
FILEFLAGSMASK 0x3FL
FILEFLAGS 0x00L
FILEOS 0x40004L
@ -13,10 +13,10 @@ BEGIN
BLOCK "0C0A04E4"
BEGIN
VALUE "CompanyName", "Rodax Software S.L.\0"
VALUE "FileVersion", "4.1.9.0\0"
VALUE "FileVersion", "4.2.1.0\0"
VALUE "InternalName", "FactuGES\0"
VALUE "ProductName", "FactuGES\0"
VALUE "ProductVersion", "4.1.9.0\0"
VALUE "ProductVersion", "4.2.1.0\0"
END
END
BLOCK "VarFileInfo"

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TfrxReport Version="4.7.71" DotMatrixReport="False" EngineOptions.DoublePass="True" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Por defecto" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="37800,8077143519" ReportOptions.Description.Text="" ReportOptions.LastChange="40942,6681015741" ScriptLanguage="PascalScript" ScriptText.Text="procedure mContinuaOnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if Engine.FinalPass then&#13;&#10; begin&#13;&#10; if (&#60;Page#&#62; = &#60;TotalPages#&#62;) then&#13;&#10; begin &#13;&#10; mContinua.Visible := False;&#13;&#10; end &#13;&#10; else&#13;&#10; begin &#13;&#10; mContinua.Visible := True;&#13;&#10; end &#13;&#10; end; &#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end." ShowProgress="False" StoreInDFM="False" OnStartReport="frxReportOnStartReport" PropData="044C65667403910003546F70021008446174617365747301010C4400000020446174615365743D226672784442496E666F726D654F626A657469766F732220446174615365744E616D653D226672784442496E666F726D654F626A657469766F73220000095661726961626C657301010C13000000204E616D653D2220506172616D6574726F732200010C17000000204E616D653D22546578746F506172616D6574726F73220000055374796C650100">
<TfrxReport Version="4.7.71" DotMatrixReport="False" EngineOptions.DoublePass="True" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Por defecto" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="37800,8077143519" ReportOptions.Description.Text="" ReportOptions.LastChange="40952,7636454282" ScriptLanguage="PascalScript" ScriptText.Text="procedure mContinuaOnBeforePrint(Sender: TfrxComponent);&#13;&#10;begin&#13;&#10; if Engine.FinalPass then&#13;&#10; begin&#13;&#10; if (&#60;Page#&#62; = &#60;TotalPages#&#62;) then&#13;&#10; begin &#13;&#10; mContinua.Visible := False;&#13;&#10; end &#13;&#10; else&#13;&#10; begin &#13;&#10; mContinua.Visible := True;&#13;&#10; end &#13;&#10; end; &#13;&#10;end;&#13;&#10;&#13;&#10;begin&#13;&#10;&#13;&#10;end." ShowProgress="False" StoreInDFM="False" OnStartReport="frxReportOnStartReport" PropData="044C65667403910003546F70021008446174617365747301010C4400000020446174615365743D226672784442496E666F726D654F626A657469766F732220446174615365744E616D653D226672784442496E666F726D654F626A657469766F73220000095661726961626C657301010C13000000204E616D653D2220506172616D6574726F732200010C17000000204E616D653D22546578746F506172616D6574726F73220000055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" Orientation="poLandscape" PaperWidth="297" PaperHeight="210" PaperSize="9" LeftMargin="15" RightMargin="15" TopMargin="15" BottomMargin="20" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxPageHeader Name="Band1" Height="104,10235" Left="0" Top="16" Width="1009,13451" OnBeforePrint="Band1OnBeforePrint">
@ -32,8 +32,8 @@
<TfrxMemoView Name="Memo20" Align="baLeft" Left="298" Top="0" Width="100" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" Color="-16777194" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;IMPORTE_OBJETIVO&#34;]"/>
<TfrxMemoView Name="Memo21" Align="baLeft" Left="103" Top="0" Width="50" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haCenter" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;ALTAS_CLIENTE&#34;]"/>
<TfrxMemoView Name="Memo18" Align="baLeft" Left="0" Top="0" Width="103" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;DESCRIPCION&#34;]"/>
<TfrxMemoView Name="Memo29" Align="baLeft" Left="398" Top="0" Width="100" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;CANTIDAD_CONSEGUIDA&#34;] / [frxDBInformeObjetivos.&#34;CANTIDAD_DEVUELTA&#34;]"/>
<TfrxMemoView Name="Memo30" Align="baLeft" Left="498" Top="0" Width="100" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;IMPORTE_CONSEGUIDO&#34;]"/>
<TfrxMemoView Name="Memo29" Align="baLeft" Left="398" Top="0" Width="100" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haCenter" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;CANTIDAD_CONSEGUIDA&#34;] / [frxDBInformeObjetivos.&#34;CANTIDAD_DEVUELTA&#34;] = [frxDBInformeObjetivos.&#34;CANTIDAD_TOTAL_CONSEGUIDA&#34;]"/>
<TfrxMemoView Name="Memo30" Align="baLeft" Left="498" Top="0" Width="100" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;IMPORTE_TOTAL_CONSEGUIDO&#34;]"/>
<TfrxMemoView Name="Memo31" Left="598" Top="0" Width="95" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" Color="-16777194" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haCenter" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;CANTIDAD_RESULTADO&#34;]"/>
<TfrxMemoView Name="Memo5" Align="baLeft" Left="153" Top="0" Width="65" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haCenter" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;CLIENTES_TOTALES&#34;]"/>
<TfrxMemoView Name="Memo12" Left="693" Top="0" Width="105" Height="17,00787402" ShowHint="False" StretchMode="smMaxHeight" Color="-16777194" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="16384" Font.Height="-12" Font.Name="Tahoma" Font.Style="0" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" Text="[frxDBInformeObjetivos.&#34;IMPORTE_RESULTADO&#34;]"/>
@ -45,12 +45,12 @@
<TfrxMemoView Name="Memo6" Align="baLeft" Left="903" Top="0" Width="105" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;IMPORTE_MEDIO_CLIENTE&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo14" Align="baLeft" Left="798" Top="0" Width="105" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haRight" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;IMPORTE_MEDIO_UNIDAD&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo15" Align="baLeft" Left="693" Top="0" Width="105" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;IMPORTE_RESULTADO&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo2" Align="baLeft" Left="103" Top="0" Width="50" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;ALTAS_CLIENTE&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo2" Align="baLeft" Left="103" Top="0" Width="50" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;ALTAS_CLIENTE&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo17" Align="baLeft" Left="153" Top="0" Width="65" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text=""/>
<TfrxMemoView Name="Memo19" Align="baLeft" Left="218" Top="0" Width="80" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_OBJETIVO&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo22" Align="baLeft" Left="398" Top="0" Width="100" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_CONSEGUIDA&#34;&#62;,DatosMaestros1)] / [SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_DEVUELTA&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo22" Align="baLeft" Left="398" Top="0" Width="100" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_CONSEGUIDA&#34;&#62;,DatosMaestros1)] / [SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_DEVUELTA&#34;&#62;,DatosMaestros1)] = [SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_TOTAL_CONSEGUIDA&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo23" Align="baLeft" Left="298" Top="0" Width="100" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;IMPORTE_OBJETIVO&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo24" Align="baLeft" Left="498" Top="0" Width="100" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;IMPORTE_CONSEGUIDO&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo24" Align="baLeft" Left="498" Top="0" Width="100" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%2.2m" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haRight" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;IMPORTE_TOTAL_CONSEGUIDO&#34;&#62;,DatosMaestros1)]"/>
<TfrxMemoView Name="Memo25" Align="baLeft" Left="598" Top="0" Width="95" Height="16" ShowHint="False" StretchMode="smMaxHeight" Color="13095676" DisplayFormat.DecimalSeparator="," DisplayFormat.FormatStr="%g" DisplayFormat.Kind="fkNumeric" Font.Charset="1" Font.Color="0" Font.Height="-11" Font.Name="Tahoma" Font.Style="1" Frame.Typ="15" HAlign="haCenter" HideZeros="True" ParentFont="False" VAlign="vaCenter" Text="[SUM(&#60;frxDBInformeObjetivos.&#34;CANTIDAD_RESULTADO&#34;&#62;,DatosMaestros1)]"/>
</TfrxGroupFooter>
</TfrxReportPage>

View File

@ -484,124 +484,6 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
DataType = datCurrency
end>
end
item
Params = <>
Statements = <
item
ConnectionType = 'Interbase'
Default = True
Name = 'IBX'
SQL =
'select A.ID_EMPRESA, A.ID_AGENTE,'#10' A.ANO,'#10' A.MES,'#10' AO.C' +
'ANTIDAD_OBJETIVO,'#10' AO.IMPORTE_OBJETIVO,'#10' A.CANTIDAD_CONSEG' +
'UIDA,'#10' A.CANTIDAD_DEVUELTA,'#10' A.IMPORTE_CONSEGUIDO,'#10' A.I' +
'MPORTE_DEVUELTO,'#10' (A.CANTIDAD_CONSEGUIDA - AO.CANTIDAD_OBJETI' +
'VO) as CANTIDAD_RESULTADO,'#10' (A.IMPORTE_CONSEGUIDO - AO.IMPORT' +
'E_OBJETIVO) as IMPORTE_RESULTADO'#10#10#10'from v_inf_objetivos_albarane' +
's A'#10'left join V_INF_OBJETIVOS_ALB_AGENTES AO on ((AO.id_agente =' +
' A.id_agente) and (AO.ano = A.ANO) and (AO.mes = A.MES))'#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_EMPRESA'
TableField = 'ID_EMPRESA'
end
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
end
item
DatasetField = 'MES'
TableField = 'MES'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
end
item
DatasetField = 'IMPORTE_OBJETIVO'
TableField = 'IMPORTE_OBJETIVO'
end
item
DatasetField = 'CANTIDAD_CONSEGUIDA'
TableField = 'CANTIDAD_CONSEGUIDA'
end
item
DatasetField = 'CANTIDAD_DEVUELTA'
TableField = 'CANTIDAD_DEVUELTA'
end
item
DatasetField = 'IMPORTE_CONSEGUIDO'
TableField = 'IMPORTE_CONSEGUIDO'
end
item
DatasetField = 'IMPORTE_DEVUELTO'
TableField = 'IMPORTE_DEVUELTO'
end
item
DatasetField = 'CANTIDAD_RESULTADO'
TableField = 'CANTIDAD_RESULTADO'
end
item
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end>
end>
Name = 'Informe_Objetivos_Albaranes'
Fields = <
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'ID_AGENTE'
DataType = datInteger
end
item
Name = 'ANO'
DataType = datSmallInt
end
item
Name = 'MES'
DataType = datSmallInt
end
item
Name = 'CANTIDAD_OBJETIVO'
DataType = datInteger
end
item
Name = 'IMPORTE_OBJETIVO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
end
item
Name = 'IMPORTE_RESULTADO'
DataType = datCurrency
end>
end
item
Params = <
item
@ -619,47 +501,64 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Default = True
Name = 'IBX'
SQL =
'select SEN.ID_AGENTE, C.NOMBRE as AGENTE, ANO, MES,'#10' P.descri' +
'pcion,'#10#10' coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALES, 0) a' +
's CLIENTES_TOTALES,'#10#10' sum(ALTAS_CLIENTE) as ALTAS_CLIENTE,'#10#10' ' +
' sum(CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(IMPORTE_OBJE' +
'TIVO) as IMPORTE_OBJETIVO,'#10#10' sum(CANTIDAD_CONSEGUIDA) as CANT' +
'IDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA,'#10' ' +
' sum(IMPORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEV' +
'UELTO) as IMPORTE_DEVUELTO,'#10#10' (sum(CANTIDAD_CONSEGUIDA) - sum' +
'(CANTIDAD_OBJETIVO)) as CANTIDAD_RESULTADO,'#10' (sum(IMPORTE_CON' +
'SEGUIDO) - sum(IMPORTE_OBJETIVO)) as IMPORTE_RESULTADO,'#10' case' +
' when (sum(IMPORTE_CONSEGUIDO) > 0) then (sum(IMPORTE_CONSEGUIDO' +
')/sum(CANTIDAD_CONSEGUIDA))'#10' else 0'#10' end as IMPORTE_MEDIO_' +
'UNIDAD,'#10#10' case when (sum(IMPORTE_CONSEGUIDO) > 0) then (sum(I' +
'MPORTE_CONSEGUIDO)/coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALE' +
'S, 0))'#10' else 0'#10' end as IMPORTE_MEDIO_CLIENTE'#10#10'from'#10'('#10'selec' +
't AO.ID_AGENTE, AO.ANO, AO.MES,'#10'0 as ALTAS_CLIENTE,'#10'sum(AO.CANTI' +
'DAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(AO.IMPORTE_OBJETIVO) as ' +
'IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVUEL' +
'TA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO'#10'from V_INF_OB' +
'JETIVOS_ALB_AGENTES AO'#10'left join contactos C on (C.ID = AO.ID_AG' +
'ENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'select I' +
'D_AGENTE, ANO, MES,'#10'0 as ALTAS_CLIENTE,'#10'0 as CANTIDAD_OBJETIVO, ' +
'0 as IMPORTE_OBJETIVO,'#10'sum(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONS' +
'EGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELTA, sum(IMPORTE' +
'_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMP' +
'ORTE_DEVUELTO'#10'from v_inf_objetivos_albaranes'#10'where ((v_inf_objet' +
'ivos_albaranes.id_empresa = :ID_EMPRESA) and (v_inf_objetivos_al' +
'baranes.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'select ID_AGENT' +
'E, ANO, MES,'#10'count(ID_CLIENTE) as ALTAS_CLIENTE,'#10'0 as CANTIDAD_O' +
'BJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as C' +
'ANTIDAD_DEVUELTA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO' +
#10'from v_inf_obj_clientes_agentes'#10'where (ANO = :ANO1)'#10'group by 1,' +
'2,3'#10') SEN'#10#10'left join periodos_aux P on ((P.periodo = '#39'MENSUAL'#39') ' +
'and (P.valor = MES))'#10'left join contactos C on (C.ID = SEN.ID_AGE' +
'NTE)'#10#10'left join'#10'('#10'select coalesce(ID_AGENTE, -1) as ID_AGENTE, c' +
'ount(ID_CLIENTE) as NUM_CLIENTES_TOTALES'#10'from clientes_datos'#10'gro' +
'up by 1'#10') CLIENTES_TOTALES on (CLIENTES_TOTALES.ID_AGENTE = SEN.' +
'id_Agente)'#10#10'where {where}'#10'group by 1,2,3,4,5,6'#10'order by 1,2,3,4,' +
'5,6'#10#10#10#10
'select SEN.ID_AGENTE, COALESCE(C.NOMBRE, '#39'SIN ASIGNAR'#39') as AGENT' +
'E, ANO, MES,'#10' P.descripcion,'#10#10' coalesce(CLIENTES_TOTALES.N' +
'UM_CLIENTES_TOTALES, 0) as CLIENTES_TOTALES,'#10#10' sum(ALTAS_CLIE' +
'NTE) as ALTAS_CLIENTE,'#10#10' sum(CANTIDAD_OBJETIVO) as CANTIDAD_O' +
'BJETIVO, sum(IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10#10' sum(CAN' +
'TIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA)' +
' as CANTIDAD_DEVUELTA, sum(CANTIDAD_TOTAL_CONSEGUIDA) as CANTIDA' +
'D_TOTAL_CONSEGUIDA,'#10' sum(IMPORTE_CONSEGUIDO) as IMPORTE_CONSE' +
'GUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEVUELTO, sum(IMPORTE_TO' +
'TAL_CONSEGUIDO) as IMPORTE_TOTAL_CONSEGUIDO,'#10#10' (sum(CANTIDAD_' +
'TOTAL_CONSEGUIDA) - sum(CANTIDAD_OBJETIVO)) as CANTIDAD_RESULTAD' +
'O,'#10' (sum(IMPORTE_TOTAL_CONSEGUIDO) - sum(IMPORTE_OBJETIVO)) a' +
's IMPORTE_RESULTADO,'#10#10' case when (sum(CANTIDAD_TOTAL_CONSEGUI' +
'DA) <> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/sum(CANTIDAD_TOTAL' +
'_CONSEGUIDA))'#10' else 0'#10' end as IMPORTE_MEDIO_UNIDAD,'#10#10' c' +
'ase when (coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALES, 0) <> ' +
'0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/coalesce(CLIENTES_TOTALES' +
'.NUM_CLIENTES_TOTALES, 0))'#10' else 0'#10' end as IMPORTE_MEDIO_C' +
'LIENTE'#10#10#10'from'#10'('#10'select AO.ID_AGENTE, AO.ANO, AO.MES,'#10'0 as ALTAS_' +
'CLIENTE,'#10'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(AO.' +
'IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA,' +
' 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IM' +
'PORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONS' +
'EGUIDO'#10'from V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join contactos C' +
' on (C.ID = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,2,3'#10 +
#10'UNION ALL'#10#10'select ID_AGENTE, ANO, MES,'#10'0 as ALTAS_CLIENTE,'#10'0 as' +
' CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'sum(CANTIDAD_CONSEGUI' +
'DA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_D' +
'EVUELTA, (sum(CANTIDAD_CONSEGUIDA) + sum(CANTIDAD_DEVUELTA)) as ' +
'CANTIDAD_TOTAL_CONSEGUIDA,'#10'sum(IMPORTE_CONSEGUIDO) as IMPORTE_CO' +
'NSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEVUELTO, (sum(IMPORT' +
'E_CONSEGUIDO) + sum(IMPORTE_DEVUELTO)) as IMPORTE_TOTAL_CONSEGUI' +
'DO'#10'from v_inf_objetivos_albaranes'#10'where ((v_inf_objetivos_albara' +
'nes.id_empresa = :ID_EMPRESA) and (v_inf_objetivos_albaranes.ANO' +
' = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'select ID_AGENTE, ANO, MES' +
','#10'count(ID_CLIENTE) as ALTAS_CLIENTE,'#10'0 as CANTIDAD_OBJETIVO, 0 ' +
'as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTIDAD_DEV' +
'UELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as IMPORTE_CONSEGUIDO, ' +
'0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CONSEGUIDO'#10'from v_inf_' +
'obj_clientes_agentes'#10'where (ANO = :ANO1)'#10'group by 1,2,3'#10') SEN'#10#10'l' +
'eft join periodos_aux P on ((P.periodo = '#39'MENSUAL'#39') and (P.valor' +
' = MES))'#10'left join contactos C on (C.ID = SEN.ID_AGENTE)'#10'left jo' +
'in agentes_datos on (agentes_datos.id_agente = SEN.ID_AGENTE)'#10#10'l' +
'eft join'#10'('#10'select coalesce(ID_AGENTE, -1) as ID_AGENTE, count(ID' +
'_CLIENTE) as NUM_CLIENTES_TOTALES'#10'from clientes_datos'#10'group by 1' +
#10') CLIENTES_TOTALES on (CLIENTES_TOTALES.ID_AGENTE = SEN.id_Agen' +
'te)'#10#10'where agentes_datos.FECHA_BAJA is null'#10'and {where}'#10'group by' +
' 1,2,3,4,5,6'#10'order by 1,2,3,4,5,6'#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
@ -672,6 +571,14 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
@ -704,18 +611,6 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'IMPORTE_MEDIO_UNIDAD'
TableField = 'IMPORTE_MEDIO_UNIDAD'
@ -725,8 +620,12 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
TableField = 'IMPORTE_MEDIO_CLIENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
DatasetField = 'CANTIDAD_TOTAL_CONSEGUIDA'
TableField = 'CANTIDAD_TOTAL_CONSEGUIDA'
end
item
DatasetField = 'IMPORTE_TOTAL_CONSEGUIDO'
TableField = 'IMPORTE_TOTAL_CONSEGUIDO'
end>
end>
Name = 'InformeListadoObjetivosMensual'
@ -777,6 +676,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
@ -785,6 +688,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
@ -2131,51 +2038,85 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
ConnectionType = 'Interbase'
Default = True
SQL =
'select SEN.ID_AGENTE, C.NOMBRE as AGENTE, ANO, TRIMESTRE,'#10' P.' +
'descripcion,'#10#10' coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALES' +
', 0) as CLIENTES_TOTALES,'#10#10' sum(ALTAS_CLIENTE) as ALTAS_CLIEN' +
'TE,'#10#10' sum(CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(IMPORT' +
'E_OBJETIVO) as IMPORTE_OBJETIVO,'#10#10' sum(CANTIDAD_CONSEGUIDA) a' +
's CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUEL' +
'TA,'#10' sum(IMPORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPOR' +
'TE_DEVUELTO) as IMPORTE_DEVUELTO,'#10#10' (sum(CANTIDAD_CONSEGUIDA)' +
' - sum(CANTIDAD_OBJETIVO)) as CANTIDAD_RESULTADO,'#10' (sum(IMPOR' +
'TE_CONSEGUIDO) - sum(IMPORTE_OBJETIVO)) as IMPORTE_RESULTADO,'#10' ' +
' case when (sum(IMPORTE_CONSEGUIDO) > 0) then (sum(IMPORTE_CONS' +
'EGUIDO)/sum(CANTIDAD_CONSEGUIDA))'#10' else 0'#10' end as IMPORTE_' +
'MEDIO_UNIDAD,'#10#10' case when (sum(IMPORTE_CONSEGUIDO) > 0) then ' +
'(sum(IMPORTE_CONSEGUIDO)/coalesce(CLIENTES_TOTALES.NUM_CLIENTES_' +
'TOTALES, 0))'#10' else 0'#10' end as IMPORTE_MEDIO_CLIENTE'#10#10'from'#10'(' +
#10'select AO.ID_AGENTE, AO.ANO, AO.TRIMESTRE,'#10'0 as ALTAS_CLIENTE,'#10 +
'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(AO.IMPORTE_O' +
'BJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CAN' +
'TIDAD_DEVUELTA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO'#10'f' +
'rom V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join contactos C on (C.I' +
'D = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,2,3'#10#10'UNION A' +
'LL'#10#10'select ID_AGENTE, ANO, TRIMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'0 as C' +
'ANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'sum(CANTIDAD_CONSEGUIDA' +
') as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEV' +
'UELTA, sum(IMPORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORT' +
'E_DEVUELTO) as IMPORTE_DEVUELTO'#10'from v_inf_objetivos_albaranes'#10'w' +
'here ((v_inf_objetivos_albaranes.id_empresa = :ID_EMPRESA) and (' +
'v_inf_objetivos_albaranes.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION AL' +
'L'#10#10'select ID_AGENTE, ANO, TRIMESTRE,'#10'count(ID_CLIENTE) as ALTAS_' +
'CLIENTE,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CAN' +
'TIDAD_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 as IMPORTE_CONSEGUID' +
'O, 0 as IMPORTE_DEVUELTO'#10'from v_inf_obj_clientes_agentes'#10'where (' +
'ANO = :ANO1)'#10'group by 1,2,3'#10') SEN'#10#10'left join periodos_aux P on (' +
'(P.periodo = '#39'TRIMESTRAL'#39') and (P.valor = TRIMESTRE))'#10'left join ' +
'contactos C on (C.ID = SEN.ID_AGENTE)'#10#10'left join'#10'('#10'select coales' +
'ce(ID_AGENTE, -1) as ID_AGENTE, count(ID_CLIENTE) as NUM_CLIENTE' +
'S_TOTALES'#10'from clientes_datos'#10'group by 1'#10') CLIENTES_TOTALES on (' +
'CLIENTES_TOTALES.ID_AGENTE = SEN.id_Agente)'#10#10'where {where}'#10'group' +
' by 1,2,3,4,5,6'#10'order by 1,2,3,4,5,6'#10#10#10#10
'select SEN.ID_AGENTE, COALESCE(C.NOMBRE, '#39'SIN ASIGNAR'#39') as AGENT' +
'E, ANO, TRIMESTRE,'#10' P.descripcion,'#10#10' coalesce(CLIENTES_TOT' +
'ALES.NUM_CLIENTES_TOTALES, 0) as CLIENTES_TOTALES,'#10#10' sum(ALTA' +
'S_CLIENTE) as ALTAS_CLIENTE,'#10#10' sum(CANTIDAD_OBJETIVO) as CANT' +
'IDAD_OBJETIVO, sum(IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10#10' s' +
'um(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEV' +
'UELTA) as CANTIDAD_DEVUELTA, sum(CANTIDAD_TOTAL_CONSEGUIDA) as C' +
'ANTIDAD_TOTAL_CONSEGUIDA,'#10' sum(IMPORTE_CONSEGUIDO) as IMPORTE' +
'_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEVUELTO, sum(IMPO' +
'RTE_TOTAL_CONSEGUIDO) as IMPORTE_TOTAL_CONSEGUIDO,'#10#10' (sum(CAN' +
'TIDAD_TOTAL_CONSEGUIDA) - sum(CANTIDAD_OBJETIVO)) as CANTIDAD_RE' +
'SULTADO,'#10' (sum(IMPORTE_TOTAL_CONSEGUIDO) - sum(IMPORTE_OBJETI' +
'VO)) as IMPORTE_RESULTADO,'#10#10' case when (sum(CANTIDAD_TOTAL_CO' +
'NSEGUIDA) <> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/sum(CANTIDAD' +
'_TOTAL_CONSEGUIDA))'#10' else 0'#10' end as IMPORTE_MEDIO_UNIDAD,'#10 +
#10' case when (coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALES, ' +
'0) <> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/coalesce(CLIENTES_T' +
'OTALES.NUM_CLIENTES_TOTALES, 0))'#10' else 0'#10' end as IMPORTE_M' +
'EDIO_CLIENTE'#10#10#10'from'#10'('#10'select AO.ID_AGENTE, AO.ANO, AO.TRIMESTRE,' +
#10'0 as ALTAS_CLIENTE,'#10'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJET' +
'IVO, sum(AO.IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD' +
'_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGU' +
'IDA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORT' +
'E_TOTAL_CONSEGUIDO'#10'from V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join' +
' contactos C on (C.ID = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'gro' +
'up by 1,2,3'#10#10'UNION ALL'#10#10'select ID_AGENTE, ANO, TRIMESTRE,'#10'0 as A' +
'LTAS_CLIENTE,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'sum' +
'(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUE' +
'LTA) as CANTIDAD_DEVUELTA, (sum(CANTIDAD_CONSEGUIDA) + sum(CANTI' +
'DAD_DEVUELTA)) as CANTIDAD_TOTAL_CONSEGUIDA,'#10'sum(IMPORTE_CONSEGU' +
'IDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEV' +
'UELTO, (sum(IMPORTE_CONSEGUIDO) + sum(IMPORTE_DEVUELTO)) as IMPO' +
'RTE_TOTAL_CONSEGUIDO'#10'from v_inf_objetivos_albaranes'#10'where ((v_in' +
'f_objetivos_albaranes.id_empresa = :ID_EMPRESA) and (v_inf_objet' +
'ivos_albaranes.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'select I' +
'D_AGENTE, ANO, TRIMESTRE,'#10'count(ID_CLIENTE) as ALTAS_CLIENTE,'#10'0 ' +
'as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSE' +
'GUIDA, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0' +
' as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTA' +
'L_CONSEGUIDO'#10'from v_inf_obj_clientes_agentes'#10'where (ANO = :ANO1)' +
#10'group by 1,2,3'#10') SEN'#10#10'left join periodos_aux P on ((P.periodo =' +
' '#39'TRIMESTRAL'#39') and (P.valor = TRIMESTRE))'#10'left join contactos C ' +
'on (C.ID = SEN.ID_AGENTE)'#10'left join agentes_datos on (agentes_da' +
'tos.id_agente = SEN.ID_AGENTE)'#10#10'left join'#10'('#10'select coalesce(ID_A' +
'GENTE, -1) as ID_AGENTE, count(ID_CLIENTE) as NUM_CLIENTES_TOTAL' +
'ES'#10'from clientes_datos'#10'group by 1'#10') CLIENTES_TOTALES on (CLIENTE' +
'S_TOTALES.ID_AGENTE = SEN.id_Agente)'#10#10'where agentes_datos.FECHA_' +
'BAJA is null'#10'and {where}'#10'group by 1,2,3,4,5,6'#10'order by 1,2,3,4,5' +
',6'#10#10#10#10#10#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
end
item
DatasetField = 'TRIMESTRE'
TableField = 'TRIMESTRE'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
@ -2208,30 +2149,6 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'TRIMESTRE'
TableField = 'TRIMESTRE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'IMPORTE_MEDIO_UNIDAD'
TableField = 'IMPORTE_MEDIO_UNIDAD'
@ -2239,6 +2156,14 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
item
DatasetField = 'IMPORTE_MEDIO_CLIENTE'
TableField = 'IMPORTE_MEDIO_CLIENTE'
end
item
DatasetField = 'CANTIDAD_TOTAL_CONSEGUIDA'
TableField = 'CANTIDAD_TOTAL_CONSEGUIDA'
end
item
DatasetField = 'IMPORTE_TOTAL_CONSEGUIDO'
TableField = 'IMPORTE_TOTAL_CONSEGUIDO'
end>
end>
Name = 'InformeListadoObjetivosTrimestral'
@ -2289,6 +2214,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
@ -2297,6 +2226,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
@ -2330,51 +2263,85 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
ConnectionType = 'Interbase'
Default = True
SQL =
'select SEN.ID_AGENTE, C.NOMBRE as AGENTE, ANO, SEMESTRE,'#10' P.d' +
'escripcion,'#10#10' coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALES,' +
' 0) as CLIENTES_TOTALES,'#10#10' sum(ALTAS_CLIENTE) as ALTAS_CLIENT' +
'E,'#10#10' sum(CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(IMPORTE' +
'_OBJETIVO) as IMPORTE_OBJETIVO,'#10#10' sum(CANTIDAD_CONSEGUIDA) as' +
' CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUELT' +
'A,'#10' sum(IMPORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORT' +
'E_DEVUELTO) as IMPORTE_DEVUELTO,'#10#10' (sum(CANTIDAD_CONSEGUIDA) ' +
'- sum(CANTIDAD_OBJETIVO)) as CANTIDAD_RESULTADO,'#10' (sum(IMPORT' +
'E_CONSEGUIDO) - sum(IMPORTE_OBJETIVO)) as IMPORTE_RESULTADO,'#10' ' +
' case when (sum(IMPORTE_CONSEGUIDO) > 0) then (sum(IMPORTE_CONSE' +
'GUIDO)/sum(CANTIDAD_CONSEGUIDA))'#10' else 0'#10' end as IMPORTE_M' +
'EDIO_UNIDAD,'#10#10' case when (sum(IMPORTE_CONSEGUIDO) > 0) then (' +
'sum(IMPORTE_CONSEGUIDO)/coalesce(CLIENTES_TOTALES.NUM_CLIENTES_T' +
'OTALES, 0))'#10' else 0'#10' end as IMPORTE_MEDIO_CLIENTE'#10#10'from'#10'('#10 +
'select AO.ID_AGENTE, AO.ANO, AO.SEMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'su' +
'm(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIVO, sum(AO.IMPORTE_OBJ' +
'ETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUIDA, 0 as CANTI' +
'DAD_DEVUELTA, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO'#10'fro' +
'm V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join contactos C on (C.ID ' +
'= AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group by 1,2,3'#10#10'UNION ALL' +
#10#10'select ID_AGENTE, ANO, SEMESTRE,'#10'0 as ALTAS_CLIENTE,'#10'0 as CANT' +
'IDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'sum(CANTIDAD_CONSEGUIDA) a' +
's CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA) as CANTIDAD_DEVUEL' +
'TA, sum(IMPORTE_CONSEGUIDO) as IMPORTE_CONSEGUIDO, sum(IMPORTE_D' +
'EVUELTO) as IMPORTE_DEVUELTO'#10'from v_inf_objetivos_albaranes'#10'wher' +
'e ((v_inf_objetivos_albaranes.id_empresa = :ID_EMPRESA) and (v_i' +
'nf_objetivos_albaranes.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10#10 +
'select ID_AGENTE, ANO, SEMESTRE,'#10'count(ID_CLIENTE) as ALTAS_CLIE' +
'NTE,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CANTIDA' +
'D_CONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 as IMPORTE_CONSEGUIDO, 0' +
' as IMPORTE_DEVUELTO'#10'from v_inf_obj_clientes_agentes'#10'where (ANO ' +
'= :ANO1)'#10'group by 1,2,3'#10') SEN'#10#10'left join periodos_aux P on ((P.p' +
'eriodo = '#39'SEMESTRAL'#39') and (P.valor = SEMESTRE))'#10'left join contac' +
'tos C on (C.ID = SEN.ID_AGENTE)'#10#10'left join'#10'('#10'select coalesce(ID_' +
'AGENTE, -1) as ID_AGENTE, count(ID_CLIENTE) as NUM_CLIENTES_TOTA' +
'LES'#10'from clientes_datos'#10'group by 1'#10') CLIENTES_TOTALES on (CLIENT' +
'ES_TOTALES.ID_AGENTE = SEN.id_Agente)'#10#10'where {where}'#10'group by 1,' +
'2,3,4,5,6'#10'order by 1,2,3,4,5,6'#10#10#10#10
'select SEN.ID_AGENTE, COALESCE(C.NOMBRE, '#39'SIN ASIGNAR'#39') as AGENT' +
'E, ANO, SEMESTRE,'#10' P.descripcion,'#10#10' coalesce(CLIENTES_TOTA' +
'LES.NUM_CLIENTES_TOTALES, 0) as CLIENTES_TOTALES,'#10#10' sum(ALTAS' +
'_CLIENTE) as ALTAS_CLIENTE,'#10#10' sum(CANTIDAD_OBJETIVO) as CANTI' +
'DAD_OBJETIVO, sum(IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10#10' su' +
'm(CANTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVU' +
'ELTA) as CANTIDAD_DEVUELTA, sum(CANTIDAD_TOTAL_CONSEGUIDA) as CA' +
'NTIDAD_TOTAL_CONSEGUIDA,'#10' sum(IMPORTE_CONSEGUIDO) as IMPORTE_' +
'CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEVUELTO, sum(IMPOR' +
'TE_TOTAL_CONSEGUIDO) as IMPORTE_TOTAL_CONSEGUIDO,'#10#10' (sum(CANT' +
'IDAD_TOTAL_CONSEGUIDA) - sum(CANTIDAD_OBJETIVO)) as CANTIDAD_RES' +
'ULTADO,'#10' (sum(IMPORTE_TOTAL_CONSEGUIDO) - sum(IMPORTE_OBJETIV' +
'O)) as IMPORTE_RESULTADO,'#10#10' case when (sum(CANTIDAD_TOTAL_CON' +
'SEGUIDA) <> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/sum(CANTIDAD_' +
'TOTAL_CONSEGUIDA))'#10' else 0'#10' end as IMPORTE_MEDIO_UNIDAD,'#10#10 +
' case when (coalesce(CLIENTES_TOTALES.NUM_CLIENTES_TOTALES, 0' +
') <> 0) then (sum(IMPORTE_TOTAL_CONSEGUIDO)/coalesce(CLIENTES_TO' +
'TALES.NUM_CLIENTES_TOTALES, 0))'#10' else 0'#10' end as IMPORTE_ME' +
'DIO_CLIENTE'#10#10#10'from'#10'('#10'select AO.ID_AGENTE, AO.ANO, AO.SEMESTRE,'#10'0' +
' as ALTAS_CLIENTE,'#10'sum(AO.CANTIDAD_OBJETIVO) as CANTIDAD_OBJETIV' +
'O, sum(AO.IMPORTE_OBJETIVO) as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_C' +
'ONSEGUIDA, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUID' +
'A, 0 as IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_' +
'TOTAL_CONSEGUIDO'#10'from V_INF_OBJETIVOS_ALB_AGENTES AO'#10'left join c' +
'ontactos C on (C.ID = AO.ID_AGENTE)'#10'where (AO.ANO = :ANO1)'#10'group' +
' by 1,2,3'#10#10'UNION ALL'#10#10'select ID_AGENTE, ANO, SEMESTRE,'#10'0 as ALTA' +
'S_CLIENTE,'#10'0 as CANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'sum(CA' +
'NTIDAD_CONSEGUIDA) as CANTIDAD_CONSEGUIDA, sum(CANTIDAD_DEVUELTA' +
') as CANTIDAD_DEVUELTA, (sum(CANTIDAD_CONSEGUIDA) + sum(CANTIDAD' +
'_DEVUELTA)) as CANTIDAD_TOTAL_CONSEGUIDA,'#10'sum(IMPORTE_CONSEGUIDO' +
') as IMPORTE_CONSEGUIDO, sum(IMPORTE_DEVUELTO) as IMPORTE_DEVUEL' +
'TO, (sum(IMPORTE_CONSEGUIDO) + sum(IMPORTE_DEVUELTO)) as IMPORTE' +
'_TOTAL_CONSEGUIDO'#10'from v_inf_objetivos_albaranes'#10'where ((v_inf_o' +
'bjetivos_albaranes.id_empresa = :ID_EMPRESA) and (v_inf_objetivo' +
's_albaranes.ANO = :ANO1))'#10'group by 1,2,3'#10#10'UNION ALL'#10#10'select ID_A' +
'GENTE, ANO, SEMESTRE,'#10'count(ID_CLIENTE) as ALTAS_CLIENTE,'#10'0 as C' +
'ANTIDAD_OBJETIVO, 0 as IMPORTE_OBJETIVO,'#10'0 as CANTIDAD_CONSEGUID' +
'A, 0 as CANTIDAD_DEVUELTA, 0 as CANTIDAD_TOTAL_CONSEGUIDA, 0 as ' +
'IMPORTE_CONSEGUIDO, 0 as IMPORTE_DEVUELTO, 0 as IMPORTE_TOTAL_CO' +
'NSEGUIDO'#10'from v_inf_obj_clientes_agentes'#10'where (ANO = :ANO1)'#10'gro' +
'up by 1,2,3'#10') SEN'#10#10'left join periodos_aux P on ((P.periodo = '#39'SE' +
'MESTRAL'#39') and (P.valor = SEMESTRE))'#10'left join contactos C on (C.' +
'ID = SEN.ID_AGENTE)'#10'left join agentes_datos on (agentes_datos.id' +
'_agente = SEN.ID_AGENTE)'#10#10'left join'#10'('#10'select coalesce(ID_AGENTE,' +
' -1) as ID_AGENTE, count(ID_CLIENTE) as NUM_CLIENTES_TOTALES'#10'fro' +
'm clientes_datos'#10'group by 1'#10') CLIENTES_TOTALES on (CLIENTES_TOTA' +
'LES.ID_AGENTE = SEN.id_Agente)'#10#10'where agentes_datos.FECHA_BAJA i' +
's null'#10'and {where}'#10'group by 1,2,3,4,5,6'#10'order by 1,2,3,4,5,6'#10#10#10#10 +
#10#10#10#10#10
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ANO'
TableField = 'ANO'
end
item
DatasetField = 'SEMESTRE'
TableField = 'SEMESTRE'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CANTIDAD_OBJETIVO'
TableField = 'CANTIDAD_OBJETIVO'
@ -2407,26 +2374,6 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
DatasetField = 'IMPORTE_RESULTADO'
TableField = 'IMPORTE_RESULTADO'
end
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'AGENTE'
TableField = 'AGENTE'
end
item
DatasetField = 'ID_AGENTE'
TableField = 'ID_AGENTE'
end
item
DatasetField = 'ALTAS_CLIENTE'
TableField = 'ALTAS_CLIENTE'
end
item
DatasetField = 'CLIENTES_TOTALES'
TableField = 'CLIENTES_TOTALES'
end
item
DatasetField = 'IMPORTE_MEDIO_UNIDAD'
TableField = 'IMPORTE_MEDIO_UNIDAD'
@ -2436,8 +2383,12 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
TableField = 'IMPORTE_MEDIO_CLIENTE'
end
item
DatasetField = 'SEMESTRE'
TableField = 'SEMESTRE'
DatasetField = 'CANTIDAD_TOTAL_CONSEGUIDA'
TableField = 'CANTIDAD_TOTAL_CONSEGUIDA'
end
item
DatasetField = 'IMPORTE_TOTAL_CONSEGUIDO'
TableField = 'IMPORTE_TOTAL_CONSEGUIDO'
end>
end>
Name = 'InformeListadoObjetivosSemestral'
@ -2488,6 +2439,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
@ -2496,6 +2451,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
@ -2532,7 +2491,7 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 37800.807714351900000000
ReportOptions.LastChange = 40935.658182025470000000
ReportOptions.LastChange = 40952.717896423610000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'procedure mContinuaOnBeforePrint(Sender: TfrxComponent);'
@ -3793,6 +3752,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
@ -3801,6 +3764,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
@ -3885,6 +3852,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
@ -3893,6 +3864,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency
@ -3977,6 +3952,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'CANTIDAD_DEVUELTA'
DataType = datCurrency
end
item
Name = 'CANTIDAD_TOTAL_CONSEGUIDA'
DataType = datCurrency
end
item
Name = 'IMPORTE_CONSEGUIDO'
DataType = datCurrency
@ -3985,6 +3964,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente
Name = 'IMPORTE_DEVUELTO'
DataType = datCurrency
end
item
Name = 'IMPORTE_TOTAL_CONSEGUIDO'
DataType = datCurrency
end
item
Name = 'CANTIDAD_RESULTADO'
DataType = datCurrency

View File

@ -375,11 +375,6 @@ begin
else
PrepararTablaInformeObjetivos(tbl_InformeObjetivosSemestral);
//Se preparan las tablas del listado resumen del informe
// PrepararTablaResumenInformeGrafComp(tbl_InformeListadoClientesMayorAlbaranadoResumen);
// PrepararTablaResumenInformeGrafComp(tbl_InformeListadoClientesMayorIncidenciasResumen);
// PrepararTablaResumenInformeGrafComp(tbl_InformeListadoClientesMayorOrdenesDevResumen);
Result := Binary.Create;
AInforme := DarRutaFichero(DarRutaInformes, rptInformeObjetivosAgentesAlbaranes, IntTostr(FIdEmpresa));
@ -462,7 +457,7 @@ begin
begin
// (ID_AGENTE = ID)
Condicion := NewBinaryExpression(NewField('OBJETIVOS', 'ID_AGENTE'), NewConstant(FListaIDAgentes.Items[i], datInteger), dboEqual);
Condicion := NewBinaryExpression(NewField('SEN', 'ID_AGENTE'), NewConstant(FListaIDAgentes.Items[i], datInteger), dboEqual);
if IsEmpty then
Expression := Condicion
else
@ -471,7 +466,6 @@ begin
end;
end;
DADSInformeObjetivos.DataTable := ATabla;
ATabla.ParamByName('ID_EMPRESA').AsInteger := FIdEmpresa;
ATabla.ParamByName('ANO1').AsVariant := FAno1;

View File

@ -132,7 +132,7 @@ inherited fEditorAgente: TfEditorAgente
inherited pgPaginas: TPageControl
Width = 864
Height = 614
ActivePage = ObjetivosFacturas
ActivePage = ObjetivosAlbaranes
ExplicitWidth = 864
ExplicitHeight = 614
inherited pagGeneral: TTabSheet
@ -366,18 +366,6 @@ inherited fEditorAgente: TfEditorAgente
inherited ToolBar1: TToolBar
Width = 856
ExplicitWidth = 856
inherited ToolButton1: TToolButton
ExplicitWidth = 113
end
inherited ToolButton4: TToolButton
ExplicitWidth = 113
end
inherited ToolButton2: TToolButton
ExplicitWidth = 113
end
inherited ToolButton7: TToolButton
ExplicitWidth = 113
end
end
end
end
@ -415,7 +403,7 @@ inherited fEditorAgente: TfEditorAgente
end
end
object ObjetivosAlbaranes: TTabSheet
Caption = 'Objetivos Albaranes'
Caption = 'Objetivos'
ImageIndex = 4
inline frViewAgenteObjetivosAlbaranes1: TfrViewAgenteObjetivosAlbaranes
Left = 0
@ -459,18 +447,6 @@ inherited fEditorAgente: TfEditorAgente
inherited ToolBar1: TToolBar
Width = 856
ExplicitWidth = 856
inherited ToolButton1: TToolButton
ExplicitWidth = 113
end
inherited ToolButton4: TToolButton
ExplicitWidth = 113
end
inherited ToolButton2: TToolButton
ExplicitWidth = 113
end
inherited ToolButton7: TToolButton
ExplicitWidth = 113
end
end
inherited tbxFiltro: TTBXToolbar
Width = 856
@ -481,6 +457,7 @@ inherited fEditorAgente: TfEditorAgente
object ObjetivosFacturas: TTabSheet
Caption = 'Objetivos Facturas'
ImageIndex = 5
TabVisible = False
inline frViewAgenteObjetivosFacturas1: TfrViewAgenteObjetivosFacturas
Left = 0
Top = 0
@ -495,11 +472,13 @@ inherited fEditorAgente: TfEditorAgente
ParentFont = False
TabOrder = 0
ReadOnly = False
ExplicitLeft = 353
ExplicitTop = 229
ExplicitWidth = 856
ExplicitHeight = 586
inherited cxGrid: TcxGrid
Width = 856
Height = 540
ExplicitWidth = 856
ExplicitHeight = 540
inherited cxGridView: TcxGridDBTableView
DataController.Summary.DefaultGroupSummaryItems = <
item
@ -521,9 +500,11 @@ inherited fEditorAgente: TfEditorAgente
end
inherited ToolBar1: TToolBar
Width = 856
ExplicitWidth = 856
end
inherited tbxFiltro: TTBXToolbar
Width = 856
ExplicitWidth = 856
end
end
end

View File

@ -43,7 +43,7 @@ type
implementation
{$R *.dfm}
uses schContactosClient_Intf;
uses schContactosClient_Intf, DateUtils;
{ TfrViewAgenteObjetivosAlbaranes }
@ -58,10 +58,14 @@ begin
end;
procedure TfrViewAgenteObjetivosAlbaranes.CustomViewShow(Sender: TObject);
var
i: Integer;
Ano: String;
begin
Ano := IntToStr(YearOf(Date));
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
cbxListaAnos.ItemIndex := 0;
cbxListaAnos.ItemIndex := FListaAnos.IndexOfName(Ano);
end;
function TfrViewAgenteObjetivosAlbaranes.GetController: IAgentesController;

View File

@ -106,10 +106,12 @@ type
tbl_InformeListadoBeneficiosGrafCompSemestral: TDAMemDataTable;
tbl_InformeListadoBeneficiosGrafCompTrimestral: TDAMemDataTable;
tbl_InformeListadoBeneficiosGrafCompMensual: TDAMemDataTable;
schReport: TDASchema;
tbl_InformeObjetivos: TDAMemDataTable;
DADSInformeObjetivos: TDADataSource;
frxDBInformeObjetivos: TfrxDBDataset;
tbl_InformeObjetivosMensual: TDAMemDataTable;
tbl_InformeObjetivosTrimestral: TDAMemDataTable;
tbl_InformeObjetivosSemestral: TDAMemDataTable;
schReport: TDASchema;
procedure DataModuleCreate(Sender: TObject);
procedure DataModuleDestroy(Sender: TObject);
procedure frxReportGetValue(const VarName: string; var Value: Variant);
@ -125,6 +127,8 @@ type
FIntervalo: Variant;
FListaIDClientes: TIntegerArray;
FListaNombresClientes : TStringList;
FListaIDAgentes: TIntegerArray;
FListaNombresAgentes : TStringList;
FImporteMinimo: Currency;
FDesglosado : Boolean;
FShowLogotipo: Boolean;
@ -137,9 +141,11 @@ type
procedure PrepararTablaResumenInforme(ATabla: IDADataset);
procedure PrepararTablaInformeGrafComp(ATabla: TDAMemDataTable);
procedure PrepararTablaResumenInformeGrafComp(ATabla: TDAMemDataTable);
procedure PrepararTablaInformeObjetivos(ATabla: TDAMemDataTable);
function _GenerarInforme(const TipoInforme: String): Binary;
procedure IniciarParametrosInforme;
procedure RecuperarNombresClientes;
procedure RecuperarNombresAgentes;
public
function GenerarFactura(const ListaID : TIntegerArray; const VerSello: Boolean = True; const VerCopia: Boolean = True): Binary;
function GenerarFacturaEnPDF(const ListaID : TIntegerArray; const VerSello: Boolean = True): Binary;
@ -148,6 +154,7 @@ type
function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeFacturasGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; const TopN: Integer): Binary;
function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const Serie: Variant): Binary;
function GenerarInformeObjetivosAgentesFacturas(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDAgentes: TIntegerArray; const TopN: Integer): Binary;
end;
implementation
@ -167,7 +174,8 @@ const
rptInformeListadoFactuasClientePendiente = 'InformeListadoFacturasClientePendientes.fr3';
rptInformeListadoFactuasClientePendienteDesglosado = 'InformeListadoFacturasClientePendientesDesglosado.fr3';
rptInformeListadoFacturasClienteGrafComp = 'InformeListadoFacturasClienteGrafComp.fr3';
rptInformeListadoBeneficiosGrafComp = 'InformeListadoBeneficiosGrafComp.fr3';
rptInformeListadoBeneficiosGrafComp = 'InformeListadoBeneficiosGrafComp.fr3';
rptInformeObjetivosAgentesFacturas = 'InformeObjetivosAgentesFacturas.fr3';
{ Dataset names for schReport }
ds_InformeListadoFacturasResumen = 'InformeListadoFacturasResumen';
@ -526,6 +534,55 @@ begin
end;
end;
function TRptFacturasCliente.GenerarInformeObjetivosAgentesFacturas(
const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant;
const ListaIDAgentes: TIntegerArray; const TopN: Integer): Binary;
var
AStream: TMemoryStream;
AInforme: Variant;
begin
FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
AStream := TMemoryStream.Create;
try
//Inicializamos parametros
FIdEmpresa := IdEmpresa;
FAno1 := Ano1;
FIntervalo := Intervalo;
FFechaVenInicio := Null;
FFechaVenFin := Null;
if Assigned(FListaIDAgentes) then
FListaIDClientes.Free;
FListaIDAgentes := ListaIDAgentes;
//Preparamos la tabla correspondiente y la abrimos para el informe
if (FIntervalo = CTE_MENSUAL) then
PrepararTablaInformeObjetivos(tbl_InformeObjetivosMensual)
else if (FIntervalo = CTE_TRIMESTRAL) then
PrepararTablaInformeObjetivos(tbl_InformeObjetivosTrimestral)
else
PrepararTablaInformeObjetivos(tbl_InformeObjetivosSemestral);
Result := Binary.Create;
AInforme := DarRutaFichero(DarRutaInformes, rptInformeObjetivosAgentesFacturas, IntTostr(FIdEmpresa));
if VarIsNull(AInforme) then
raise Exception.Create (('Error Servidor: GenerarInformeObjetivosAgentesFacturas, no encuentra informe ' + rptInformeObjetivosAgentesFacturas));
frxReport.LoadFromFile(AInforme, True);
IniciarParametrosInforme;
frxReport.PrepareReport(False);
frxReport.PreviewPages.SaveToStream(Result);
finally
AStream.Free;
FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
end;
end;
procedure TRptFacturasCliente.IniciarParametrosInforme;
var
ATextos : TStringList;
@ -567,6 +624,29 @@ begin
ACadena := ACadena + ' (desglosados)'
end;
if not VarIsNull(FAno1) then
begin
ACadena := 'Año: ' + FAno1;
ATextos.Add(ACadena);
end;
if Assigned(FListaIDAgentes) and (FListaIDAgentes.Count > 0) then
begin
ACadena := 'Agente: ';
RecuperarNombresAgentes;
ACadena := ACadena + FListaNombresAgentes.Text;
end
else begin
ACadena := 'Todos los agentes';
// if FDesglosado then
ACadena := ACadena + ' (desglosados)'
end;
ATextos.Add(ACadena);
ACadena := '';
ATextos.Add(ACadena);
ACadena := '';
@ -672,6 +752,40 @@ begin
ATabla.Active := True;
end;
procedure TRptFacturasCliente.PrepararTablaInformeObjetivos(
ATabla: TDAMemDataTable);
var
Condicion: TDAWhereExpression;
i: Integer;
begin
if ATabla.Active then
ATabla.Active := False;
// Filtrar el informe por agente
if Assigned(FListaIDAgentes) then
begin
with ATabla.DynamicWhere do
begin
for i := 0 to FListaIDAgentes.Count - 1 do
begin
// (ID_AGENTE = ID)
Condicion := NewBinaryExpression(NewField('SEN', 'ID_AGENTE'), NewConstant(FListaIDAgentes.Items[i], datInteger), dboEqual);
if IsEmpty then
Expression := Condicion
else
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
end;
end;
end;
DADSInformeObjetivos.DataTable := ATabla;
ATabla.ParamByName('ID_EMPRESA').AsInteger := FIdEmpresa;
ATabla.ParamByName('ANO1').AsVariant := FAno1;
ATabla.Active := True;
end;
procedure TRptFacturasCliente.PrepararTablaResumenInforme(ATabla: IDADataset);
var
i: Integer;
@ -733,6 +847,96 @@ begin
ATabla.Active := True;
end;
procedure TRptFacturasCliente.RecuperarNombresAgentes;
var
AContactosService : IsrvContactos;
Intf : IInterface;
AClientID : TGUID;
ATableNameArray: StringArray;
ATableRequestInfoArray: TableRequestInfoArray;
ATableRequestInfo: TableRequestInfoV5;
AStream: TMemoryStream;
ADataTable: TDAMemDataTable;
i: Integer;
AWhereBuilder : TDAWhereBuilder;
ACondicion : TDAWhereExpression;
begin
CreateGUID(AClientID);
GetClassFactory('srvContactos').CreateInstance(AClientID, Intf);
if Assigned(Intf) then
begin
AContactosService := Intf as IsrvContactos;
ATableNameArray := StringArray.Create;
ATableRequestInfoArray := TableRequestInfoArray.Create;
AWhereBuilder := TDAWhereBuilder.Create;
try
ATableNameArray.Add('Agentes');
ATableRequestInfo := TableRequestInfoV5.Create;
with ATableRequestInfo do
begin
IncludeSchema := True;
MaxRecords := -1;
UserFilter := '';
AWhereBuilder.Clear;
with AWhereBuilder do
for i := 0 to FListaIDAgentes.Count - 1 do
begin
ACondicion := NewBinaryExpression(
NewBinaryExpression(NewField('', 'ID'), NewConstant(FListaIDAgentes[i], datInteger), dboEqual),
NewBinaryExpression(NewField('', 'ID_EMPRESA'), NewConstant(FIdEmpresa, datInteger), dboEqual),
dboAnd);
if not AWhereBuilder.IsEmpty then
Expression := NewBinaryExpression(Expression, ACondicion, dboOr)
else
Expression := ACondicion;
end;
WhereClause := AWhereBuilder.ExpressionToXmlNode(AWhereBuilder.Expression);
end;
try
ATableRequestInfoArray.Add(ATableRequestInfo);
AStream := AContactosService.GetData(ATableNameArray, ATableRequestInfoArray);
if Assigned(AStream) then
begin
ADataTable := TDAMemDataTable.Create(nil);
try
ADataTable.Name := 'Agentes';
ADataTable.LocalDataStreamer := Bin2DataStreamer;
ADataTable.RemoteFetchEnabled := False;
Bin2DataStreamer.ReadDataset(AStream, ADataTable, True);
ADataTable.Open;
FListaNombresAgentes.Clear;
for i := 0 to ADataTable.RecordCount - 1 do
begin
FListaNombresAgentes.Add(ADataTable.FieldByName('NOMBRE').AsString);
ADataTable.Next;
end;
finally
FreeANDNil(ADataTable);
end;
end;
except
on e: Exception do
dmServer.EscribirLog(e.Message);
end;
finally
FreeANDNIL(ATableRequestInfoArray);
FreeANDNIL(ATableNameArray);
FreeANDNIL(AWhereBuilder);
end;
end;
end;
procedure TRptFacturasCliente.RecuperarNombresClientes;
var
AContactosService : IsrvContactos;

View File

@ -736,8 +736,29 @@ begin
end;
procedure TGestorInformesController.VerInformeObjetivosFacturas;
var
AStream: Binary;
AEditor : IEditorInformeObjetivosFacturasReport;
begin
//
AEditor := NIL;
ShowHourglassCursor;
CreateEditor('EditorInformeObjetivosFacturasReport', IEditorInformeObjetivosFacturasReport, AEditor);
if Assigned(AEditor) then
try
AEditor.Controller := Self;
AEditor.Title := 'Informe comparativo de objetivos de agentes de facturas';
AStream := FDataModule.GenerarInformeObjetivosAgentesFacturas(AppFactuGES.EmpresaActiva.ID,
AEditor.Intervalo, AEditor.Ano1, AEditor.Ano2, AEditor.ListaIDAgentes, AEditor.NTop);
AEditor.LoadFromStream(AStream);
AEditor.Preview;
finally
AEditor.Release;
AEditor := Nil;
HideHourglassCursor;
FreeAndNil(AStream);
end;
end;
{

View File

@ -38,6 +38,7 @@ type
function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; Const NTop: Variant): Binary;
function DarListaAnosFacturasCli: TStringList;
function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const Serie: Variant): Binary;
function GenerarInformeObjetivosAgentesFacturas(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDAgentes: TIntegerArray; Const NTop: Variant): Binary;
//MODULO RECIBOS DE CLIENTE
function GenerarInformeListadoRecibosCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
@ -323,6 +324,13 @@ begin
Result := (RORemoteService as IsrvGestorInformes).GenerarInformeObjetivosAgentesAlbaranes(IdEmpresa, Intervalo, Ano1, Ano2, ListaIdAgentes, NTop);
end;
function TDataModuleGestorInformes.GenerarInformeObjetivosAgentesFacturas(
const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant;
const ListaIDAgentes: TIntegerArray; const NTop: Variant): Binary;
begin
Result := (RORemoteService as IsrvGestorInformes).GenerarInformeObjetivosAgentesFacturas(IdEmpresa, Intervalo, Ano1, Ano2, ListaIdAgentes, NTop);
end;
procedure TDataModuleGestorInformes.getInforme;
begin
tbl_DirectoryData.close;

View File

@ -26,7 +26,8 @@ type
function GenerarInformeListadoFacturasCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeFacturasCliGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDClientes: TIntegerArray; Const NTop: Variant): Binary;
function DarListaAnosFacturasCli: TStringList;
function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const Serie: Variant): Binary;
function GenerarInformeBeneficiosGrafComp(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const Serie: Variant): Binary;
function GenerarInformeObjetivosAgentesFacturas(const IdEmpresa: Integer; const Intervalo: Variant; const Ano1: Variant; const Ano2: Variant; const ListaIDAgentes: TIntegerArray; Const NTop: Variant): Binary;
//MODULO RECIBOS DE CLIENTE
function GenerarInformeListadoRecibosCliPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;

View File

@ -155,8 +155,9 @@ object PluginGestorInformes: TPluginGestorInformes
end
object actInformeObjetivosFacturas: TAction
Category = 'Agentes'
Caption = 'Informe objetivos de agente en albaranes'
Caption = 'Informe objetivos de agente en facturas'
ImageIndex = 0
OnExecute = actInformeObjetivosFacturasExecute
end
end
object MainMenu: TMainMenu
@ -241,6 +242,10 @@ object PluginGestorInformes: TPluginGestorInformes
Tag = 190
Action = actInformeObjetivosAlbaranes
end
object Informeobjetivosdeagenteenalbaranes1: TMenuItem
Tag = 200
Action = actInformeObjetivosFacturas
end
end
end
object SmallImages: TPngImageList

View File

@ -53,6 +53,7 @@ type
actInformeObjetivosAlbaranes: TAction;
actInformeObjetivos1: TMenuItem;
actInformeObjetivosFacturas: TAction;
Informeobjetivosdeagenteenalbaranes1: TMenuItem;
procedure actInformeFacturasClienteExecute(Sender: TObject);
procedure actInformeFacturasClientePendientesExecute(Sender: TObject);
procedure actInformeFacturasClienteIVAExecute(Sender: TObject);
@ -68,6 +69,7 @@ type
procedure actInformeBeneficiosGrafCompExecute(Sender: TObject);
procedure actInformeAlbaranesClienteGrafCompExecute(Sender: TObject);
procedure actInformeObjetivosAlbaranesExecute(Sender: TObject);
procedure actInformeObjetivosFacturasExecute(Sender: TObject);
private
FController : IGestorInformesController;
public
@ -156,6 +158,12 @@ begin
FController.VerInformeObjetivosAlbaranes;
end;
procedure TPluginGestorInformes.actInformeObjetivosFacturasExecute(
Sender: TObject);
begin
FController.VerInformeObjetivosFacturas;
end;
procedure TPluginGestorInformes.actInformeRecibosClienteExecute(
Sender: TObject);
begin

View File

@ -393,8 +393,15 @@ end;
function TsrvGestorInformes.GenerarInformeObjetivosAgentesFacturas(
const IdEmpresa: Integer; const Intervalo, Ano1, Ano2: Variant;
const ListaIDAgentes: TIntegerArray; const TopN: Integer): Binary;
var
AReportGenerator : TRptFacturasCliente;
begin
//
AReportGenerator := TRptFacturasCliente.Create(nil);
try
Result := AReportGenerator.GenerarInformeObjetivosAgentesFacturas(IdEmpresa, Intervalo, Ano1, Ano2, ListaIDAgentes, TopN);
finally
FreeAndNIL(AReportGenerator);
end;
end;
initialization

View File

@ -94,8 +94,8 @@ contains
uEditorInformeFacturasProveedorReportGrafComp in 'uEditorInformeFacturasProveedorReportGrafComp.pas' {fEditorInformeFacturasProveedorReportGrafComp: TForm},
uEditorInformeBeneficiosReportGrafComp in 'uEditorInformeBeneficiosReportGrafComp.pas' {fEditorInformeBeneficiosReportGrafComp: TForm},
uEditorInformeAlbaranesClienteReportGrafComp in 'uEditorInformeAlbaranesClienteReportGrafComp.pas' {fEditorInformeAlbaranesClienteReportGrafComp: TForm},
uEditorInformeObjetivosFacturasReport in 'uEditorInformeObjetivosFacturasReport.pas' {fEditorInformeObjetivosFacturasReport: TForm},
uEditorInformeObjetivosAlbaranesReport in 'uEditorInformeObjetivosAlbaranesReport.pas' {fEditorInformeObjetivosAlbaranesReport: TForm},
uViewFiltroAgentes in 'uViewFiltroAgentes.pas' {frViewFiltroAgentes: TFrame};
uViewFiltroAgentes in 'uViewFiltroAgentes.pas' {frViewFiltroAgentes: TFrame},
uEditorInformeObjetivosFacturasReport in 'uEditorInformeObjetivosFacturasReport.pas' {fEditorInformeObjetivosFacturasReport: TForm};
end.

View File

@ -124,7 +124,7 @@
<DesignClass>TForm</DesignClass>
</DCCReference>
<DCCReference Include="uEditorInformeObjetivosFacturasReport.pas">
<Form>fEditorInformeObjetivosFacturasReport</Form>
<Form>fEditorInformeObjetivosFacturaReport</Form>
<DesignClass>TForm</DesignClass>
</DCCReference>
<DCCReference Include="uEditorInformePedidosReport.pas">
@ -153,7 +153,7 @@
</DCCReference>
<DCCReference Include="uGestorInformesViewRegister.pas" />
<DCCReference Include="uViewFiltroAgentes.pas">
<Form>frViewIntervaloComparativo</Form>
<Form>frViewFiltroAgentes</Form>
<DesignClass>TFrame</DesignClass>
</DCCReference>
<DCCReference Include="uViewFiltroClientes.pas">

View File

@ -186,8 +186,7 @@ inherited fEditorInformeObjetivosAlbaranesReport: TfEditorInformeObjetivosAlbara
ParentFont = False
TabOrder = 2
ReadOnly = False
ExplicitLeft = -1
ExplicitTop = 318
ExplicitTop = 313
ExplicitWidth = 188
inherited TBXLabel2: TTBXLabel
Width = 188

View File

@ -123,6 +123,7 @@ inherited fEditorInformeObjetivosFacturasReport: TfEditorInformeObjetivosFactura
end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
Width = 182
Visible = False
ExplicitWidth = 182
inherited Label1: TLabel
Width = 172
@ -139,6 +140,7 @@ inherited fEditorInformeObjetivosFacturasReport: TfEditorInformeObjetivosFactura
inherited TBXAlignmentPanel4: TTBXAlignmentPanel
Top = 224
Width = 182
Visible = False
ExplicitTop = 224
ExplicitWidth = 182
inherited Label2: TLabel
@ -148,6 +150,7 @@ inherited fEditorInformeObjetivosFacturasReport: TfEditorInformeObjetivosFactura
inherited TBXAlignmentPanel5: TTBXAlignmentPanel
Top = 176
Width = 182
Visible = False
ExplicitTop = 176
ExplicitWidth = 182
inherited Label4: TLabel
@ -169,7 +172,7 @@ inherited fEditorInformeObjetivosFacturasReport: TfEditorInformeObjetivosFactura
end
end
end
inline frViewFiltroClientes1: TfrViewFiltroClientes
inline frViewFiltroAgentes1: TfrViewFiltroAgentes
Left = 0
Top = 313
Width = 188
@ -182,7 +185,6 @@ inherited fEditorInformeObjetivosFacturasReport: TfEditorInformeObjetivosFactura
Font.Style = []
ParentFont = False
TabOrder = 2
Visible = False
ReadOnly = False
ExplicitTop = 313
ExplicitWidth = 188
@ -190,11 +192,14 @@ inherited fEditorInformeObjetivosFacturasReport: TfEditorInformeObjetivosFactura
Width = 188
ExplicitWidth = 188
end
inherited bElegirCliente: TBitBtn
inherited bElegirAgente: TBitBtn
Width = 119
ExplicitWidth = 119
end
inherited edtCliente: TcxTextEdit
inherited cbxDesglosado: TCheckBox
Visible = False
end
inherited edtAgente: TcxTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''

View File

@ -14,24 +14,24 @@ uses
uViewBase, uViewPeriodoFechas, uControllerBase,
dxLayoutControl, cxControls, uViewFiltroImportes,
FactuGES_Intf, TBXDkPanels, uEditorInformeBase,
uIEditorInformeBase, uViewParametrosInforme, uIEditorInformeAlbaranesClienteReportGrafComp,
uViewIntervaloComparativo, uViewFiltroClientes;
uIEditorInformeBase, uViewParametrosInforme, uIEditorInformeObjetivosFacturasReport,
uViewIntervaloComparativo, uViewFiltroClientes, uViewFiltroAgentes;
type
TfEditorInformeObjetivosFacturasReport = class(TfEditorInformeBase, IEditorInformeAlbaranesClienteReportGrafComp)
TfEditorInformeObjetivosFacturasReport = class(TfEditorInformeBase, IEditorInformeObjetivosFacturasReport)
TBXItem58: TTBXItem;
frViewIntervaloComparativo1: TfrViewIntervaloComparativo;
frViewFiltroClientes1: TfrViewFiltroClientes;
frViewFiltroAgentes1: TfrViewFiltroAgentes;
procedure actRefrescarExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
private
FListaIDClientes: TIntegerArray;
FListaIDAgentes: TIntegerArray;
function GetIntervalo: Variant;
function GetAno1: Variant;
function GetAno2: Variant;
function GetSerie: variant;
function GetListaIDClientes: TIntegerArray;
function GetListaIDAgentes: TIntegerArray;
function GetNTop: Variant;
procedure RefrescarInforme;
@ -43,9 +43,9 @@ type
property Intervalo: Variant read GetIntervalo;
property Ano1: Variant read GetAno1;
property Ano2: Variant read GetAno2;
property ListaIDClientes: TIntegerArray read GetListaIDClientes;
property ListaIDAgentes: TIntegerArray read GetListaIDAgentes;
property NTop: Variant read GetNTop;
property Serie: Variant read GetSerie;
property Serie: Variant read GetSerie;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -69,12 +69,12 @@ end;
constructor TfEditorInformeObjetivosFacturasReport.Create(AOwner: TComponent);
begin
inherited;
FListaIDClientes := TIntegerArray.Create;
FListaIDAgentes := TIntegerArray.Create;
end;
destructor TfEditorInformeObjetivosFacturasReport.Destroy;
begin
FListaIDClientes.Free;
FListaIDAgentes.Free;
inherited;
end;
@ -99,13 +99,13 @@ begin
Result := frViewIntervaloComparativo1.cbAno2.EditValue;
end;
function TfEditorInformeObjetivosFacturasReport.GetListaIDClientes: TIntegerArray;
function TfEditorInformeObjetivosFacturasReport.GetListaIDAgentes: TIntegerArray;
begin
FListaIDClientes.Clear;
if Assigned(frViewFiltroClientes1.Cliente) then
FListaIDClientes.Add(frViewFiltroClientes1.Cliente.ID);
FListaIDAgentes.Clear;
if Assigned(frViewFiltroAgentes1.Agente) then
FListaIDAgentes.Add(frViewFiltroAgentes1.Agente.ID);
Result := FListaIDClientes;
Result := FListaIDAgentes;
end;
function TfEditorInformeObjetivosFacturasReport.GetNTop: Variant;
@ -125,14 +125,13 @@ begin
ShowHourglassCursor;
try
AStream := (Controller as IGestorInformesController).DataModule.GenerarInformeAlbaranesCliGrafComp(
AStream := (Controller as IGestorInformesController).DataModule.GenerarInformeObjetivosAgentesAlbaranes(
AppFactuGES.EmpresaActiva.ID,
Intervalo,
Ano1,
Ano2,
ListaIDClientes,
NTop,
Serie);
ListaIDAgentes,
NTop);
LoadFromStream(AStream);
Report.ShowPreparedReport;

View File

@ -38,6 +38,7 @@
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters><Parameters Name="RunParams">/standalone</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">4</VersionInfo><VersionInfo Name="MinorVer">2</VersionInfo><VersionInfo Name="Release">1</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">4.2.1.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">4.2.1.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys><VersionInfoKeys Name="CompileDate">martes, 31 de enero de 2012 10:21</VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
<Excluded_Packages Name="C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPSCoreD11.bpl">ExpressPrinting System by Developer Express Inc.</Excluded_Packages>
</Excluded_Packages><Source><Source Name="MainSource">FactuGES_Server.dpr</Source></Source></Delphi.Personality><ModelSupport>False</ModelSupport></BorlandProject></BorlandProject>
</ProjectExtensions>

View File

@ -1,7 +1,7 @@
MAINICON ICON "C:\Codigo\Resources\Iconos\Servidor.ico"
1 VERSIONINFO
FILEVERSION 4,1,9,0
PRODUCTVERSION 4,1,9,0
FILEVERSION 4,2,1,0
PRODUCTVERSION 4,2,1,0
FILEFLAGSMASK 0x3FL
FILEFLAGS 0x00L
FILEOS 0x40004L
@ -12,9 +12,9 @@ BEGIN
BEGIN
BLOCK "0C0A04E4"
BEGIN
VALUE "FileVersion", "4.1.9.0\0"
VALUE "ProductVersion", "4.1.9.0\0"
VALUE "CompileDate", "lunes, 31 de octubre de 2011 11:24\0"
VALUE "FileVersion", "4.2.1.0\0"
VALUE "ProductVersion", "4.2.1.0\0"
VALUE "CompileDate", "viernes, 03 de febrero de 2012 10:41\0"
END
END
BLOCK "VarFileInfo"