Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo

This commit is contained in:
2025-07-24 10:21:17 +02:00
34 changed files with 2142 additions and 1350 deletions

View File

@@ -389,8 +389,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Humanitas", "ReportImp\Huma
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiakonischesWerkHerne", "ReportImp\DiakonischesWerkHerne\DiakonischesWerkHerne.csproj", "{25AE0253-30AC-4E85-9FA4-2F8FADA62787}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabGmbH", "ReportImp\SabGmbH\SabGmbH.csproj", "{491FE69C-49BF-4003-85CE-755DE9C99E7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeWoWalzPaiva", "ReportImp\BeWoWalzPaiva\BeWoWalzPaiva.csproj", "{FE709CF1-6579-4A69-8E43-5C3BF7BD96D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbwDziallasMuhrin", "ReportImp\AbwDziallasMuhrin\AbwDziallasMuhrin.csproj", "{4ACCB582-3B1C-42E8-B658-9D506B8620AD}"
@@ -791,8 +789,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Alloheim", "ReportImp\Alloh
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZuhauseWohnenIrisThimm", "ReportImp\ZuhauseWohnenIrisThimm\ZuhauseWohnenIrisThimm.csproj", "{22E7F5F8-BB34-4243-896B-221F78837F83}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PetraWagnerMatthes", "ReportImp\PetraWagnerMatthes\PetraWagnerMatthes.csproj", "{644F73A6-7EA0-456D-B7BC-22F44B851812}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SKMAachen", "ReportImp\SKMAachen\SKMAachen.csproj", "{95342759-C161-4A44-8130-9740E57FE3A1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DieLebenslotsen", "ReportImp\DieLebenslotsen\DieLebenslotsen.csproj", "{1D72670D-FC74-4806-B6B8-847BB01718B9}"
@@ -4964,30 +4960,6 @@ Global
{25AE0253-30AC-4E85-9FA4-2F8FADA62787}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{25AE0253-30AC-4E85-9FA4-2F8FADA62787}.Release|x86.ActiveCfg = Release|Any CPU
{25AE0253-30AC-4E85-9FA4-2F8FADA62787}.Release|x86.Build.0 = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|.NET.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|.NET.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|x86.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Debug|x86.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|.NET.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|.NET.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|Any CPU.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|Any CPU.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|Mixed Platforms.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|Mixed Platforms.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|x86.ActiveCfg = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.DebugRemote|x86.Build.0 = Debug|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|.NET.ActiveCfg = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|.NET.Build.0 = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|Any CPU.Build.0 = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|x86.ActiveCfg = Release|Any CPU
{491FE69C-49BF-4003-85CE-755DE9C99E7C}.Release|x86.Build.0 = Release|Any CPU
{FE709CF1-6579-4A69-8E43-5C3BF7BD96D7}.Debug|.NET.ActiveCfg = Debug|Any CPU
{FE709CF1-6579-4A69-8E43-5C3BF7BD96D7}.Debug|.NET.Build.0 = Debug|Any CPU
{FE709CF1-6579-4A69-8E43-5C3BF7BD96D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -9788,30 +9760,6 @@ Global
{22E7F5F8-BB34-4243-896B-221F78837F83}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{22E7F5F8-BB34-4243-896B-221F78837F83}.Release|x86.ActiveCfg = Release|Any CPU
{22E7F5F8-BB34-4243-896B-221F78837F83}.Release|x86.Build.0 = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|.NET.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|.NET.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|Any CPU.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|x86.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Debug|x86.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|.NET.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|.NET.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|Any CPU.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|Any CPU.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|Mixed Platforms.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|Mixed Platforms.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|x86.ActiveCfg = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.DebugRemote|x86.Build.0 = Debug|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|.NET.ActiveCfg = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|.NET.Build.0 = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|Any CPU.ActiveCfg = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|Any CPU.Build.0 = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|x86.ActiveCfg = Release|Any CPU
{644F73A6-7EA0-456D-B7BC-22F44B851812}.Release|x86.Build.0 = Release|Any CPU
{95342759-C161-4A44-8130-9740E57FE3A1}.Debug|.NET.ActiveCfg = Debug|Any CPU
{95342759-C161-4A44-8130-9740E57FE3A1}.Debug|.NET.Build.0 = Debug|Any CPU
{95342759-C161-4A44-8130-9740E57FE3A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -11540,7 +11488,6 @@ Global
{062698EA-8477-4F07-BF2A-CE4FAE4DCFA3} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{DB03F765-7CE2-40A6-B469-BCEBE61ACF9E} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{25AE0253-30AC-4E85-9FA4-2F8FADA62787} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{491FE69C-49BF-4003-85CE-755DE9C99E7C} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{FE709CF1-6579-4A69-8E43-5C3BF7BD96D7} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{4ACCB582-3B1C-42E8-B658-9D506B8620AD} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{FE14BABA-B6FD-47C8-BB38-DD4479EADA39} = {D8A691C5-146D-4613-86CC-438F02FE9106}
@@ -11741,7 +11688,6 @@ Global
{8404C9FB-662A-4676-8454-64ED3CED2014} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{D2821E8E-76BE-4865-B5B3-381457BB5D71} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{22E7F5F8-BB34-4243-896B-221F78837F83} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{644F73A6-7EA0-456D-B7BC-22F44B851812} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{95342759-C161-4A44-8130-9740E57FE3A1} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{1D72670D-FC74-4806-B6B8-847BB01718B9} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{BEAE2DED-A98E-4EF9-8390-A2432CF88E8B} = {D8A691C5-146D-4613-86CC-438F02FE9106}

View File

@@ -47,6 +47,9 @@ namespace BeWoPlanerMobil.Controllers
private MainModel _Model;
public bool SkipModelInitialization { get; set; }
public bool SkipServiceRecordInitialization { get; set; }
public MainModel Model
{
get
@@ -139,9 +142,8 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model.LoggedInEmployee?.EmployeeOid.HasValue ?? false)
{
//Model.SupportConcepts = new List<CompactSupportConceptDC>();
var test = OperationsService.GetAllActiveSupportConceptCostbearer(false, true, Model.LoggedInEmployee.EmployeeOid.Value);
var customerService = PluginLoader.FindClass<CustomerService>();
var test = customerService.GetAllActiveSupportConceptCostbearer(false, true, Model.LoggedInEmployee.EmployeeOid.Value);
Model.SupportConcepts = test;
}
@@ -155,7 +157,16 @@ namespace BeWoPlanerMobil.Controllers
Model.SupportConcepts = Model.SupportConcepts.Where(sc => sc.EndDate is null || sc.EndDate.Value >= DateTime.Now.Date).ToList();
}
foreach(var supportConcept in Model.SupportConcepts)
if (Model.SelectedSupportConceptFilter == CustomerFilterEnum.MyCustomer)
{
Model.SupportConcepts = Model.SupportConcepts.Where(sc => sc.IsRelatedToEmployee).ToList();
}
else if (Model.SelectedSupportConceptFilter == CustomerFilterEnum.TeamCustomer)
{
Model.SupportConcepts = Model.SupportConcepts.Where(sc => sc.Customer.IsRelatedToTeam).ToList();
}
foreach (var supportConcept in Model.SupportConcepts)
{
if(supportConcept.Goals is null)
{
@@ -256,8 +267,11 @@ namespace BeWoPlanerMobil.Controllers
if(Model.SelectedCostBearerSupportConceptOid.HasValue && Model.SelectedCostBearerSupportConceptOid != -1)
{
LoadSupportConceptThings(Model.SelectedCostBearerSupportConceptOid, true);
LoadPaginatedServiceRecordsToModel(Model.CurrentPage);
LoadSupportConceptThings(Model.SelectedCostBearerSupportConceptOid, true);
if (!SkipServiceRecordInitialization)
{
LoadPaginatedServiceRecordsToModel(Model.CurrentPage);
}
}
else if(Model.IsInGroupBookingMode || Model.IsInMultiBookingMode)
{
@@ -644,17 +658,23 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public ActionResult SetShowExpiredSupportConcepts(FormCollection pCollection)
{
if(Model is null)
if(!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
return Logout();
}
SkipModelInitialization = true;
var newValue = "true,false" == pCollection[FormCollectionConstants.ShowExpiredSupportConceptsKey];
UpdateApplicationSettings(SettingsKeys.ShowExpiredSupportConcepts, newValue ? "1" : "0");
Model.ShowExpiredSupportConcepts = newValue;
return UpdateApplicationSettings(SettingsKeys.ShowExpiredSupportConcepts, newValue ? "1" : "0");
Model.SupportConceptListObjects.Clear(); // Erzwingt das neu laden
return RedirectToAction("Main");
}
[HttpPost]
@@ -679,7 +699,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model.IsInGroupBookingMode)
{
var list = GetSelectedGroupBookingSupportConcepts();
LoadSupportConceptThings(null, false);
list.DoForEach(sc => { allGoals.AddRangeIfElementsNotIn(sc.Goals); });
}
else if(!Model.IsInGroupBookingMode)
@@ -2186,35 +2206,109 @@ namespace BeWoPlanerMobil.Controllers
return result;
}
if(nodes.Count == 1)
if (nodes.Count == 1)
{
firstNode.ServiceAccountings.DoForEach(serviceAccounting => result.AddOrUpdateValueInDictionary(serviceAccounting.ServiceDescription.Category, serviceAccounting.ServiceDescription));
}
foreach(var serviceAccounting in firstNode.ServiceAccountings)
else if (Model.FilterGroupServiceCategories)
{
var serviceDescription = serviceAccounting.ServiceDescription;
var serviceCategory = serviceDescription.Category;
var schnittmenge = ErstelleServiceCategorySchnittmenge(nodes);
if(nodes.All(node => node.ServiceAccountings.Any(accounting => accounting.ServiceDescription.Equals(serviceDescription))))
foreach (var serviceAccounting in schnittmenge)
{
var serviceDescription = serviceAccounting.ServiceDescription;
var serviceCategory = serviceDescription.Category;
result.AddOrUpdateValueInDictionary(serviceCategory, serviceDescription);
}
}
if(firstNode.ServiceAccountings.Count == 0 || result.Count == 0)
if (result.Count == 0)
{
var allServiceDescriptions = OperationsService.GetAllServiceDescriptions().Where(sd => sd.Category.ActivationType == ActivationTypeId.Active && sd.ActivationType == ActivationTypeId.Active && sd.Category.OhneHilfeplan != AccountingvisibilityType.NichtKlientenbezogen).ToList();
foreach(var serviceDescription in allServiceDescriptions)
{
result.AddOrUpdateValueInDictionary(serviceDescription.Category, serviceDescription);
}
result = GetAllServiceCategory2ServiceDescriptionDict();
}
return result.OrderBy(kvp => kvp.Key.Position).ToDictionary(category2Descriptions => category2Descriptions.Key, category2Descriptions => category2Descriptions.Value.OrderBy(serviceDescription => serviceDescription.Position).ToList());
}
private Dictionary<ServiceCategoryDC, List<ServiceDescriptionDC>> GetAllServiceCategory2ServiceDescriptionDict()
{
var result = new Dictionary<ServiceCategoryDC, List<ServiceDescriptionDC>>();
var allServiceDescriptions = OperationsService.GetAllServiceDescriptions().Where(sd => sd.Category.ActivationType == ActivationTypeId.Active && sd.ActivationType == ActivationTypeId.Active && sd.Category.OhneHilfeplan != AccountingvisibilityType.NichtKlientenbezogen).ToList();
foreach (var serviceDescription in allServiceDescriptions)
{
result.AddOrUpdateValueInDictionary(serviceDescription.Category, serviceDescription);
}
return result;
}
private List<ServiceAccountingDC> ErstelleServiceCategorySchnittmenge(List<SupportConceptTreeNodeDetailInfoDC> allInfos)
{
if (allInfos.Count == 0)
{
return null;
}
else if (allInfos.Count == 1)
{
return allInfos[0].ServiceAccountings;
}
var schnittmenge = new List<ServiceAccountingDC>();
Dictionary<ServiceCategoryDC, List<ServiceDescriptionDC>> allDict = null;
foreach (var info in allInfos)
{
if (info.ServiceAccountings != null && info.ServiceAccountings.Count == 0)
{
if (allDict == null)
{
allDict = GetAllServiceCategory2ServiceDescriptionDict();
}
foreach (var cat in allDict.Keys)
{
if (!cat.OhneHilfeplan.HasValue || (cat.OhneHilfeplan.Value != AccountingvisibilityType.NichtKlientenbezogen && cat.OhneHilfeplan.Value != AccountingvisibilityType.Never))
{
var descList = allDict[cat];
foreach (var desc in descList)
{
info.ServiceAccountings.Add(new ServiceAccountingDC { ServiceDescription = desc });
}
}
}
}
}
var erster = allInfos[0];
foreach (var sa in erster.ServiceAccountings)
{
//Prüfe für jeden des ersten ob er auch in allen anderen enthalten ist
bool istDrin = true;
for (int i = 1; i < allInfos.Count; i++)
{
var info2 = allInfos[i];
if (!info2.ServiceAccountings.Exists(sa2 => sa2.ServiceDescription.ServiceDescriptionOid == sa.ServiceDescription.ServiceDescriptionOid))
{
istDrin = false;
}
}
if (istDrin)
{
schnittmenge.Add(sa);
}
}
return schnittmenge;
}
[HttpPost]
[Authorize]
public ActionResult DeleteServiceRecord(FormCollection formCollection)
@@ -2377,12 +2471,14 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public ActionResult LoadServiceRecordsNonPost(int dayCountNumber, string start, string end, int month, int year, int recordsKey)
{
if(Model is null)
if(!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("ServiceRecordListPartial");
}
SkipServiceRecordInitialization = true;
var lastSelectedServiceRecordMonth = new DateTime(year, month, 1);
var isValidStart = DateTime.TryParse(start, out var parsedStart);
@@ -2537,7 +2633,7 @@ namespace BeWoPlanerMobil.Controllers
var employees = group.ServiceRecordList.Select(serviceRecord => serviceRecord.Employee).Distinct().ToList();
Model.GroupBookingSelectedEmployeeOids = employees.Select(e => e.EmployeeOid).ToList();
var cb2ScOids = group.ServiceRecordList.Where(w => w.CostBearer2SupportConceptOid.HasValue).Select(s => s.CostBearer2SupportConceptOid.Value).ToList();
var cb2ScOids = group.ServiceRecordList.Where(w => w.CostBearer2SupportConceptOid.HasValue).Select(s => s.CostBearer2SupportConceptOid.Value).Distinct().ToList();
//Model.SelectedConceptCostBearerRelations.AddRangeIfElementsNotIn(OperationsService.GetSupportConceptCostBearerRelDCsByOids(cb2ScOids));
Model.GroupBookingSelectedCostBearerSupportConceptOids = cb2ScOids;
@@ -3525,30 +3621,53 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public ActionResult AddScCbRelsToGroupBooking(string[] relOids, string[] groupOids)
{
SkipModelInitialization = true;
if(!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("GroupBookingScCbRelList");
}
AddScCbRelsToGroupOrMultiBooking(relOids, groupOids);
return PartialView("GroupBookingScCbRelList", Model);
}
[Authorize]
public ActionResult AddScCbRelsToMultiBooking(string[] relOids, string[] groupOids)
{
if (!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("MultiBookingScCbRelList");
}
AddScCbRelsToGroupOrMultiBooking(relOids, groupOids);
return PartialView("MultiBookingScCbRelList", Model);
}
private void AddScCbRelsToGroupOrMultiBooking(string[] relOids, string[] groupOids)
{
SkipModelInitialization = true;
var singleRels = new List<long>();
var groupRels = new List<long>();
var groups = new List<GroupOfPeopleDC>();
if(groupOids is null)
if (groupOids is null)
{
groupOids = Array.Empty<string>();
}
if(relOids is null)
if (relOids is null)
{
relOids = Array.Empty<string>();
}
relOids.DoForEach(relOid =>
{
if(long.TryParse(relOid, out var singleRelOid))
if (long.TryParse(relOid, out var singleRelOid))
{
singleRels.AddIfNotIn(singleRelOid);
}
@@ -3556,19 +3675,21 @@ namespace BeWoPlanerMobil.Controllers
groupOids.DoForEach(groupOid =>
{
if(long.TryParse(groupOid, out var g))
if (long.TryParse(groupOid, out var g))
{
groupRels.AddIfNotIn(g);
}
});
Model.GroupsOfPeople = EmployeeService.GetAllGroups(LoggedInEmployee.EmployeeOid).OrderBy(gop => gop.Name).ToList();
Model.GroupBookingSelectedGroupOfPeopleOids.Clear();
groupRels.DoForEach(groupOid =>
{
var group = Model.GroupsOfPeople.FirstOrDefault(f => f.GroupOfPeopleOid.HasValue && f.GroupOfPeopleOid.Value.Equals(groupOid));
if(group is null)
if (group is null)
{
return;
}
@@ -3578,7 +3699,7 @@ namespace BeWoPlanerMobil.Controllers
});
Model.GroupBookingSelectedCostBearerSupportConcepts.Clear();
Model.GroupBookingSelectedCostBearerSupportConceptOids.Clear();
Model.GroupBookingSelectedCostBearerSupportConceptOids.AddRangeIfElementsNotIn(singleRels);
@@ -3587,24 +3708,24 @@ namespace BeWoPlanerMobil.Controllers
//var groupCostBearerRelations = CustomerService.GetSupportConceptCostBearerRelationsById(singleRels);
foreach(var gruppe in groups.Where(g => g.GroupOfPeopleOid.HasValue))
foreach (var gruppe in groups.Where(g => g.GroupOfPeopleOid.HasValue))
{
var groupRelOids = new List<long>();
gruppe.SupportConceptList.ForEach(f => groupRelOids.AddRange(f.CostBearerRelOids));
if(!gruppe.GroupOfPeopleOid.HasValue)
if (!gruppe.GroupOfPeopleOid.HasValue)
{
continue;
}
var groupOid = gruppe.GroupOfPeopleOid.Value;
if(singleRels.ContainsItems(groupRelOids))
if (singleRels.ContainsItems(groupRelOids))
{
Model.GroupBookingSelectedGroupOfPeopleOids.AddIfNotIn(groupOid);
}
else if(Model.GroupBookingSelectedGroupOfPeopleOids.Contains(groupOid))
else if (Model.GroupBookingSelectedGroupOfPeopleOids.Contains(groupOid))
{
Model.GroupBookingSelectedGroupOfPeopleOids.Remove(groupOid);
}
@@ -3615,8 +3736,6 @@ namespace BeWoPlanerMobil.Controllers
CreateModelSupportConceptListObjects(false);
LoadSupportConceptThings(null, true);
return PartialView("GroupBookingScCbRelList", Model);
}
[Authorize]
@@ -3714,11 +3833,13 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public ActionResult SetSupportConceptFilter(FormCollection formCollection)
{
if(Model is null)
if(!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
return Logout();
}
SkipModelInitialization = true;
var selectedSupportConceptFilter = formCollection[nameof(Model.SelectedSupportConceptFilter)];
@@ -3729,6 +3850,8 @@ namespace BeWoPlanerMobil.Controllers
UpdateApplicationSettings(SettingsKeys.CustomerFilterInZeiterfassung, customerFilter.ToString());
Model.SupportConceptListObjects.Clear(); // Erzwingt das neu laden
return RedirectToActionPermanent("Main");
}
@@ -3997,7 +4120,7 @@ namespace BeWoPlanerMobil.Controllers
CompactSupportConceptDC sc = null;
if (Model.SupportConcepts != null)
{
//sc = Model.SupportConcepts.FirstOrDefault(s => s.SupportConceptOid == supportConceptOid);
sc = Model.SupportConcepts.FirstOrDefault(s => s.SupportConceptOid == supportConceptOid);
}
if (sc == null)
{
@@ -4032,12 +4155,14 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public ActionResult PrepareServiceRecordInsert()
{
if(Model is null)
if(!IsUserLoggedIn())
{
TempData[TempDataConstants.DoLogoutKey] = true;
return Logout();
}
SkipModelInitialization = true;
Model.TransferringAppointmentOid = TempData[TempDataConstants.AppointmentOidKey] as long?;
if(Model.TransferringAppointmentOid.HasValue && Model.LoggedInEmployee.EmployeeOid.HasValue)
@@ -4064,9 +4189,10 @@ namespace BeWoPlanerMobil.Controllers
var notice = appointment.Description;
var customerService = PluginLoader.FindClass<CustomerService>();
var supportConcepts = customerService.GetAllActiveSupportConceptCostbearer(false, true, Model.LoggedInEmployee.EmployeeOid.Value);
supportConcepts = supportConcepts.Where(sc => customerOids.Contains(sc.Customer.CustomerOid) && sc.StartDate.HasValue && sc.EndDate.HasValue && start.Value.AreInBetweenDates(end.Value, sc.StartDate.Value, sc.EndDate.Value)).ToList();
Model.SupportConceptListObjects.Clear(); //Macht, dass beim Init die SupportConcepts neu geladen werden
InitViewModel();
var supportConcepts = Model.SupportConcepts.Where(sc => customerOids.Contains(sc.Customer.CustomerOid) && sc.StartDate.HasValue && sc.EndDate.HasValue && start.Value.AreInBetweenDates(end.Value, sc.StartDate.Value, sc.EndDate.Value)).ToList();
var supportConceptList = new List<CompactSupportConceptDC>();
@@ -4115,15 +4241,13 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedEmployee = Model.AllEmployees.FirstOrDefault(e => e.EmployeeOid.Equals(employeeOids.FirstOrDefault()));
var compactSupportConcept = supportConceptList.First();
var supportConcept = Model.SupportConcepts.FirstOrDefault(f => f.SupportConceptOid.Equals(compactSupportConcept.SupportConceptOid));
var scListObject = Model.SupportConceptListObjects.FirstOrDefault(f => f.SupportConceptOid.Equals(compactSupportConcept.SupportConceptOid));
var serviceRecord = CreateServiceRecordFromScratch(start.Value, end.Value, supportConcept?.Customer, Model.SelectedEmployee, notice);
var serviceRecord = CreateServiceRecordFromScratch(start.Value, end.Value, compactSupportConcept?.Customer, Model.SelectedEmployee, notice);
var costBearer = supportConcept?.CostBearerList.FirstOrDefault();
var costBearer = compactSupportConcept?.CostBearerList.FirstOrDefault();
var cb2ScOid = supportConcept?.CostBearerRelOids.FirstOrDefault(cbOid => availableRelOids.Contains(cbOid));
LoadSupportConceptThings(cb2ScOid ?? -2, false);
var cb2ScOid = compactSupportConcept?.CostBearerRelOids.FirstOrDefault(cbOid => availableRelOids.Contains(cbOid));
serviceRecord.CostBearer = costBearer?.Organisation;
serviceRecord.CostBearer2SupportConceptOid = cb2ScOid;
@@ -4133,6 +4257,7 @@ namespace BeWoPlanerMobil.Controllers
{
Model.SelectedServiceRecord = serviceRecord;
}
Model.SelectedCostBearerSupportConceptOid = cb2ScOid;
}
else // Gruppenbuchung
{
@@ -4151,11 +4276,9 @@ namespace BeWoPlanerMobil.Controllers
ServiceDescription = Model.GetSelectedOrFirstServiceDescription()
};
var supportConceptsForGroupBooking = Model.SupportConcepts.Where(sc => supportConceptList.Any(csc => csc.SupportConceptOid.Equals(sc.SupportConceptOid))).ToList();
var costBearer2SupportConceptOids = new List<long>();
foreach(var supportConcept in supportConceptsForGroupBooking)
foreach(var supportConcept in supportConceptList)
{
var cb2ScOid = supportConcept?.CostBearerRelOids.FirstOrDefault(cbOid => availableRelOids.Contains(cbOid));
@@ -4173,13 +4296,15 @@ namespace BeWoPlanerMobil.Controllers
//Model.SelectedConceptCostBearerRelations = costBearer2SupportConcepts;
//Model.GroupBookingSelectedSupportConcepts = supportConceptsForGroupBooking;
}
Model.GroupBookingSelectedEmployeeOids = employeeOids;
LoadSupportConceptThings(null, false);
}
}
Model.SelectedServiceRecordOid = Model.SelectedServiceRecord?.ServiceRecordOid;
SetSelectedObjects();
Model.TransferringAppointmentOid = appointment.SchedulerAppointmentOid;
Model.IsInTransferMode = true;
}
@@ -4274,102 +4399,7 @@ namespace BeWoPlanerMobil.Controllers
return PartialView("MultiBookingSelectionPartial", Model);
}
[Authorize]
public ActionResult AddScCbRelsToMultiBooking(string[] relOids, string[] groupOids)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("MultiBookingScCbRelList");
}
var singleRels = new List<long>();
var groupRels = new List<long>();
var groups = new List<GroupOfPeopleDC>();
if(groupOids is null)
{
groupOids = Array.Empty<string>();
}
if(relOids is null)
{
relOids = Array.Empty<string>();
}
relOids.DoForEach(relOid =>
{
if(long.TryParse(relOid, out var singleRelOid))
{
singleRels.AddIfNotIn(singleRelOid);
}
});
groupOids.DoForEach(groupOid =>
{
if(long.TryParse(groupOid, out var g))
{
groupRels.AddIfNotIn(g);
}
});
Model.GroupBookingSelectedGroupOfPeopleOids.Clear();
groupRels.DoForEach(groupOid =>
{
var group = Model.GroupsOfPeople.FirstOrDefault(f => f.GroupOfPeopleOid.HasValue && f.GroupOfPeopleOid.Value.Equals(groupOid));
if(group is null)
{
return;
}
groups.AddIfNotIn(group);
group.SupportConceptList.DoForEach(f => singleRels.AddRangeIfElementsNotIn(f.CostBearerRelOids));
});
//Model.MultiBookingSelectedSupportConcepts.Clear();
Model.GroupBookingSelectedCostBearerSupportConceptOids.Clear();
Model.GroupBookingSelectedCostBearerSupportConceptOids.AddRangeIfElementsNotIn(singleRels);
//var selectedSupportConcepts = CustomerService.GetSupportConceptsByCostbearer2SupportConceptRelOids(singleRels);
//var groupCostBearerRelations = CustomerService.GetSupportConceptCostBearerRelationsById(singleRels);
//Model.MultiBookingSelectedSupportConcepts.AddRangeIfElementsNotIn(selectedSupportConcepts);
foreach(var gruppe in groups.Where(g => g.GroupOfPeopleOid.HasValue))
{
var groupRelOids = new List<long>();
gruppe.SupportConceptList.ForEach(f => groupRelOids.AddRange(f.CostBearerRelOids));
if(!gruppe.GroupOfPeopleOid.HasValue)
{
continue;
}
var groupOid = gruppe.GroupOfPeopleOid.Value;
if(singleRels.ContainsItems(groupRelOids))
{
Model.GroupBookingSelectedGroupOfPeopleOids.AddIfNotIn(groupOid);
}
else if(Model.GroupBookingSelectedGroupOfPeopleOids.Contains(groupOid))
{
Model.GroupBookingSelectedGroupOfPeopleOids.Remove(groupOid);
}
}
CreateModelSupportConceptListObjects(false);
LoadSupportConceptThings(null, true);
//Model.SelectedConceptCostBearerRelationOids = Model.SelectedConceptCostBearerRelations.Select(s => s.CostBearer2SupportConceptOid.Value).ToList();
//Model.MultiBookingSelectedSupportConceptOids = Model.MultiBookingSelectedSupportConcepts.Select(s => s.SupportConceptOid.Value).ToList();
return PartialView("MultiBookingScCbRelList", Model);
}
[Authorize]
public ActionResult RemoveSupportConceptCostbearerRelFromMultiBooking(string relOid)
@@ -4775,6 +4805,7 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public ActionResult LoadServiceRecordPage(int selectedPage)
{
SkipServiceRecordInitialization = true;
if(Model.SelectedZeitraum?.StartDate is null || Model.SelectedZeitraum.EndDate is null)
{
Model.SelectedZeitraum = new NullableDateTimeSpan(DateTime.Today.GetFirstOfMonth(), DateTime.Today);
@@ -4833,6 +4864,7 @@ namespace BeWoPlanerMobil.Controllers
pages++;
}
Model.ServiceRecordCount = totalServiceRecords;
Model.ServiceRecordPageCount = pages;
@@ -4886,6 +4918,11 @@ namespace BeWoPlanerMobil.Controllers
Model.ServiceRecordOids2GoalHeader = GetServiceRecordOids2GoalHeaders(serviceRecords, goalCategories);
Model.ServiceRecords = serviceRecords;
if (selectedPage > 1 && Model.ServiceRecordPageCount < selectedPage)
{
LoadPaginatedServiceRecordsToModel(1);
}
}
[Authorize]

View File

@@ -110,7 +110,10 @@ namespace BeWoPlanerMobil.Service
}
var userLoaded = TryAuthenticateWithLoginForm(context);
//if (!userLoaded && MobileSessionFacade.IsUserLoggedIn())
//{
// MobileSessionFacade.LogUserOut();
//}
//if(!userLoaded && MobileSessionFacade.LoggedInUser != null && MobileSessionFacade.LoggedInUser.UserOid.HasValue)
//{
// MobileSessionFacade.LoggedInUser = MapperFactory.UserDC_User.MapToNewDC(DAOFactory.GenericDAO.LoadByID<ApplicationUser>(MobileSessionFacade.LoggedInUser.UserOid.Value));

View File

@@ -6019,11 +6019,8 @@ WHERE sc.Billable = 1 and sr.StartDate >= '{0:yyyy-MM-dd}' and sr.StartDate < '{
rowCount = rowCountCirteria.SetProjection(Projections.RowCount()).FutureValue<int>().Value;
var result = criteria
.CreateAlias(nameof(ServiceRecord.ValueList), "vl", JoinType.LeftOuterJoin)
.CreateAlias(nameof(ServiceRecord.ServiceDescription), "sd", JoinType.InnerJoin)
.CreateAlias($"sd.{nameof(ServiceDescription.ServiceCategory)}", "sc", JoinType.InnerJoin)
//.CreateAlias(ServiceRecord.PropertyName_Employee, "e", JoinType.InnerJoin)
//.CreateCriteria("e." + Employee.PropertyName_Person, JoinType.InnerJoin)
.SetFirstResult(firstResult)
.SetMaxResults(maxResults)
.Future<ServiceRecord>();

View File

@@ -319,7 +319,7 @@ namespace Akkurat.Export
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 c.`IsActive` = 1 AND sc.`IsActive` = 1 and org.Name = 'LVR' and (sr.`GeleisteteFLM` is not null)))qry
WHERE c.`IsActive` <> 0 AND sc.`IsActive` <> 0 and org.Name = 'LVR' and (sr.`GeleisteteFLM` is not null)))qry
GROUP BY qry.OID
ORDER BY qry.Verwendung
";

