Quittierungsbeleg für SKF Leverkusen hinzugefügt

MoK erweiterte Ressourcenverfügbarkeitsprüfung hinzugefügt
MoK Darstellung von ServiceRecords mit Marker ist wie im FaC, Anpassung im Formular folgt
This commit is contained in:
2023-07-24 17:57:14 +02:00
parent b4ce085bba
commit 2a2cf05f5b
24 changed files with 2218 additions and 140 deletions

View File

@@ -582,6 +582,12 @@ namespace BeWo.Scheduler.View
BeWoApp.AppSettings.SchedulerViewType = schedulerViewType;
var settings = ViewModel.GetActiveSettings();
if(settings is null)
{
return;
}
BeWoApp.AppSettings.SchedulerTimelineViewDayCount = settings.TimelineIntervalCount;
BeWoApp.SaveAppSettings();

View File

@@ -125,6 +125,7 @@ textarea {
--danger: #dc3545;
--light: #f8f9fa;
--dark: #343a40;
--service-record-marked: #c5e3ff;
--bewo-teams: #565999;
--bewo-goal-rating: #0000ff;
--bewo-dev: #00cf7c;
@@ -1992,6 +1993,26 @@ pre code {
background-color: #b9bbbe;
}
.table-service-record-marked,
.table-service-record-marked > th,
.table-service-record-marked > td {
background-color: #eff7ff;
}
.table-service-record-marked th,
.table-service-record-marked td,
.table-service-record-marked thead th,
.table-service-record-marked tbody + tbody {
border-color: #e1f0ff;
}
.table-hover .table-service-record-marked:hover {
background-color: #d6eaff;
}
.table-hover .table-service-record-marked:hover > td,
.table-hover .table-service-record-marked:hover > th {
background-color: #d6eaff;
}
.table-bewo-teams,
.table-bewo-teams > th,
.table-bewo-teams > td {
@@ -3060,6 +3081,36 @@ fieldset:disabled a.btn {
box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
}
.btn-service-record-marked {
color: #212529;
background-color: #c5e3ff;
border-color: #c5e3ff;
}
.btn-service-record-marked:hover {
color: #212529;
background-color: #9fd1ff;
border-color: #92caff;
}
.btn-service-record-marked:focus, .btn-service-record-marked.focus {
color: #212529;
background-color: #9fd1ff;
border-color: #92caff;
box-shadow: 0 0 0 0.2rem rgba(172, 199, 223, 0.5);
}
.btn-service-record-marked.disabled, .btn-service-record-marked:disabled {
color: #212529;
background-color: #c5e3ff;
border-color: #c5e3ff;
}
.btn-service-record-marked:not(:disabled):not(.disabled):active, .btn-service-record-marked:not(:disabled):not(.disabled).active, .show > .btn-service-record-marked.dropdown-toggle {
color: #212529;
background-color: #92caff;
border-color: #85c4ff;
}
.btn-service-record-marked:not(:disabled):not(.disabled):active:focus, .btn-service-record-marked:not(:disabled):not(.disabled).active:focus, .show > .btn-service-record-marked.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(172, 199, 223, 0.5);
}
.btn-bewo-teams {
color: #fff;
background-color: #565999;
@@ -3680,6 +3731,31 @@ fieldset:disabled a.btn {
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
}
.btn-outline-service-record-marked {
color: #c5e3ff;
border-color: #c5e3ff;
}
.btn-outline-service-record-marked:hover {
color: #212529;
background-color: #c5e3ff;
border-color: #c5e3ff;
}
.btn-outline-service-record-marked:focus, .btn-outline-service-record-marked.focus {
box-shadow: 0 0 0 0.2rem rgba(197, 227, 255, 0.5);
}
.btn-outline-service-record-marked.disabled, .btn-outline-service-record-marked:disabled {
color: #c5e3ff;
background-color: transparent;
}
.btn-outline-service-record-marked:not(:disabled):not(.disabled):active, .btn-outline-service-record-marked:not(:disabled):not(.disabled).active, .show > .btn-outline-service-record-marked.dropdown-toggle {
color: #212529;
background-color: #c5e3ff;
border-color: #c5e3ff;
}
.btn-outline-service-record-marked:not(:disabled):not(.disabled):active:focus, .btn-outline-service-record-marked:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-service-record-marked.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(197, 227, 255, 0.5);
}
.btn-outline-bewo-teams {
color: #565999;
border-color: #565999;
@@ -5905,6 +5981,19 @@ a.badge-dark:focus, a.badge-dark.focus {
box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);
}
.badge-service-record-marked {
color: #212529;
background-color: #c5e3ff;
}
a.badge-service-record-marked:hover, a.badge-service-record-marked:focus {
color: #212529;
background-color: #92caff;
}
a.badge-service-record-marked:focus, a.badge-service-record-marked.focus {
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(197, 227, 255, 0.5);
}
.badge-bewo-teams {
color: #fff;
background-color: #565999;
@@ -6228,6 +6317,18 @@ a.badge-bewo-report:focus, a.badge-bewo-report.focus {
color: #040505;
}
.alert-service-record-marked {
color: #667685;
background-color: #f3f9ff;
border-color: #eff7ff;
}
.alert-service-record-marked hr {
border-top-color: #d6eaff;
}
.alert-service-record-marked .alert-link {
color: #505c68;
}
.alert-bewo-teams {
color: #2d2e50;
background-color: #dddeeb;
@@ -6753,6 +6854,20 @@ a.badge-bewo-report:focus, a.badge-bewo-report.focus {
border-color: #1b1e21;
}
.list-group-item-service-record-marked {
color: #667685;
background-color: #eff7ff;
}
.list-group-item-service-record-marked.list-group-item-action:hover, .list-group-item-service-record-marked.list-group-item-action:focus {
color: #667685;
background-color: #d6eaff;
}
.list-group-item-service-record-marked.list-group-item-action.active {
color: #fff;
background-color: #667685;
border-color: #667685;
}
.list-group-item-bewo-teams {
color: #2d2e50;
background-color: #d0d1e2;
@@ -7781,6 +7896,16 @@ button.bg-dark:focus {
background-color: #1d2124 !important;
}
.bg-service-record-marked {
background-color: #c5e3ff !important;
}
a.bg-service-record-marked:hover, a.bg-service-record-marked:focus,
button.bg-service-record-marked:hover,
button.bg-service-record-marked:focus {
background-color: #92caff !important;
}
.bg-bewo-teams {
background-color: #565999 !important;
}
@@ -8001,6 +8126,10 @@ button.bg-bewo-report:focus {
border-color: #343a40 !important;
}
.border-service-record-marked {
border-color: #c5e3ff !important;
}
.border-bewo-teams {
border-color: #565999 !important;
}
@@ -11640,6 +11769,14 @@ a.text-dark:hover, a.text-dark:focus {
color: #121416 !important;
}
.text-service-record-marked {
color: #c5e3ff !important;
}
a.text-service-record-marked:hover, a.text-service-record-marked:focus {
color: #79beff !important;
}
.text-bewo-teams {
color: #565999 !important;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
$theme-colors: ("bewo-teams": #565999, "bewo-goal-rating": #0000ff,"bewo-dev": #00cf7c, "primary": #FF5A00, "bewo-customers": #3b7799, "bewo-service-records": #c80000, "bewo-calendar": #04b4d0, "bewo-is-about-to-expire": #FF0000, "bewo-expires-in-three-months": #FF9400, "bewo-group-booking": #f9e79f, "bewo-customer-card-header": #AB4A07, "bewo-employee": #45993B, "bewo-resource": #04B4D0, "bewo-task-red": #993B3B, "bewo-report": #995E3B);
$theme-colors: ("service-record-marked": #c5e3ff, "bewo-teams": #565999, "bewo-goal-rating": #0000ff,"bewo-dev": #00cf7c, "primary": #FF5A00, "bewo-customers": #3b7799, "bewo-service-records": #c80000, "bewo-calendar": #04b4d0, "bewo-is-about-to-expire": #FF0000, "bewo-expires-in-three-months": #FF9400, "bewo-group-booking": #f9e79f, "bewo-customer-card-header": #AB4A07, "bewo-employee": #45993B, "bewo-resource": #04B4D0, "bewo-task-red": #993B3B, "bewo-report": #995E3B);
textarea {
min-height: 150px !important;

View File

@@ -83,8 +83,6 @@ namespace BeWoPlanerMobil.Controllers
{
Log.Error("Fehler beim Speichern der BrowserInfo: " + exception);
}
// ToDo: Hier durch die Mandatorsettings den Timeout setzen!
AbstractModel.TimeOfLastAction = $"{DateTime.Now:yyyy-MM-dd}T{DateTime.Now:HH:mm:ss}";

View File

@@ -2454,7 +2454,7 @@ namespace BeWoPlanerMobil.Controllers
var allowDeleteAll = MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll);
var validationResultList = OperationsService.ValidateServiceRecordDeletion(serviceRecord, Model.Employee.EmployeeOid.Value);
if(validationResultList.Count > 0)
{
foreach(var result in validationResultList)
@@ -2463,11 +2463,17 @@ namespace BeWoPlanerMobil.Controllers
{
case Custom:
newResult.KannTrotzdemGespeichertWerden = true;
newResult.Message += "Dieser Eintrag wurde bereits unterschrieben.<br/>Möchten Sie ihn trotzdem löschen?<br/><br/>";
newResult.Message += RemoveConfirmationFromValidationResultMessage(result.Message) + "<br /><br />";
break;
}
}
if(newResult.Message?.Length > 0)
{
newResult.Message += "Möchten Sie ihn trotzdem löschen?<br/><br/>";
}
return SerializeObject(newResult);
}
@@ -2476,6 +2482,28 @@ namespace BeWoPlanerMobil.Controllers
: SerializeObject(new ValidationResult {KannTrotzdemGespeichertWerden = true, Message = null});
}
private static string RemoveConfirmationFromValidationResultMessage(string resultMessage)
{
if(resultMessage is null)
{
return string.Empty;
}
var confirmation = "Möchten Sie ihn trotzdem löschen?";
if(resultMessage.Contains(confirmation))
{
var length = resultMessage.Length - confirmation.Length;
if(length > 0)
{
resultMessage = resultMessage.Substring(0, length);
}
}
return resultMessage;
}
[Authorize]
public string SetServiceRecordEmployee(long employeeOid)
{

View File

@@ -174,12 +174,14 @@ namespace BeWoPlanerMobil.Controllers
if(AbstractModel.HasRightToViewCustomerSelectionInScheduler)
{
Model.AllCustomers = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid).OrderBy(o => o.DetailDescription).ToList();
//Model.AllCustomers = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid).OrderBy(o => o.DetailDescription).ToList();
Model.AllCustomers = CustomerService.GetAllActiveCompactCustomers();
}
if(AbstractModel.HasRightToViewEmployeeAppointments)
{
Model.AllEmployees = EmployeeService.GetActiveCompactEmployeesForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(o => o.DetailDescription).ToList();
//Model.AllEmployees = EmployeeService.GetActiveCompactEmployeesForEmployee(Model.Employee.EmployeeOid.Value).OrderBy(o => o.DetailDescription).ToList();
Model.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact();
}
}
@@ -594,34 +596,73 @@ namespace BeWoPlanerMobil.Controllers
return JsonConvert.SerializeObject(Model.SelectedCustomers.OrderBy(o => o.LastNameFirstName));
}
// ToDo: AUSFÜHRLICH TESTEN!
[Authorize]
public string CheckResourcesAvailability(string start, string end, string resourceOids)
public string CheckResourcesAvailability(string start, string end, string resourceOids, bool allDay)
{
if(!AbstractModel.HasRightToInsertRessourceAppointments)
{
return "Fehler!Sie haben nicht das Recht, Termine mit Ressourcen anzulegen!";
}
if(string.IsNullOrWhiteSpace(start) || string.IsNullOrWhiteSpace(end) || string.IsNullOrWhiteSpace(resourceOids) || Model is null)
{
return LeerzeichenFuerGetMethoden;
}
if(!string.IsNullOrWhiteSpace(start) && !string.IsNullOrWhiteSpace(end) && !string.IsNullOrWhiteSpace(resourceOids) && Model != null)
var oidList = ConvertOidStringToList(resourceOids);
foreach(var oid in oidList)
{
var oidList = ConvertOidStringToList(resourceOids);
foreach(var oid in oidList)
if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid)))
{
if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid)))
{
return JsonConvert.SerializeObject(new List<ResourceDC>());
}
return JsonConvert.SerializeObject(new List<ResourceDC>());
}
var dateTimes = ConvertStringDatesToDateTimes(start, end);
var unavailableResources = KalenderService.CheckResourceAvailability(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid);
return JsonConvert.SerializeObject(unavailableResources);
}
return LeerzeichenFuerGetMethoden;
var dateTimes = ConvertStringDatesToDateTimes(start, end);
var unavailableResources = KalenderService.CheckResourceAvailability(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid);
return JsonConvert.SerializeObject(unavailableResources);
// ToDo: Wieder einchecken
//var oidList = ConvertOidStringToList(resourceOids);
//foreach(var oid in oidList)
//{
// if(!Model.ResourceCategories2Resources.Any(a => a.Value.All(b => b.ResourceOid != oid)))
// {
// return LeerzeichenFuerGetMethoden;
// }
//}
//var dateTimes = ConvertStringDatesToDateTimes(start, end);
//if(allDay)
//{
// dateTimes.EndDate = dateTimes.EndDate.AddDays(1);
//}
//var info = KalenderService.CheckResourceAvailabilityWithEmployeeInformation(dateTimes.StartDate, dateTimes.EndDate, oidList, Model.SelectedAppointment?.SchedulerAppointmentOid);
//var result = string.Empty;
//foreach(var kvp in info)
//{
// result += $"Die Ressource \"{kvp.Key}\" ist im ausgewählten Zeitraum {start} bis {end} bereits gebucht";
// if(!kvp.Value.All(string.IsNullOrWhiteSpace))
// {
// result += ":<br /><br />";
// }
// foreach(var interval in kvp.Value)
// {
// result += $"{interval}<br />";
// }
//}
//return result;
}
[Authorize]

