﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<StiSerializer version="1.02" type="Net" application="StiReport">
  <Dictionary Ref="1" type="Dictionary" isKey="true">
    <BusinessObjects isList="true" count="0" />
    <Databases isList="true" count="1">
      <Connection Ref="2" type="Stimulsoft.Report.Dictionary.StiOracleODPDatabase" isKey="true">
        <Alias>Connection</Alias>
        <ConnectionStringEncrypted>9GrVL1h8QoFwbCUEdAB3r9104+9fbUpdy0wpyWF86zuNGJHvXWvCvEYV2Q==</ConnectionStringEncrypted>
        <Name>Connection</Name>
      </Connection>
    </Databases>
    <DataSources isList="true" count="1">
      <DataSource1 Ref="3" type="Stimulsoft.Report.Dictionary.StiOracleODPSource" isKey="true">
        <Alias>DataSource1</Alias>
        <Columns isList="true" count="0" />
        <CommandTimeout>30</CommandTimeout>
        <Dictionary isRef="1" />
        <Name>DataSource1</Name>
        <NameInSource>Connection</NameInSource>
        <Parameters isList="true" count="3">
          <value>:p3,_x0020_int1,112,20</value>
          <value>:d1,date1,106,20</value>
          <value>:d2,date2,106,20</value>
        </Parameters>
        <SqlCommand>SELECT s.id,
	s.EPONYMIA,
	kat.DNSH,
	kat.POLH,
	s.EPAGGELMA,
	s.AFM,
	kat.THL1,
	NVL (tz.res, 0) AS res
	FROM SUPL s,
       SUPL_KATASTHMATA Kat,
