using System;
using System.Collections.Generic;
using BeWo.Report;
using BeWo.Report.ReportObjects;

namespace BeWo.FibMarburg
{
    public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
    {
        public Stundenzettel()
        {
            InitializeComponent();
        }

        public void SetReportDataSource(ServicesOverviewRO pRO)
        {
            if (pRO.Services != null)
            {
                List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();

                foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
                {
	                if (s.IsBillable)
	                {
						ServicesOverviewRO.CreateGoalList(s);
		                servicesBillable.Add(s);
	                }
                }

                pRO.Services = servicesBillable;
            }

	        lblPauschal.Text =
		        String.Format("pauschalierte indirekte Leistungen (13%): {0:0.##} = {1:0.##} Minuten Gesamt.",
			        pRO.TotalFLMBillable*0.13, pRO.TotalFLMBillable*1.13);
            this.bindingSource1.DataSource = pRO;
        }

    }
}
