From 61f6332d285b8a52cc9eb6aeaa99c5b2bb247be2 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 15 Dec 2025 15:47:44 +0100 Subject: [PATCH] Ruhrstern/Export/DatevExporter - Finetuning --- ReportImp/Ruhrstern/Export/DatevExporter.cs | 26 +++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/ReportImp/Ruhrstern/Export/DatevExporter.cs b/ReportImp/Ruhrstern/Export/DatevExporter.cs index 9e1e022cb..bb9a2312b 100644 --- a/ReportImp/Ruhrstern/Export/DatevExporter.cs +++ b/ReportImp/Ruhrstern/Export/DatevExporter.cs @@ -80,14 +80,14 @@ namespace Ruhrstern.Export DateTime firstDate = new DateTime(date.Year, date.Month, 1); DateTime lastDate = firstDate.AddMonths(1).AddDays(-1); sb.Append(String.Format("{0:0.00}", row[0])); // Umsatz - sb.Append(";"); + sb.Append(";S;"); sb.Append(String.Format("{0}", row[1])); //Debitornr sb.Append(";"); sb.Append("8100"); // Erlöskonto sb.Append(";"); - sb.Append(String.Format("{0:MM}{0:yy}", row[2])); //Belegdatum + sb.Append(String.Format("{0:dd}{0:MM}", row[2])); //Belegdatum sb.Append(";"); - sb.Append(String.Format("{0:MM}{0:yy}", row[3])); //Belegnr + sb.Append(String.Format("{0}", row[3])); //Belegnr sb.Append(";"); sb.Append(String.Format("{0:dd}{0:MM}{0:yy}", lastDate)); sb.Append(";"); @@ -133,26 +133,18 @@ namespace Ruhrstern.Export DateTime firstDate = new DateTime(date.Year, date.Month, 1); DateTime lastDate = firstDate.AddMonths(1).AddDays(-1); sb.Append(String.Format("{0:0.00}", row[0])); // Umsatz - sb.Append(";"); + sb.Append(";S;"); sb.Append(String.Format("{0}", row[1])); //Debitornr sb.Append(";"); sb.Append("8100"); // Erlöskonto sb.Append(";"); - sb.Append(String.Format("{0:MM}{0:yy}", lastDate)); //Belegdatum + sb.Append(String.Format("{0:dd}{0:MM}", lastDate)); //Belegdatum sb.Append(";"); //sb.Append(String.Format("{0:MM}{0:yy}", row[3])); //Belegnr sb.Append(";"); sb.Append(String.Format("{0:dd}{0:MM}{0:yy}", lastDate)); sb.Append(";"); - String buchungstext = ""; - long? c2sOid = (long?)row[5]; - if (c2sOid.HasValue) - { - var c2s = DAOFactory.GenericDAO.LoadByID(c2sOid.Value); - var c = c2s.SupportConcept.Customer; - buchungstext = String.Format("{1:dd.MM.yy}-{2:dd.MM.yy} {0}", row[3], firstDate, lastDate); - } - + String buchungstext = String.Format("{1:dd.MM.yy}-{2:dd.MM.yy} {0}", row[3], firstDate, lastDate); sb.Append(buchungstext); sb.Append(";"); sb.Append("99999"); @@ -222,7 +214,7 @@ order by ib.invoicenumber INNER JOIN `servicecategory` sc ON sd.`ServiceCategoryOid` = sc.`Oid` WHERE sr2.`StartDate` >= ':Monat_Start' AND sr2.`StartDate` < ':Monat_End' AND sc.`Billable` = 1 AND sd.Name <> 'Fehlkontakt' GROUP BY sr2.`CostBearer2SupportConceptOid`) AS sr ON sr.`CostBearer2SupportConceptOid` = cb2sc.`Oid` - WHERE org.Name LIKE 'LVR%' AND c.`IsActive` <> 0 AND sc.`IsActive` <> 0 AND (sr.`GeleisteteFLM` is not null)) + WHERE org.Name LIKE 'LVR%' OR org.Name LIKE 'LWL%' AND c.`IsActive` <> 0 AND sc.`IsActive` <> 0 AND (sr.`GeleisteteFLM` is not null)) UNION (SELECT ROUND(0.8 * (sr.`GeleisteteFLM` / 60) * (SELECT crp.`CostRateValue` FROM `costrateperiod` crp WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 0 AND crp.`ObjectOid` = cb2sc.`CostBearerOid` AND (crp.`EndDate` is null or crp.`EndDate` > ':Monat_Start') order by IF(crp.`EndDate` is null, MAKEDATE(9999,365),crp.`EndDate`) LIMIT 1 ),2) AS 'Betrag', @@ -242,8 +234,8 @@ order by ib.invoicenumber INNER JOIN `servicecategory` sc ON sd.`ServiceCategoryOid` = sc.`Oid` WHERE sr2.`StartDate` >= ':Monat_Start' AND sr2.`StartDate` < ':Monat_End' AND sc.`Billable` = 1 and sd.Name = 'Fehlkontakt' GROUP BY sr2.`CostBearer2SupportConceptOid`) AS sr ON sr.`CostBearer2SupportConceptOid` = cb2sc.`Oid` - WHERE org.Name LIKE 'LVR%' AND c.`IsActive` <> 0 AND sc.`IsActive` <> 0 AND (sr.`GeleisteteFLM` is not null)) - )qry + WHERE org.Name LIKE 'LVR%' OR org.Name LIKE 'LWL%' AND c.`IsActive` <> 0 AND sc.`IsActive` <> 0 AND (sr.`GeleisteteFLM` is not null)) + )qry WHERE qry.Betrag is not null GROUP BY qry.OID ORDER BY qry.Verwendung";