(  SELECT SUM (RES) AS res, ID_PELATH
FROM (SELECT ID_PELATH,
	CR_DATE,
	CASE
                            WHEN -1 = :p3
                            THEN
                               (PEL_XREOSI - PEL_PISTOSI) * SUNOLO
                            WHEN 0 = :p3
                            THEN
                                 (PEL_XREOSI - PEL_PISTOSI)
                               * (AJIA_FPA_0 + KATHARO_0)
                            WHEN 1 = :p3
                            THEN
                                 (PEL_XREOSI - PEL_PISTOSI)
                               * (AJIA_FPA_1 + KATHARO_1)
                            WHEN 2 = :p3
                            THEN
                                 (PEL_XREOSI - PEL_PISTOSI)
                               * (AJIA_FPA_2 + KATHARO_2)
                               else
                               0
                         END
                            res
                    FROM ALL_PARASTATIKA
                         INNER JOIN P_L_M
                            ON (ALL_PARASTATIKA.ID = ID_PARASTATIKOY)
                         INNER JOIN ANALISI_ANA_FPA_GR_L2
                            ON (P_L_M.ID = ID_MASTER)
                   WHERE NOT EXISTS
(SELECT 'x'
	FROM P_L_MA
	WHERE P_L_MA.ID_MASTER = P_L_M.id)
                  UNION ALL
SELECT ID_PELATH,
	CR_DATE,
	CASE
                            WHEN -1 = :p3
                            THEN
                               (PEL_XREOSI - PEL_PISTOSI) * SUNOLO
                            WHEN 0 = :p3
                            THEN
                                 (PEL_XREOSI - PEL_PISTOSI)
                               * (AJIA_FPA_0 + KATHARO_0)
                            WHEN 1 = :p3
                            THEN
                                 (PEL_XREOSI - PEL_PISTOSI)
                               * (AJIA_FPA_1 + KATHARO_1)
                            WHEN 2 = :p3
                            THEN
                                 (PEL_XREOSI - PEL_PISTOSI)
                               * (AJIA_FPA_2 + KATHARO_2)
                               else
                               0
                         END
                            res
                    FROM ALL_PARASTATIKA
                         INNER JOIN P_X_M
                            ON (ALL_PARASTATIKA.ID = ID_PARASTATIKOY)
                         INNER JOIN ANALISI_ANA_FPA_GR_X2
                            ON (P_X_M.ID = ID_MASTER)
                   WHERE NOT EXISTS
(SELECT 'x'
	FROM P_X_MA
	WHERE P_X_MA.ID_MASTER = P_X_M.id))
           WHERE TRUNC (CR_DATE) BETWEEN ( :d1) AND TRUNC ( :d2)
        GROUP BY ID_PELATH) tz
 WHERE     s.ID = Kat.ID_PROMHTHEYTH
       AND S.ID = Tz.ID_PELATH(+)
       AND KAT.IS_EDRA = 1
       AND S.IS_DEFAULT_L = 0</SqlCommand>
      </DataSource1>
    </DataSources>
    <Relations isList="true" count="0" />
    <Report isRef="0" />
    <Variables isList="true" count="3">
      <value>,int1,int1,System.Int32,_x0031_,False,False</value>
      <value>,date1,date1,,System.DateTime,,False,False,True,False,_x003C__x003F_xml_x0020_version_x003D__x0022_1.0_x0022__x0020_encoding_x003D__x0022_utf-16_x0022__x0020_standalone_x003D__x0022_yes_x0022__x003F__x003E__x003C_StiSerializer_x0020_version_x003D__x0022_1.02_x0022__x0020_type_x003D__x0022_Net_x0022__x0020_application_x003D__x0022_State_x0022__x003E__x003C_DateTimeType_x003E_DateAndTime_x003C__x002F_DateTimeType_x003E__x003C__x002F_StiSerializer_x003E_</value>
      <value>,date2,date2,System.DateTime,,False,False</value>
    </Variables>
  </Dictionary>
  <EngineVersion>EngineV2</EngineVersion>
  <GlobalizationStrings isList="true" count="0" />
  <MetaTags isList="true" count="0" />
  <Pages isList="true" count="1">
    <Page1 Ref="4" type="Page" isKey="true">
      <Border>None;Black;2;Solid;False;4;Black</Border>
      <Brush>Transparent</Brush>
      <Components isList="true" count="0" />
      <Conditions isList="true" count="0" />
      <Guid>467605c1cf9340be81f82d427492820d</Guid>
      <Margins>1,1,1,1</Margins>
      <Name>Page1</Name>
      <PageHeight>29.7</PageHeight>
      <PageWidth>21</PageWidth>
      <Report isRef="0" />
      <Watermark Ref="5" type="Stimulsoft.Report.Components.StiWatermark" isKey="true">
        <Font>Arial,100</Font>
        <TextBrush>[50:0:0:0]</TextBrush>
      </Watermark>
    </Page1>
  </Pages>
  <PrinterSettings Ref="6" type="Stimulsoft.Report.Print.StiPrinterSettings" isKey="true" />
  <ReferencedAssemblies isList="true" count="8">
    <value>System.Dll</value>
    <value>System.Drawing.Dll</value>
    <value>System.Windows.Forms.Dll</value>
    <value>System.Data.Dll</value>
    <value>System.Xml.Dll</value>
    <value>Stimulsoft.Controls.Dll</value>
    <value>Stimulsoft.Base.Dll</value>
    <value>Stimulsoft.Report.Dll</value>
  </ReferencedAssemblies>
  <ReportAlias>Report</ReportAlias>
  <ReportChanged>2/3/2014 5:44:28 PM</ReportChanged>
  <ReportCreated>2/1/2014 8:51:02 PM</ReportCreated>
  <ReportFile>C:\Users\Aris\Downloads\Report.mrt</ReportFile>
  <ReportGuid>d22f3546351142929f07687bfb12a557</ReportGuid>
  <ReportName>Report</ReportName>
  <ReportUnit>Centimeters</ReportUnit>
  <ReportVersion>2013.1.1600</ReportVersion>
  <Script>using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;

namespace Reports
{
    public class Report : Stimulsoft.Report.StiReport
    {
        public Report()        {
            this.InitializeComponent();
        }

        #region StiReport Designer generated code - do not modify
		#endregion StiReport Designer generated code - do not modify
    }
}
</Script>
  <ScriptLanguage>CSharp</ScriptLanguage>
  <Styles isList="true" count="0" />
</StiSerializer>