MalteserJohanniterJohanneshaus/Datev/DatevExporter.cs - Integration LVR-besW in den Export
This commit is contained in:
@@ -25,6 +25,11 @@ namespace MalteserJohanniterJohanneshaus.Export
|
||||
query.FileName = String.Format("Datev Export LVR {0:yyyyMM}.csv", dt);
|
||||
query.QueryResult = GetAbrechnungenString(dt, "LVR");
|
||||
}
|
||||
else if (query.Title == "Datev Export LVR-besW")
|
||||
{
|
||||
query.FileName = String.Format("Datev Export LVR-besW {0:yyyyMM}.csv", dt);
|
||||
query.QueryResult = GetAbrechnungenString(dt, "LVR-besW");
|
||||
}
|
||||
else
|
||||
{
|
||||
query.FileName = String.Format("Datev Export Soziotherapie {0:yyyyMM}.csv", dt);
|
||||
@@ -51,7 +56,7 @@ namespace MalteserJohanniterJohanneshaus.Export
|
||||
}
|
||||
else
|
||||
{
|
||||
s = GetMonatlicheRechnungenString(date);
|
||||
s = GetMonatlicheRechnungenString(date, typ);
|
||||
if (!String.IsNullOrWhiteSpace(s))
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(s))
|
||||
@@ -63,9 +68,17 @@ namespace MalteserJohanniterJohanneshaus.Export
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static String GetMonatlicheRechnungenString(DateTime date)
|
||||
public static String GetMonatlicheRechnungenString(DateTime date, string typ)
|
||||
{
|
||||
var sql = GetMonatlicheRechnungenSql(date);
|
||||
string sql = "";
|
||||
if (typ == "LVR-besW")
|
||||
{
|
||||
sql = GetMonatlicheRechnungenBesWSql(date);
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = GetMonatlicheRechnungenSql(date);
|
||||
}
|
||||
|
||||
/*
|
||||
sip.Claim,
|
||||
@@ -201,6 +214,35 @@ order by ib.invoicenumber
|
||||
return sql;
|
||||
}
|
||||
|
||||
private static String GetMonatlicheRechnungenBesWSql(DateTime date)
|
||||
{
|
||||
|
||||
String sql = @"
|
||||
SELECT
|
||||
sip.Claim,
|
||||
c.DebitorNumber AS DebitorNumber,
|
||||
ib.InvoiceDate,
|
||||
ib.invoicenumber,
|
||||
c.CostCenter,
|
||||
c2s.Oid,
|
||||
ib.InvoiceId,
|
||||
c2s.Notice AS Kostenstelle
|
||||
FROM
|
||||
invoicebase ib
|
||||
JOIN serviceinvoice si ON si.invoicebaseoid = ib.oid
|
||||
JOIN serviceinvoiceperiod sip ON sip.serviceinvoiceoid = si.oid
|
||||
JOIN invoiceitem ii ON ii.serviceinvoiceperiodoid = sip.oid
|
||||
JOIN customer c ON c.oid = sip.CustomerOid
|
||||
join supportconcept sc on sc.customeroid = c.oid
|
||||
inner join costbearer2supportconcept c2s on c2s.supportconceptoid = sc.oid
|
||||
WHERE ib.`AccountingPeriodEnd` >= ':Monat_Start' AND ib.`AccountingPeriodEnd` < ':Monat_End' AND ib.IsActive = 1
|
||||
AND ib.RecipientOrganisationOid = 147
|
||||
ORDER BY c.DebitorNumber
|
||||
";
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
private static String GetMonatlicheBetraegeLvrSql(DateTime date)
|
||||
{
|
||||
// Achtung da Preise nur Verwaltung wird Preis von FLS geholt und auch nur FLS exportiert!
|
||||
|
||||
Reference in New Issue
Block a user