View File

@@ -101,7 +101,6 @@ function validateAppointmentForm() {
if(endDate.isBefore(startDate)) {
hideSpinner();
//$("#messagePopup .modal-body").html('<div class="alert alert-danger" role="alert">Das Startdatum muss vor dem Enddatum liegen.</div>');
showMessagePopupWithHtml("Fehler", '<div class="alert alert-danger" role="alert">Das Startdatum muss vor dem Enddatum liegen.</div>');
return;
}
@@ -111,20 +110,35 @@ function validateAppointmentForm() {
$("#resources-popup input:checked").each(function() {
var id = $(this).attr("id");
selectedOids.push(id.split("-")[0]);
logInfo(id);
selectedOids.push(id.split("-")[1]);
});
for(var i = 0; i < selectedOids.length; i++) {
oidString += selectedOids[i] + ",";
}
$.get(getCheckResourcesAvailabilityUrl(), { start: startDate.format("DD.MM.YYYY HH:mm"), end: endDate.format("DD.MM.YYYY HH:mm"), resourceOids: oidString }).done(function(result) {
if(result === undefined || result === null || result.length === 0) {
return;
}
$.get(getCheckResourcesAvailabilityUrl(), { start: startDate.format("DD.MM.YYYY HH:mm"), end: endDate.format("DD.MM.YYYY HH:mm"), resourceOids: oidString, allDay: isAllDay }).done(function(result) {
if (result.length > 1) {
try {
// ToDo: Wieder einchecken! (24.07.2023)
//hideSpinner();
//if (result.includes("Fehler!")) {
// showErrorMessagePopup(result.substring(7));
// return;
//} else {
// showMessagePopupWithHtml("Überschneidung",
// result,
// function() {
// $("#messagePopup .modal-body").html();
// showSpinner();
// insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm"));
// },
// false);
//}
var unavailableResources = $.parseJSON(result);
var resourceCount = 0;
var names = "";
@@ -140,14 +154,14 @@ function validateAppointmentForm() {
});
var unavailableResourcesMessage;
if(resourceCount > 0) {
if(resourceCount > 1) {
unavailableResourcesMessage = "Einige der ausgewählten Ressourcen (" + names + ") sind zum gewählten Zeitpunkt nicht verfügbar.";
} else {
unavailableResourcesMessage = "Eine der ausgewählten Ressourcen (" + names + ") ist zum gewählten Zeitpunkt nicht verfügbar.";
}
hideSpinner();
showWarningMessageBox("Überschneidung", unavailableResourcesMessage, function() {
@@ -158,13 +172,13 @@ function validateAppointmentForm() {
return;
}
} catch(error) {
} catch (error) {
showErrorPopup(error);
return;
}
} else {
insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm"));
}
insertOrUpdateAppointment(startDate.format("DD.MM.YYYY"), endDate.format("DD.MM.YYYY"), startDate.format("HH:mm"), endDate.format("HH:mm"));
});
}

View File

@@ -32,15 +32,12 @@
var form = $('#change-password-form');
var isValid = true;
// ToDo: Hier weitermachen
//$.each($(".pw-chng-inv-fdb"),
$.each($(".pw-ch-in-container"),
function (index, item) {
var input = $(item).find("input");
var feedback = $(item).find(".pw-chng-inv-fdb");
logInfo3(input.val());
if (isEmptyOrSpaces(input.val())) {
feedback.addClass("d-block");
isValid = false;
@@ -248,6 +245,8 @@
"#distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn").prop("disabled", (hasSelectedSupportConcepts ? false : true));
}
$("#fehlerdetail-textarea").prop("disabled", false);
if ("@Model.IsInMultiBookingMode".toLowerCase() === "true") {
var isMultiBookingFormEnabeld = "@Model.MultiBookingSelectedConceptCostBearerRelations.Any()".toLowerCase() === "true";

View File

@@ -757,7 +757,7 @@
}
}
var cardBackground = serviceRecord.GroupOid.HasValue ? "bg-bewo-group-booking" : string.Empty;
var cardBackground = serviceRecord.ServiceRecordType == ServiceRecordTypeId.Content ? "bg-service-record-marked" : serviceRecord.GroupOid.HasValue ? "bg-bewo-group-booking" : string.Empty;
<div class="row mb-3">
<div class="card w-100 @cardBackground">

View File

@@ -106,6 +106,11 @@
configureErrorPopup(textToShow);
}
function showErrorMessagePopup(text) {
hideSpinner();
configureErrorPopup(text);
}
function configureErrorPopup(textToShow) {
$("#fehlerdetail-textarea").text(textToShow);
$("#error-message-popup").modal("show");

View File

@@ -5183,7 +5183,8 @@ namespace BeWo.Data.Access
return signature.Count == 1;
}
// ToDo: Nach Meeting mit Jörg am 10.07.2023 weitermachen
// ToDo: FALSCHE METHODE! SUCHT NUR NACH SERIENTERMINEN, DIE SO NICHT IN DER DATENBANK SIND!
// ToDo: SQL BEARBEITEN, DAMIT DIE SCHEDULERAPPOINTMENT-OBJEKTE ZURÜCKGEGEBEN WERDEN UND NICHT DIE GEBUCHTEN RESSOURCEN!
/// <summary>
/// Prüft anhand der Oids von Ressourcen deren Verfügbarkeit in einem Zeitraum.
/// Gibt die nicht verfügbaren Ressourcen und Mitarbeiter, die sie gebucht aben zurück für eine detaillierte Fehlermeldung.
@@ -5195,23 +5196,39 @@ namespace BeWo.Data.Access
/// <param name="recurrenceId">Recurrence Id, falls es sich um einen Serientermin handelt, der keine eigene Oid hat.</param>
/// <param name="occurrenceIndex">Occurrence-Index des Serientermins ohne eigene Oid</param>
/// <returns>Die im angegebenen Zeitraum belegten Ressourcen mit den Mitarbeitern, die sie gebucht haben</returns>
public Dictionary<Resource, List<Employee>> FindBookedResourcesWithBookingEmployees(List<long> resourceOids, DateTime start, DateTime end, long? selectedAppointmentOid, Guid? recurrenceId = null, int? occurrenceIndex = null)
public List<SchedulerAppointment> FindAppointmentsByResourcesInInterval(List<long> resourceOids, DateTime start, DateTime end, long? selectedAppointmentOid, Guid? recurrenceId = null, int? occurrenceIndex = null)
{
var result = new Dictionary<Resource, List<Employee>>();
//var c = CreateCriteria<Resource>("r").Add(Restrictions.Eq(nameof(BeWoEntityBase.IsActive), ActivationTypeId.Active)).Add(Restrictions.In(nameof(BeWoEntityBase.Oid), resourceOids));
var c = CreateCriteria<Resource>("r").Add(Restrictions.Eq(nameof(BeWoEntityBase.IsActive), ActivationTypeId.Active)).Add(Restrictions.In(nameof(BeWoEntityBase.Oid), resourceOids));
//var excludingSelectedAppointment = selectedAppointmentOid.HasValue ? $"Oid <> {selectedAppointmentOid} AND " : "";
var excludingSelectedAppointment = selectedAppointmentOid.HasValue ? $"Oid <> {selectedAppointmentOid} AND " : "";
//var sql = "Oid IN " +
// "(SELECT ResourceOid FROM resource2newschapp r2n WHERE r2n.NewSchAppOid IN " +
// $"(SELECT Oid FROM newschedulerappointment WHERE IsActive = 1 AND Type <> 4 AND {excludingSelectedAppointment}('{start:yyyy-MM-dd HH:mm:ss}' > StartDate OR '{end:yyyy-MM-dd HH:mm:ss}' > StartDate) AND ('{start:yyyy-MM-dd HH:mm:ss}' < EndDate OR '{end:yyyy-MM-dd HH:mm:ss}' < EndDate)))";
var sql = "Oid IN " +
"(SELECT ResourceOid FROM resource2newschapp r2n WHERE r2n.NewSchAppOid IN " +
$"(SELECT Oid FROM newschedulerappointment WHERE IsActive = 1 AND Type <> 4 AND {excludingSelectedAppointment}('{start:yyyy-MM-dd HH:mm:ss}' > StartDate OR '{end:yyyy-MM-dd HH:mm:ss}' > StartDate) AND ('{start:yyyy-MM-dd HH:mm:ss}' < EndDate OR '{end:yyyy-MM-dd HH:mm:ss}' < EndDate)))";
//var criterion = Expression.Sql(sql);
//c.Add(criterion);
//var resources = c.List<Resource>().ToList();
var c2 = CreateCriteriaIsActive<SchedulerAppointment>()
.Add(Restrictions.Not(Restrictions.Eq(nameof(SchedulerAppointment.Type), 4)))
.Add(Expression.Sql($"'{start:yyyy-MM-dd HH:mm:ss}' BETWEEN StartDate AND EndDate OR '{end:yyyy-MM-dd HH:mm:ss}' BETWEEN StartDate AND EndDate OR StartDate BETWEEN '{start:yyyy-MM-dd HH:mm:ss}' AND '{end:yyyy-MM-dd HH:mm:ss}' OR EndDate BETWEEN '{start:yyyy-MM-dd HH:mm:ss}' AND '{end:yyyy-MM-dd HH:mm:ss}'"));
if(!(selectedAppointmentOid is null))
{
c2.Add(Restrictions.Not(Restrictions.Eq(nameof(BeWoEntityBase.Oid), selectedAppointmentOid)));
}
c2.CreateAlias(nameof(SchedulerAppointment.ResourceList), "resources", JoinType.InnerJoin)
.Add(Restrictions.In($"resources.{nameof(BeWoEntityBase.Oid)}", resourceOids));
var appointments = c2.List<SchedulerAppointment>().ToList();
var criterion = Expression.Sql(sql);
c.Add(criterion);
var resources = c.List<Resource>().ToList();
var recurringAppointmentsCriteria = CreateRecurrenceCriteria(start, end).Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 1));
@@ -5219,9 +5236,10 @@ namespace BeWo.Data.Access
recurringAppointments = recurringAppointments.Where(s => s.ResourceList.Any(r => r.Oid.HasValue && resourceOids.Contains(r.Oid.Value))).ToList();
// ToDo: Wieso wird das gemacht?
if(recurringAppointments.Count == 0)
{
return result;
//return new List<SchedulerAppointment>();
}
var changedOccurrencesCriteria = CreateCriteriaIsActive<SchedulerAppointment>().Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 3));
@@ -5232,7 +5250,7 @@ namespace BeWo.Data.Access
changedOccurrencesCriteria.Add(inBetween);
deletedOccurrencesCriteria.Add(inBetween);
var appointments = new List<SchedulerAppointment>();
//var appointments = new List<SchedulerAppointment>();
if(selectedAppointmentOid.HasValue)
{
@@ -5302,12 +5320,7 @@ namespace BeWo.Data.Access
return false;
}
if(guid.Value.Equals(patternId) && index == i)
{
return true;
}
return false;
return guid.Value.Equals(patternId) && index == i;
}) || deletedOccurrences.Any(a =>
{
var guid = a.GetRecurrenceIdAndIndex(out var i);
@@ -5317,12 +5330,7 @@ namespace BeWo.Data.Access
return false;
}
if(guid.Value.Equals(patternId) && index == i)
{
return true;
}
return false;
return guid.Value.Equals(patternId) && index == i;
});
if(isDeletedOrChanged)
@@ -5340,21 +5348,21 @@ namespace BeWo.Data.Access
var occurrenceAppointment = new SchedulerAppointment
{
AllDay = occurrence.AllDay,
CustomerList = recurringAppointment.CustomerList,
Notice = recurringAppointment.Notice,
EmployeeList = recurringAppointment.EmployeeList,
EndDate = occurrence.Start.AddMinutes(duration),
AllDay = occurrence.AllDay,
CustomerList = recurringAppointment.CustomerList,
Notice = recurringAppointment.Notice,
EmployeeList = recurringAppointment.EmployeeList,
EndDate = occurrence.Start.AddMinutes(duration),
FormerBookingSequenceOid = recurringAppointment.FormerBookingSequenceOid,
IsPrivate = recurringAppointment.IsPrivate,
Location = recurringAppointment.Location,
Originator = recurringAppointment.Originator,
RecurrenceInfo = occurrence.RecurrenceInfo.ToXml(),
ReminderInfo = recurringAppointment.ReminderInfo,
ResourceList = recurringAppointment.ResourceList,
StartDate = occurrence.Start,
Subject = recurringAppointment.Subject ?? Empty,
Type = recurringAppointment.Type
IsPrivate = recurringAppointment.IsPrivate,
Location = recurringAppointment.Location,
Originator = recurringAppointment.Originator,
RecurrenceInfo = occurrence.RecurrenceInfo.ToXml(),
ReminderInfo = recurringAppointment.ReminderInfo,
ResourceList = recurringAppointment.ResourceList,
StartDate = occurrence.Start,
Subject = recurringAppointment.Subject ?? Empty,
Type = recurringAppointment.Type
};
if(!(recurrenceId is null) && occurrenceIndex.HasValue)
@@ -5371,16 +5379,19 @@ namespace BeWo.Data.Access
}
}
// ToDo: Hier noch die Mitarbeiter zurückgeben
appointments.DoForEach(a => a.ResourceList.DoForEach(resources.AddIfNotIn));
return appointments.ToList();
}
appointments.DoForEach(appointment =>
{
appointment.ResourceList.DoForEach(resource =>
{
public List<ConfirmationReceiptSignature> LoadAllConfirmationReceiptSignaturesByServiceRecordOids(IList<long> serviceRecordOids)
{
var c = CreateCriteria<ConfirmationReceiptSignature>()
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "sr", JoinType.InnerJoin)
.Add(Restrictions.In($"sr.{nameof(BeWoEntityBase.Oid)}", serviceRecordOids.ToArray()));
});
});
// Der ResultTransformer erzeugt ein SELECT DISTINCT für den Roottypen (ConfirmationReceiptSignature)
c.SetResultTransformer(new DistinctRootEntityResultTransformer());
var result = c.List<ConfirmationReceiptSignature>().ToList();
return result;
}

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Service.Plugins;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
namespace BetreuWoReports.Service
{
@@ -22,9 +21,9 @@ namespace BetreuWoReports.Service
return new List<ResourceDC>();
}
public override Dictionary<ResourceDC, List<CompactEmployeeDC>> CheckResourceAvailabilityWithBookingEmployees(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid)
public override List<SchedulerAppointmentDC> CheckResourceAvailabilityWithBookingEmployees(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid)
{
return new Dictionary<ResourceDC, List<CompactEmployeeDC>>();
return new List<SchedulerAppointmentDC>();
}
}
}