View File

@@ -299,7 +299,7 @@ namespace CaritasverbandDuerenJuelichEV.Export
{
konto = "84291";
}
else if (item.ToString().ToLower().Contains("aok")) //derzeit nur ein Einzelfall
else if (item.ToString().ToLower().Contains("aok") || item.ToString().ToLower().Contains("dak")) //derzeit nur ein Einzelfall
{
konto = "84281";
}

View File

@@ -39,7 +39,7 @@ namespace CaritasverbandKelheim.Invoicing
var team = c.Team2CustomerList != null && c.Team2CustomerList.Count > 0 ? c.Team2CustomerList[0].Team : null;
if (team != null)
{
if (team.Name.ToLower().Contains("ambulant betreutes wohnen"))
if (team.Name.ToLower().Contains("ambulant betreutes wohnen") || team.Name.Contains("ABW"))
oid_ = 1;
}
}
@@ -47,7 +47,7 @@ namespace CaritasverbandKelheim.Invoicing
// Es wird also beim KT mit Textinhalt "ambulant betreutes wohnen" die Nummer für oid 1 geladen und bei "wohnen plus" die oid 2
else
{
if (invoiceBase.RecipientOrganisation.ToLower().Contains("ambulant betreutes wohnen"))
if (invoiceBase.RecipientOrganisation.ToLower().Contains("ambulant betreutes wohnen") || invoiceBase.RecipientOrganisation.ToLower().Contains("ABW"))
oid_ = 1;
}

View File

@@ -0,0 +1,18 @@
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 LebenshilfeBadKreuznachFUD.Export
{
public class CustomDataExporter : DataExporter
{
public override QueryDC CreateQuery(QueryDC query)
{
return SageExporter.CreateQuery(query);
}
}
}

View File

@@ -0,0 +1,178 @@
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 LebenshilfeBadKreuznachFUD.Export
{
public class SageExporter
{
private String teamname = "Integration";
public static QueryDC CreateQuery(QueryDC query)
{
DateTime dt = DateTime.Now;
DateTime.TryParse(query.Parameter[0].Value.ToString(), out dt);
if (query.Oid == 100)
{
query.FileName = String.Format("SageExportIntegration{0:yyyyMM}.csv", dt);
query.QueryResult = GetAbrechnungenString(dt, "Integration");
}
else if (query.Oid == 101)
{
query.FileName = String.Format("SageExportEntlastung{0:yyyyMM}.csv", dt);
query.QueryResult = GetAbrechnungenString(dt, "Entlastung");
}
else if (query.Oid == 102)
{
query.FileName = String.Format("SageExportAutismus{0:yyyyMM}.csv", dt);
query.QueryResult = GetAbrechnungenString(dt, "Autismus");
}
return query;
}
public static String GetAbrechnungenString(DateTime date, String teamname)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Buchungsdatum; Belegdatum; Belegnummer; Buchungstext; Sollkonto; Habenkonto; Umsatz; Währung; Steuerart; Steuercode; " +
"Kostenstelle Soll; Kostenstelle Haben; Kostenträger Soll; Kostenträger Haben; Kostenart; Buchungskreis");
var s = GetMonatlicheRechnungenString(date, teamname);
if (!String.IsNullOrWhiteSpace(s))
{
sb.Append(s);
}
return sb.ToString();
}
public static String GetMonatlicheRechnungenString(DateTime date, String teamname)
{
var sql = GetMonatlicheRechnungenSql(date);
/*
cb2sc.Oid,
ib.InvoiceNumber,
c.DebitorNumber,
Round(ii.AmountTotal, 2) AS 'Betrag',
ib.InvoiceDate,
org.Name AS 'VerwendungOrg'
CONCAT(p.`LastName`, ', ', p.`FirstName`) as 'VerwendungPerson',
org.DebitorNumber,
ii.ItemDescription,
c.CostCenter,
ib.Oid,
ib.AccountingPeriodEnd,
*/
//sb.AppendLine("Belegdatum;Belegnummer;Debitorennummer;Kontonummer;Betrag;Buchungstext;Kostenstelle");
//sb.AppendLine("Buchungsdatum; Belegdatum; Belegnummer; Buchungstext; Sollkonto; Habenkonto; Umsatz; Währung; Steuerart; Steuercode; " +
// "Kostenstelle Soll; Kostenstelle Haben; Kostenträger Soll; Kostenträger Haben; Kostenart; Buchungskreis");
var dt = ExecuteQuery(sql, date, teamname);
String LastKonto = "";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dt.Rows.Count; i++)
{
var row = dt.Rows[i];
if (sb.Length > 0)
{
sb.AppendLine();
}
sb.Append(String.Format("{0:dd.MM.yyyy}", row[4]));
sb.Append(";");
sb.Append(String.Format("{0:dd.MM.yyyy}", row[4]));
sb.Append(";");
sb.Append(String.Format("{0}", row[1]));
sb.Append(";");
String buchungstext = String.Format("AR-SI {0:MM}/{0:yyyy} {1} - {2}", row[11], row[5], row[6]);
sb.Append(buchungstext);
sb.Append(";");
sb.Append(String.Format("{0}", row[7])); // Sollkonto - Kundennr. Kostenträger
sb.Append(";");
String hbnKto = "S82035"; // Habenkonto für Q1 + Q2
if (row[8].ToString() != null && (row[8].ToString().ToLower().Contains("q3") || row[8].ToString().ToLower().Contains("q4")))
{
hbnKto = "S82025";
}
// Samstagszuschläge gehören immer auf das gleiche Konto wie die andere Buchung
else if (row[8].ToString() != null && (row[8].ToString().ToLower().Contains("zuschlag") ||
!row[8].ToString().ToLower().Contains("q1") && !row[8].ToString().ToLower().Contains("q2")) && i > 0)
{
if (dt.Rows[i-1][1].ToString() == row[1].ToString() && LastKonto.IsNotNullOrEmpty())
{
hbnKto = LastKonto;
}
}
LastKonto = hbnKto;
sb.Append(String.Format("{0}", hbnKto)); // Habenkonto
sb.Append(";");
sb.Append(String.Format("{0:0.00}", row[3]));
sb.Append(";EUR;;;");
sb.Append("T70400;"); // Kostenstelle (String.Format("{0}", row[9]));
sb.Append("T70400;"); // Kostenstelle Haben (String.Format("{0}", row[9]));
sb.Append(";;;12"); // Buchungskreis
}
return sb.ToString();
}
private static String GetMonatlicheRechnungenSql(DateTime date)
{
String sql = @"
SELECT * FROM
(SELECT
cb2sc.Oid AS cb2scOid,
ib.InvoiceNumber,
c.DebitorNumber,
Round(ii.GrossAmountTotal, 2) AS 'Betrag',
ib.InvoiceDate,
org.Name AS 'VerwendungOrg',
CONCAT(p.`LastName`, ', ', p.`FirstName`) as 'VerwendungPerson',
org.DebitorNumber AS OrgDebitorNumber,
ii.ItemDescription,
c.CostCenter,
ib.Oid AS ibOid,
ib.AccountingPeriodEnd,
(select t.name from team t inner join team2customer t2c on t2c.teamoid = t.oid where t2c.customeroid = c.Oid limit 1) AS Team
FROM `supportconcept` sc
INNER JOIN `costbearer2supportconcept` cb2sc ON sc.`Oid` = cb2sc.`SupportConceptOid`
INNER JOIN `costbearer` cb ON cb2sc.`CostBearerOid` = 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 invoicebase ib on ib.costbearer2supportconceptoid = cb2sc.oid
inner join serviceinvoice si on si.invoicebaseoid = ib.oid
inner join serviceinvoiceperiod sip on sip.serviceinvoiceoid = si.oid
inner join invoiceitem ii on ii.serviceinvoiceperiodoid = sip.oid
WHERE ib.`AccountingPeriodEnd` >= ':Monat_Start' AND ib.`AccountingPeriodEnd` < ':Monat_End' and ib.IsActive = 1
ORDER BY p.`LastName`, p.`FirstName`, cb2sc.`ApprovedStartDate`, ii.GrossAmountTotal desc) AS sqry
WHERE Team = ':teamname'
";
return sql;
}
public static DataTable ExecuteQuery(String sql, DateTime dt, String teamname)
{
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));
newsql = newsql.Replace(":teamname", String.Format("{0}", teamname));
return DAOFactory.AdoDAO.ExecuteQuery(newsql).Tables[0];
}
}
}

View File

