Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo
This commit is contained in:
@@ -139,28 +139,6 @@ Bsp. LK Stade - Mustermann, Max - 11.2019
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static Dictionary<long, decimal> CreateHourlyRateDict(List<long> catOids, DateTime date)
|
||||
{
|
||||
Dictionary<long, decimal> dict = new Dictionary<long, decimal>();
|
||||
|
||||
foreach (var oid in catOids)
|
||||
{
|
||||
var cat = DAOFactory.GenericDAO.LoadByID<ServiceCategory>(oid);
|
||||
|
||||
var crps = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(cat.CostRatePeriods);
|
||||
|
||||
var cp = crps.GetCostRatePeriodForDate(CostRatePeriodType.AmountOfMoney, date);
|
||||
|
||||
if (cp != null && cp.CostRateValue.HasValue)
|
||||
{
|
||||
dict.Add(oid, cp.CostRateValue.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
private static String GetMonatlicheRechnungenSql(DateTime date)
|
||||
{
|
||||
|
||||
@@ -187,192 +165,6 @@ order by ib.invoicenumber
|
||||
return sql;
|
||||
}
|
||||
|
||||
private static String GetMonatlicheAbrechnungStringForCatsSql(DateTime date, IList<long> includeCatOids, IList<long> excludeOids, bool holeEinzel, bool holeGruppen)
|
||||
{
|
||||
|
||||
String sql = @"
|
||||
SELECT distinct
|
||||
c.`DebitorNumber` AS 'Debitoren Nr.',
|
||||
c.`CostCenter` AS 'Kostenstelle',
|
||||
CONCAT(p.`LastName`, ', ', p.`FirstName`) as Name,
|
||||
org.`Name` as 'Kostentraeger',
|
||||
ROUND(sr.`GeleisteteFLM` / 60, 2) as 'FLS',
|
||||
IF(crpRateFactor.`CostRateValue` is null, ROUND((sr.`GeleisteteFLM` / 60) * crpHourlyRate.`CostRateValue`, 2),ROUND(ROUND((sr.`GeleisteteFLM` / 60), 2) * crpHourlyRate.`CostRateValue` * ((100 + crpRateFactor.`CostRateValue`)/100), 2)) AS 'Forderung',
|
||||
':Monat_MM' AS 'Belegnr.',
|
||||
ROUND(crpHourlyRate.`CostRateValue`,2) as 'Stundensatz', ROUND(crpRateFactor.`CostRateValue`,2) as 'Pauschaler Faktor in %'
|
||||
FROM `supportconcept` sc
|
||||
INNER JOIN `costbearer2supportconcept` cb2sc ON sc.`Oid` = cb2sc.`SupportConceptOid`
|
||||
INNER JOIN `costbearer` cb ON cb2sc.`CostBearerOid` = cb.`Oid`
|
||||
INNER JOIN
|
||||
(SELECT crp.`ObjectOid`, crp.costratetype, crp.`CostRateValue`, If(crp.Enddate is null, '9999-01-01', crp.enddate) as aenddatum, crptemp.enddatum FROM `costrateperiod` crp
|
||||
inner join (SELECT crpi.`ObjectOid`, Min(If(crpi.Enddate is null, '9999-01-01', crpi.enddate)) as enddatum FROM `costrateperiod` crpi
|
||||
WHERE crpi.`ObjectTid` = 22 AND crpi.`CostRateType` = 0 AND (crpi.`EndDate` is null or crpi.`EndDate` > ':Monat_Start')
|
||||
group by crpi.objectoid) as crptemp on crptemp.objectoid = crp.objectoid
|
||||
WHERE crp.`ObjectTid` = 22 and crp.costratetype = 0
|
||||
having aenddatum = crptemp.enddatum)
|
||||
AS crpHourlyRate ON crpHourlyRate.`ObjectOid` = cb.`Oid`
|
||||
LEFT JOIN
|
||||
(SELECT crp.`ObjectOid`, crp.costratetype, crp.`CostRateValue`, If(crp.Enddate is null, '9999-01-01', crp.enddate) as aenddatum, crptemp.enddatum FROM `costrateperiod` crp
|
||||
inner join (SELECT crpi.`ObjectOid`, Min(If(crpi.Enddate is null, '9999-01-01', crpi.enddate)) as enddatum FROM `costrateperiod` crpi
|
||||
WHERE crpi.`ObjectTid` = 22 AND crpi.`CostRateType` = 2 AND (crpi.`EndDate` is null or crpi.`EndDate` > ':Monat_Start')
|
||||
group by crpi.objectoid) as crptemp on crptemp.objectoid = crp.objectoid
|
||||
WHERE crp.`ObjectTid` = 22 and crp.costratetype = 2
|
||||
having aenddatum = crptemp.enddatum)
|
||||
AS crpRateFactor ON crpRateFactor.`ObjectOid` = cb.`Oid`
|
||||
INNER JOIN `organisation` org ON org.`CostBearerOid` = cb.`Oid`
|
||||
INNER JOIN `customer` c ON sc.`CustomerOid` = c.`Oid`
|
||||
INNER JOIN `person` p on c.`PersonOid` = p.`Oid`
|
||||
INNER JOIN
|
||||
(SELECT
|
||||
v2o.`ObjectOid`,
|
||||
v2o.`ValueListEntryOid`
|
||||
FROM `valuelistentry2object` v2o
|
||||
WHERE v2o.`ValueListEntryOid` in (12,13,14) ) as vle2o ON vle2o.`ObjectOid` = c.`Oid`
|
||||
INNER JOIN `valuelistentry` vle on vle.`Oid` = vle2o.`ValueListEntryOid`
|
||||
INNER JOIN
|
||||
(SELECT sr2.`CostBearer2SupportConceptOid`, SUM(sr2.`roundedduration` / IF(sr2.`GroupEmployeeCount` is null, 1, sr2.`GroupEmployeeCount`)) AS GeleisteteFLM FROM `servicerecord` sr2
|
||||
INNER JOIN `servicedescription` sd ON sr2.`ServiceDescriptionOid` = sd.`Oid`
|
||||
INNER JOIN `servicecategory` sc ON sd.`ServiceCategoryOid` = sc.`Oid`
|
||||
WHERE sr2.`StartDate` >= ':Monat_Start' AND sr2.`StartDate` < ':Monat_End' AND sc.`Billable` = 1:IncludeCatOidList:ExcludeCatOidList GROUP BY sr2.`CostBearer2SupportConceptOid`)
|
||||
AS sr ON sr.`CostBearer2SupportConceptOid` = cb2sc.`Oid`
|
||||
WHERE c.`IsActive` <> 0 AND sc.`IsActive` <> 0 and
|
||||
((If (cb2sc.`ApprovedStartDate` is null, cb2sc.`RequestedStartDate`, cb2sc.`ApprovedStartDate`) < ':Monat_End' and
|
||||
If (cb2sc.`ApprovedEndDate` is null, cb2sc.`RequestedEndDate`, cb2sc.`ApprovedEndDate`) >= ':Monat_Start'
|
||||
and GeleisteteFLM is null) or GeleisteteFLM is not null)
|
||||
ORDER BY p.`LastName`
|
||||
";
|
||||
|
||||
String sqlalt = @"
|
||||
SELECT
|
||||
CONCAT(p.Lastname, ', ', p.Firstname),
|
||||
c.DebitorNumber as 'DebKonto',
|
||||
DATE_FORMAT(DATE_ADD(':Monat_End',INTERVAL -1 DAY), '%d.%m.%Y') as 'Datum',
|
||||
c.`CostCenter` AS 'Kst',
|
||||
ROUND(sr.`GeleisteteFLM` / 60, 2) as 'Text',
|
||||
IF(crpRateFactor.`CostRateValue` is null,
|
||||
ROUND(ROUND(sr.`GeleisteteFLM` / 60, 2) * (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),
|
||||
ROUND(ROUND((sr.`GeleisteteFLM` / 60) * ((100 + crpRateFactor.`CostRateValue`)/100), 2) * (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',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
sr.`GeleisteteFLM`,
|
||||
sr.CatOid
|
||||
FROM `supportconcept` sc
|
||||
INNER JOIN `costbearer2supportconcept` cb2sc ON sc.`Oid` = cb2sc.`SupportConceptOid`
|
||||
INNER JOIN `costbearer` cb ON cb2sc.`CostBearerOid` = cb.`Oid`
|
||||
LEFT JOIN
|
||||
(SELECT crp.`ObjectOid`, crp.`CostRateValue` FROM `costrateperiod` crp
|
||||
WHERE crp.`ObjectTid` = 22 AND crp.`CostRateType` = 2 AND (crp.`EndDate` is null or crp.`EndDate` > NOW()))
|
||||
AS crpRateFactor ON crpRateFactor.`ObjectOid` = cb.`Oid`
|
||||
INNER JOIN `organisation` org ON org.`CostBearerOid` = cb.`Oid`
|
||||
INNER JOIN `customer` c ON sc.`CustomerOid` = c.`Oid`
|
||||
INNER JOIN `person` p on c.`PersonOid` = p.`Oid`
|
||||
LEFT JOIN
|
||||
(SELECT sr2.`CostBearer2SupportConceptOid`, SUM(sr2.`roundedduration` / IF(sr2.`GroupEmployeeCount` is null, 1, sr2.`GroupEmployeeCount`)) AS GeleisteteFLM, sc.Oid as CatOid FROM `servicerecord` sr2
|
||||
INNER JOIN `servicedescription` sd ON sr2.`ServiceDescriptionOid` = sd.`Oid`
|
||||
INNER JOIN `servicecategory` sc ON sd.`ServiceCategoryOid` = sc.`Oid`
|
||||
WHERE sr2.`StartDate` >= ':Monat_Start' AND sr2.`StartDate` < ':Monat_End' AND sc.`Billable` = 1 AND sc.oid in (CATOIDLIST) :Gruppenfilter GROUP BY sr2.`CostBearer2SupportConceptOid`)
|
||||
AS sr ON sr.`CostBearer2SupportConceptOid` = cb2sc.`Oid`
|
||||
WHERE c.`IsActive` <> 0 AND sc.`IsActive` <> 0
|
||||
and (sr.`GeleisteteFLM` is not null)
|
||||
ORDER BY p.`LastName`, p.`FirstName`, cb2sc.`ApprovedStartDate`
|
||||
";
|
||||
|
||||
String includeString = "";
|
||||
String excludeString = "";
|
||||
if (includeCatOids != null && includeCatOids.Count > 0)
|
||||
{
|
||||
StringBuilder oidList = new StringBuilder();
|
||||
|
||||
foreach (var catOid in includeCatOids)
|
||||
{
|
||||
if (oidList.Length > 0)
|
||||
oidList.Append(",");
|
||||
oidList.Append(catOid);
|
||||
}
|
||||
|
||||
includeString = String.Format(" AND sc.oid in ({0})", oidList.ToString());
|
||||
}
|
||||
|
||||
if (excludeOids != null && excludeOids.Count > 0)
|
||||
{
|
||||
StringBuilder notoidList = new StringBuilder();
|
||||
|
||||
foreach (var catOid in excludeOids)
|
||||
{
|
||||
if (notoidList.Length > 0)
|
||||
notoidList.Append(",");
|
||||
notoidList.Append(catOid);
|
||||
}
|
||||
excludeString = String.Format(" AND sc.oid not in ({0})", notoidList.ToString());
|
||||
}
|
||||
|
||||
String gruppenfilter = "";
|
||||
|
||||
if (!holeEinzel || !holeGruppen)
|
||||
{
|
||||
if (holeGruppen)
|
||||
{
|
||||
gruppenfilter = "AND sr2.GroupOid is not null";
|
||||
}
|
||||
else
|
||||
{
|
||||
gruppenfilter = "AND sr2.GroupOid is null";
|
||||
}
|
||||
}
|
||||
sql = sql.Replace(":Gruppenfilter", gruppenfilter);
|
||||
sql = sql.Replace(":IncludeCatOidList", includeString);
|
||||
sql = sql.Replace(":ExcludeCatOidList", excludeString);
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
||||
private static String GetAbschlagszahlungenSql(DateTime date)
|
||||
{
|
||||
String sql = @"
|
||||
SELECT
|
||||
date_format(at.BookingDate, '%d.%m.%Y') as 'Belegdatum',
|
||||
':Belegnr',
|
||||
'S13690' as 'Konto Soll',
|
||||
'' as 'Kostenstelle Soll',
|
||||
c.DebitorNumber as 'Konto Haben',
|
||||
'' as 'Kostenstelle Haben',
|
||||
Round(at.Amount, 2) as 'Betrag',
|
||||
CONCAT('Abschlagszahlung,', p.FirstName, ' ', p.LastName) as 'Buchungstext'
|
||||
from accountingtransaction at
|
||||
join costbearer2supportconcept c2s on c2s.oid = at.costbearer2supportconceptoid
|
||||
join supportconcept sc on sc.oid = c2s.supportconceptoid
|
||||
join customer c on sc.customeroid = c.oid
|
||||
join person p on c.personoid = p.oid
|
||||
WHERE at.`BookingDate` >= ':Monat_Start' AND at.`BookingDate` < ':Monat_End' and c.`IsActive` <> 0 AND sc.`IsActive` <> 0
|
||||
ORDER BY p.`LastName`, p.`FirstName`
|
||||
";
|
||||
return sql;
|
||||
}
|
||||
|
||||
private static String GetSelbstzahlerSql(DateTime date)
|
||||
{
|
||||
String sql = @"
|
||||
SELECT
|
||||
date_format(ib.InvoiceDate, '%d.%m.%Y') as 'Belegdatum',
|
||||
ib.InvoiceNumber as 'Belegnummer',
|
||||
c.DebitorNumber as 'Konto Soll',
|
||||
'' as 'Kostenstelle Soll',
|
||||
'S86400' as 'Konto Haben',
|
||||
c.CostCenter as 'Kostenstelle Haben',
|
||||
Round(ii.AmountTotal, 2) as 'Betrag',
|
||||
CONCAT('Eigenanteil, ', p.`FirstName`, ' ', p.`LastName`) as 'Buchungstext'
|
||||
from invoicebase ib
|
||||
join invoiceitem ii on ii.invoicebaseoid = ib.oid
|
||||
join customer c on c.oid = ib.recipientcustomeroid
|
||||
join `person` p on c.`PersonOid` = p.`Oid`
|
||||
where ib.`InvoiceDate` >= ':Monat_Start' AND ib.`InvoiceDate` < ':Monat_End'
|
||||
and ib.type = 0 and ib.isactive = 1 and c.isactive <> 0
|
||||
";
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
public static DataTable ExecuteQuery(String sql, DateTime dt)
|
||||
{
|
||||
var newsql = sql;
|
||||
|
||||
29
ReportImp/LebenshilfeStadeMID/Export/CustomDataExporter.cs
Normal file
29
ReportImp/LebenshilfeStadeMID/Export/CustomDataExporter.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using Utils = BS.Shared.Core.Utils;
|
||||
|
||||
namespace LebenshilfeStadeMID.Export
|
||||
{
|
||||
public class CustomDataExporter : DataExporter
|
||||
{
|
||||
public override string CreateExportString(string pFileID, string[] pHeaderCaption, string[][] pContent)
|
||||
{
|
||||
|
||||
if (pHeaderCaption != null && pHeaderCaption.Length > 0 && pHeaderCaption[0].Contains("Sage"))
|
||||
{
|
||||
return DiamantExporter.CreateExportString(pHeaderCaption, pContent);
|
||||
}
|
||||
return base.CreateExportString(pFileID, pHeaderCaption, pContent);
|
||||
|
||||
}
|
||||
|
||||
public override QueryDC CreateQuery(QueryDC query)
|
||||
{
|
||||
return DatevExporter.CreateQuery(query);
|
||||
}
|
||||
}
|
||||
}
|
||||
167
ReportImp/LebenshilfeStadeMID/Export/DatevExporter.cs
Normal file
167
ReportImp/LebenshilfeStadeMID/Export/DatevExporter.cs
Normal file
@@ -0,0 +1,167 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
namespace LebenshilfeStadeMID.Export
|
||||
{
|
||||
public class DatevExporter
|
||||
{
|
||||
|
||||
public static QueryDC CreateQuery(QueryDC query)
|
||||
{
|
||||
DateTime dt = DateTime.Now;
|
||||
DateTime.TryParse(query.Parameter[0].Value.ToString(), out dt);
|
||||
|
||||
query.FileName = String.Format("Datev Export {0:yyyyMM}.csv", dt);
|
||||
query.QueryResult = GetAbrechnungenString(dt);
|
||||
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
public static String GetAbrechnungenString(DateTime date)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("Umsatz (ohne Soll/Haben-Kz);Soll/Haben-Kennzeichen;WKZ Umsatz;Kurs;Basis-Umsatz;WKZ Basis-Umsatz;Konto;Gegenkonto (ohne BU-Schlüssel);BU-Schlüssel;Belegdatum;Belegfeld 1;Belegfeld 2;Skonto;Buchungstext;Postensperre;Diverse Adressnummer;Geschäftspartnerbank;Sachverhalt;Zinssperre;Beleglink;Beleginfo - Art 1;Beleginfo - Inhalt 1;Beleginfo - Art 2;Beleginfo - Inhalt 2;Beleginfo - Art 3;Beleginfo - Inhalt 3;Beleginfo - Art 4;Beleginfo - Inhalt 4;Beleginfo - Art 5;Beleginfo - Inhalt 5;Beleginfo - Art 6;Beleginfo - Inhalt 6;Beleginfo - Art 7;Beleginfo - Inhalt 7;Beleginfo - Art 8;Beleginfo - Inhalt 8;KOST1 - Kostenstelle;KOST2 - Kostenstelle;Festschreibung");
|
||||
//Herr Zenker
|
||||
|
||||
|
||||
var s = GetMonatlicheRechnungenString(date);
|
||||
if (!String.IsNullOrWhiteSpace(s))
|
||||
{
|
||||
sb.Append(s);
|
||||
}
|
||||
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static String GetMonatlicheRechnungenString(DateTime date)
|
||||
{
|
||||
//"Umsatz (ohne Soll/Haben-Kz);Soll/Haben-Kennzeichen;WKZ Umsatz;Kurs;Basis-Umsatz;WKZ Basis-Umsatz;Konto;Gegenkonto (ohne BU-Schlüssel);BU-Schlüssel;Belegdatum;Belegfeld 1;Belegfeld 2;Skonto;Buchungstext;Postensperre;Diverse Adressnummer;Geschäftspartnerbank;Sachverhalt;Zinssperre;Beleglink;Beleginfo - Art 1;Beleginfo - Inhalt 1;Beleginfo - Art 2;Beleginfo - Inhalt 2;Beleginfo - Art 3;Beleginfo - Inhalt 3;Beleginfo - Art 4;Beleginfo - Inhalt 4;Beleginfo - Art 5;Beleginfo - Inhalt 5;Beleginfo - Art 6;Beleginfo - Inhalt 6;Beleginfo - Art 7;Beleginfo - Inhalt 7;Beleginfo - Art 8;Beleginfo - Inhalt 8;KOST1 - Kostenstelle;KOST2 - Kostenstelle;Festschreibung"
|
||||
//100,18;S;;;;;48400;;;3101;;;;;;;;;;;;;;;;;;;;;;;;;;;50;;0
|
||||
//100,18;S;;;;;48400;ggk;;3101;rgnummer;;;buchungstext;;;;;;;;;;;;;;;;;;;;;;;50;;0
|
||||
var sql = GetMonatlicheRechnungenSql(date);
|
||||
|
||||
/*
|
||||
sip.Claim,
|
||||
c.DebitorNumber,
|
||||
ib.InvoiceDate,
|
||||
ib.invoicenumber
|
||||
c.CostCenter,
|
||||
c2s.Oid
|
||||
*/
|
||||
var dt = ExecuteQuery(sql, date);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
sb.AppendLine();
|
||||
}
|
||||
sb.Append(String.Format("{0:0.00}", row[0]));
|
||||
sb.Append(";S;;;;;");
|
||||
sb.Append(String.Format("{0:0.00}", row[1]));
|
||||
sb.Append(";");
|
||||
sb.Append("4002"); // Erlöskonto
|
||||
sb.Append(";;");
|
||||
|
||||
DateTime lastDate = new DateTime(date.Year, date.Month, 1);
|
||||
lastDate = lastDate.AddMonths(1).AddDays(-1);
|
||||
|
||||
sb.Append(String.Format("{0:ddMM}", lastDate));
|
||||
sb.Append(";");
|
||||
sb.Append(String.Format("{0}", row[3]));
|
||||
sb.Append(";;;");
|
||||
|
||||
String buchungstext = "";
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
Name, Vorname Rechnungsadressat wenn kein Name, Vorname vorhanden, dann das Feld Firma ausgeben - plus Name, Vorname Kunde -
|
||||
plus Datum aus Leistung Format mmjj
|
||||
|
||||
wenn Re-Adressat gleich Kunde, dann nur den Name, Vorname des Kunden ausgeben."
|
||||
Bsp. LK Stade - Mustermann, Max - 11.2019
|
||||
|
||||
*/
|
||||
long? c2sOid = (long?)row[5];
|
||||
|
||||
if (c2sOid.HasValue)
|
||||
{
|
||||
var c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(c2sOid.Value);
|
||||
|
||||
var c = c2s.SupportConcept.Customer;
|
||||
|
||||
String firma = c2s.CostBearer.Organisation.Name;
|
||||
|
||||
buchungstext = String.Format("{0} - {1}, {2} - {3:MM.yyyy}", firma, c.Person.LastName, c.Person.FirstName, date);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// int test = 0;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
sb.Append(buchungstext);
|
||||
|
||||
sb.Append(";;;;;;;;;;;;;;;;;;;;;;;639;;0");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static String GetMonatlicheRechnungenSql(DateTime date)
|
||||
{
|
||||
|
||||
String sql = @"
|
||||
select
|
||||
sip.Claim,
|
||||
c.DebitorNumber,
|
||||
ib.InvoiceDate,
|
||||
ib.invoicenumber,
|
||||
c.CostCenter,
|
||||
c2s.Oid
|
||||
from
|
||||
person p
|
||||
inner join customer c on c.personoid = p.oid
|
||||
inner join supportconcept sc on sc.customeroid = c.oid
|
||||
inner join costbearer2supportconcept c2s on c2s.supportconceptoid = sc.oid
|
||||
inner join invoicebase ib on ib.costbearer2supportconceptoid = c2s.oid
|
||||
inner join serviceinvoice si on si.invoicebaseoid = ib.oid
|
||||
inner join serviceinvoiceperiod sip on sip.serviceinvoiceoid = si.oid
|
||||
WHERE ib.`AccountingPeriodEnd` >= ':Monat_Start' AND ib.`AccountingPeriodEnd` < ':Monat_End' and ib.IsActive = 1
|
||||
order by ib.invoicenumber
|
||||
";
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
public static DataTable ExecuteQuery(String sql, DateTime dt)
|
||||
{
|
||||
var newsql = sql;
|
||||
newsql = newsql.Replace(":Abrechnungsmonat", String.Format("{0:dd.MM.yyyy}", dt));
|
||||
newsql = newsql.Replace(":Belegnr", String.Format("{0:yyMM}", dt));
|
||||
newsql = newsql.Replace(":Monat_MM", String.Format("{0:MM}", dt));
|
||||
newsql = newsql.Replace(":Monat_Start", String.Format("{0:yyyy-MM}-01", dt));
|
||||
dt = dt.AddMonths(1);
|
||||
newsql = newsql.Replace(":Monat_End", String.Format("{0:yyyy-MM}-01", dt));
|
||||
|
||||
return DAOFactory.AdoDAO.ExecuteQuery(newsql).Tables[0];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace LebenshilfeStadeMID.Invoicing
|
||||
var ende = scap.EndDate.HasValue ? scap.EndDate.Value : invoicePeriod.EndDate;
|
||||
var serviceRecordsImSchuljahr = DAOFactory.SearchDAO.FindServiceRecordsInSpan(scap.CostBearer2SupportConcept.Oid.Value, new DateTimeSpan(start, ende));
|
||||
int maxKrankheitstage = GetMaximalAbrechenbareKrankheitstage(scap, serviceRecordsImSchuljahr);
|
||||
int nochUebrigeKrankheitstage = GetUebrigeAbrechenbareKrankheitstage(maxKrankheitstage, serviceRecordsImSchuljahr.Where(s => s.Start < start).ToList());
|
||||
int nochUebrigeKrankheitstage = GetUebrigeAbrechenbareKrankheitstage(maxKrankheitstage, serviceRecordsImSchuljahr.Where(s => s.Start < invoicePeriod.StartDate).ToList());
|
||||
|
||||
foreach (ServiceRecordDC iServiceRecord in serviceRecordsInPeriod)
|
||||
{
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="CustomMitarbeiterstundenkontoBerechnung.cs" />
|
||||
<Compile Include="CustomReportCreator.cs" />
|
||||
<Compile Include="Export\CustomDataExporter.cs" />
|
||||
<Compile Include="Export\DatevExporter.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
|
||||
<Compile Include="LeistungsnachweisSbd.cs">
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace LebenshilfeStadeMID
|
||||
verfuegungszeiten.Remove(vz);
|
||||
}
|
||||
// Zusatzleistung in eigentlichen ServiceRecord eintragen und aus Liste entfernen, dass der nicht mehrfach übertragen wird
|
||||
else if (zl != null)
|
||||
if (zl != null)
|
||||
{
|
||||
sd.Notice2 = string.Format("{0:0}", zl.Minutes);
|
||||
sd.Minutes += zl.Minutes;
|
||||
|
||||
@@ -51,8 +51,6 @@ namespace LebenshilfeStadeMID
|
||||
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel11 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel();
|
||||
this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
|
||||
@@ -329,38 +327,12 @@ namespace LebenshilfeStadeMID
|
||||
this.xrLabel11.Text = "Betreute(r):";
|
||||
this.xrLabel11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomLeft;
|
||||
//
|
||||
// xrLabel10
|
||||
//
|
||||
this.xrLabel10.Font = new DevExpress.Drawing.DXFont("Arial", 11F);
|
||||
this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(206.917F, 389.4479F);
|
||||
this.xrLabel10.Name = "xrLabel10";
|
||||
this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel10.SizeF = new System.Drawing.SizeF(470.54F, 20F);
|
||||
this.xrLabel10.StylePriority.UseBorders = false;
|
||||
this.xrLabel10.StylePriority.UseFont = false;
|
||||
this.xrLabel10.StylePriority.UseTextAlignment = false;
|
||||
this.xrLabel10.Text = "[CustomerStreet], [CustomerPostalCode] [CustomerTown]";
|
||||
this.xrLabel10.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomLeft;
|
||||
//
|
||||
// xrLabel4
|
||||
//
|
||||
this.xrLabel4.Font = new DevExpress.Drawing.DXFont("Arial", 11F);
|
||||
this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(0.4585266F, 389.4479F);
|
||||
this.xrLabel4.Name = "xrLabel4";
|
||||
this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel4.SizeF = new System.Drawing.SizeF(206.4585F, 20F);
|
||||
this.xrLabel4.StylePriority.UseBorders = false;
|
||||
this.xrLabel4.StylePriority.UseFont = false;
|
||||
this.xrLabel4.StylePriority.UseTextAlignment = false;
|
||||
this.xrLabel4.Text = "wohnhaft:";
|
||||
this.xrLabel4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomLeft;
|
||||
//
|
||||
// xrLabel5
|
||||
//
|
||||
this.xrLabel5.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
|
||||
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerReferenceNumber")});
|
||||
this.xrLabel5.Font = new DevExpress.Drawing.DXFont("Arial", 11F);
|
||||
this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(206.917F, 409.4481F);
|
||||
this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(206.4585F, 389.4479F);
|
||||
this.xrLabel5.Name = "xrLabel5";
|
||||
this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel5.SizeF = new System.Drawing.SizeF(281.25F, 20F);
|
||||
@@ -372,7 +344,7 @@ namespace LebenshilfeStadeMID
|
||||
// xrLabel13
|
||||
//
|
||||
this.xrLabel13.Font = new DevExpress.Drawing.DXFont("Arial", 11F);
|
||||
this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(0.4585266F, 409.4481F);
|
||||
this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(0F, 389.4479F);
|
||||
this.xrLabel13.Name = "xrLabel13";
|
||||
this.xrLabel13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
|
||||
this.xrLabel13.SizeF = new System.Drawing.SizeF(206.4585F, 20F);
|
||||
@@ -494,13 +466,11 @@ namespace LebenshilfeStadeMID
|
||||
this.xrLabel3,
|
||||
this.xrLabel12,
|
||||
this.xrLabel11,
|
||||
this.xrLabel10,
|
||||
this.xrLabel4,
|
||||
this.xrLabel5,
|
||||
this.xrLabel13,
|
||||
this.lblAdresse});
|
||||
this.GroupHeader2.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
|
||||
this.GroupHeader2.HeightF = 429.4481F;
|
||||
this.GroupHeader2.HeightF = 419.2878F;
|
||||
this.GroupHeader2.Level = 1;
|
||||
this.GroupHeader2.Name = "GroupHeader2";
|
||||
this.GroupHeader2.StylePriority.UseFont = false;
|
||||
@@ -767,8 +737,6 @@ namespace LebenshilfeStadeMID
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel12;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel11;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel10;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel4;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel5;
|
||||
private DevExpress.XtraReports.UI.XRLabel xrLabel13;
|
||||
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -125,6 +125,8 @@ namespace LebenshilfeStadeMID.Service
|
||||
verfuegungszeit.ServiceDescription = DAOFactory.SearchDAO.FindServiceDescriptionForCategory(serviceRecord.ServiceDescription.ServiceCategory.Oid.Value).FirstOrDefault(sr => sr.Name.ToLower().Contains("verfügungszeit einfache schulassistenz(jas)"));
|
||||
else if (serviceRecord.ServiceDescription.Name.ToLower().Contains("qualifizierte schulassistenz (jas)") || serviceRecord.ServiceDescription.Name.ToLower().Contains("kind krank qualifiziert (jas)")|| serviceRecord.ServiceDescription.Name.ToLower().Contains("kind krank (jas)"))
|
||||
verfuegungszeit.ServiceDescription = DAOFactory.SearchDAO.FindServiceDescriptionForCategory(serviceRecord.ServiceDescription.ServiceCategory.Oid.Value).FirstOrDefault(sr => sr.Name.ToLower().Contains("verfügungszeit fachlich (jas)"));
|
||||
else if (serviceRecord.ServiceDescription.Name.ToLower().Contains("75%-fachliche schulassistenz jas") || serviceRecord.ServiceDescription.Name.ToLower().Contains("75%-kind krank qualifiziert jas") )
|
||||
verfuegungszeit.ServiceDescription = DAOFactory.SearchDAO.FindServiceDescriptionForCategory(serviceRecord.ServiceDescription.ServiceCategory.Oid.Value).FirstOrDefault(sr => sr.Name.ToLower().Contains("75%-verfügungszeit fachlich jas"));
|
||||
|
||||
return verfuegungszeit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user