View File

@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
using DevExpress.XtraReports.Design;
using DevExpress.XtraReports.UI;
namespace SKFLeverkusen

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text.RegularExpressions;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
namespace SKFLeverkusen
{
public partial class Quittierungsbeleg : XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Quittierungsbeleg()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
var hatGruppen = false;
if(pRO.Services != null)
{
var servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach(var sd in pRO.Services)
{
if(sd.IsBillable || sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt"))
{
ServicesOverviewRO.CreateSignatureString(sd);
sd.Notice5 = "E";
if(sd.IsGroup)
{
sd.Notice5 = "GR";
hatGruppen = true;
}
if(sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt"))
{
sd.Notice5 = "F";
}
servicesBillable.Add(sd);
}
}
pRO.Services = servicesBillable;
}
if(string.IsNullOrWhiteSpace(pRO.AbsenceTimes))
{
lblHatAbwesenheiten.Text = "X";
}
if(!hatGruppen)
{
lblHatGruppen.Text = "X";
}
ErstelleAbwesenheitenTabelle(pRO);
bindingSource1.DataSource = pRO;
}
private void ErstelleAbwesenheitenTabelle(ServicesOverviewRO pRo)
{
if(pRo.Abwesenheiten is null)
{
return;
}
var newRows = 0;
var index = 1;
foreach(var at in pRo.Abwesenheiten)
{
XRTableRow row;
if(index < xrTableAbwesenheiten.Rows.Count)
{
row = xrTableAbwesenheiten.Rows[index];
}
else
{
row = xrTableAbwesenheiten.InsertRowBelow(xrTableAbwesenheiten.Rows[xrTableAbwesenheiten.Rows.Count - 1]);
newRows++;
}
row.Cells[0].Text = $"{at.Start:dd.MM.yyyy}";
int? days = null;
if(at.End.HasValue)
{
row.Cells[1].Text = $"{at.End:dd.MM.yyyy}";
days = (int)at.End.Value.Subtract(at.Start.Value).TotalDays + 1;
}
else
{
row.Cells[1].Text = "unbekannt";
}
row.Cells[2].Text = String.Format("{0:0}", days);
index++;
}
if(newRows <= 0)
{
return;
}
lblUnterschriftKlient.Top += newRows * 20;
lblUnterschriftMitarbeiter.Top += newRows * 20;
}
private void picSignature_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
if(sender is XRPictureBox xrPictureBox && xrPictureBox.Tag is string base64ImageString)
{
if(!string.IsNullOrWhiteSpace(base64ImageString))
{
var base64Data = Regex.Match(base64ImageString, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
var binData = Convert.FromBase64String(base64Data);
var img = ByteArrayToImage(binData);
xrPictureBox.Image = Utils.CropImage(img);
}
else
{
xrPictureBox.Image = null;
}
}
var xrBox = sender as XRPictureBox;
var base64String = xrBox.Tag as string;
if (!string.IsNullOrWhiteSpace(base64String))
{
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
var binData = Convert.FromBase64String(base64Data);
var img = ByteArrayToImage(binData);
xrBox.Image = Utils.CropImage(img);
}
else
{
xrBox.Image = null;
}
}
public Image ByteArrayToImage(byte[] byteArrayIn)
{
using(var memoryStream = new MemoryStream(byteArrayIn))
{
return Image.FromStream(memoryStream);
}
}
}
}

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>21, 17</value>
</metadata>
<data name="xrRichText2.SerializableRtfString" xml:space="preserve">
<value>ewBcAHIAdABmADEAXABkAGUAZgBmADAAewBcAGYAbwBuAHQAdABiAGwAewBcAGYAMAAgAEMAYQBsAGkAYgByAGkAOwB9AHsAXABmADEAIABUAGkAbQBlAHMAIABOAGUAdwAgAFIAbwBtAGEAbgA7AH0AewBcAGYAMgAgAEEAcgBpAGEAbAA7AH0AfQB7AFwAYwBvAGwAbwByAHQAYgBsACAAOwBcAHIAZQBkADAAXABnAHIAZQBlAG4AMABcAGIAbAB1AGUAMAAgADsAXAByAGUAZAAwAFwAZwByAGUAZQBuADAAXABiAGwAdQBlADIANQA1ACAAOwB9AHsAXAAqAFwAZABlAGYAYwBoAHAAIABcAGYAMQBcAGYAcwAyADQAfQB7AFwAcwB0AHkAbABlAHMAaABlAGUAdAAgAHsAXABxAGwAXABmADEAXABmAHMAMgA0ACAATgBvAHIAbQBhAGwAOwB9AHsAXAAqAFwAYwBzADEAXABmADEAXABmAHMAMgA0AFwAYwBmADEAIABEAGUAZgBhAHUAbAB0ACAAUABhAHIAYQBnAHIAYQBwAGgAIABGA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AGYAMQAgAGEAYgByAGUAYwBoAG4AdQBuAGcAcwByAGUAbABlAHYAYQBuAHQAfQB7AFwAbABhAG4AZwAxADAAMwAxAFwAbABhAG4AZwBmAGUAMQAwADMAMQBcAGYAMgBcAGYAcwAyADAAXABjAGYAMQAgACAAaQBtACAAQQBiAHIAZQBjAGgAbgB1AG4AZwBzAHoAZQBpAHQAcgBhAHUAbQB9AFwAbABhAG4AZwAxADAAMwAxAFwAbABhAG4AZwBmAGUAMQAwADMAMQBcAGYAMQBcAGYAcwAyADQAXABjAGYAMQBcAHAAYQByAH0A</value>
</data>
<data name="xrRichText1.SerializableRtfString" xml:space="preserve">
<value>ewBcAHIAdABmADEAXABkAGUAZgBmADAAewBcAGYAbwBuAHQAdABiAGwAewBcAGYAMAAgAEMAYQBsAGkAYgByAGkAOwB9AHsAXABmADEAIABUAGkAbQBlAHMAIABOAGUAdwAgAFIAbwBtAGEAbgA7AH0AewBcAGYAMgAgAEEAcgBpAGEAbAA7AH0AfQB7AFwAYwBvAGwAbwByAHQAYgBsACAAOwBcAHIAZQBkADAAXABnAHIAZQBlAG4AMABcAGIAbAB1AGUAMAAgADsAXAByAGUAZAAwAFwAZwByAGUAZQBuADAAXABiAGwAdQBlADIANQA1ACAAOwB9AHsAXAAqAFwAZABlAGYAYwBoAHAAIABcAGYAMQBcAGYAcwAyADQAfQB7AFwAcwB0AHkAbABlAHMAaABlAGUAdAAgAHsAXABxAGwAXABmADEAXABmAHMAMgA0ACAATgBvAHIAbQBhAGwAOwB9AHsAXAAqAFwAYwBzADEAXABmADEAXABmAHMAMgA0AFwAYwBmADEAIABEAGUAZgBhAHUAbAB0ACAAUABhAHIAYQBnAHIAYQBwAGgAIABGAG8AbgB0ADsAfQB7AFwAKgBcAGMAcwAyAFwAcwBiAGEAcwBlAGQAbwBuADEAXABmADEAXABmAHMAMgA0AFwAYwBmADEAIABMAGkAbgBlACAATgB1AG0AYgBlAHIAOwB9AHsAXAAqAFwAYwBzADMAXAB1AGwAX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GIAbABlACAAUwBpAG0AcABsAGUAIAAxADsAfQB9AHsAXAAqAFwAbABpAHMAdABvAHYAZQByAHIAaQBkAGUAdABhAGIAbABlAH0AXABuAG8AdQBpAGMAbwBtAHAAYQB0AFwAcwBwAGwAeQB0AHcAbgBpAG4AZQBcAGgAdABtAGEAdQB0AHMAcABcAHAAYQByAGQAXABwAGwAYQBpAG4AXABxAGwAewBcAGYAMgBcAGYAcwAyADAAXABjAGYAMQAgAEsAZQBpAG4AZQAgAH0AewBcAHUAbABcAGYAMgBcAGYAcwAyADAAXABjAGYAMQAgAEcAcgB1AHAAcABlAG4AYQBuAGcAZQBiAG8AdABlAH0AewBcAGYAMgBcAGYAcwAyADAAXABjAGYAMQAgACAAaQBtACAAQQBiAHIAZQBjAGgAbgB1AG4AZwBzAHoAZQBpAHQAcgBhAHUAbQB9AFwAZgAxAFwAZgBzADIANABcAGMAZgAxAFwAcABhAHIAfQA=</value>
</data>
</root>