@@ -18,6 +18,12 @@ namespace LebenshilfeBadKreuznachFUD.Invoicing
// weitgehend normal, für Entlastung kommt eine Hausbesuchspauschale und für Q1 KANN eine Wegevergütung hinzugefügt werden
public class CustomInvoiceCreation : InvoiceCreation
{
public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod, IList<CompactSupportConceptDC> supportConceptList)
{
base.SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList);
invoice.InvoiceBase.InvoiceDate = invoice.InvoiceBase.AccountingPeriodEnd;
}
public override ServiceInvoicePeriod CreateServiceInvoicePeriod(SupportConceptApprovalPeriodDC approvalPeriodDC, DateTimeSpan invoiceAccountingPeriodSpan)
{
var sip = new ServiceInvoicePeriod

View File

@@ -58,6 +58,8 @@
<ItemGroup>
<Compile Include="Calculations\DefaultCalculations.cs" />
<Compile Include="Calculations\CustomGroupDurationCalculator.cs" />
<Compile Include="Export\CustomDataExporter.cs" />
<Compile Include="Export\SageExporter.cs" />
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -110,7 +112,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Export\" />
<Folder Include="Import\" />
<Folder Include="Validation\" />
</ItemGroup>

View File

@@ -46,7 +46,7 @@ namespace LebenshilfeBadKreuznachFUD.Reporting.Reports
if (ferien != null)
{
item.Notice = ferien.Name;
//item.Notice = ferien.Name;
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
using BeWo.Service.Import.AvisImport;
using BeWo.Service.Plugins;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using Utils = BS.Shared.Core.Utils;
namespace MalteserJohanniterJohanneshaus.Import
{
public class CustomLvrAviseImporter : LvrAviseImporter
{
public override List<HilfeplanInfo> CreateHilfeplanInfos()
{
List<HilfeplanInfo> liste = new List<HilfeplanInfo>();
var scList = DAOFactory.GenericDAO.GetAllActiveAndArchived<SupportConcept>();
foreach (var supportConcept in scList)
{
foreach (var cb2sc in supportConcept.CostBearer2SupportConceptList)
{
if (cb2sc.Notice == "60")
{
HilfeplanInfo hi = new HilfeplanInfo();
hi.Start = cb2sc.StartDate;
hi.Ende = cb2sc.EndDate;
hi.Aktenzeichen = cb2sc.CustomerReferenceNumber;
hi.CostBearer2SupportConcept = cb2sc;
hi.CustomerFirstName = cb2sc.SupportConcept.Customer.Person.FirstName;
hi.CustomerLastName = cb2sc.SupportConcept.Customer.Person.LastName;
if (hi.Start.HasValue && hi.Ende.HasValue && !String.IsNullOrEmpty(hi.Aktenzeichen))
{
liste.Add(hi);
}
}
}
}
return liste;
}
}
}

View File

@@ -91,6 +91,7 @@
<Compile Include="Finanzauswertung.designer.cs">
<DependentUpon>Finanzauswertung.cs</DependentUpon>
</Compile>
<Compile Include="Import\CustomDataImporter.cs" />
<Compile Include="InvoiceCustomerReport.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -62,19 +62,19 @@ namespace MuenchenerAidsHilfeEV.Invoicing
IList <InvoiceItem> ergebnis = new List<InvoiceItem>();
var customer = scap.CostBearer2SupportConcept.SupportConcept.Customer;
// Alle Abwesenheiten raussuchen, die länger als 31 Tage gehen. Abwesenheiten werden normal mit abgerechnet bis zum 31. Tag.
// Alle Abwesenheiten raussuchen, die länger als 30 Tage gehen. Abwesenheiten werden normal mit abgerechnet bis zum 30. Tag.
// Ab dann wird erst wieder abgerechnet, wenn der Klient wieder da ist, inkl. des letzten Abwesenheitstages.
// Das gilt nur, wenn es für den Abwesenheitszeitraum keinen Pauschalbetrag in der Bewilligung gibt. Dieser wird nämlich ein paar
// Monate später eingetragen, wenn mit dem KT ein Preis verhandelt wurde. Der wird dann als neue Bewilligung Pauschal eingetragen
// und abgerechnet.
List<AbsenceTime> laengerAls31 = new List<AbsenceTime>();
List<AbsenceTime> laengerAls30 = new List<AbsenceTime>();
if (customer.AbsenceTimes != null)
{
laengerAls31 = customer.AbsenceTimes
.Where(at => at.Start.HasValue && at.End.HasValue && ((at.End - at.Start).Value.TotalDays + 1 > 31)).ToList();
laengerAls30 = customer.AbsenceTimes
.Where(at => at.Start.HasValue && at.End.HasValue && ((at.End - at.Start).Value.TotalDays + 1 > 30)).ToList();
// Abwesenheit künstlich um 1 tag verkürzen, da der letzte Abwesenheitstag wieder als anwesend gilt
//foreach (var item in laengerAls31)
//foreach (var item in laengerAls30)
// item.End = item.End.Value.AddDays(-1);
}
@@ -91,8 +91,8 @@ namespace MuenchenerAidsHilfeEV.Invoicing
}
// Wenn eine Abwesenheit den aktuellen Tag enthält prüfen, ob er schon > 31 ist und wenn nein, ob es eine pauschale Bewilligung gibt
var abs = laengerAls31.FirstOrDefault(l => l.AbsenceSpan.ContainsDate(start));
// Wenn eine Abwesenheit den aktuellen Tag enthält prüfen, ob er schon > 30 ist und wenn nein, ob es eine pauschale Bewilligung gibt
var abs = laengerAls30.FirstOrDefault(l => l.AbsenceSpan.ContainsDate(start));
bool abrechenbar = true;
bool alsAbwesendAbrechnen = false;
if (abs != null)
@@ -101,13 +101,13 @@ namespace MuenchenerAidsHilfeEV.Invoicing
int tage = 1;
while (absStart < abs.End)
{
if (absStart.Day == 30 && absStart.Month == 5)
if (absStart.Day == 1 && absStart.Month == 5)
{
}
// Wenn der abzurechnende Tag nach dem 31. einer Abwesenheit liegt prüfen, ob er abgerechnet werden soll oder nicht
if (absStart.Date == start.Date && tage > 31 || scap.ApprovedFixedAmount != null)
// Wenn der abzurechnende Tag nach dem 30. einer Abwesenheit liegt prüfen, ob er abgerechnet werden soll oder nicht
if (absStart.Date == start.Date && tage > 30 || scap.ApprovedFixedAmount != null)
{
alsAbwesendAbrechnen = true;
// Wenn eine Bewilligung mit Tagessatz speziell für die Abwesenheit existiert, prüfen ob der Betrag > 0 ist

View File

@@ -61,6 +61,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="CustomReportCreator.cs" />
<Compile Include="Service\CustomAccountingService.cs" />
<Compile Include="UeberUnterbelegungReport.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -0,0 +1,294 @@
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MuenchenerAidsHilfeEV.Service
{
public class CustomAccountingService : AccountingService
{
protected override List<ServiceInvoiceDC> ErstelleNeueRechnungen(List<DifferenzRechnungCheck> differenzRechnungChecks)
{
var rechnungen = new List<ServiceInvoiceDC>();
foreach (var item in differenzRechnungChecks)
{
if (item.VorhandeneRechungen.Count == 0 || !item.VorhandeneRechungen.Any(r => item.NeueRechnung.InvoiceBase.CustomerLastName == r.InvoiceBase.CustomerLastName &&
item.NeueRechnung.InvoiceBase.CustomerFirstName == r.InvoiceBase.CustomerFirstName))
{
item.NeueRechnung.InvoiceBase.NeuErstellen = true;
rechnungen.Add(item.NeueRechnung);
}
else
{
var diffRechnung = ErstelleDifferenzRechnung(item);
if (diffRechnung != null)
{
diffRechnung.InvoiceBase.NeuErstellen = false;
rechnungen.Add(diffRechnung);
}
}
}
return rechnungen;
}
protected override ServiceInvoiceDC ErstelleDifferenzRechnung(DifferenzRechnungCheck item)
{
ServiceInvoiceDC diffRechnung = null;
//var alterBetrag = item.VorhandeneRechungen.Sum(i => i.ClaimSum ?? 0);
var letzteRg = item.VorhandeneRechungen.OrderByDescending(r => r.ServiceInvoiceOid).FirstOrDefault();
letzteRg = item.VorhandeneRechungen.FirstOrDefault(r => item.NeueRechnung.InvoiceBase.CustomerOid == r.InvoiceBase.CustomerOid);
if (letzteRg != null)
{
if (item.NeueRechnung.ClaimSum == letzteRg.ClaimSum)
{
diffRechnung = item.NeueRechnung;
diffRechnung.InvoiceBase.NeuErstellen = false;
diffRechnung.InvoiceBase.Hinweise = String.Format("Rechnung wurde bereits erstellt");
}
else
{
diffRechnung = new ServiceInvoiceDC();
diffRechnung.OriginalZurDifferenz = item.NeueRechnung;
diffRechnung.InvoiceBase = new InvoiceBaseDC();
CopyInvoiceBaseDC(item.NeueRechnung.InvoiceBase, diffRechnung);
ServiceInvoice counterInvoice = new ServiceInvoice();
var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(letzteRg.InvoiceBase.InvoiceBaseOid.Value);
CopyServiceInvoice(serviceInvoice, counterInvoice);
SetzeStornoInfos(counterInvoice);
SetzeRechnungspositionenServiceInvoice(diffRechnung, counterInvoice, item);
diffRechnung.InvoiceBase.NeuErstellen = true;
diffRechnung.InvoiceBase.Hinweise = String.Format("Rechnungsdifferenz zu Rechnung {0} in Höhe von {1:c}", letzteRg.InvoiceBase.InvoiceNumber, letzteRg.InvoiceBase.TotalAmount.Value);
}
}
return diffRechnung;
}
// Standard, aber in der Basis private und dahar musste es hier mit rein da ich sonst nicht nicht SetzeRechnungspositionenServiceInvoice überschreiben konnte
private void CopyServiceInvoice(ServiceInvoice existingInvoice, ServiceInvoice copyInvoice)
{
copyInvoice.AmountAdvancePayments = existingInvoice.AmountAdvancePayments;
copyInvoice.AmountEquityContribution = existingInvoice.AmountEquityContribution;
copyInvoice.ServiceUnitOid = existingInvoice.ServiceUnitOid;
CopyInvoiceBase(existingInvoice.InvoiceBase, copyInvoice.InvoiceBase);
foreach (var sip in existingInvoice.ServiceInvoicePeriodList)
{
var copySip = new ServiceInvoicePeriod();
copyInvoice.ServiceInvoicePeriodList.Add(copySip);
CopyServiceInvoicePeriod(sip, copySip);
}
}
// Standard, aber in der Basis private und dahar musste es hier mit rein da ich sonst nicht nicht SetzeRechnungspositionenServiceInvoice überschreiben konnte
private void CopyInvoiceBase(InvoiceBase existing, InvoiceBase copy)
{
copy.AccountingPeriodEnd = existing.AccountingPeriodEnd;
copy.AccountingPeriodStart = existing.AccountingPeriodStart;
copy.CostBearer2SupportConcept = existing.CostBearer2SupportConcept;
copy.CreatorFirstName = existing.CreatorFirstName;
copy.CreatorLastName = existing.CreatorLastName;
copy.CustomerReferenceNumber = existing.CustomerReferenceNumber;
copy.DueDate = existing.DueDate;
copy.DunningLetterCount = existing.DunningLetterCount;
copy.InvoiceDate = existing.InvoiceDate;
copy.InvoiceId = existing.InvoiceId;
copy.InvoiceNumber = existing.InvoiceNumber;
copy.InvoiceTitle = existing.InvoiceTitle;
copy.InvoiceTypeText = existing.InvoiceTypeText;
copy.IsPaid = existing.IsPaid;
copy.IsPrinted = existing.IsPrinted;
copy.RecipientCostBearerOid = existing.RecipientCostBearerOid;
copy.RecipientCustomerOid = existing.RecipientCustomerOid;
copy.RecipientDivision = existing.RecipientDivision;
copy.RecipientOrganisation = existing.RecipientOrganisation;
copy.RecipientOrganisationOid = existing.RecipientOrganisationOid;
copy.RecipientPersonFirstName = existing.RecipientPersonFirstName;
copy.RecipientPersonLastName = existing.RecipientPersonLastName;
copy.RecipientPersonOid = existing.RecipientPersonOid;
copy.SenderDivision = existing.SenderDivision;
copy.SenderFirstName = existing.SenderFirstName;
copy.SenderLastName = existing.SenderLastName;
copy.SenderOrganisation = existing.SenderOrganisation;
copy.SupportConceptOid = existing.SupportConceptOid;
copy.Type = existing.Type;
copy.XMLData = existing.XMLData;
foreach (var ii in existing.InvoiceItems)
{
var copyItem = new InvoiceItem();
copy.InvoiceItems.Add(copyItem);
CopyInvoiceItem(ii, copyItem);
}
if (existing.RecipientAddress != null)
{
copy.RecipientAddress = CreateCopyAddress(existing.RecipientAddress);
}
if (existing.RecipientContacts != null)
{
copy.RecipientContacts = new List<Contact>();
foreach (var existingContact in existing.RecipientContacts)
{
copy.RecipientContacts.Add(CreateCopyContact(existingContact));
}
}
if (existing.SenderAddress != null)
{
copy.SenderAddress = existing.SenderAddress;
}
if (existing.SenderContacts != null)
{
copy.SenderContacts = new List<Contact>();
foreach (var existingContact in existing.SenderContacts)
{
copy.SenderContacts.Add(CreateCopyContact(existingContact));
}
}
}
// Standard, aber in der Basis private und dahar musste es hier mit rein da ich sonst nicht nicht SetzeRechnungspositionenServiceInvoice überschreiben konnte
private void CopyInvoiceItem(InvoiceItem existingItem, InvoiceItem copyItem)
{
copyItem.AccountingInterval = existingItem.AccountingInterval;
copyItem.AmountPerUnit = existingItem.AmountPerUnit;
copyItem.AmountTotal = existingItem.AmountTotal;
copyItem.ApprovalUnit = existingItem.AccountingInterval;
copyItem.ApprovedPerUnit = existingItem.ApprovedPerUnit;
copyItem.GrossAmountTotal = existingItem.GrossAmountTotal;
copyItem.ItemDescription = existingItem.ItemDescription;
copyItem.ItemPeriodEnd = existingItem.ItemPeriodEnd;
copyItem.ItemPeriodStart = existingItem.ItemPeriodStart;
copyItem.MaxApprovedAmount = existingItem.MaxApprovedAmount;
copyItem.MaxApprovedUnitCount = existingItem.MaxApprovedUnitCount;
copyItem.RateFactor = existingItem.RateFactor;
copyItem.ReceivedAmount = existingItem.ReceivedAmount;
copyItem.SupportConceptApprovalPeriodOid = existingItem.SupportConceptApprovalPeriodOid;
copyItem.UnitCount = existingItem.UnitCount;
copyItem.UnitDescription = existingItem.UnitDescription;
copyItem.Notice = existingItem.Notice;
copyItem.ServiceRecord = existingItem.ServiceRecord;
}
// Standard, aber in der Basis private und dahar musste es hier mit rein da ich sonst nicht nicht SetzeRechnungspositionenServiceInvoice überschreiben konnte
private Address CreateCopyAddress(Address address)
{
Address newAddress = new Address();
newAddress.AddressLine1 = address.AddressLine1;
newAddress.AddressLine2 = address.AddressLine2;
newAddress.Country = address.Country;
newAddress.PostalCode = address.PostalCode;
newAddress.State = address.State;
newAddress.Street = address.Street;
newAddress.Town = address.Town;
return newAddress;
}
// Standard, aber in der Basis private und dahar musste es hier mit rein da ich sonst nicht nicht SetzeRechnungspositionenServiceInvoice überschreiben konnte
private Contact CreateCopyContact(Contact existingContact)
{
Contact newContact = new Contact();
newContact.Value = existingContact.Value;
newContact.Type = existingContact.Type;
return newContact;
}
private void SetzeRechnungspositionenServiceInvoice(ServiceInvoiceDC diffRechnung, ServiceInvoice counterInvoice, DifferenzRechnungCheck item)
{
var siDCAlt = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(counterInvoice);
if (siDCAlt.ServiceInvoicePeriods != null && siDCAlt.ServiceInvoicePeriods.Count > 0)
{
diffRechnung.ServiceInvoicePeriods = siDCAlt.ServiceInvoicePeriods;
}
if (item.NeueRechnung.ServiceInvoicePeriods != null && item.NeueRechnung.ServiceInvoicePeriods.Count > 0)
{
if (diffRechnung.ServiceInvoicePeriods == null)
{
diffRechnung.ServiceInvoicePeriods = item.NeueRechnung.ServiceInvoicePeriods;
}
else
{
foreach (var NewSip in item.NeueRechnung.ServiceInvoicePeriods)
{
if (NewSip.InvoiceItems != null && NewSip.InvoiceItems.Count > 0)
{
if (NewSip.Customer != null && diffRechnung.ServiceInvoicePeriods.Any(s => s.Customer.CustomerOid == NewSip.Customer.CustomerOid) &&
NewSip.SupportConceptApprovalPeriod != null && NewSip.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.HasValue
&& diffRechnung.ServiceInvoicePeriods.Any(s => s.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.HasValue
&& s.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value == NewSip.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value))
{
var ip = diffRechnung.ServiceInvoicePeriods.Where(s => s.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value == NewSip.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value).First();
if (ip.InvoiceItems != null && ip.InvoiceItems.Count > 0)
{
ip.Claim += NewSip.Claim;
foreach (var ii in NewSip.InvoiceItems)
{
ip.InvoiceItems.Add(ii);
}
// Bei Rechnungspositionen mit negativem Betrag auf alte Rechnung verweisen
foreach (var iitem in ip.InvoiceItems)
{
if (iitem.AmountTotal < 0)
{
var vorhandeneRechnung = item.VorhandeneRechungen.FirstOrDefault(r => r.InvoiceBase != null && r.InvoiceBase.CustomerOid == ip.Customer.CustomerOid);
if (vorhandeneRechnung != null)
iitem.ItemDescription += string.Format(" (am {0:dd.MM.yyyy} in Rechnung {1} berechnet)", vorhandeneRechnung.InvoiceBase.InvoiceDate, vorhandeneRechnung.InvoiceBase.InvoiceNumber);
}
}
}
}
else
{
diffRechnung.ServiceInvoicePeriods.Add(NewSip);
}
}
}
}
}
}
// Standard, aber in der Basis private und dahar musste es hier mit rein da ich sonst nicht nicht SetzeRechnungspositionenServiceInvoice überschreiben konnte
private void CopyServiceInvoicePeriod(ServiceInvoicePeriod existingSip, ServiceInvoicePeriod copySip)
{
copySip.AccountingInterval = existingSip.AccountingInterval;
copySip.ApprovedAmountDefaultHourlyRate = existingSip.ApprovedAmountDefaultHourlyRate;
copySip.ApprovedBE = existingSip.ApprovedBE;
copySip.ApprovedFixedAmount = existingSip.ApprovedFixedAmount;
copySip.ApprovedHours = existingSip.ApprovedHours;
copySip.Claim = existingSip.Claim;
copySip.End = existingSip.End;
copySip.HoursNotBillableAbsence = existingSip.HoursNotBillableAbsence;
copySip.HoursNotBillableNotApproved = existingSip.HoursNotBillableNotApproved;
copySip.ServiceUnitName = existingSip.ServiceUnitName;
copySip.Start = existingSip.Start;
copySip.Notice = existingSip.Notice;
copySip.Customer = existingSip.Customer;
copySip.SupportConceptApprovalPeriod = existingSip.SupportConceptApprovalPeriod;
foreach (var ii in existingSip.InvoiceItemList)
{
var copyItem = new InvoiceItem();
copySip.InvoiceItemList.Add(copyItem);
CopyInvoiceItem(ii, copyItem);
}
}
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
namespace SbbMainzReports.Invoicing
{
public class CustomInvoiceCreation : InvoiceCreation
{
public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List<ServiceRecordDC> serviceRecords)
{
// auch nicht bewilligte abrechnen
if (!supportConcept.IsDeleted && !supportConcept.IsArchived)
{
var invoice = new ServiceInvoice();
var supportConceptList = new List<CompactSupportConceptDC> { supportConcept };
SetSenderInformation(invoice);
SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList);
SetSingleInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConcept);
SetRecipientInformation(invoice, costBearer);
SetServiceInvoicePeriods(invoice, invoice.InvoiceBase.CostBearer2SupportConcept, invoicePeriod, serviceRecords);
SetServiceInvoicePeriodAmounts(invoice);
SetAmountAdvancePayments(invoice);
SetAmountEquityContribution(invoice);
return invoice;
}
return null;
}
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, BS.Shared.Services.Calculations calc)
{
var ii = base.CreateInvoiceItem(iServiceRecord, scap, calc);
ii.ItemDescription = iServiceRecord.ServiceDescription.CategoryName;
return ii;
}
public override void CreateFixedAmounts(ServiceInvoicePeriod serviceInvoicePeriod, SupportConceptApprovalPeriodDC supportConceptApprovalPeriod, CostBearer2SupportConcept cb2sc)
{
base.CreateFixedAmounts(serviceInvoicePeriod, supportConceptApprovalPeriod, cb2sc);
if (supportConceptApprovalPeriod.ServiceCategory != null
&& serviceInvoicePeriod.InvoiceItemList != null && serviceInvoicePeriod.InvoiceItemList.Count > 0)
{
foreach (var ii in serviceInvoicePeriod.InvoiceItemList)
{
ii.ItemDescription = supportConceptApprovalPeriod.ServiceCategory.Name;
}
}
}
public override void CheckMaxApprovedAmount(ServiceInvoice invoice, ServiceInvoicePeriod sip, SupportConceptApprovalPeriodDC scap, CostBearer2SupportConcept costBearer2SupportConcept, DateTimeSpan invoicePeriod, List<ServiceRecordDC> serviceRecords)
{
// do nothing
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using BeWo.Data.Entities;
using BeWo.Service.Invoicing;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
namespace SbbMainzReports.Invoicing
{
public class CustomInvoiceFactory : InvoiceFactory
{
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
{
return new CustomInvoiceCreation();
}
}
}

View File

@@ -1,116 +1,116 @@
using System;
using System.Collections;
using System.ComponentModel;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Collections.Generic;
using System.Drawing;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.SBBMainzReports.Calculations;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Services;
using DevExpress.XtraPrinting;
using BS.Shared.DataContracts;
using System.Text;
using System.Linq;
namespace SBBMainzReports
{
public partial class QuittierungsbelegJaMainz : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public QuittierungsbelegJaMainz()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
xrCheckBox1.Visible = false;
xrCheckBox2.Visible = false;
xrCheckBox3.Visible = false;
xrCheckBox4.Visible = false;
decimal anteilBetreuungsstundenProzent = 100;
decimal anteilOverheadProzent = 0;
double TotalMin = 0.00;
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
CreateGoalList(s);
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(s.ServiceRecordOid);
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
s.ServiceCategory = "";
if (s.IsBillable)
{
TotalMin += s.Minutes/60;
}
}
}
SetKopfbereich(pRO);
pRO.ApprovedFLSPerMonth = pRO.ApprovedFLSPerWeek * 4.33m;
DateTime start = pRO.StartDate;
DateTime end = pRO.EndDate;
var hp = GetCurrentC2S(pRO);
if (hp != null)
{
if (hp.StartDate > start)
start = hp.StartDate.Value;
if (hp.EndDate < end)
end = hp.EndDate.Value;
}
decimal days = (decimal)end.Subtract(start).TotalDays + 1;
pRO.ApprovedFLSPerMonth *= days / DateTime.DaysInMonth(pRO.StartDate.Year, pRO.StartDate.Month);
decimal gesamt = (decimal)TotalMin;
decimal mehrMinusStunden = gesamt - pRO.ApprovedFLSPerMonth;
decimal uebertragVormonat = BerechneUebertragVormonat(pRO, anteilBetreuungsstundenProzent, anteilOverheadProzent);
bool uebertrag = MussUebertragBerechnen(pRO);
cellMehrMinusStunden.Text = String.Format("{0:0.000}", mehrMinusStunden);
cellUebertragVormonat.Text = String.Format("{0:0.000}", uebertragVormonat);
if (uebertrag)
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", mehrMinusStunden + uebertragVormonat);
else
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", 0);
// cellWoechentlichKlientenbezogen.Text = String.Format("{0:0.00}", (pRO.ApprovedFLSPerMonth - uebertragVormonat) * 0.7m / 4.33m);
// cellMonatlichKlientenbezogen.Text = String.Format("{0:0.00}", pRO.ApprovedFLSPerMonth * 0.7m);
cellBetreuungstunden.Text = String.Format("{0:0.##}% Betreuungsstunden", anteilBetreuungsstundenProzent);
var minutes = (decimal)Math.Round(pRO.TotalFLMBillable / 60, 3, MidpointRounding.AwayFromZero);
var pausch = Math.Round(((decimal)pRO.TotalFLMBillable / anteilBetreuungsstundenProzent * anteilOverheadProzent) / 60, 3, MidpointRounding.AwayFromZero);
cellMinutes.Text = String.Format("{0:0.000}", minutes);
this.bindingSource1.DataSource = pRO;
}
private CostBearer2SupportConcept GetCurrentC2S(ServicesOverviewRO ro)
{
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0)
{
foreach (var c2sc in ro.CostBearer2SupportConceptList)
{
var cbName = c2sc.CostBearer.Organisation.Name;
if ((cbName.ToLower().Contains("jugendamt der landeshauptstadt mainz") ||
cbName.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
using System;
using System.Collections;
using System.ComponentModel;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Collections.Generic;
using System.Drawing;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.SBBMainzReports.Calculations;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Services;
using DevExpress.XtraPrinting;
using BS.Shared.DataContracts;
using System.Text;
using System.Linq;
namespace SBBMainzReports
{
public partial class QuittierungsbelegJaMainz : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public QuittierungsbelegJaMainz()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
xrCheckBox1.Visible = false;
xrCheckBox2.Visible = false;
xrCheckBox3.Visible = false;
xrCheckBox4.Visible = false;
decimal anteilBetreuungsstundenProzent = 100;
decimal anteilOverheadProzent = 0;
double TotalMin = 0.00;
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
CreateGoalList(s);
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(s.ServiceRecordOid);
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
s.ServiceCategory = "";
if (s.IsBillable)
{
TotalMin += s.Minutes/60;
}
}
}
SetKopfbereich(pRO);
pRO.ApprovedFLSPerMonth = pRO.ApprovedFLSPerWeek * 4.33m;
DateTime start = pRO.StartDate;
DateTime end = pRO.EndDate;
var hp = GetCurrentC2S(pRO);
if (hp != null)
{
if (hp.StartDate > start)
start = hp.StartDate.Value;
if (hp.EndDate < end)
end = hp.EndDate.Value;
}
decimal days = (decimal)end.Subtract(start).TotalDays + 1;
pRO.ApprovedFLSPerMonth *= days / DateTime.DaysInMonth(pRO.StartDate.Year, pRO.StartDate.Month);
decimal gesamt = (decimal)TotalMin;
decimal mehrMinusStunden = gesamt - pRO.ApprovedFLSPerMonth;
decimal uebertragVormonat = BerechneUebertragVormonat(pRO, anteilBetreuungsstundenProzent, anteilOverheadProzent);
bool uebertrag = MussUebertragBerechnen(pRO);
cellMehrMinusStunden.Text = String.Format("{0:0.000}", mehrMinusStunden);
cellUebertragVormonat.Text = String.Format("{0:0.000}", uebertragVormonat);
if (uebertrag)
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", mehrMinusStunden + uebertragVormonat);
else
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", 0);
// cellWoechentlichKlientenbezogen.Text = String.Format("{0:0.00}", (pRO.ApprovedFLSPerMonth - uebertragVormonat) * 0.7m / 4.33m);
// cellMonatlichKlientenbezogen.Text = String.Format("{0:0.00}", pRO.ApprovedFLSPerMonth * 0.7m);
cellBetreuungstunden.Text = String.Format("{0:0.##}% Betreuungsstunden", anteilBetreuungsstundenProzent);
var minutes = (decimal)Math.Round(pRO.TotalFLMBillable / 60, 3, MidpointRounding.AwayFromZero);
var pausch = Math.Round(((decimal)pRO.TotalFLMBillable / anteilBetreuungsstundenProzent * anteilOverheadProzent) / 60, 3, MidpointRounding.AwayFromZero);
cellMinutes.Text = String.Format("{0:0.000}", minutes);
this.bindingSource1.DataSource = pRO;
}
private CostBearer2SupportConcept GetCurrentC2S(ServicesOverviewRO ro)
{
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0)
{
foreach (var c2sc in ro.CostBearer2SupportConceptList)
{
var cbName = c2sc.CostBearer.Organisation.Name;
if ((cbName.ToLower().Contains("jugendamt der landeshauptstadt mainz") || ro.Costbearer.ToLower().Contains("jugend und familie mainz amt 51") ||
cbName.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
&& c2sc.StartDate <= ro.StartDate && c2sc.EndDate >= ro.StartDate)
{
if (cbName.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
@@ -118,292 +118,292 @@ namespace SBBMainzReports
lblReceiver.Text = "Landeshauptstadt Wiesbaden";
}
return c2sc;
}
}
}
return null;
}
private void SetKopfbereich(ServicesOverviewRO pRO)
{
String betreuer1 = "";
long betreuer1EOid = 0;
String betreuer2 = "";
long betreuer2EOid = 0;
int i = 0;
var c2s = GetCurrentC2S(pRO);
if (c2s != null)
{
SupportConceptApprovalPeriod2Employee p2e;
foreach (var rating in c2s.SupportConcept.Ratings)
{
if (rating.StartDate >= pRO.StartDate && rating.StartDate < pRO.EndDate.AddDays(1))
{
foreach (var item in rating.GoalRatingList)
{
ValueListEntry entry = null;
string ratingName = null;
string ratingErgebnis = null;
if (item.ValueListEntryOid != null)
entry = DAOFactory.GenericDAO.LoadByID<ValueListEntry>(item.ValueListEntryOid.Value);
if (entry != null)
ratingName = entry.Value;
if (item.RatingType != null)
ratingErgebnis = item.RatingType.DisplayName;
switch (i)
{
case 0:
lblZiel1.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox1.Checked = true;
xrCheckBox1.Visible = true;
}
else
lblBewertung1.Text = ratingErgebnis; break;
case 1:
lblZiel2.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox2.Checked = true;
xrCheckBox2.Visible = true;
}
else
lblBewertung2.Text = ratingErgebnis; break;
case 2:
lblZiel3.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox3.Checked = true;
xrCheckBox3.Visible = true;
}
else
lblBewertung3.Text = ratingErgebnis; break;
case 3:
lblZiel4.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox4.Checked = true;
xrCheckBox4.Visible = true;
}
else
lblBewertung4.Text = ratingErgebnis; break;
}
i++;
}
}
}
foreach (var scap in c2s.ApprovalPeriodList)
{
if (scap.SupportConceptApprovalPeriod2Employee != null)
{
var sortedScs = scap.SupportConceptApprovalPeriod2Employee.OrderByDescending(s => s.Betreuungsschluessel).ToList();
if (sortedScs.Count > 0)
{
p2e = sortedScs[0];
betreuer1 = p2e.Employee.Person.FirstNameLastName;
betreuer1EOid = (long)p2e.Employee.Oid;
}
if (sortedScs.Count > 1)
{
p2e = sortedScs[1];
betreuer2 = p2e.Employee.Person.FirstNameLastName;
betreuer2EOid = (long)p2e.Employee.Oid;
}
}
}
lblBetreuer1.Text = betreuer1;
lblBetreuer2.Text = betreuer2;
String qualifikation1 = "";
String qualifikation2 = "";
if (betreuer1EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer1EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation1 = valueEntry.Entry.Value.ToString();
}
}
if (betreuer2EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer2EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation2 = valueEntry.Entry.Value.ToString();
}
}
lblQualifikation1.Text = qualifikation1;
lblQualifikation2.Text = qualifikation2;
if (c2s.CostBearerContactPerson != null)
{
if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Female)
lblAnsprechpartner.Text = "Frau ";
else if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Male)
lblAnsprechpartner.Text = "Herr ";
lblAnsprechpartner.Text += c2s.CostBearerContactPerson.LastName;
}
}
}
private decimal BerechneUebertragVormonat(ServicesOverviewRO pRO, decimal anteilBetreuungsstundenProzent, decimal anteilOverheadProzent)
{
var calc = new SBBMainzCalculations();
decimal uebertrag = 0;
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
IList<ServiceRecord> allServiceRecords = c2s.ServiceRecords;
decimal flmSoll = 0;
DateTime start = c2s.StartDate.Value;
int months = 0;
while (start < pRO.StartDate)
{
var dc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c2s);
var approvedPerWeek = calc.GetApprovedHoursPerWeek(dc, start, false) ?? 0;
decimal soll = approvedPerWeek * 4.33m;
if (start.Day != 1)
{
DateTime end = new DateTime(start.AddMonths(1).Year, start.AddMonths(1).Month, 1);
decimal days = (decimal)end.Subtract(start).TotalDays;
soll *= days / DateTime.DaysInMonth(start.Year, start.Month);
}
flmSoll += soll;
decimal ist = GetIstImMonat(allServiceRecords, start);
ist += ist / anteilBetreuungsstundenProzent * anteilOverheadProzent;
ist /= 60;
var uebertragMonat = ist - soll;
uebertrag += uebertragMonat;
start = start.AddMonths(1);
start = new DateTime(start.Year, start.Month, 1);
months++;
var mod = months % 3;
if (mod == 0)
uebertrag = 0;
}
}
return uebertrag;
}
private decimal GetIstImMonat(IList<ServiceRecord> allServiceRecords, DateTime start)
{
DateTime monatEnd = start.AddMonths(1);
monatEnd = new DateTime(monatEnd.Year, monatEnd.Month, 1);
decimal ist = 0;
Dictionary<long, bool> groupBookingDict = new Dictionary<long, bool>();
foreach (var item in allServiceRecords)
{
if (!item.GroupOid.HasValue || !groupBookingDict.ContainsKey(item.GroupOid.Value))
{
if (item.Start != null)
{
if (item.Start >= start && item.Start.Value < monatEnd)
{
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null && item.ServiceDescription.ServiceCategory.IsBillable)
{
var p = item.ServiceDescription.ServiceCategory.ProzentAbrechnung;
if (item.ServiceDescription.ProzentAbrechnung.HasValue)
{
p = item.ServiceDescription.ProzentAbrechnung.Value;
}
ist += (item.RoundedDuration * p) / 100;
if (item.GroupOid.HasValue)
groupBookingDict.Add(item.GroupOid.Value, true);
}
}
}
}
}
return ist;
}
private bool MussUebertragBerechnen(ServicesOverviewRO pRO)
{
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
int months = 0;
DateTime start = c2s.StartDate.Value;
while (start < pRO.EndDate)
{
months++;
start = start.AddMonths(1);
}
var mod = months % 3;
if (mod == 0)
return false;
}
return true;
}
public static void CreateGoalList(ServicesOverviewRO.ServiceDetail sd)
{
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(sd.ServiceRecordOid);
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
sd.GoalList = String.Empty;
if (srDc.Goals != null && srDc.Goals.Count > 0)
{
foreach (var goal in srDc.Goals)
{
// Ohne diese Abfrage wird das selbe Ziel so oft eingefügt wie die Anzahl der Gruppenmitglieder ist
if (sd.CustomerCount > 1 && !string.IsNullOrEmpty(goal.TypeDescription) && sd.GoalList.Contains(goal.TypeDescription))
continue;
if (sd.GoalList.Length > 0)
{
sd.GoalList += ", ";
}
if (!string.IsNullOrEmpty(goal.Abbreviation))
{
sd.GoalList += goal.Abbreviation;
}
//else // Das wird sonst tot hässlich
//{
// sd.GoalList += goal.TypeDescription;
//}
}
}
}
}
}
}
}
}
return null;
}
private void SetKopfbereich(ServicesOverviewRO pRO)
{
String betreuer1 = "";
long betreuer1EOid = 0;
String betreuer2 = "";
long betreuer2EOid = 0;
int i = 0;
var c2s = GetCurrentC2S(pRO);
if (c2s != null)
{
SupportConceptApprovalPeriod2Employee p2e;
foreach (var rating in c2s.SupportConcept.Ratings)
{
if (rating.StartDate >= pRO.StartDate && rating.StartDate < pRO.EndDate.AddDays(1))
{
foreach (var item in rating.GoalRatingList)
{
ValueListEntry entry = null;
string ratingName = null;
string ratingErgebnis = null;
if (item.ValueListEntryOid != null)
entry = DAOFactory.GenericDAO.LoadByID<ValueListEntry>(item.ValueListEntryOid.Value);
if (entry != null)
ratingName = entry.Value;
if (item.RatingType != null)
ratingErgebnis = item.RatingType.DisplayName;
switch (i)
{
case 0:
lblZiel1.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox1.Checked = true;
xrCheckBox1.Visible = true;
}
else
lblBewertung1.Text = ratingErgebnis; break;
case 1:
lblZiel2.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox2.Checked = true;
xrCheckBox2.Visible = true;
}
else
lblBewertung2.Text = ratingErgebnis; break;
case 2:
lblZiel3.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox3.Checked = true;
xrCheckBox3.Visible = true;
}
else
lblBewertung3.Text = ratingErgebnis; break;
case 3:
lblZiel4.Text = ratingName;
if (ratingErgebnis != null && ratingErgebnis.ToLower() == "erledigt")
{
xrCheckBox4.Checked = true;
xrCheckBox4.Visible = true;
}
else
lblBewertung4.Text = ratingErgebnis; break;
}
i++;
}
}
}
foreach (var scap in c2s.ApprovalPeriodList)
{
if (scap.SupportConceptApprovalPeriod2Employee != null)
{
var sortedScs = scap.SupportConceptApprovalPeriod2Employee.OrderByDescending(s => s.Betreuungsschluessel).ToList();
if (sortedScs.Count > 0)
{
p2e = sortedScs[0];
betreuer1 = p2e.Employee.Person.FirstNameLastName;
betreuer1EOid = (long)p2e.Employee.Oid;
}
if (sortedScs.Count > 1)
{
p2e = sortedScs[1];
betreuer2 = p2e.Employee.Person.FirstNameLastName;
betreuer2EOid = (long)p2e.Employee.Oid;
}
}
}
lblBetreuer1.Text = betreuer1;
lblBetreuer2.Text = betreuer2;
String qualifikation1 = "";
String qualifikation2 = "";
if (betreuer1EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer1EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation1 = valueEntry.Entry.Value.ToString();
}
}
if (betreuer2EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer2EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation2 = valueEntry.Entry.Value.ToString();
}
}
lblQualifikation1.Text = qualifikation1;
lblQualifikation2.Text = qualifikation2;
if (c2s.CostBearerContactPerson != null)
{
if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Female)
lblAnsprechpartner.Text = "Frau ";
else if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Male)
lblAnsprechpartner.Text = "Herr ";
lblAnsprechpartner.Text += c2s.CostBearerContactPerson.LastName;
}
}
}
private decimal BerechneUebertragVormonat(ServicesOverviewRO pRO, decimal anteilBetreuungsstundenProzent, decimal anteilOverheadProzent)
{
var calc = new SBBMainzCalculations();
decimal uebertrag = 0;
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
IList<ServiceRecord> allServiceRecords = c2s.ServiceRecords;
decimal flmSoll = 0;
DateTime start = c2s.StartDate.Value;
int months = 0;
while (start < pRO.StartDate)
{
var dc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c2s);
var approvedPerWeek = calc.GetApprovedHoursPerWeek(dc, start, false) ?? 0;
decimal soll = approvedPerWeek * 4.33m;
if (start.Day != 1)
{
DateTime end = new DateTime(start.AddMonths(1).Year, start.AddMonths(1).Month, 1);
decimal days = (decimal)end.Subtract(start).TotalDays;
soll *= days / DateTime.DaysInMonth(start.Year, start.Month);
}
flmSoll += soll;
decimal ist = GetIstImMonat(allServiceRecords, start);
ist += ist / anteilBetreuungsstundenProzent * anteilOverheadProzent;
ist /= 60;
var uebertragMonat = ist - soll;
uebertrag += uebertragMonat;
start = start.AddMonths(1);
start = new DateTime(start.Year, start.Month, 1);
months++;
var mod = months % 3;
if (mod == 0)
uebertrag = 0;
}
}
return uebertrag;
}
private decimal GetIstImMonat(IList<ServiceRecord> allServiceRecords, DateTime start)
{
DateTime monatEnd = start.AddMonths(1);
monatEnd = new DateTime(monatEnd.Year, monatEnd.Month, 1);
decimal ist = 0;
Dictionary<long, bool> groupBookingDict = new Dictionary<long, bool>();
foreach (var item in allServiceRecords)
{
if (!item.GroupOid.HasValue || !groupBookingDict.ContainsKey(item.GroupOid.Value))
{
if (item.Start != null)
{
if (item.Start >= start && item.Start.Value < monatEnd)
{
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null && item.ServiceDescription.ServiceCategory.IsBillable)
{
var p = item.ServiceDescription.ServiceCategory.ProzentAbrechnung;
if (item.ServiceDescription.ProzentAbrechnung.HasValue)
{
p = item.ServiceDescription.ProzentAbrechnung.Value;
}
ist += (item.RoundedDuration * p) / 100;
if (item.GroupOid.HasValue)
groupBookingDict.Add(item.GroupOid.Value, true);
}
}
}
}
}
return ist;
}
private bool MussUebertragBerechnen(ServicesOverviewRO pRO)
{
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
int months = 0;
DateTime start = c2s.StartDate.Value;
while (start < pRO.EndDate)
{
months++;
start = start.AddMonths(1);
}
var mod = months % 3;
if (mod == 0)
return false;
}
return true;
}
public static void CreateGoalList(ServicesOverviewRO.ServiceDetail sd)
{
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(sd.ServiceRecordOid);
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
sd.GoalList = String.Empty;
if (srDc.Goals != null && srDc.Goals.Count > 0)
{
foreach (var goal in srDc.Goals)
{
// Ohne diese Abfrage wird das selbe Ziel so oft eingefügt wie die Anzahl der Gruppenmitglieder ist
if (sd.CustomerCount > 1 && !string.IsNullOrEmpty(goal.TypeDescription) && sd.GoalList.Contains(goal.TypeDescription))
continue;
if (sd.GoalList.Length > 0)
{
sd.GoalList += ", ";
}
if (!string.IsNullOrEmpty(goal.Abbreviation))
{
sd.GoalList += goal.Abbreviation;
}
//else // Das wird sonst tot hässlich
//{
// sd.GoalList += goal.TypeDescription;
//}
}
}
}
}
}

