70 lines
2.0 KiB
C#
70 lines
2.0 KiB
C#
using System;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using DevExpress.XtraReports.UI;
|
|
using System.Data;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using DiePerspektive.Export;
|
|
using System.Collections.Generic;
|
|
|
|
namespace DiePerspektive
|
|
{
|
|
public partial class Fibuuebergabe : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<QueryRO>
|
|
{
|
|
public Fibuuebergabe()
|
|
{
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
public void SetReportDataSource(QueryRO pRO)
|
|
{
|
|
this.bindingSource1.DataSource = CreateRo(pRO);
|
|
}
|
|
|
|
private QueryRO CreateRo(QueryRO ro)
|
|
{
|
|
QueryRO result = new QueryRO();
|
|
result.Rows = new List<QueryRO.Row>();
|
|
|
|
if (ro.Rows.Count > 0)
|
|
{
|
|
var text = ro.Rows[0].Field1.ToString();
|
|
var oidStr = text.Split(' ')[0];
|
|
|
|
var oid = Int64.Parse(oidStr);
|
|
|
|
var export = DAOFactory.GenericDAO.LoadByID<BuchungsExport>(oid);
|
|
|
|
var lines = FibuNetExporter.GetExportZeilen(export.Export);
|
|
|
|
var datensaetze = new List<FibuNetDatensatz>();
|
|
|
|
foreach (var item in lines)
|
|
{
|
|
datensaetze.Add(FibuNetDatensatz.ErzeugeDatensatz(item));
|
|
}
|
|
|
|
foreach (var item in datensaetze)
|
|
{
|
|
var newRow = new QueryRO.Row();
|
|
result.Rows.Add(newRow);
|
|
|
|
newRow.Field1 = item.Belegnr;
|
|
newRow.Field2 = String.Format("{0:dd.MM.yyyy}", item.Belegdatum);
|
|
newRow.Field3 = item.Debitor;
|
|
newRow.Field4 = String.Format("{0:c}", item.Betrag / 100);
|
|
newRow.Field5 = item.Erloeskonto;
|
|
newRow.Field6 = String.Format("{0:c}", item.Betrag / 100);
|
|
newRow.Field7 = item.Kostenstelle;
|
|
newRow.Field8 = item.Buchungstext;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
}
|
|
}
|