View File

@@ -119,6 +119,12 @@
<Compile Include="Betreuungsvertrag.Designer.cs">
<DependentUpon>Betreuungsvertrag.cs</DependentUpon>
</Compile>
<Compile Include="Quittierungsbeleg.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Quittierungsbeleg.Designer.cs">
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>
</Compile>
<Compile Include="SettlementReport.cs">
<SubType>Component</SubType>
</Compile>
@@ -192,6 +198,10 @@
<EmbeddedResource Include="Betreuungsvertrag.resx">
<DependentUpon>Betreuungsvertrag.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Quittierungsbeleg.resx">
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SettlementReport.resx">
<DependentUpon>SettlementReport.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -142,7 +142,7 @@ namespace BeWo.Service.Plugins
//t = "3956369664"; // LH Wetterau
//t = "3984525482"; // API Berlin
//t = "9975231461"; // Selwo
t = "8181286349"; // BeWo am Rhein
//t = "8181286349"; // BeWo am Rhein
//t = "4595275645"; // Eigenständig
//t = "7912635399"; // Prof. Dr. Eggers Stiftung
//t = "3549726254"; // Socia
@@ -157,7 +157,7 @@ namespace BeWo.Service.Plugins
//t = "3852198843"; // LH Mannheim
//t = "9800364930"; // BeWo Leverkusen
//t = "4439874912"; // BeWo Sahin
t = "1873138856"; // BUG e.V.
//t = "1873138856"; // BUG e.V.
//t = "6463422907"; // Caritas Leverkusen
//t = "6149463003"; // Diakonisches Werk Bad Windsheim Neustadt a. d. Aisch
//t = "6548202677"; // VKM Aachen SBD
@@ -195,7 +195,7 @@ namespace BeWo.Service.Plugins
//t = "9556218062"; // Diakonie Landshut
//t = "2279593936"; // Diakonie Mülheim
//t = "3623837005"; // Betreuwo Wesel
//t = "8407321888"; // AWO Wesel
t = "8407321888"; // AWO Wesel
//t = "8454426692"; // Mit-Menschen Wuppertal
//t = "0629004412"; // BeWo-Colonia Basaran (Projekt
//t = "7668701607"; // Wohnstätten Essen
@@ -209,7 +209,7 @@ namespace BeWo.Service.Plugins
//t = "4189934785"; // Landshuter Netzwerke
//t = "7584236951"; // Aachener Betreuungsbüro Kirschbaum und Manz GbR
//t = "3678599942"; // VKM Rietberg
t = "4069072369"; // BeWo Dreilich&Pastor (Projekt TranskulturellesBBPastor)
//t = "4069072369"; // BeWo Dreilich&Pastor (Projekt TranskulturellesBBPastor)
//t = "4160851689"; // BeWo Dreilich&Pastor (Dreilich)
//t = "9970072066"; // Bussmannshof
//t = "2993745954"; // Kollegium für freie Jugendarbeit und Berufsbildung e.V.
@@ -346,7 +346,7 @@ namespace BeWo.Service.Plugins
//t = "3226307161"; // Roman Roger Puth
//t = "3522103738"; // AWO Münsterland-Recklinghausen
//t = "5592509446"; // Kontakt Verein für psychosoziale Hilfen e.V
t = "5344902949"; // SHK Service GmbH SBD
//t = "5344902949"; // SHK Service GmbH SBD
//t = "1422963536"; // Malteser-Johanniter-Johanneshaus gGmbH
//t = "5433105975"; // aha e.V.
//t = "1701920223"; // SKFM Monheim