View File

@@ -1,111 +1,111 @@
using System;
using System.Collections;
using System.ComponentModel;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Collections.Generic;
using System.Drawing;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.SBBMainzReports.Calculations;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Services;
using DevExpress.XtraPrinting;
using BS.Shared.DataContracts;
using System.Text;
using System.Linq;
namespace SBBMainzReports
{
public partial class QuittierungsbelegJaMainzWiJu : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public QuittierungsbelegJaMainzWiJu()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
decimal anteilBetreuungsstundenProzent = 100;
decimal anteilOverheadProzent = 0;
double TotalMin = 0.00;
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(s.ServiceRecordOid);
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
s.ServiceCategory = "";
if (s.IsBillable)
{
TotalMin += s.Minutes/60;
}
}
}
SetKopfbereich(pRO);
pRO.ApprovedFLSPerMonth = pRO.ApprovedFLSPerWeek * 4.33m;
DateTime start = pRO.StartDate;
DateTime end = pRO.EndDate;
var hp = GetCurrentC2S(pRO);
if (hp != null)
{
if (hp.StartDate > start)
start = hp.StartDate.Value;
if (hp.EndDate < end)
end = hp.EndDate.Value;
}
decimal days = (decimal)end.Subtract(start).TotalDays + 1;
pRO.ApprovedFLSPerMonth *= days / DateTime.DaysInMonth(pRO.StartDate.Year, pRO.StartDate.Month);
decimal gesamt = (decimal)TotalMin;
decimal mehrMinusStunden = gesamt - pRO.ApprovedFLSPerMonth;
decimal uebertragVormonat = BerechneUebertragVormonat(pRO, anteilBetreuungsstundenProzent, anteilOverheadProzent);
bool uebertrag = MussUebertragBerechnen(pRO);
cellMehrMinusStunden.Text = String.Format("{0:0.000}", mehrMinusStunden);
cellUebertragVormonat.Text = String.Format("{0:0.000}", uebertragVormonat);
if (uebertrag)
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", mehrMinusStunden + uebertragVormonat);
else
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", 0);
// cellWoechentlichKlientenbezogen.Text = String.Format("{0:0.00}", (pRO.ApprovedFLSPerMonth - uebertragVormonat) * 0.7m / 4.33m);
// cellMonatlichKlientenbezogen.Text = String.Format("{0:0.00}", pRO.ApprovedFLSPerMonth * 0.7m);
cellBetreuungstunden.Text = String.Format("{0:0.##}% Betreuungsstunden", anteilBetreuungsstundenProzent);
var minutes = (decimal)Math.Round(pRO.TotalFLMBillable / 60, 3, MidpointRounding.AwayFromZero);
var pausch = Math.Round(((decimal)pRO.TotalFLMBillable / anteilBetreuungsstundenProzent * anteilOverheadProzent) / 60, 3, MidpointRounding.AwayFromZero);
cellMinutes.Text = String.Format("{0:0.000}", minutes);
this.bindingSource1.DataSource = pRO;
}
private CostBearer2SupportConcept GetCurrentC2S(ServicesOverviewRO ro)
{
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0)
{
foreach (var c2sc in ro.CostBearer2SupportConceptList)
{
var cbName = c2sc.CostBearer.Organisation.Name;
if ((cbName.ToLower().Contains("jugendamt der landeshauptstadt mainz") ||
cbName.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
using System;
using System.Collections;
using System.ComponentModel;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Collections.Generic;
using System.Drawing;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.SBBMainzReports.Calculations;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Services;
using DevExpress.XtraPrinting;
using BS.Shared.DataContracts;
using System.Text;
using System.Linq;
namespace SBBMainzReports
{
public partial class QuittierungsbelegJaMainzWiJu : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public QuittierungsbelegJaMainzWiJu()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
decimal anteilBetreuungsstundenProzent = 100;
decimal anteilOverheadProzent = 0;
double TotalMin = 0.00;
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(s.ServiceRecordOid);
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
s.ServiceCategory = "";
if (s.IsBillable)
{
TotalMin += s.Minutes/60;
}
}
}
SetKopfbereich(pRO);
pRO.ApprovedFLSPerMonth = pRO.ApprovedFLSPerWeek * 4.33m;
DateTime start = pRO.StartDate;
DateTime end = pRO.EndDate;
var hp = GetCurrentC2S(pRO);
if (hp != null)
{
if (hp.StartDate > start)
start = hp.StartDate.Value;
if (hp.EndDate < end)
end = hp.EndDate.Value;
}
decimal days = (decimal)end.Subtract(start).TotalDays + 1;
pRO.ApprovedFLSPerMonth *= days / DateTime.DaysInMonth(pRO.StartDate.Year, pRO.StartDate.Month);
decimal gesamt = (decimal)TotalMin;
decimal mehrMinusStunden = gesamt - pRO.ApprovedFLSPerMonth;
decimal uebertragVormonat = BerechneUebertragVormonat(pRO, anteilBetreuungsstundenProzent, anteilOverheadProzent);
bool uebertrag = MussUebertragBerechnen(pRO);
cellMehrMinusStunden.Text = String.Format("{0:0.000}", mehrMinusStunden);
cellUebertragVormonat.Text = String.Format("{0:0.000}", uebertragVormonat);
if (uebertrag)
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", mehrMinusStunden + uebertragVormonat);
else
cellUebertragNaechsterMonat.Text = String.Format("{0:0.000}", 0);
// cellWoechentlichKlientenbezogen.Text = String.Format("{0:0.00}", (pRO.ApprovedFLSPerMonth - uebertragVormonat) * 0.7m / 4.33m);
// cellMonatlichKlientenbezogen.Text = String.Format("{0:0.00}", pRO.ApprovedFLSPerMonth * 0.7m);
cellBetreuungstunden.Text = String.Format("{0:0.##}% Betreuungsstunden", anteilBetreuungsstundenProzent);
var minutes = (decimal)Math.Round(pRO.TotalFLMBillable / 60, 3, MidpointRounding.AwayFromZero);
var pausch = Math.Round(((decimal)pRO.TotalFLMBillable / anteilBetreuungsstundenProzent * anteilOverheadProzent) / 60, 3, MidpointRounding.AwayFromZero);
cellMinutes.Text = String.Format("{0:0.000}", minutes);
this.bindingSource1.DataSource = pRO;
}
private CostBearer2SupportConcept GetCurrentC2S(ServicesOverviewRO ro)
{
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0)
{
foreach (var c2sc in ro.CostBearer2SupportConceptList)
{
var cbName = c2sc.CostBearer.Organisation.Name;
if ((cbName.ToLower().Contains("jugendamt der landeshauptstadt mainz") || ro.Costbearer.ToLower().Contains("jugend und familie mainz amt 51") ||
cbName.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
&& c2sc.StartDate <= ro.StartDate && c2sc.EndDate >= ro.StartDate)
{
if (cbName.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
@@ -113,201 +113,201 @@ namespace SBBMainzReports
lblReceiver.Text = "Landeshauptstadt Wiesbaden";
}
return c2sc;
}
}
}
return null;
}
private void SetKopfbereich(ServicesOverviewRO pRO)
{
String betreuer1 = "";
long betreuer1EOid = 0;
String betreuer2 = "";
long betreuer2EOid = 0;
var c2s = GetCurrentC2S(pRO);
if (c2s != null)
{
SupportConceptApprovalPeriod2Employee p2e;
foreach (var scap in c2s.ApprovalPeriodList)
{
if (scap.SupportConceptApprovalPeriod2Employee != null)
{
var sortedScs = scap.SupportConceptApprovalPeriod2Employee.OrderByDescending(s => s.Betreuungsschluessel).ToList();
if (sortedScs.Count > 0)
{
p2e = sortedScs[0];
betreuer1 = p2e.Employee.Person.FirstNameLastName;
betreuer1EOid = (long)p2e.Employee.Oid;
}
if (sortedScs.Count > 1)
{
p2e = sortedScs[1];
betreuer2 = p2e.Employee.Person.FirstNameLastName;
betreuer2EOid = (long)p2e.Employee.Oid;
}
}
}
lblBetreuer1.Text = betreuer1;
lblBetreuer2.Text = betreuer2;
String qualifikation1 = "";
String qualifikation2 = "";
if (betreuer1EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer1EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation1 = valueEntry.Entry.Value.ToString();
}
}
if (betreuer2EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer2EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation2 = valueEntry.Entry.Value.ToString();
}
}
lblQualifikation1.Text = qualifikation1;
lblQualifikation2.Text = qualifikation2;
if (c2s.CostBearerContactPerson != null)
{
if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Female)
lblAnsprechpartner.Text = "Frau ";
else if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Male)
lblAnsprechpartner.Text = "Herr ";
lblAnsprechpartner.Text += c2s.CostBearerContactPerson.LastName;
}
}
}
private decimal BerechneUebertragVormonat(ServicesOverviewRO pRO, decimal anteilBetreuungsstundenProzent, decimal anteilOverheadProzent)
{
var calc = new SBBMainzCalculations();
decimal uebertrag = 0;
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
IList<ServiceRecord> allServiceRecords = c2s.ServiceRecords;
decimal flmSoll = 0;
DateTime start = c2s.StartDate.Value;
int months = 0;
while (start < pRO.StartDate)
{
var dc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c2s);
var approvedPerWeek = calc.GetApprovedHoursPerWeek(dc, start, false) ?? 0;
decimal soll = approvedPerWeek * 4.33m;
if (start.Day != 1)
{
DateTime end = new DateTime(start.AddMonths(1).Year, start.AddMonths(1).Month, 1);
decimal days = (decimal)end.Subtract(start).TotalDays;
soll *= days / DateTime.DaysInMonth(start.Year, start.Month);
}
flmSoll += soll;
decimal ist = GetIstImMonat(allServiceRecords, start);
ist += ist / anteilBetreuungsstundenProzent * anteilOverheadProzent;
ist /= 60;
var uebertragMonat = ist - soll;
uebertrag += uebertragMonat;
start = start.AddMonths(1);
start = new DateTime(start.Year, start.Month, 1);
months++;
var mod = months % 3;
if (mod == 0)
uebertrag = 0;
}
}
return uebertrag;
}
private decimal GetIstImMonat(IList<ServiceRecord> allServiceRecords, DateTime start)
{
DateTime monatEnd = start.AddMonths(1);
monatEnd = new DateTime(monatEnd.Year, monatEnd.Month, 1);
decimal ist = 0;
Dictionary<long, bool> groupBookingDict = new Dictionary<long, bool>();
foreach (var item in allServiceRecords)
{
if (!item.GroupOid.HasValue || !groupBookingDict.ContainsKey(item.GroupOid.Value))
{
if (item.Start != null)
{
if (item.Start >= start && item.Start.Value < monatEnd)
{
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null && item.ServiceDescription.ServiceCategory.IsBillable)
{
var p = item.ServiceDescription.ServiceCategory.ProzentAbrechnung;
if (item.ServiceDescription.ProzentAbrechnung.HasValue)
{
p = item.ServiceDescription.ProzentAbrechnung.Value;
}
ist += (item.RoundedDuration * p) / 100;
if (item.GroupOid.HasValue)
groupBookingDict.Add(item.GroupOid.Value, true);
}
}
}
}
}
return ist;
}
private bool MussUebertragBerechnen(ServicesOverviewRO pRO)
{
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
int months = 0;
DateTime start = c2s.StartDate.Value;
while (start < pRO.EndDate)
{
months++;
start = start.AddMonths(1);
}
var mod = months % 3;
if (mod == 0)
return false;
}
return true;
}
}
}
}
}
}
return null;
}
private void SetKopfbereich(ServicesOverviewRO pRO)
{
String betreuer1 = "";
long betreuer1EOid = 0;
String betreuer2 = "";
long betreuer2EOid = 0;
var c2s = GetCurrentC2S(pRO);
if (c2s != null)
{
SupportConceptApprovalPeriod2Employee p2e;
foreach (var scap in c2s.ApprovalPeriodList)
{
if (scap.SupportConceptApprovalPeriod2Employee != null)
{
var sortedScs = scap.SupportConceptApprovalPeriod2Employee.OrderByDescending(s => s.Betreuungsschluessel).ToList();
if (sortedScs.Count > 0)
{
p2e = sortedScs[0];
betreuer1 = p2e.Employee.Person.FirstNameLastName;
betreuer1EOid = (long)p2e.Employee.Oid;
}
if (sortedScs.Count > 1)
{
p2e = sortedScs[1];
betreuer2 = p2e.Employee.Person.FirstNameLastName;
betreuer2EOid = (long)p2e.Employee.Oid;
}
}
}
lblBetreuer1.Text = betreuer1;
lblBetreuer2.Text = betreuer2;
String qualifikation1 = "";
String qualifikation2 = "";
if (betreuer1EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer1EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation1 = valueEntry.Entry.Value.ToString();
}
}
if (betreuer2EOid != 0)
{
var employee = DAOFactory.GenericDAO.LoadByID<Employee>(betreuer2EOid);
foreach (var valueEntry in employee.ValueList)
{
if (valueEntry.Entry.Type == ValueListEntryType.StaffQualificationsType)
if (valueEntry.Entry.Value.StartsWith("Q") && valueEntry.Entry.Value.Length < 4)
qualifikation2 = valueEntry.Entry.Value.ToString();
}
}
lblQualifikation1.Text = qualifikation1;
lblQualifikation2.Text = qualifikation2;
if (c2s.CostBearerContactPerson != null)
{
if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Female)
lblAnsprechpartner.Text = "Frau ";
else if (c2s.CostBearerContactPerson.Sex.HasValue &&
c2s.CostBearerContactPerson.Sex.Value == Sex.Male)
lblAnsprechpartner.Text = "Herr ";
lblAnsprechpartner.Text += c2s.CostBearerContactPerson.LastName;
}
}
}
private decimal BerechneUebertragVormonat(ServicesOverviewRO pRO, decimal anteilBetreuungsstundenProzent, decimal anteilOverheadProzent)
{
var calc = new SBBMainzCalculations();
decimal uebertrag = 0;
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
IList<ServiceRecord> allServiceRecords = c2s.ServiceRecords;
decimal flmSoll = 0;
DateTime start = c2s.StartDate.Value;
int months = 0;
while (start < pRO.StartDate)
{
var dc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c2s);
var approvedPerWeek = calc.GetApprovedHoursPerWeek(dc, start, false) ?? 0;
decimal soll = approvedPerWeek * 4.33m;
if (start.Day != 1)
{
DateTime end = new DateTime(start.AddMonths(1).Year, start.AddMonths(1).Month, 1);
decimal days = (decimal)end.Subtract(start).TotalDays;
soll *= days / DateTime.DaysInMonth(start.Year, start.Month);
}
flmSoll += soll;
decimal ist = GetIstImMonat(allServiceRecords, start);
ist += ist / anteilBetreuungsstundenProzent * anteilOverheadProzent;
ist /= 60;
var uebertragMonat = ist - soll;
uebertrag += uebertragMonat;
start = start.AddMonths(1);
start = new DateTime(start.Year, start.Month, 1);
months++;
var mod = months % 3;
if (mod == 0)
uebertrag = 0;
}
}
return uebertrag;
}
private decimal GetIstImMonat(IList<ServiceRecord> allServiceRecords, DateTime start)
{
DateTime monatEnd = start.AddMonths(1);
monatEnd = new DateTime(monatEnd.Year, monatEnd.Month, 1);
decimal ist = 0;
Dictionary<long, bool> groupBookingDict = new Dictionary<long, bool>();
foreach (var item in allServiceRecords)
{
if (!item.GroupOid.HasValue || !groupBookingDict.ContainsKey(item.GroupOid.Value))
{
if (item.Start != null)
{
if (item.Start >= start && item.Start.Value < monatEnd)
{
if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null && item.ServiceDescription.ServiceCategory.IsBillable)
{
var p = item.ServiceDescription.ServiceCategory.ProzentAbrechnung;
if (item.ServiceDescription.ProzentAbrechnung.HasValue)
{
p = item.ServiceDescription.ProzentAbrechnung.Value;
}
ist += (item.RoundedDuration * p) / 100;
if (item.GroupOid.HasValue)
groupBookingDict.Add(item.GroupOid.Value, true);
}
}
}
}
}
return ist;
}
private bool MussUebertragBerechnen(ServicesOverviewRO pRO)
{
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
int months = 0;
DateTime start = c2s.StartDate.Value;
while (start < pRO.EndDate)
{
months++;
start = start.AddMonths(1);
}
var mod = months % 3;
if (mod == 0)
return false;
}
return true;
}
}
}