View File

@@ -1,13 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using NHibernate.Util;
namespace BeWo.Service.Plugins
{
@@ -32,21 +34,77 @@ namespace BeWo.Service.Plugins
return list;
}
public virtual Dictionary<ResourceDC, List<CompactEmployeeDC>> CheckResourceAvailabilityWithBookingEmployees(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid)
public virtual Dictionary<string, List<string>> CheckResourceAvailabilityWithBookingEmployees(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid)
{
var result = new Dictionary<ResourceDC, List<CompactEmployeeDC>>();
var appointments = DAOFactory.SearchDAO.FindAppointmentsByResourcesInInterval(resourceOids, start, end, selectedAppointmentOid);
var dictionary = DAOFactory.SearchDAO.CheckAvailabilityOfResources(resourceOids, start, end, selectedAppointmentOid);
var user = LoggedInUserOperationContextExt.Current?.User ?? SessionFacade.LoggedInUser;
dictionary.DoForEach(kvp =>
var result = new Dictionary<string, List<string>>();
if(user is null)
{
//var resourceDC = MapperFactory.ResourceDC_Resource.MapToNewDC(kvp.Key);
//var compactEmployeeDCs = MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(kvp.Value);
return result;
}
//result.Add(resourceDC, compactEmployeeDCs);
});
var loggedInEmployee = user.Employee;
var hasRightToViewEmployeeAppointments = user.CheckForRight(UserRightType.KalenderMitarbeitertermineAnsehen);
var hasRightToViewResourceAppointments = user.CheckForRight(UserRightType.KalenderRessourcentermineAnsehen);
var dictionary = new Dictionary<Resource, List<SchedulerAppointment>>();
foreach(var appointment in appointments)
{
foreach(var resource in appointment.ResourceList)
{
dictionary.AddOrUpdateValueInDictionary(resource, appointment);
}
}
foreach(var resource2Appointments in dictionary)
{
foreach(var appointment in resource2Appointments.Value)
{
var originator = appointment.Originator;
var employee2Appointments = appointment.EmployeeList;
var isOwnAppointment = (originator?.Equals(loggedInEmployee) ?? false) || employee2Appointments.ToList().Any(e2a => e2a.Employee.Equals(loggedInEmployee));
// Wenn isOwnAppointment true ist, darf der Benutzer die Uhrzeiten und die Mitarbeiter sehen. Ansonsten müssen die Rechte geprüft werden.
if(isOwnAppointment || hasRightToViewEmployeeAppointments) // Es werden Zeit und Mitarbeiter angezeigt
{
result.AddOrUpdateValueInDictionary(resource2Appointments.Key.Name, $"{CreateDateTimeInfoFromAppointment(appointment.StartDate, appointment.EndDate, appointment.AllDay)} von {originator}");
}
else if(hasRightToViewResourceAppointments && !hasRightToViewEmployeeAppointments) // Nur die Uhrzeit anzeigen
{
result.AddOrUpdateValueInDictionary(resource2Appointments.Key.Name, $"{CreateDateTimeInfoFromAppointment(appointment.StartDate, appointment.EndDate, appointment.AllDay)}");
}
else if(!hasRightToViewEmployeeAppointments) // Es werden weder Zeit noch Mitarbeiter angezeigt
{
result.AddOrUpdateValueInDictionary(resource2Appointments.Key.Name, string.Empty);
}
}
}
return result;
}
private string CreateDateTimeInfoFromAppointment(DateTime? start, DateTime? end, bool allDay)
{
if(start.HasValue && end.HasValue)
{
return start.Value.Date == end.Value.Date ?
$"{start.Value.ToShortTimeString()} - {end.Value.ToShortTimeString()} " :
$"{start.Value:dd.MM.yyyy HH:mm} - {end.Value:dd.MM.yyyy HH:mm} ";
}
if(allDay && start.HasValue && end.HasValue)
{
return start.Value.Date == end.Value.Date ? " " : $"{start.Value.ToShortDateString()} - {end.Value.ToShortDateString()} ";
}
return string.Empty;
}
}
}