View File

@@ -41,8 +41,8 @@ namespace SBBMainzReports
anteilOverheadProzent = 35;
}
if (!String.IsNullOrEmpty(pRO.Costbearer) &&
pRO.Costbearer.Contains("Jugendamt der Landeshauptstadt Mainz"))
if (!String.IsNullOrEmpty(pRO.Costbearer) &&
(pRO.Costbearer.Contains("Jugendamt der Landeshauptstadt Mainz") || pRO.Costbearer.ToLower().Contains("jugend und familie mainz amt 51")))
{
anteilBetreuungsstundenProzent = 70;
anteilOverheadProzent = 30;

View File

@@ -70,7 +70,7 @@ namespace SBBMainzReports
tsRo.TotalFLMBillable += s.Minutes;
tsRo.TotalFLMBillable += s.Minutes / 60;
}
else if (ro.Costbearer.ToLower().Contains("jugendamt der landeshauptstadt mainz")
else if (ro.Costbearer.ToLower().Contains("jugendamt der landeshauptstadt mainz") || ro.Costbearer.ToLower().Contains("jugend und familie mainz amt 51")
|| ro.Costbearer.Equals("Landeshauptstadt Wiesbaden Amt für Soziale Arbeit und ambulante Erziehungshilfen"))
//&& (s.ServiceCategory.ToLower().Contains("spfh") || s.ServiceCategory.ToLower().Contains("erziehungsbeistand")))
{

View File

@@ -76,6 +76,8 @@
<Compile Include="CustomerDataReport.designer.cs">
<DependentUpon>CustomerDataReport.cs</DependentUpon>
</Compile>
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
<Compile Include="LeistungsbestaetigungRlpTs.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -43,7 +43,7 @@ namespace SBBMainzReports
this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel();
this.lblUeberschrift = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel();
this.lblAbrechnungszeitraum = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel();
@@ -87,17 +87,16 @@ namespace SBBMainzReports
this.xrTableRow25 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell40 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell44 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell45 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell47 = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.xrLabel14 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel9 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.ReportFooter = new DevExpress.XtraReports.UI.ReportFooterBand();
this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel19 = new DevExpress.XtraReports.UI.XRLabel();
this.PageFooter = new DevExpress.XtraReports.UI.PageFooterBand();
this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel();
this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable6)).BeginInit();
@@ -106,7 +105,7 @@ namespace SBBMainzReports
//
// Detail
//
this.Detail.HeightF = 1.124954F;
this.Detail.HeightF = 0F;
this.Detail.Name = "Detail";
this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
@@ -163,7 +162,7 @@ namespace SBBMainzReports
this.xrLabel4,
this.xrLabel16,
this.xrLabel17,
this.xrLabel13,
this.lblUeberschrift,
this.xrLabel12,
this.lblAbrechnungszeitraum,
this.xrLabel10,
@@ -176,7 +175,7 @@ namespace SBBMainzReports
this.xrLabel2,
this.xrTable2});
this.Page1.Font = new DevExpress.Drawing.DXFont("Verdana", 10F);
this.Page1.HeightF = 404.7083F;
this.Page1.HeightF = 428.4583F;
this.Page1.Name = "Page1";
this.Page1.StylePriority.UseFont = false;
//
@@ -185,7 +184,7 @@ namespace SBBMainzReports
this.xrLabel3.BackColor = System.Drawing.Color.Transparent;
this.xrLabel3.CanShrink = true;
this.xrLabel3.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(10.00016F, 356.0416F);
this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(10.00016F, 378.9583F);
this.xrLabel3.Name = "xrLabel3";
this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel3.SizeF = new System.Drawing.SizeF(112.5F, 20F);
@@ -199,7 +198,7 @@ namespace SBBMainzReports
this.xrLabel4.BackColor = System.Drawing.Color.Transparent;
this.xrLabel4.CanShrink = true;
this.xrLabel4.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(264.5416F, 356.0416F);
this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(264.5416F, 378.9583F);
this.xrLabel4.Name = "xrLabel4";
this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel4.SizeF = new System.Drawing.SizeF(433.8333F, 20F);
@@ -213,7 +212,7 @@ namespace SBBMainzReports
this.xrLabel16.BackColor = System.Drawing.Color.Transparent;
this.xrLabel16.CanShrink = true;
this.xrLabel16.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(264.5416F, 376.0415F);
this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(264.5416F, 398.9581F);
this.xrLabel16.Name = "xrLabel16";
this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel16.SizeF = new System.Drawing.SizeF(433.8334F, 20.00003F);
@@ -227,7 +226,7 @@ namespace SBBMainzReports
this.xrLabel17.BackColor = System.Drawing.Color.Transparent;
this.xrLabel17.CanShrink = true;
this.xrLabel17.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(10.00016F, 376.0415F);
this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(10.00016F, 398.9581F);
this.xrLabel17.Name = "xrLabel17";
this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel17.SizeF = new System.Drawing.SizeF(112.5F, 20F);
@@ -236,22 +235,22 @@ namespace SBBMainzReports
this.xrLabel17.Text = "wohnhaft:";
this.xrLabel17.WordWrap = false;
//
// xrLabel13
// lblUeberschrift
//
this.xrLabel13.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
this.lblUeberschrift.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
| DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrLabel13.Font = new DevExpress.Drawing.DXFont("arial", 11F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(10.0001F, 320.1665F);
this.xrLabel13.Multiline = true;
this.xrLabel13.Name = "xrLabel13";
this.xrLabel13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel13.SizeF = new System.Drawing.SizeF(688.3749F, 20.87509F);
this.xrLabel13.StylePriority.UseBorders = false;
this.xrLabel13.StylePriority.UseFont = false;
this.xrLabel13.StylePriority.UseTextAlignment = false;
this.xrLabel13.Text = "Hilfen zur Erziehung - Sozialpädagogische Familienhilfe gem. § 31 SGB VIII";
this.xrLabel13.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.lblUeberschrift.Font = new DevExpress.Drawing.DXFont("arial", 11F, DevExpress.Drawing.DXFontStyle.Bold);
this.lblUeberschrift.LocationFloat = new DevExpress.Utils.PointFloat(10.0001F, 320.1665F);
this.lblUeberschrift.Multiline = true;
this.lblUeberschrift.Name = "lblUeberschrift";
this.lblUeberschrift.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblUeberschrift.SizeF = new System.Drawing.SizeF(688.3749F, 42.75009F);
this.lblUeberschrift.StylePriority.UseBorders = false;
this.lblUeberschrift.StylePriority.UseFont = false;
this.lblUeberschrift.StylePriority.UseTextAlignment = false;
this.lblUeberschrift.Text = "Hilfen zur Erziehung - Sozialpädagogische Familienhilfe gem. § 31 SGB VIII ";
this.lblUeberschrift.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
//
// xrLabel12
//
@@ -409,7 +408,7 @@ namespace SBBMainzReports
// xrTableCell4
//
this.xrTableCell4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "DebitorNumber")});
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerReferenceNumber")});
this.xrTableCell4.Multiline = true;
this.xrTableCell4.Name = "xrTableCell4";
this.xrTableCell4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
@@ -491,7 +490,7 @@ namespace SBBMainzReports
this.xrLabel6.Multiline = true;
this.xrLabel6.Name = "xrLabel6";
this.xrLabel6.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel6.SizeF = new System.Drawing.SizeF(317F, 39.99999F);
this.xrLabel6.SizeF = new System.Drawing.SizeF(357.625F, 39.99999F);
this.xrLabel6.StylePriority.UseFont = false;
this.xrLabel6.Text = "Sozialtherapeutische Beratungsstelle / \r\nBetreuungsverein e.V. Rheinallee 17 55" +
"118 Mainz";
@@ -503,7 +502,7 @@ namespace SBBMainzReports
this.lblAdresse.Multiline = true;
this.lblAdresse.Name = "lblAdresse";
this.lblAdresse.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAdresse.SizeF = new System.Drawing.SizeF(317F, 111F);
this.lblAdresse.SizeF = new System.Drawing.SizeF(357.625F, 111F);
this.lblAdresse.StylePriority.UseFont = false;
this.lblAdresse.Text = "[RecipientOrganisation]\r\n[RecipientDivision]\r\n[RecipientStreet]\r\n[RecipientPostCo" +
"deAndTown]";
@@ -667,7 +666,8 @@ namespace SBBMainzReports
//
this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail1,
this.DetailReport2});
this.DetailReport2,
this.ReportFooter});
this.DetailReport.DataMember = "ServiceInvoicePeriods";
this.DetailReport.DataSource = this.bindingSource1;
this.DetailReport.Level = 0;
@@ -681,13 +681,11 @@ namespace SBBMainzReports
// DetailReport2
//
this.DetailReport2.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail3,
this.GroupFooter1});
this.Detail3});
this.DetailReport2.DataMember = "ServiceInvoicePeriods.ServiceInvoiceItems";
this.DetailReport2.DataSource = this.bindingSource1;
this.DetailReport2.Level = 0;
this.DetailReport2.Name = "DetailReport2";
this.DetailReport2.PageBreak = DevExpress.XtraReports.UI.PageBreak.AfterBand;
//
// Detail3
//
@@ -704,7 +702,7 @@ namespace SBBMainzReports
this.xrTable6.Name = "xrTable6";
this.xrTable6.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow25});
this.xrTable6.SizeF = new System.Drawing.SizeF(688.3747F, 25F);
this.xrTable6.SizeF = new System.Drawing.SizeF(688.3748F, 25F);
this.xrTable6.StylePriority.UseFont = false;
//
// xrTableRow25
@@ -712,7 +710,6 @@ namespace SBBMainzReports
this.xrTableRow25.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell40,
this.xrTableCell44,
this.xrTableCell45,
this.xrTableCell9,
this.xrTableCell47});
this.xrTableRow25.Name = "xrTableRow25";
@@ -722,6 +719,8 @@ namespace SBBMainzReports
//
this.xrTableCell40.BorderColor = System.Drawing.Color.DarkGray;
this.xrTableCell40.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell40.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.ServiceDescription")});
this.xrTableCell40.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrTableCell40.Name = "xrTableCell40";
this.xrTableCell40.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -739,7 +738,7 @@ namespace SBBMainzReports
this.xrTableCell44.BorderColor = System.Drawing.Color.DarkGray;
this.xrTableCell44.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell44.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.Hours", "{0:0.##}")});
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.Hours")});
this.xrTableCell44.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrTableCell44.Name = "xrTableCell44";
this.xrTableCell44.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -750,24 +749,9 @@ namespace SBBMainzReports
this.xrTableCell44.StylePriority.UseTextAlignment = false;
this.xrTableCell44.Text = "xrTableCell44";
this.xrTableCell44.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell44.TextFormatString = "{0:0.00}";
this.xrTableCell44.Weight = 0.14933396933294971D;
//
// xrTableCell45
//
this.xrTableCell45.BorderColor = System.Drawing.Color.DarkGray;
this.xrTableCell45.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell45.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrTableCell45.Name = "xrTableCell45";
this.xrTableCell45.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell45.StylePriority.UseBorderColor = false;
this.xrTableCell45.StylePriority.UseBorders = false;
this.xrTableCell45.StylePriority.UseFont = false;
this.xrTableCell45.StylePriority.UsePadding = false;
this.xrTableCell45.StylePriority.UseTextAlignment = false;
this.xrTableCell45.Text = "zu";
this.xrTableCell45.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell45.Weight = 0.10254101486409843D;
//
// xrTableCell9
//
this.xrTableCell9.BorderColor = System.Drawing.Color.DarkGray;
@@ -781,9 +765,9 @@ namespace SBBMainzReports
this.xrTableCell9.StylePriority.UseFont = false;
this.xrTableCell9.StylePriority.UsePadding = false;
this.xrTableCell9.StylePriority.UseTextAlignment = false;
this.xrTableCell9.Text = "[HourlyRate!0.00 €]";
this.xrTableCell9.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.xrTableCell9.Weight = 0.21029226665145875D;
this.xrTableCell9.Text = "[HourlyRateString]";
this.xrTableCell9.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell9.Weight = 0.31283277136800258D;
//
// xrTableCell47
//
@@ -801,62 +785,66 @@ namespace SBBMainzReports
this.xrTableCell47.StylePriority.UseTextAlignment = false;
this.xrTableCell47.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell47.TextFormatString = "{0} Euro";
this.xrTableCell47.Weight = 0.53063955118854178D;
this.xrTableCell47.Weight = 0.53064018869841689D;
//
// GroupFooter1
// bindingSource1
//
this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel14,
this.xrLabel9,
this.xrLabel1});
this.GroupFooter1.HeightF = 238.3333F;
this.GroupFooter1.Name = "GroupFooter1";
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);
//
// xrLabel14
// ReportFooter
//
this.xrLabel14.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(186.7086F, 0F);
this.xrLabel14.Name = "xrLabel14";
this.xrLabel14.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel14.SizeF = new System.Drawing.SizeF(263.9997F, 25F);
this.xrLabel14.StylePriority.UseFont = false;
this.xrLabel14.StylePriority.UsePadding = false;
this.xrLabel14.StylePriority.UseTextAlignment = false;
this.xrLabel14.Text = "Rechnungsbetrag Gesamt:";
this.xrLabel14.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.ReportFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel13,
this.xrLabel18,
this.xrLabel19});
this.ReportFooter.HeightF = 238.3333F;
this.ReportFooter.Name = "ReportFooter";
//
// xrLabel9
// xrLabel13
//
this.xrLabel9.BackColor = System.Drawing.Color.Transparent;
this.xrLabel9.CanShrink = true;
this.xrLabel9.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(10.00016F, 75.20834F);
this.xrLabel9.Multiline = true;
this.xrLabel9.Name = "xrLabel9";
this.xrLabel9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel9.SizeF = new System.Drawing.SizeF(688.375F, 163.125F);
this.xrLabel9.StylePriority.UseBackColor = false;
this.xrLabel9.StylePriority.UseFont = false;
this.xrLabel9.Text = resources.GetString("xrLabel9.Text");
//
// xrLabel1
//
this.xrLabel1.BorderDashStyle = DevExpress.XtraPrinting.BorderDashStyle.Double;
this.xrLabel1.Borders = DevExpress.XtraPrinting.BorderSide.Top;
this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
this.xrLabel13.BorderDashStyle = DevExpress.XtraPrinting.BorderDashStyle.Double;
this.xrLabel13.Borders = DevExpress.XtraPrinting.BorderSide.Top;
this.xrLabel13.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "GrossClaim")});
this.xrLabel1.Font = new DevExpress.Drawing.DXFont("arial", 11F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(450.7083F, 0F);
this.xrLabel1.Name = "xrLabel1";
this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel1.SizeF = new System.Drawing.SizeF(247.6669F, 25F);
this.xrLabel1.StylePriority.UseBorderDashStyle = false;
this.xrLabel1.StylePriority.UseBorders = false;
this.xrLabel1.StylePriority.UseFont = false;
this.xrLabel1.StylePriority.UsePadding = false;
this.xrLabel1.StylePriority.UseTextAlignment = false;
this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrLabel1.TextFormatString = "{0} Euro";
this.xrLabel13.Font = new DevExpress.Drawing.DXFont("arial", 11F, DevExpress.Drawing.DXFontStyle.Bold);
this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(450.7081F, 0F);
this.xrLabel13.Name = "xrLabel13";
this.xrLabel13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel13.SizeF = new System.Drawing.SizeF(247.6669F, 25F);
this.xrLabel13.StylePriority.UseBorderDashStyle = false;
this.xrLabel13.StylePriority.UseBorders = false;
this.xrLabel13.StylePriority.UseFont = false;
this.xrLabel13.StylePriority.UsePadding = false;
this.xrLabel13.StylePriority.UseTextAlignment = false;
this.xrLabel13.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrLabel13.TextFormatString = "{0} Euro";
//
// xrLabel18
//
this.xrLabel18.BackColor = System.Drawing.Color.Transparent;
this.xrLabel18.CanShrink = true;
this.xrLabel18.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel18.LocationFloat = new DevExpress.Utils.PointFloat(9.999939F, 75.20834F);
this.xrLabel18.Multiline = true;
this.xrLabel18.Name = "xrLabel18";
this.xrLabel18.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel18.SizeF = new System.Drawing.SizeF(688.375F, 163.125F);
this.xrLabel18.StylePriority.UseBackColor = false;
this.xrLabel18.StylePriority.UseFont = false;
this.xrLabel18.Text = resources.GetString("xrLabel18.Text");
//
// xrLabel19
//
this.xrLabel19.Font = new DevExpress.Drawing.DXFont("arial", 11F);
this.xrLabel19.LocationFloat = new DevExpress.Utils.PointFloat(186.7084F, 0F);
this.xrLabel19.Name = "xrLabel19";
this.xrLabel19.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F);
this.xrLabel19.SizeF = new System.Drawing.SizeF(263.9997F, 25F);
this.xrLabel19.StylePriority.UseFont = false;
this.xrLabel19.StylePriority.UsePadding = false;
this.xrLabel19.StylePriority.UseTextAlignment = false;
this.xrLabel19.Text = "Rechnungsbetrag Gesamt:";
this.xrLabel19.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
//
// PageFooter
//
@@ -887,10 +875,6 @@ namespace SBBMainzReports
this.xrPictureBox2.SizeF = new System.Drawing.SizeF(159.7919F, 111F);
this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);
//
// ServiceInvoiceReport
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -947,11 +931,8 @@ namespace SBBMainzReports
private DevExpress.XtraReports.UI.XRTableRow xrTableRow25;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell40;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell44;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell45;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell47;
private DevExpress.XtraReports.UI.XRLabel lblAdresse;
private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1;
private DevExpress.XtraReports.UI.XRLabel xrLabel1;
private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox1;
private DevExpress.XtraReports.UI.XRLabel xrLabel5;
private DevExpress.XtraReports.UI.XRTable xrTable1;
@@ -982,12 +963,14 @@ namespace SBBMainzReports
private DevExpress.XtraReports.UI.XRLabel xrLabel4;
private DevExpress.XtraReports.UI.XRLabel xrLabel16;
private DevExpress.XtraReports.UI.XRLabel xrLabel17;
private DevExpress.XtraReports.UI.XRLabel xrLabel13;
private DevExpress.XtraReports.UI.XRLabel xrLabel14;
private DevExpress.XtraReports.UI.XRLabel xrLabel9;
private DevExpress.XtraReports.UI.XRLabel lblUeberschrift;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell9;
private DevExpress.XtraReports.UI.PageFooterBand PageFooter;
private DevExpress.XtraReports.UI.XRLabel xrLabel15;
private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox2;
private DevExpress.XtraReports.UI.ReportFooterBand ReportFooter;
private DevExpress.XtraReports.UI.XRLabel xrLabel13;
private DevExpress.XtraReports.UI.XRLabel xrLabel18;
private DevExpress.XtraReports.UI.XRLabel xrLabel19;
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
@@ -47,8 +48,21 @@ namespace SBBMainzReports
{
if (sip.ServiceInvoiceItems != null && sip.ServiceInvoiceItems.Count > 0)
{
if (sip.ServiceInvoiceItems.Any(i => i.ServiceDescription != null && i.ServiceDescription.ToLower().Contains("erziehungsbeistand")))
{
lblUeberschrift.Text = "Hilfe zur Erziehung gemäß § 27 ff SGB VIII i.V. m. § 30 SGB VIII - \nErziehungsbeistandschaft";
}
foreach (var ii in sip.ServiceInvoiceItems)
{
if (!ii.ServiceDescription.ToLower().Contains("handgeld") && !ii.ServiceDescription.ToLower().Contains("hangeld"))
{
ii.ServiceDescription = "Fachleistungstunden / Monat";
ii.HourlyRateString = String.Format("zu {0:0.00} €", ii.HourlyRate);
}
else
{
ii.HourlyRateString = "";
}
ii.GrossAmount = ii.GrossAmount.Replace("€", "").Trim();
}
}
@@ -67,14 +81,6 @@ namespace SBBMainzReports
{
sb.AppendLine(pRO.RecipientOrganisation);
}
//if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1))
//{
// sb.AppendLine(pRO.RecipientAddressLine1);
//}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation.ToLower() != "selbstzahler")
{
sb.AppendLine(pRO.RecipientDivision);

File diff suppressed because one or more lines are too long

View File

@@ -30,6 +30,7 @@ namespace SHKServiceSBD.Reports
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
DevExpress.XtraReports.UI.XRWatermark xrWatermark1 = new DevExpress.XtraReports.UI.XRWatermark();
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
this.lblKlient = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
@@ -66,8 +67,12 @@ namespace SHKServiceSBD.Reports
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableRow5 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenAssiWoche = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenAssiMonat = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenAssiJahr = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupHeader3 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
@@ -75,7 +80,12 @@ namespace SHKServiceSBD.Reports
this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell19 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell24 = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenBefTag = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenBefWoche = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenBefMonat = new DevExpress.XtraReports.UI.XRTableCell();
this.cellKostenBefJahr = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.tableBetreuungszeiten = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow();
@@ -84,29 +94,24 @@ namespace SHKServiceSBD.Reports
this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableRow5 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell21 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell22 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell23 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell24 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell25 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell26 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell27 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell28 = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.lblAngebotGesamt = new DevExpress.XtraReports.UI.XRLabel();
this.lblAngebotBefProMonat = new DevExpress.XtraReports.UI.XRLabel();
this.lblAngebotAssProMonat = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel();
this.lblAngebotAssProMonat = new DevExpress.XtraReports.UI.XRLabel();
this.lblAngebotBefProMonat = new DevExpress.XtraReports.UI.XRLabel();
this.lblAngebotGesamt = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel();
this.lblKmProTag = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel();
this.lblEuroProKm = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tableBetreuungszeiten)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// Detail
@@ -153,6 +158,10 @@ namespace SHKServiceSBD.Reports
// ReportHeader
//
this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel16,
this.lblEuroProKm,
this.xrLabel15,
this.lblKmProTag,
this.xrTable3,
this.lblStundenProWoche,
this.lblDurchschnittStundenProTag,
@@ -171,7 +180,7 @@ namespace SHKServiceSBD.Reports
this.lblAlter2,
this.xrLabel5,
this.lblKlient});
this.ReportHeader.HeightF = 409.0001F;
this.ReportHeader.HeightF = 470.3334F;
this.ReportHeader.Name = "ReportHeader";
//
// xrTable3
@@ -179,7 +188,7 @@ namespace SHKServiceSBD.Reports
this.xrTable3.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
| DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 391.0001F);
this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 452.3334F);
this.xrTable3.Name = "xrTable3";
this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow4});
@@ -317,7 +326,7 @@ namespace SHKServiceSBD.Reports
//
// xrLabel14
//
this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(0F, 361.0001F);
this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 422.3334F);
this.xrLabel14.Name = "xrLabel14";
this.xrLabel14.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel14.SizeF = new System.Drawing.SizeF(155.41F, 30F);
@@ -497,28 +506,74 @@ namespace SHKServiceSBD.Reports
this.xrTableCell8.Text = "Jährlich";
this.xrTableCell8.Weight = 0.34190062050507453D;
//
// xrTableRow5
//
this.xrTableRow5.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell20,
this.cellKostenAssiWoche,
this.cellKostenAssiMonat,
this.cellKostenAssiJahr});
this.xrTableRow5.Name = "xrTableRow5";
this.xrTableRow5.Weight = 1.125D;
//
// xrTableCell20
//
this.xrTableCell20.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell20.Multiline = true;
this.xrTableCell20.Name = "xrTableCell20";
this.xrTableCell20.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell20.StylePriority.UseBorders = false;
this.xrTableCell20.StylePriority.UseFont = false;
this.xrTableCell20.StylePriority.UsePadding = false;
this.xrTableCell20.Text = "Schulassistenz";
this.xrTableCell20.Weight = 0.253114955818913D;
//
// cellKostenAssiWoche
//
this.cellKostenAssiWoche.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenAssiWoche.Multiline = true;
this.cellKostenAssiWoche.Name = "cellKostenAssiWoche";
this.cellKostenAssiWoche.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenAssiWoche.StylePriority.UseBorders = false;
this.cellKostenAssiWoche.StylePriority.UseFont = false;
this.cellKostenAssiWoche.StylePriority.UsePadding = false;
this.cellKostenAssiWoche.Weight = 0.2024922118380062D;
//
// cellKostenAssiMonat
//
this.cellKostenAssiMonat.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenAssiMonat.Multiline = true;
this.cellKostenAssiMonat.Name = "cellKostenAssiMonat";
this.cellKostenAssiMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenAssiMonat.StylePriority.UseBorders = false;
this.cellKostenAssiMonat.StylePriority.UsePadding = false;
this.cellKostenAssiMonat.Weight = 0.20249221183800623D;
//
// cellKostenAssiJahr
//
this.cellKostenAssiJahr.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenAssiJahr.Multiline = true;
this.cellKostenAssiJahr.Name = "cellKostenAssiJahr";
this.cellKostenAssiJahr.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenAssiJahr.StylePriority.UseBorders = false;
this.cellKostenAssiJahr.StylePriority.UseFont = false;
this.cellKostenAssiJahr.StylePriority.UsePadding = false;
this.cellKostenAssiJahr.Weight = 0.34190062050507453D;
//
// GroupHeader3
//
this.GroupHeader3.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel2,
this.xrTable1});
this.GroupHeader3.HeightF = 106F;
this.GroupHeader3.HeightF = 91.99998F;
this.GroupHeader3.Name = "GroupHeader3";
//
// xrLabel2
//
this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 24F);
this.xrLabel2.Name = "xrLabel2";
this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel2.SizeF = new System.Drawing.SizeF(642.0001F, 24F);
this.xrLabel2.StylePriority.UseBorders = false;
this.xrLabel2.StylePriority.UseFont = false;
this.xrLabel2.Text = "Fahrtkosten / Bef. ";
//
// xrTable1
//
this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 47.99998F);
this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 33.99999F);
this.xrTable1.Name = "xrTable1";
this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow2,
@@ -595,9 +650,75 @@ namespace SHKServiceSBD.Reports
this.xrTableCell19.Text = "Jährlich";
this.xrTableCell19.Weight = 0.18613738062968507D;
//
// bindingSource1
// xrTableRow6
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.CustomerDataRO);
this.xrTableRow6.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell24,
this.cellKostenBefTag,
this.cellKostenBefWoche,
this.cellKostenBefMonat,
this.cellKostenBefJahr});
this.xrTableRow6.Name = "xrTableRow6";
this.xrTableRow6.Weight = 2.5D;
//
// xrTableCell24
//
this.xrTableCell24.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell24.Multiline = true;
this.xrTableCell24.Name = "xrTableCell24";
this.xrTableCell24.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell24.StylePriority.UseBorders = false;
this.xrTableCell24.StylePriority.UseFont = false;
this.xrTableCell24.StylePriority.UsePadding = false;
this.xrTableCell24.Text = "Kosten\r\nBeförderung";
this.xrTableCell24.Weight = 0.25311495581891308D;
//
// cellKostenBefTag
//
this.cellKostenBefTag.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenBefTag.Multiline = true;
this.cellKostenBefTag.Name = "cellKostenBefTag";
this.cellKostenBefTag.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenBefTag.StylePriority.UseBorders = false;
this.cellKostenBefTag.StylePriority.UseFont = false;
this.cellKostenBefTag.StylePriority.UsePadding = false;
this.cellKostenBefTag.Weight = 0.18691588785046726D;
//
// cellKostenBefWoche
//
this.cellKostenBefWoche.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenBefWoche.Multiline = true;
this.cellKostenBefWoche.Name = "cellKostenBefWoche";
this.cellKostenBefWoche.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenBefWoche.StylePriority.UseBorders = false;
this.cellKostenBefWoche.StylePriority.UsePadding = false;
this.cellKostenBefWoche.Weight = 0.18691588785046726D;
//
// cellKostenBefMonat
//
this.cellKostenBefMonat.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenBefMonat.Multiline = true;
this.cellKostenBefMonat.Name = "cellKostenBefMonat";
this.cellKostenBefMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenBefMonat.StylePriority.UseBorders = false;
this.cellKostenBefMonat.StylePriority.UseFont = false;
this.cellKostenBefMonat.StylePriority.UsePadding = false;
this.cellKostenBefMonat.Weight = 0.18691588785046728D;
//
// cellKostenBefJahr
//
this.cellKostenBefJahr.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.cellKostenBefJahr.Multiline = true;
this.cellKostenBefJahr.Name = "cellKostenBefJahr";
this.cellKostenBefJahr.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.cellKostenBefJahr.StylePriority.UseBorders = false;
this.cellKostenBefJahr.StylePriority.UseFont = false;
this.cellKostenBefJahr.StylePriority.UsePadding = false;
this.cellKostenBefJahr.Weight = 0.18613738062968507D;
//
// GroupHeader2
//
@@ -683,133 +804,6 @@ namespace SHKServiceSBD.Reports
this.xrTableCell13.StylePriority.UsePadding = false;
this.xrTableCell13.Weight = 0.15498442367601245D;
//
// xrTableRow5
//
this.xrTableRow5.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell20,
this.xrTableCell21,
this.xrTableCell22,
this.xrTableCell23});
this.xrTableRow5.Name = "xrTableRow5";
this.xrTableRow5.Weight = 1.125D;
//
// xrTableCell20
//
this.xrTableCell20.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell20.Multiline = true;
this.xrTableCell20.Name = "xrTableCell20";
this.xrTableCell20.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell20.StylePriority.UseBorders = false;
this.xrTableCell20.StylePriority.UseFont = false;
this.xrTableCell20.StylePriority.UsePadding = false;
this.xrTableCell20.Text = "Schulassistenz";
this.xrTableCell20.Weight = 0.253114955818913D;
//
// xrTableCell21
//
this.xrTableCell21.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell21.Multiline = true;
this.xrTableCell21.Name = "xrTableCell21";
this.xrTableCell21.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell21.StylePriority.UseBorders = false;
this.xrTableCell21.StylePriority.UseFont = false;
this.xrTableCell21.StylePriority.UsePadding = false;
this.xrTableCell21.Weight = 0.2024922118380062D;
//
// xrTableCell22
//
this.xrTableCell22.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell22.Multiline = true;
this.xrTableCell22.Name = "xrTableCell22";
this.xrTableCell22.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell22.StylePriority.UseBorders = false;
this.xrTableCell22.StylePriority.UsePadding = false;
this.xrTableCell22.Weight = 0.20249221183800623D;
//
// xrTableCell23
//
this.xrTableCell23.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell23.Multiline = true;
this.xrTableCell23.Name = "xrTableCell23";
this.xrTableCell23.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell23.StylePriority.UseBorders = false;
this.xrTableCell23.StylePriority.UseFont = false;
this.xrTableCell23.StylePriority.UsePadding = false;
this.xrTableCell23.Weight = 0.34190062050507453D;
//
// xrTableRow6
//
this.xrTableRow6.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell24,
this.xrTableCell25,
this.xrTableCell26,
this.xrTableCell27,
this.xrTableCell28});
this.xrTableRow6.Name = "xrTableRow6";
this.xrTableRow6.Weight = 2.5D;
//
// xrTableCell24
//
this.xrTableCell24.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell24.Multiline = true;
this.xrTableCell24.Name = "xrTableCell24";
this.xrTableCell24.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell24.StylePriority.UseBorders = false;
this.xrTableCell24.StylePriority.UseFont = false;
this.xrTableCell24.StylePriority.UsePadding = false;
this.xrTableCell24.Text = "Kosten\r\nBeförderung";
this.xrTableCell24.Weight = 0.25311495581891308D;
//
// xrTableCell25
//
this.xrTableCell25.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell25.Multiline = true;
this.xrTableCell25.Name = "xrTableCell25";
this.xrTableCell25.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell25.StylePriority.UseBorders = false;
this.xrTableCell25.StylePriority.UseFont = false;
this.xrTableCell25.StylePriority.UsePadding = false;
this.xrTableCell25.Weight = 0.18691588785046726D;
//
// xrTableCell26
//
this.xrTableCell26.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell26.Multiline = true;
this.xrTableCell26.Name = "xrTableCell26";
this.xrTableCell26.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell26.StylePriority.UseBorders = false;
this.xrTableCell26.StylePriority.UsePadding = false;
this.xrTableCell26.Weight = 0.18691588785046726D;
//
// xrTableCell27
//
this.xrTableCell27.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell27.Multiline = true;
this.xrTableCell27.Name = "xrTableCell27";
this.xrTableCell27.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell27.StylePriority.UseBorders = false;
this.xrTableCell27.StylePriority.UseFont = false;
this.xrTableCell27.StylePriority.UsePadding = false;
this.xrTableCell27.Weight = 0.18691588785046728D;
//
// xrTableCell28
//
this.xrTableCell28.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell28.Multiline = true;
this.xrTableCell28.Name = "xrTableCell28";
this.xrTableCell28.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTableCell28.StylePriority.UseBorders = false;
this.xrTableCell28.StylePriority.UseFont = false;
this.xrTableCell28.StylePriority.UsePadding = false;
this.xrTableCell28.Weight = 0.18613738062968507D;
//
// GroupFooter1
//
this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
@@ -821,6 +815,37 @@ namespace SHKServiceSBD.Reports
this.xrLabel13});
this.GroupFooter1.Name = "GroupFooter1";
//
// lblAngebotGesamt
//
this.lblAngebotGesamt.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 70F);
this.lblAngebotGesamt.Name = "lblAngebotGesamt";
this.lblAngebotGesamt.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAngebotGesamt.SizeF = new System.Drawing.SizeF(78.33333F, 30F);
this.lblAngebotGesamt.StylePriority.UseFont = false;
this.lblAngebotGesamt.StylePriority.UseTextAlignment = false;
this.lblAngebotGesamt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// lblAngebotBefProMonat
//
this.lblAngebotBefProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 40F);
this.lblAngebotBefProMonat.Name = "lblAngebotBefProMonat";
this.lblAngebotBefProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAngebotBefProMonat.SizeF = new System.Drawing.SizeF(78.33333F, 30F);
this.lblAngebotBefProMonat.StylePriority.UseFont = false;
this.lblAngebotBefProMonat.StylePriority.UseTextAlignment = false;
this.lblAngebotBefProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// lblAngebotAssProMonat
//
this.lblAngebotAssProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 10F);
this.lblAngebotAssProMonat.Name = "lblAngebotAssProMonat";
this.lblAngebotAssProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAngebotAssProMonat.SizeF = new System.Drawing.SizeF(78.33333F, 30F);
this.lblAngebotAssProMonat.StylePriority.UseFont = false;
this.lblAngebotAssProMonat.StylePriority.UseTextAlignment = false;
this.lblAngebotAssProMonat.Text = "9.000,00 €";
this.lblAngebotAssProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// xrLabel8
//
this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10F);
@@ -848,35 +873,63 @@ namespace SHKServiceSBD.Reports
this.xrLabel13.StylePriority.UseFont = false;
this.xrLabel13.Text = "Gesamtbetrag:";
//
// lblAngebotAssProMonat
// xrLabel15
//
this.lblAngebotAssProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 10F);
this.lblAngebotAssProMonat.Name = "lblAngebotAssProMonat";
this.lblAngebotAssProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAngebotAssProMonat.SizeF = new System.Drawing.SizeF(68.33333F, 30F);
this.lblAngebotAssProMonat.StylePriority.UseFont = false;
this.lblAngebotAssProMonat.StylePriority.UseTextAlignment = false;
this.lblAngebotAssProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(0F, 340F);
this.xrLabel15.Name = "xrLabel15";
this.xrLabel15.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel15.SizeF = new System.Drawing.SizeF(155.41F, 30F);
this.xrLabel15.StylePriority.UseFont = false;
this.xrLabel15.Text = "Kilometer / Tag";
//
// lblAngebotBefProMonat
// lblKmProTag
//
this.lblAngebotBefProMonat.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 40F);
this.lblAngebotBefProMonat.Name = "lblAngebotBefProMonat";
this.lblAngebotBefProMonat.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAngebotBefProMonat.SizeF = new System.Drawing.SizeF(68.33333F, 30F);
this.lblAngebotBefProMonat.StylePriority.UseFont = false;
this.lblAngebotBefProMonat.StylePriority.UseTextAlignment = false;
this.lblAngebotBefProMonat.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
this.lblKmProTag.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
| DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.lblKmProTag.LocationFloat = new DevExpress.Utils.PointFloat(155.41F, 340F);
this.lblKmProTag.Multiline = true;
this.lblKmProTag.Name = "lblKmProTag";
this.lblKmProTag.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblKmProTag.SizeF = new System.Drawing.SizeF(181.4193F, 24F);
this.lblKmProTag.StylePriority.UseBorders = false;
this.lblKmProTag.StylePriority.UseFont = false;
//
// lblAngebotGesamt
// xrLabel16
//
this.lblAngebotGesamt.LocationFloat = new DevExpress.Utils.PointFloat(214.1667F, 70F);
this.lblAngebotGesamt.Name = "lblAngebotGesamt";
this.lblAngebotGesamt.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblAngebotGesamt.SizeF = new System.Drawing.SizeF(68.33333F, 30F);
this.lblAngebotGesamt.StylePriority.UseFont = false;
this.lblAngebotGesamt.StylePriority.UseTextAlignment = false;
this.lblAngebotGesamt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(0.0002034505F, 370F);
this.xrLabel16.Name = "xrLabel16";
this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel16.SizeF = new System.Drawing.SizeF(155.41F, 30F);
this.xrLabel16.StylePriority.UseFont = false;
this.xrLabel16.Text = "€ / Kilometer";
//
// lblEuroProKm
//
this.lblEuroProKm.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
| DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.lblEuroProKm.LocationFloat = new DevExpress.Utils.PointFloat(155.4102F, 370F);
this.lblEuroProKm.Multiline = true;
this.lblEuroProKm.Name = "lblEuroProKm";
this.lblEuroProKm.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.lblEuroProKm.SizeF = new System.Drawing.SizeF(181.4193F, 24F);
this.lblEuroProKm.StylePriority.UseBorders = false;
this.lblEuroProKm.StylePriority.UseFont = false;
//
// xrLabel2
//
this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10F);
this.xrLabel2.Name = "xrLabel2";
this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel2.SizeF = new System.Drawing.SizeF(642.0001F, 24F);
this.xrLabel2.StylePriority.UseBorders = false;
this.xrLabel2.StylePriority.UseFont = false;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.CustomerDataRO);
//
// KalkulationReport
//
@@ -889,6 +942,8 @@ namespace SHKServiceSBD.Reports
this.GroupHeader3,
this.GroupHeader2,
this.GroupFooter1});
this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
this.bindingSource1});
this.DataSource = this.bindingSource1;
this.Font = new DevExpress.Drawing.DXFont("Calibri", 11F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
@@ -897,11 +952,13 @@ namespace SHKServiceSBD.Reports
this.PageWidth = 827;
this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4;
this.Version = "23.2";
xrWatermark1.Id = "Watermark1";
this.Watermarks.Add(xrWatermark1);
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tableBetreuungszeiten)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}
@@ -939,7 +996,6 @@ namespace SHKServiceSBD.Reports
private DevExpress.XtraReports.UI.XRTableCell xrTableCell6;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell7;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell8;
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
private DevExpress.XtraReports.UI.XRTable xrTable1;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow2;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell1;
@@ -964,15 +1020,15 @@ namespace SHKServiceSBD.Reports
private DevExpress.XtraReports.UI.XRTableCell xrTableCell19;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow5;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell20;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell21;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell22;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell23;
private DevExpress.XtraReports.UI.XRTableCell cellKostenAssiWoche;
private DevExpress.XtraReports.UI.XRTableCell cellKostenAssiMonat;
private DevExpress.XtraReports.UI.XRTableCell cellKostenAssiJahr;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow6;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell24;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell25;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell26;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell27;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell28;
private DevExpress.XtraReports.UI.XRTableCell cellKostenBefTag;
private DevExpress.XtraReports.UI.XRTableCell cellKostenBefWoche;
private DevExpress.XtraReports.UI.XRTableCell cellKostenBefMonat;
private DevExpress.XtraReports.UI.XRTableCell cellKostenBefJahr;
private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1;
private DevExpress.XtraReports.UI.XRLabel lblAngebotGesamt;
private DevExpress.XtraReports.UI.XRLabel lblAngebotBefProMonat;
@@ -980,5 +1036,10 @@ namespace SHKServiceSBD.Reports
private DevExpress.XtraReports.UI.XRLabel xrLabel8;
private DevExpress.XtraReports.UI.XRLabel xrLabel12;
private DevExpress.XtraReports.UI.XRLabel xrLabel13;
private DevExpress.XtraReports.UI.XRLabel xrLabel16;
private DevExpress.XtraReports.UI.XRLabel lblEuroProKm;
private DevExpress.XtraReports.UI.XRLabel xrLabel15;
private DevExpress.XtraReports.UI.XRLabel lblKmProTag;
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
}
}