View File

@@ -230,7 +230,6 @@ namespace BeWo.Service.Plugins
// });
//}
#if DEBUG
if(!(newServiceRecord.ServiceRecordOid is null))
{
var original = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(newServiceRecord.ServiceRecordOid.Value);
@@ -241,19 +240,11 @@ namespace BeWo.Service.Plugins
var areTimesEqual = startEqual && endEqual;
var confirmationReceiptSignatures = DAOFactory.SearchDAO.GetConfirmationReceiptSignaturesByServiceRecord(newServiceRecord.ServiceRecordOid.Value);
// ToDo: Nur anzeigen, wenn die Monatsunterschrift auch gültig ist? Welchen Zeitraum wählen? Den, der ausgewählt ist?
if(!areTimesEqual && confirmationReceiptSignatures.Any())
{
var sum = confirmationReceiptSignatures.Sum(s => s.ServiceRecords.Count);
var message = "Für diesen Eintrag existiert bereits eine Monatsunterschrift. Das Verändern von Datum oder Uhrzeit führt zu einer ungültigen Monatsunterschrift, die erneut geleistet werden muss, um auf dem Quittierungsbeleg angezeigt zu werden.";
if(sum == 1)
{
// Die Unterschrift wird gelöscht, weil der einzige damit verknüpfte Zeiterfassungseintrag geändert wird.
message = "Der zu speichernde Zeiterfassungseintrag ist der einzige, für den eine Monatsunterschrift geleistet wurde. Das Speichern führt zur Löschung der Monatsunterschrift.";
}
result.Add(new ServiceRecordValidationResultDC
{
ResultType = ServiceRecordValidationResult.SignatureExists,
@@ -262,7 +253,6 @@ namespace BeWo.Service.Plugins
});
}
}
#endif
bool isGroupRecord = (cb2scOids != null && cb2scOids.Count > 1) ||
(employeeOids != null && employeeOids.Count > 1);
@@ -1094,24 +1084,42 @@ namespace BeWo.Service.Plugins
{
Allow = true,
ResultType = ServiceRecordValidationResult.Custom,
Message = "Dieser Eintrag wurde bereits unterschrieben.\nMöchten Sie ihn trotzdem löschen?"
});
Message = "Dieser Eintrag wurde bereits unterschrieben.\n\nMöchten Sie ihn trotzdem löschen?"
});
}
// TODO: Flag beachten
// 2. Prüfe, ob eine Mitarbeiterunterschrift mit diesem Eintrag verknüpft ist
//if(serviceRecord.ServiceRecordOid.HasValue)
//{
// var hasEmployeeSignature = DAOFactory.SearchDAO.HasEmployeeSignaturesForServiceRecord(serviceRecord.ServiceRecordOid.Value);
// 2. Prüfe, ob eine Mitarbeiterunterschrift mit diesem Eintrag verknüpft ist
//if(serviceRecord.ServiceRecordOid.HasValue)
//{
// var hasEmployeeSignature = DAOFactory.SearchDAO.HasEmployeeSignaturesForServiceRecord(serviceRecord.ServiceRecordOid.Value);
// if(hasEmployeeSignature)
// {
// result.Add(new ServiceRecordValidationResultDC
// {
// ResultType = ServiceRecordValidationResult.HasEmployeeSignature
// });
// }
//}
// if(hasEmployeeSignature)
// {
// result.Add(new ServiceRecordValidationResultDC
// {
// ResultType = ServiceRecordValidationResult.HasEmployeeSignature
// });
// }
//}
// 3. Prüfe, ob eine Monatsunterschrift vorhanden ist.
if(serviceRecord.ServiceRecordOid is null)
{
return result;
}
var confirmationReceiptSignatures = DAOFactory.SearchDAO.GetConfirmationReceiptSignaturesByServiceRecord(serviceRecord.ServiceRecordOid.Value);
if(confirmationReceiptSignatures.Any(crs => crs.IsActive == ActivationTypeId.Active))
{
result.Add(new ServiceRecordValidationResultDC
{
ResultType = ServiceRecordValidationResult.Custom,
Message = "Für diesen Eintrag existiert bereits eine Monatsunterschrift. Das Löschen dieses Eintrags führt zu einer ungültigen Monatsunterschrift, die erneut geleistet werden muss, um auf dem Quittierungsbeleg angezeigt zu werden.\n\nMöchten Sie ihn trotzdem löschen?",
Allow = true
});
}
return result;
}

View File

@@ -240,5 +240,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<AbsenceTimeDC> GetAllActiveEmployeeAbsenceTimesInInterval(DateTime start, DateTime end, long employeeOid, List<long> selectedEmployeeOids);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
Dictionary<string, List<string>> CheckResourceAvailabilityWithEmployeeInformation(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid);
}
}

View File

@@ -325,6 +325,8 @@ namespace BeWo.Service.ServiceImplementations
{
if(item.Group != null)
{
RemoveServiceRecordsFromConfirmationReceiptSignatureForDeletion(item.Group.ServiceRecordList);
DeleteServiceRecordsFromAppointments(item.Group.ServiceRecordList.ToList());
DAOFactory.GenericDAO.Delete(item.Group);
@@ -340,6 +342,8 @@ namespace BeWo.Service.ServiceImplementations
return;
}
RemoveServiceRecordsFromConfirmationReceiptSignatureForDeletion(srListToDelete);
DeleteServiceRecordsFromAppointments(srListToDelete);
DAOFactory.GenericDAO.Delete(srListToDelete);
@@ -7560,10 +7564,12 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
var originals = DAOFactory.GenericDAO.LoadByIDs<ConfirmationReceiptSignature>(oid2Version.Select(e => e.Key));
originals.DoForEach(or => MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.ConcurrencyCheck(oid2Version[or.Oid.Value], or));
//var originals = DAOFactory.GenericDAO.LoadByIDs<ConfirmationReceiptSignature>(oid2Version.Select(e => e.Key));
//originals.DoForEach(or => MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.ConcurrencyCheck(oid2Version[or.Oid.Value], or));
DAOFactory.GenericDAO.Delete(originals);
//DAOFactory.GenericDAO.Delete(originals);
ServiceLogic.SetActivationType<ConfirmationReceiptSignature>(oid2Version, ActivationTypeId.Deleted);
}
catch(Exception e)
{
@@ -7672,7 +7678,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
var confirmationReceiptSignatures = DAOFactory.SearchDAO.LoadConfirmationReceiptSignaturesByServiceRecordOids(serviceRecordOids);
var confirmationReceiptSignatures = DAOFactory.SearchDAO.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(serviceRecordOids);
var confirmationReceiptSignatures2Delete = new List<ConfirmationReceiptSignature>();
var confirmationReceiptSignatures2Update = new List<ConfirmationReceiptSignature>();
@@ -7704,6 +7710,22 @@ namespace BeWo.Service.ServiceImplementations
ServiceLogic.SetActivationType<ConfirmationReceiptSignature>(oids2Versions, ActivationTypeId.Deleted);
}
private static void RemoveServiceRecordsFromConfirmationReceiptSignatureForDeletion(IEnumerable<ServiceRecord> serviceRecords)
{
var serviceRecordOids = serviceRecords.Select(serviceRecord => serviceRecord.Oid.Value).ToList();
var confirmationReceiptSignatures = DAOFactory.SearchDAO.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(serviceRecordOids);
foreach(var signature in confirmationReceiptSignatures)
{
var serviceRecords2Keep = signature.ServiceRecords.Where(serviceRecord => serviceRecord.Oid.HasValue && !serviceRecordOids.Contains(serviceRecord.Oid.Value)).ToList();
signature.ServiceRecords.Clear();
signature.ServiceRecords = serviceRecords2Keep;
}
DAOFactory.GenericDAO.Update(confirmationReceiptSignatures);
}
public List<RatingTypeDC> GetRatingTypesByOids(List<long> ratingTypeOids)
{
try

View File

@@ -2570,13 +2570,11 @@ namespace BeWo.Service.ServiceImplementations
var s = PluginLoader.FindClass<ResourceService>();
return s.CheckResourceAvailability(start, end, resourceOids, selectedAppointmentOid);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public SchedulerAppointmentDC FindRootAppointmentByRecurrenceId(string recurrenceId)
@@ -2713,5 +2711,19 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
public Dictionary<string, List<string>> CheckResourceAvailabilityWithEmployeeInformation(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid)
{
try
{
var s = PluginLoader.FindClass<ResourceService>();
return s.CheckResourceAvailabilityWithBookingEmployees(start, end, resourceOids, selectedAppointmentOid);
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
}
}