View File

@@ -11,6 +11,8 @@ using BeWo.Report;
using BeWo.Service.ServiceImplementations;
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
using System.Linq;
using BS.Shared;
namespace SHKServiceSBD.Reports
{
@@ -28,13 +30,16 @@ namespace SHKServiceSBD.Reports
DateTime monat = DateTime.Now;
decimal euroKm = GetPreis("Kilometerpauschale", DateTime.Now);
CostBearer2SupportConcept c2s = GetC2S(pRO);
if (c2s != null)
{
Customer c = c2s.SupportConcept.Customer;
decimal km = GetKilometer(pRO);
Customer c = c2s.SupportConcept.Customer;
//foreach (var sc in c.SupportConcepts)
//{
@@ -49,29 +54,67 @@ namespace SHKServiceSBD.Reports
//}
decimal euroProStunde = 0;
var stunden = CreateArbeitszeitenTableAndCalculateStunden(c.Arbeitszeiten);
lblKlient.Text = String.Format("{0}, geb. {1:dd.MM.yyyy}", c.Person.FirstNameLastName, c.Person.DateOfBirth);
lblStundenProWoche.Text = String.Format("{0:0.00}", stunden);
lblDurchschnittStundenProTag.Text = String.Format("{0:0.00}", stunden / 5);
lblWochenProJahr.Text = "52";
lblMonateProJahr.Text = "12";
lblKmProTag.Text = String.Format("{0:0.00}", km);
lblEuroProKm.Text = String.Format("{0:c}", euroKm);
var crlist = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(c2s.CostBearer.CostRatePeriods);
var crp = crlist.GetCostRatePeriodForDate(BS.Shared.CostRatePeriodType.HourlyRate, monat);
if (crp != null && crp.CostRateValue.HasValue)
{
euroProStunde = crp.CostRateValue.Value;
lblEuroProStunde.Text = String.Format("{0:c}", crp.CostRateValue);
}
decimal wochen = 365 / 7; // Schaltjahre beachten?
cellKostenBefTag.Text = String.Format("{0:c}", euroKm * km);
cellKostenBefWoche.Text = String.Format("{0:c}", euroKm * km * 5);
cellKostenBefMonat.Text = String.Format("{0:c}", euroKm * km * 5 * (wochen / 12));
cellKostenBefJahr.Text = String.Format("{0:c}", euroKm * km * 5 * wochen);
cellKostenAssiWoche.Text = String.Format("{0:c}", stunden * euroProStunde);
cellKostenAssiMonat.Text = String.Format("{0:c}", stunden * euroProStunde * (wochen / 12));
cellKostenAssiJahr.Text = String.Format("{0:c}", stunden * euroProStunde * wochen);
//Organisation schule = GetSchule(c);
lblAngebotAssProMonat.Text = String.Format("{0:c}", stunden * euroProStunde * (wochen / 12));
lblAngebotBefProMonat.Text = String.Format("{0:c}", euroKm * km * 5 * (wochen / 12));
lblAngebotGesamt.Text = String.Format("{0:c}", (stunden * euroProStunde * (wochen / 12)) + (euroKm * km * 5 * (wochen / 12)));
}
this.bindingSource1.DataSource = pRO;
}
public virtual decimal GetPreis(String preisBezeichnung, DateTime datum)
{
var preise = DAOFactory.GenericDAO.GetAllActive<Preis>();
var preis = preise.Where(p => p.Name.Contains(preisBezeichnung)).FirstOrDefault();
if (preis != null)
{
var crlist = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(preis.CostRatePeriods);
var cr = crlist.GetCostRatePeriodForDate(CostRatePeriodType.AmountOfMoney, datum);
if (cr != null && cr.CostRateValue.HasValue)
{
return cr.CostRateValue.Value;
}
}
return 0;
}
private CostBearer2SupportConcept GetC2S(QueryRO ro)
{
@@ -90,6 +133,23 @@ namespace SHKServiceSBD.Reports
return null;
}
private decimal GetKilometer(QueryRO ro)
{
if (ro.Rows != null && ro.Rows.Count > 0)
{
if (ro.Rows[0].Field2 != null)
{
if (Decimal.TryParse(ro.Rows[0].Field2.ToString(), out var d))
{
return d;
}
}
}
return 0;
}
private Customer GetCustomer(QueryRO ro)
{

View File

@@ -213,6 +213,14 @@ namespace VereinBeratungTherapie.Invoicing
{
LG = lgMin;
}
if (supportConceptApprovalPeriod.Notice != null && supportConceptApprovalPeriod.Notice.ToLower().Contains("kombiniert"))
{
LG = lgMin;
if (!cat.Abbreviation.Contains("TS"))
{
LG = GetKombinierteLG(serviceInvoicePeriod, supportConceptApprovalPeriod, cat, cb2sc, lgMin, preisLG);
}
}
else
{
LG = GetLeistungsgruppe(lgMin, cat);
@@ -282,23 +290,23 @@ namespace VereinBeratungTherapie.Invoicing
if (ap.Notice == null || !ap.Notice.ToLower().Contains("alt"))
{
lgGes = GetLeistungsgruppe(lgMin + lgBw, cat);
lgBw = GetLeistungsgruppe(lgBw, cat);
var dif = lgGes - lgMin - lgBw;
if (dif != 0)
{
dif /= 2;
}
lgMin += dif;
lgBw += dif;
ii.Notice = Math.Round((lgGes - Math.Round(lgBw, 0, MidpointRounding.AwayFromZero)),0, MidpointRounding.ToEven).ToString();
}
else
{
lgGes = lgMin + lgBw;
preisGes = Math.Round(minPreis * lgGes, 2, MidpointRounding.AwayFromZero);
}
lgBw = Math.Round(lgBw / 60, 2, MidpointRounding.AwayFromZero);
preisBw = Math.Round(preis.Value * lgBw, 2, MidpointRounding.AwayFromZero);
if (new List<decimal> { 60, 120, 180, 240, 330, 450, 630, 900 }.Contains(lgBw))
{
preisBw = Math.Round(preis.Value * lgBw / 60, 2, MidpointRounding.AwayFromZero);
}
else // Altfälle
{
preisBw = Math.Round(minPreis * lgBw, 2, MidpointRounding.AwayFromZero);
}
if (new List<decimal> { 60, 120, 180, 240, 330, 450, 630, 900 }.Contains(lgGes))
{
preisGes = Math.Round(preis.Value * lgGes / 60, 2, MidpointRounding.AwayFromZero);
@@ -324,6 +332,54 @@ namespace VereinBeratungTherapie.Invoicing
}
}
private decimal GetKombinierteLG(ServiceInvoicePeriod period, SupportConceptApprovalPeriodDC scapBW, ServiceCategoryDC cat, CostBearer2SupportConcept cb2sc, decimal lgMin, decimal? preis)
{
// BeckerA, 26.05.2025: Anpassung in Umrechnung der LG, ABER das war nur für QA nötig, allerdings scheint es noch Altfälle zu gebenm die ohnehin Minutenweise umgerechnet wurden
// z.B. Babadagi
// BeckerA, 26.05.2025: Programmierung soweit angepasst, GetKombiniertenPreis fehlt noch, warte da auf ihre Rückmeldung
// Errechnung des summierten Preises und Einzelpreise TS und BW
var scapTSs = cb2sc.ApprovalPeriodList.Where(a => a.ServiceCategory != null && a.ServiceCategory.Abbreviation.Contains(cat.Abbreviation.Substring(0, 2))
&& a.ServiceCategory.Abbreviation.Substring(2, 2) == "TS").ToList();
if (scapTSs != null)
{
foreach (var ap in scapTSs)
{
if (scapBW.StartDate == ap.StartDate && scapBW.EndDate == ap.EndDate || ap.StartDate < period.End && ap.EndDate > period.Start)
{
var catTs = MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewDC(ap.ServiceCategory);
decimal minPreis = Math.Round(preis.Value / 60, 4, MidpointRounding.AwayFromZero);
decimal lgTs = 0;
decimal lgGes = 0;
if (ap.ApprovedBEPerInterval != null)
{
lgTs = ap.ApprovedBEPerInterval.Value;
}
// LWV rundet den Prei bei KA und alten Bewilligungen QA auf Minutenwert und bei neuer QA auf Stunden :-P
if (cat.Abbreviation.Contains("QA") || cat.Name.Contains("Qualifizierte"))
{
if (ap.Notice == null || !ap.Notice.ToLower().Contains("alt"))
{
lgGes = GetLeistungsgruppe(lgMin + lgTs, cat);
var dif = lgGes - lgMin - lgTs;
if (dif != 0)
{
dif /= 2;
}
lgMin += dif;
lgTs += dif;
}
else
{
lgGes = lgMin + lgTs;
}
}
return lgMin;
}
}
}
return lgMin;
}
private decimal GetLeistungsgruppe(decimal? approvedBEPerInterval, ServiceCategoryDC cat)
{
// Qualifizierte Assistenz wird in Stufen - sogenannten Leistungsgruppen abgerechnet -

View File

@@ -11,15 +11,11 @@ namespace BeWo.Service.Import.AvisImport
public class AviseImporter
{
//Der Rückgabewert wird beim Client in einer Messagebox angezeigt
public virtual String ImportAvise(List<Avis> avise)
public virtual String ImportAvise(List<Avis> avise, List<HilfeplanInfo> hilfeplaene)
{
var hilfeplaene = CreateHilfeplanInfos();
var importresult = ImportAbschlagszahlungen(avise, hilfeplaene);
String importDaten = "1 Datensatz";
String vorhandenDaten = "1 Datensatz";
int importiertCount = 0;
int bereitsVorhandenCount = 0;
var irFalseList = new List<AvisImportResult>();
@@ -74,7 +70,6 @@ namespace BeWo.Service.Import.AvisImport
{
sb.AppendLine(ir.Message);
}
}
var text = sb.ToString();
@@ -93,7 +88,6 @@ namespace BeWo.Service.Import.AvisImport
foreach (var avis in avise)
{
var ir = ImportAbschlagszahlung(avis, hilfeplaene);
result.Add(ir);
}
@@ -124,7 +118,6 @@ namespace BeWo.Service.Import.AvisImport
else
{
result.Message = String.Format("Es wurde kein Hilfeplan mit passendem Zeitraum gefunden.");
DateTime monatStart = new DateTime(avis.GueltigkeitsDatum.Year, avis.GueltigkeitsDatum.Month, 1);
DateTime monatEnde = monatStart.AddMonths(1);
@@ -176,7 +169,6 @@ namespace BeWo.Service.Import.AvisImport
//Prüfe ob Klientname vorkommt
//var nameBuchung = avis.Verwendungszweck.ToLower();
//var nachname = hp.CustomerLastName.ToLower();
//var vorname = hp.CustomerFirstName.ToLower();
//nachname = nachname.Replace("ö", "oe");
@@ -187,9 +179,7 @@ namespace BeWo.Service.Import.AvisImport
//vorname = vorname.Replace("ü", "ue");
//vorname = vorname.Replace("ä", "ae");
//vorname = vorname.Replace("ß", "ss");
//var name = String.Format("{0}{1}", nachname, vorname);
//if (nameBuchung.Contains(name))
//{
// return true;
@@ -201,7 +191,6 @@ namespace BeWo.Service.Import.AvisImport
public virtual AccountingTransaction CreateAbschlagszahlung(Avis avis, HilfeplanInfo hp)
{
var newAz = new AccountingTransaction();
newAz.CostBearer2SupportConcept = hp.CostBearer2SupportConcept;
newAz.Amount = avis.Betrag;
newAz.BookingDate = avis.BuchungsDatum;
@@ -220,39 +209,8 @@ namespace BeWo.Service.Import.AvisImport
public virtual bool CheckObAbschlagszahlungBereitsImportiert(Avis avis, HilfeplanInfo hp)
{
var azAltList = DAOFactory.SearchDAO.FindAccountingTransactionsWithImportNotice(CreateImportNotice(avis));
return azAltList != null && azAltList.Any();
}
public virtual List<HilfeplanInfo> CreateHilfeplanInfos()
{
List<HilfeplanInfo> liste = new List<HilfeplanInfo>();
var scList = DAOFactory.GenericDAO.GetAllActiveAndArchived<SupportConcept>();
foreach (var supportConcept in scList)
{
foreach (var cb2sc in supportConcept.CostBearer2SupportConceptList)
{
HilfeplanInfo hi = new HilfeplanInfo();
hi.Start = cb2sc.StartDate;
hi.Ende = cb2sc.EndDate;
hi.Aktenzeichen = cb2sc.CustomerReferenceNumber;
hi.CostBearer2SupportConcept = cb2sc;
hi.CustomerFirstName = cb2sc.SupportConcept.Customer.Person.FirstName;
hi.CustomerLastName = cb2sc.SupportConcept.Customer.Person.LastName;
if (hi.Start.HasValue && hi.Ende.HasValue && !String.IsNullOrEmpty(hi.Aktenzeichen))
{
liste.Add(hi);
}
}
}
return liste;
}
}
}

View File

@@ -32,25 +32,56 @@ namespace BeWo.Service.Import.AvisImport
{
var reader = new LvrAvisPdfReader();
var avise = reader.LeseAvise(daten);
var hilfeplaene = CreateHilfeplanInfos();
return ImportAvise(avise);
return ImportAvise(avise, hilfeplaene);
}
public String ImportTextAvise(String text)
{
var reader = new LvrAvisTextReader();
var avise = reader.LeseAvise(text);
var hilfeplaene = CreateHilfeplanInfos();
return ImportAvise(avise);
return ImportAvise(avise, hilfeplaene);
}
public String ImportCsvAvise(String csv)
public virtual String ImportCsvAvise(String csv)
{
var reader = new LvrAvisCsvReader();
var avise = reader.LeseEinzelAvise(csv);
return ImportAvise(avise);
}
var hilfeplaene = CreateHilfeplanInfos();
return ImportAvise(avise, hilfeplaene);
}
// AB: verschoben um, die Hilfeplanauswahl ggf. spezifischer machen zu können
public virtual List<HilfeplanInfo> CreateHilfeplanInfos()
{
List<HilfeplanInfo> liste = new List<HilfeplanInfo>();
var scList = DAOFactory.GenericDAO.GetAllActiveAndArchived<SupportConcept>();
foreach (var supportConcept in scList)
{
foreach (var cb2sc in supportConcept.CostBearer2SupportConceptList)
{
HilfeplanInfo hi = new HilfeplanInfo();
hi.Start = cb2sc.StartDate;
hi.Ende = cb2sc.EndDate;
hi.Aktenzeichen = cb2sc.CustomerReferenceNumber;
hi.CostBearer2SupportConcept = cb2sc;
hi.CustomerFirstName = cb2sc.SupportConcept.Customer.Person.FirstName;
hi.CustomerLastName = cb2sc.SupportConcept.Customer.Person.LastName;
if (hi.Start.HasValue && hi.Ende.HasValue && !String.IsNullOrEmpty(hi.Aktenzeichen))
{
liste.Add(hi);
}
}
}
return liste;
}
}
}

View File

@@ -80,14 +80,19 @@ namespace BeWo.Service.Plugins
var rechnungen = new List<ServiceInvoiceDC>();
foreach (var item in differenzRechnungChecks)
{
if (item.VorhandeneRechungen.Count == 0)
if (item.VorhandeneRechungen.Count == 0 || !item.VorhandeneRechungen.Any(r => item.NeueRechnung.InvoiceBase.CustomerOid == r.InvoiceBase.CustomerOid))
{
item.NeueRechnung.InvoiceBase.NeuErstellen = true;
rechnungen.Add(item.NeueRechnung);
}
else
{
rechnungen.Add(ErstelleDifferenzRechnung(item));
var diffRechnung = ErstelleDifferenzRechnung(item);
if (diffRechnung != null)
{
diffRechnung.InvoiceBase.NeuErstellen = false;
rechnungen.Add(diffRechnung);
}
}
}
@@ -100,29 +105,34 @@ namespace BeWo.Service.Plugins
//var alterBetrag = item.VorhandeneRechungen.Sum(i => i.ClaimSum ?? 0);
var letzteRg = item.VorhandeneRechungen.OrderByDescending(r => r.ServiceInvoiceOid).FirstOrDefault();
if (item.NeueRechnung.ClaimSum == letzteRg.ClaimSum)
letzteRg = item.VorhandeneRechungen.FirstOrDefault(r => item.NeueRechnung.InvoiceBase.CustomerOid == r.InvoiceBase.CustomerOid);
if (letzteRg != null)
{
diffRechnung = item.NeueRechnung;
diffRechnung.InvoiceBase.NeuErstellen = false;
diffRechnung.InvoiceBase.Hinweise = String.Format("Rechnung wurde bereits erstellt");
}
else
{
diffRechnung = new ServiceInvoiceDC();
diffRechnung.OriginalZurDifferenz = item.NeueRechnung;
diffRechnung.InvoiceBase = new InvoiceBaseDC();
CopyInvoiceBaseDC(item.NeueRechnung.InvoiceBase, diffRechnung);
if (item.NeueRechnung.ClaimSum == letzteRg.ClaimSum)
{
diffRechnung = item.NeueRechnung;
diffRechnung.InvoiceBase.NeuErstellen = false;
diffRechnung.InvoiceBase.Hinweise = String.Format("Rechnung wurde bereits erstellt");
}
else
{
diffRechnung = new ServiceInvoiceDC();
diffRechnung.OriginalZurDifferenz = item.NeueRechnung;
diffRechnung.InvoiceBase = new InvoiceBaseDC();
CopyInvoiceBaseDC(item.NeueRechnung.InvoiceBase, diffRechnung);
ServiceInvoice counterInvoice = new ServiceInvoice();
var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(letzteRg.InvoiceBase.InvoiceBaseOid.Value);
ServiceInvoice counterInvoice = new ServiceInvoice();
var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(letzteRg.InvoiceBase.InvoiceBaseOid.Value);
CopyServiceInvoice(serviceInvoice, counterInvoice);
SetzeStornoInfos(counterInvoice);
SetzeRechnungspositionenServiceInvoice(diffRechnung, counterInvoice, item);
diffRechnung.InvoiceBase.NeuErstellen = true;
diffRechnung.InvoiceBase.Hinweise = String.Format("Rechnungsdifferenz zu Rechnung {0} in Höhe von {1:c}", letzteRg.InvoiceBase.InvoiceNumber, letzteRg.InvoiceBase.TotalAmount.Value);
CopyServiceInvoice(serviceInvoice, counterInvoice);
SetzeStornoInfos(counterInvoice);
SetzeRechnungspositionenServiceInvoice(diffRechnung, counterInvoice, item);
diffRechnung.InvoiceBase.NeuErstellen = true;
diffRechnung.InvoiceBase.Hinweise = String.Format("Rechnungsdifferenz zu Rechnung {0} in Höhe von {1:c}", letzteRg.InvoiceBase.InvoiceNumber, letzteRg.InvoiceBase.TotalAmount.Value);
}
}
return diffRechnung;
}
@@ -593,16 +603,27 @@ namespace BeWo.Service.Plugins
&& s.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value == NewSip.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value))
{
var ip = diffRechnung.ServiceInvoicePeriods.Where(s => s.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value == NewSip.SupportConceptApprovalPeriod.SupportConceptApprovalPeriodOid.Value).First();
if (ip.InvoiceItems != null && ip.InvoiceItems.Count > 0)
{
ip.Claim += NewSip.Claim;
foreach (var ii in NewSip.InvoiceItems)
{
ip.InvoiceItems.Add(ii);
}
}
}
else
if (ip.InvoiceItems != null && ip.InvoiceItems.Count > 0)
{
ip.Claim += NewSip.Claim;
foreach (var ii in NewSip.InvoiceItems)
{
ip.InvoiceItems.Add(ii);
}
// Bei Rechnungspositionen mit negativem Betrag auf alte Rechnung verweisen
foreach (var iitem in ip.InvoiceItems)
{
if (iitem.AmountTotal < 0)
{
var vorhandeneRechnung = item.VorhandeneRechungen.FirstOrDefault(r => r.InvoiceBase != null && r.InvoiceBase.CustomerOid == ip.Customer.CustomerOid);
if (vorhandeneRechnung != null)
iitem.ItemDescription += string.Format(" (am {0:dd.MM.yyyy} in Rechnung {1} berechnet)", vorhandeneRechnung.InvoiceBase.InvoiceDate, vorhandeneRechnung.InvoiceBase.InvoiceNumber);
}
}
}
}
else
{
diffRechnung.ServiceInvoicePeriods.Add(NewSip);
}

View File

@@ -2,6 +2,7 @@
using BeWo.Service.MessageContracts;
using BS.Shared.Core;
namespace BeWo.Service.Plugins
{
public class DataImporter : AbstractIDSpecificDefaultClass<DataImporter>
@@ -27,7 +28,7 @@ namespace BeWo.Service.Plugins
public virtual UploadImportFileResult ImportLvrAvise(string filename, byte[] daten)
{
var aviseImport = new LvrAviseImporter();
var aviseImport = PluginLoader.FindClass<LvrAviseImporter>();
var message = aviseImport.ImportAvise(filename, daten);
var result = new UploadImportFileResult();
@@ -36,6 +37,5 @@ namespace BeWo.Service.Plugins
return result;
}
}
}