Mobilklient:
- Aufgaben werden nicht mehr doppelt angezeigt
- Erledigte Aufgaben werden nicht mehr angezeigt
- Die Meldung bei bereits belegten Ressourcen ist wieder sichtbar
This commit is contained in:
@@ -64,6 +64,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Index", "Login");
|
||||
}
|
||||
|
||||
#region Rechte
|
||||
// 1. Universalrechte
|
||||
var universalRechteGroup = new UserRightGroup("Universalrechte", new Dictionary<UserRightType, string>
|
||||
{
|
||||
@@ -413,7 +414,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.UserRightGroups.Add(sonstigeRightGroup);
|
||||
|
||||
Model.UserRightGroups = Model.UserRightGroups.OrderBy(urg => urg.UserRightTypes.Keys.Count).ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
// Verfügbare Ressourcen für die Termine
|
||||
var allResources = KalenderService.GetAllResources().ToList();
|
||||
@@ -429,6 +430,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.AllEmployees = EmployeeService.GetAllActiveEmployeesCompact();
|
||||
|
||||
Model.AllCustomers = CustomerService.GetAllActiveCompactCustomers();
|
||||
|
||||
return View(Model);
|
||||
}
|
||||
|
||||
@@ -537,6 +540,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
_IntervalStart = start;
|
||||
|
||||
_AppointmentStart = _IntervalStart.MergeDatesByDate(new DateTime(2000, 1, 1, 6, 0, 0));
|
||||
|
||||
// Keine Mitarbeiter, Ressourcen und Klienten ausgewählt -> nur Einzeltermine erstellen
|
||||
/*
|
||||
* Nur Originator (4):
|
||||
@@ -555,14 +560,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
* Originator und Mitarbeiter und Ressourcen und Klienten (4)
|
||||
*
|
||||
* TODO: Datumsangaben für die Termine bestimmen. Mindestintervall bestimmen
|
||||
* Jeweils eine Stunde lang
|
||||
*
|
||||
* Einzeltermine:
|
||||
* S 08:00 - 09:00
|
||||
* S 09:30 - 10:30
|
||||
* S 11:00 - 12:00
|
||||
* S 12:30 - 13:30
|
||||
*
|
||||
*/
|
||||
|
||||
var app1 = CreateTestAppointment("Normaler Termin", originator);
|
||||
@@ -615,25 +612,79 @@ namespace BeWoPlanerMobil.Controllers
|
||||
appointments.AddRange(onlyCustomerAppointments);
|
||||
}
|
||||
|
||||
appointments.AddRange(CreateEmployeeAndResourceAppointments(originator));
|
||||
|
||||
// Terrmin mit angemeldetem Mitarbeiter, anderen Mitarbeitern und Ressourcen
|
||||
if(Model.SelectedEmployees.Count > 0 && Model.SelectedResources.Count > 0)
|
||||
{
|
||||
appointments.AddRange(CreateEmployeeAndResourceAppointments(originator));
|
||||
}
|
||||
|
||||
/*
|
||||
* Originator und Mitarbeiter und Ressourcen (4)
|
||||
* Originator und Mitarbeiter und Klienten (4)
|
||||
* Originator und Ressourcen und Klienten (4)
|
||||
* Originator und Mitarbeiter und Ressourcen und Klienten (4)
|
||||
*/
|
||||
// Termine mit angemeldetem Mitarbeiter, Klienten und Mitarbeitern
|
||||
if(Model.SelectedEmployees.Count > 0 && Model.SelectedCustomers.Count > 0)
|
||||
{
|
||||
appointments.AddRange(CreateEmployeeAndCustomerAppointments(originator));
|
||||
}
|
||||
|
||||
//KalenderService.InsertSchedulerAppointments(appointments);
|
||||
// Termine mit angemeldetem Mitarbeiter, Ressourcen und Klienten
|
||||
if(Model.SelectedResources.Count > 0 && Model.SelectedCustomers.Count > 0)
|
||||
{
|
||||
appointments.AddRange(CreateResourceAndCustomerAppointments(originator));
|
||||
}
|
||||
|
||||
// Termine mit angemeldetem Mitarbeiter mit anderen Mitarbeitern, Klienten und Ressourcen
|
||||
if(Model.SelectedEmployees.Count > 0 && Model.SelectedResources.Count > 0 && Model.SelectedCustomers.Count > 0)
|
||||
{
|
||||
appointments.AddRange(CreateResourceAndCustomerAndEmployeeAppointments(originator));
|
||||
}
|
||||
|
||||
KalenderService.InsertSchedulerAppointments(appointments);
|
||||
|
||||
return View("Development", Model);
|
||||
}
|
||||
|
||||
private IEnumerable<SchedulerAppointmentDC> CreateResourceAndCustomerAndEmployeeAppointments(CompactEmployeeDC originator)
|
||||
{
|
||||
if(Model == null || Model?.SelectedResources?.Count == 0 || Model?.SelectedCustomers?.Count == 0 || Model?.SelectedEmployees?.Count == 0)
|
||||
{
|
||||
return new List<SchedulerAppointmentDC>();
|
||||
}
|
||||
|
||||
var a1 = CreateTestAppointment("Termin mit Mitarbeitern, Ressourcen und Klienten", originator);
|
||||
var a2 = CreateTestAppointment("Privater Termin mit Mitarbeitern, Ressourcen und Klienten", originator, true);
|
||||
var a3 = CreateTestAppointment("Ganztägiger Termin mit Mitarbeitern, Ressourcen und Klienten", originator, false, true);
|
||||
var a4 = CreateTestAppointment("Ganztätiger, privater Termin mit Mitarbeitern, Ressourcen und Klienten", originator, true, true);
|
||||
|
||||
var result = new List<SchedulerAppointmentDC> { a1, a2, a3, a4 };
|
||||
|
||||
AddResourcesToAppointments(result);
|
||||
|
||||
AddCustomersToAppointments(result);
|
||||
|
||||
AddEmployeesToAppointments(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private IEnumerable<SchedulerAppointmentDC> CreateResourceAndCustomerAppointments(CompactEmployeeDC originator)
|
||||
{
|
||||
if(Model == null || Model?.SelectedResources?.Count == 0 || Model?.SelectedCustomers?.Count == 0)
|
||||
{
|
||||
return new List<SchedulerAppointmentDC>();
|
||||
}
|
||||
|
||||
var a1 = CreateTestAppointment("Termin mit Ressourcen und Klienten", originator);
|
||||
var a2 = CreateTestAppointment("Privater Termin mit Ressourcen und Klienten", originator, true);
|
||||
var a3 = CreateTestAppointment("Ganztägiger Termin mit Ressourcen und Klienten", originator, false, true);
|
||||
var a4 = CreateTestAppointment("Ganztätiger, privater Termin mit Ressourcen und Klienten", originator, true, true);
|
||||
|
||||
var result = new List<SchedulerAppointmentDC> { a1, a2, a3, a4 };
|
||||
|
||||
AddResourcesToAppointments(result);
|
||||
|
||||
AddCustomersToAppointments(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private IEnumerable<SchedulerAppointmentDC> CreateEmployeeAndResourceAppointments(CompactEmployeeDC originator)
|
||||
{
|
||||
if(Model == null || Model?.SelectedResources?.Count == 0 || Model?.SelectedEmployees?.Count == 0)
|
||||
@@ -709,7 +760,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
private static DateTime _IntervalStart;
|
||||
private static DateTime _AppointmentStart = DateTime.Today.MergeDatesByDate(new DateTime(2000, 1, 1, 6, 0, 0));
|
||||
|
||||
private static DateTime _AppointmentStart;
|
||||
|
||||
private static AppointmentDates CalcAppointmentDates(int minHour = 5, int maxHour = 23)
|
||||
{
|
||||
@@ -747,7 +799,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Location = "Kölle",
|
||||
Originator = originator,
|
||||
IsPrivate = isPrivate,
|
||||
AllDay = isAllDay
|
||||
AllDay = isAllDay,
|
||||
ActivationType = ActivationTypeId.Active
|
||||
};
|
||||
}
|
||||
|
||||
@@ -794,6 +847,15 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
return JsonConvert.SerializeObject(Model.SelectedCustomers.Count);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult DeleteTestAppointments()
|
||||
{
|
||||
KalenderService.DeleteMobileTestAppointments();
|
||||
|
||||
return RedirectToActionPermanent("Development");
|
||||
}
|
||||
}
|
||||
|
||||
public class UserRightGroup
|
||||
|
||||
@@ -2083,7 +2083,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult RedirectToReportView()
|
||||
{
|
||||
return AbstractModel.IsAllowedToSeeBills ? RedirectToActionPermanent("Report", "Report") : RedirectToMain();
|
||||
return AbstractModel.IsAllowedToSeeBills ? RedirectToActionPermanent("InitReports", "Report") : RedirectToMain();
|
||||
}
|
||||
|
||||
public ActionResult RedirectToMain()
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
* TODO:
|
||||
* TODO: Rechte:
|
||||
* TODO:
|
||||
* TODO:
|
||||
* TODO: Für das Standartdatum den ersten des letzten Monats nehmen ✓
|
||||
*
|
||||
*
|
||||
*/
|
||||
@@ -77,6 +77,35 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
|
||||
// Damit das Standartdatum beim allerersten Aufruf gesetzt werden kann, gibt es die InitReports-Methode
|
||||
|
||||
return View(Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult InitReports()
|
||||
{
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeScheduler)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(!AbstractModel.IsAllowedToSeeBills)
|
||||
{
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
|
||||
var month = DateTime.Today.Month;
|
||||
var year = DateTime.Today.Year;
|
||||
|
||||
var first = new DateTime(year, month, 1).AddMonths(-1);
|
||||
var last = first.AddMonths(1).AddDays(-1);
|
||||
|
||||
Model.SelectedYear = first.Year;
|
||||
Model.SelectedMonth = first.Month;
|
||||
Model.SelectedStartDay = first.Day;
|
||||
Model.SelectedEndDay = last.Day;
|
||||
|
||||
var filterEnums = Enum.GetValues(typeof(QBFilterEnum)).Cast<QBFilterEnum>();
|
||||
|
||||
Model.QbFilters.Clear();
|
||||
@@ -93,10 +122,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.Organisations = CustomerService.GetAllCostBearerCompact();
|
||||
Model.Organisations.Sort((x, y) => x.Name.CompareTo(y.Name));
|
||||
|
||||
|
||||
Model.AllTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid);
|
||||
|
||||
return View(Model);
|
||||
return View("Report", Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -250,10 +279,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
stringBuilder.Append(Model.SelectedServiceCategory.Name);
|
||||
}
|
||||
|
||||
var month = Model.SelectedMonth;
|
||||
var month = Model.SelectedMonth < 10 ? $"0{Model.SelectedMonth}" : Model.SelectedMonth.ToString();
|
||||
var year = Model.SelectedYear;
|
||||
var vom = Model.SelectedStartDay;
|
||||
var bis = Model.SelectedEndDay;
|
||||
var vom = Model.SelectedStartDay < 10 ? $"0{Model.SelectedStartDay}" : Model.SelectedStartDay.ToString();
|
||||
var bis = Model.SelectedEndDay < 10 ? $"0{Model.SelectedEndDay}" : Model.SelectedEndDay.ToString();
|
||||
|
||||
stringBuilder.Append($"vom {vom}.{month}. bis {bis}.{month}.{year}");
|
||||
|
||||
@@ -350,24 +379,69 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string CheckForEmployeeSignature(string customerOidString, string monthString, string yearString, string startDayString, string endDayString)
|
||||
public string CheckForEmployeeSignature(string customerOidString, string monthString, string yearString, string startDayString, string endDayString, string costbearerOidString, string employeeOidString, string serviceCategoryOidString)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid == null)
|
||||
{
|
||||
Logout();
|
||||
}
|
||||
|
||||
// TODO: Auswahl beachten
|
||||
/*
|
||||
* Methode im SearchDAO anpassen an Kostenträger, Leistungskategorie, Mitarbeiter, Team
|
||||
*/
|
||||
|
||||
var isParsingSuccessful1 = long.TryParse(customerOidString, out var customerOid);
|
||||
var isParsingSuccessful2 = int.TryParse(monthString, out var month);
|
||||
var isParsingSuccessful3 = int.TryParse(yearString, out var year);
|
||||
var isParsingSuccessful4 = int.TryParse(startDayString, out var startDay);
|
||||
var isParsingSuccessful5 = int.TryParse(endDayString, out var endDay);
|
||||
|
||||
if(isParsingSuccessful1 && isParsingSuccessful2 && isParsingSuccessful3 && isParsingSuccessful4 && isParsingSuccessful5 && year > 0)
|
||||
{
|
||||
var hasSignature = OperationsService.HasConfirmationReceiptSignatureByDateAndCustomer(customerOid, new DateTimeSpan(new DateTime(year, month, startDay), new DateTime(year, month, endDay)));
|
||||
long.TryParse(costbearerOidString, out var organisationOid);
|
||||
long.TryParse(employeeOidString, out var employeeOid);
|
||||
long.TryParse(serviceCategoryOidString, out var serviceCategoryOid);
|
||||
|
||||
return MobileUtils.SerializeObject(hasSignature);
|
||||
var customerOids = new List<long>();
|
||||
|
||||
if(Model.SelectedFilterItem != null)
|
||||
{
|
||||
switch(Model.SelectedFilterItem.FilterEnum)
|
||||
{
|
||||
case QBFilterEnum.AlleKlienten:
|
||||
customerOids = EmployeeService.GetActiveCompactCustomersForEmployee(Model.Employee.EmployeeOid).Select(s => s.CustomerOid).ToList();
|
||||
break;
|
||||
case QBFilterEnum.NurKlientenMeinesTeams:
|
||||
customerOids = GetTeamCustomerOids().ToList();
|
||||
break;
|
||||
case QBFilterEnum.MeineKlienten:
|
||||
customerOids = DefaultReportCreator.GetMeineKlientenOids().ToList();
|
||||
break;
|
||||
case QBFilterEnum.KlientenAuswahl:
|
||||
customerOids = new List<long> {customerOid};
|
||||
break;
|
||||
case QBFilterEnum.TeamAuswahl:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
long? costbearerOid = null;
|
||||
if(organisationOid > 0)
|
||||
{
|
||||
var organisation = Model.Organisations.FirstOrDefault(o => o.OrganisationOid.Equals(organisationOid));
|
||||
costbearerOid = organisation?.CostBearerOid;
|
||||
}
|
||||
|
||||
//if(isParsingSuccessful1 && isParsingSuccessful2 && isParsingSuccessful3 && isParsingSuccessful4 && isParsingSuccessful5 && year > 0)
|
||||
if(isParsingSuccessful2 && isParsingSuccessful3 && isParsingSuccessful4 && isParsingSuccessful5 && year > 0)
|
||||
{
|
||||
var theTimeSpan = new DateTimeSpan(new DateTime(year, month, startDay), new DateTime(year, month, endDay));
|
||||
|
||||
//var hasSignature = OperationsService.HasConfirmationReceiptSignatureByDateAndCustomer(customerOid, theTimeSpan);
|
||||
|
||||
var test = OperationsService.HasConfirmationReceiptSignature(customerOids, employeeOid == 0 ? null : (long?) employeeOid, costbearerOid, serviceCategoryOid == 0 ? null : (long?) serviceCategoryOid, theTimeSpan);
|
||||
|
||||
//return MobileUtils.SerializeObject(hasSignature);
|
||||
return MobileUtils.SerializeObject(false);
|
||||
}
|
||||
|
||||
return _LeerzeichenFuerGetMethoden;
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Web.Mvc;
|
||||
using BeWoPlanerMobil.Models;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
@@ -85,7 +86,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var tasks = appointments.Where(w => w.IsTask).ToList();
|
||||
|
||||
var zuErledigen = tasks.Where(t => t.DueDate.HasValue && t.DueDate.Value.Date >= DateTime.Today);
|
||||
var zuErledigen = tasks.Where(t => t.DueDate.HasValue && t.DueDate.Value.Date >= DateTime.Today && !t.CompletedDate.HasValue);
|
||||
|
||||
// Nur eigene Kliententermine ansehen
|
||||
if(!AbstractModel.HasRightToSeeAllCustomerAppointments)
|
||||
@@ -104,6 +105,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
var holySweetFlyingFuck = appointments.Where(w =>
|
||||
w.IsTask == false &&
|
||||
w.StartDate.HasValue && w.EndDate.HasValue &&
|
||||
((date.InBetween(w.StartDate.Value, w.EndDate.Value, false) ||
|
||||
date.CompareShortDates(w.StartDate.Value)) && w.RecurrenceInfo == null ||
|
||||
@@ -225,6 +227,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
appointmentToInsert.Description = notice;
|
||||
appointmentToInsert.Originator = MobileSessionFacade.LoggedInCompactEmployee;
|
||||
appointmentToInsert.Location = location;
|
||||
appointmentToInsert.ActivationType = ActivationTypeId.Active;
|
||||
|
||||
if (!isNew)
|
||||
{
|
||||
|
||||
@@ -41,14 +41,15 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO: Wieder einkommentieren
|
||||
return false;
|
||||
|
||||
#if DEBUG
|
||||
var mandator = new MobileSessionFacade().OperationsService.GetMandator();
|
||||
|
||||
var showEmployeeSignatureSetting = MobileUtils.GetSettingValue(mandator.Settings, "ShowEmployeeSignature");
|
||||
|
||||
return MobileSessionFacade.CheckForUserRight(UserRightType.Analysis_ServiceOverview_View) && showEmployeeSignatureSetting != null && showEmployeeSignatureSetting.Equals("1");
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BeWoPlanerMobil.Util.ReportUtils;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
@@ -35,11 +32,9 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = "Monat")]
|
||||
public int SelectedMonth { get; set; }
|
||||
[Display(Name = "Monat")] public int SelectedMonth { get; set; } = 1;
|
||||
|
||||
[Display(Name = "Jahr")]
|
||||
public int SelectedYear { get; set; }
|
||||
[Display(Name = "Jahr")] public int SelectedYear { get; set; } = 2021;
|
||||
|
||||
public List<SelectListItem> Months
|
||||
{
|
||||
@@ -85,16 +80,12 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
// Index
|
||||
var m = SelectedMonth;
|
||||
var y = SelectedYear;
|
||||
|
||||
var year = int.Parse(Years[y].Value);
|
||||
var month = int.Parse(Months[m].Value);
|
||||
var month = SelectedMonth;
|
||||
var year = SelectedYear;
|
||||
|
||||
var last = new DateTime(year, month, 1).AddMonths(1).AddDays(-1).Day;
|
||||
|
||||
for(var i = 0; i <= last; i++)
|
||||
for(var i = 1; i <= last; i++)
|
||||
{
|
||||
result.Add(new SelectListItem
|
||||
{
|
||||
@@ -114,9 +105,8 @@ namespace BeWoPlanerMobil.Models
|
||||
public int SelectedEndDay { get; set; }
|
||||
|
||||
public ConfirmationReceiptObject ConfirmationReceiptObject { get; set; }
|
||||
|
||||
|
||||
[Display(Name="Mitarbeiter")]
|
||||
|
||||
[Display(Name = "Mitarbeiter")]
|
||||
public long? SelectedEmployeeOid => SelectedEmployee?.EmployeeOid;
|
||||
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
@@ -141,8 +131,7 @@ namespace BeWoPlanerMobil.Models
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Display(Name="Kostenträger")]
|
||||
public long? SelectedOrganisationOid => SelectedOrganisation?.OrganisationOid;
|
||||
|
||||
@@ -169,7 +158,6 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Display(Name="Leistungskategorie")]
|
||||
public long? SelectedServiceCategoryOid => SelectedServiceCategory?.ServiceCategoryOid;
|
||||
|
||||
@@ -200,8 +188,7 @@ namespace BeWoPlanerMobil.Models
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Display(Name="Filter")]
|
||||
public QbFilterItem SelectedFilterItem { get; set; }
|
||||
|
||||
|
||||
@@ -1,29 +1,10 @@
|
||||
function initializeYearAndMonths() {
|
||||
var begin = moment(new Date()).date(1);
|
||||
|
||||
for (var i = begin.year(); i > begin.year() - 10; i--) {
|
||||
var option = new Option(i, i);
|
||||
$("#year-select").append(option);
|
||||
}
|
||||
|
||||
var first = moment(new Date(begin.year(), 0, 1));
|
||||
for(var j = 0; j < 12; j++) {
|
||||
var option2 = new Option(first.format("MMMM"), j + 1);
|
||||
$("#month-select").append(option2);
|
||||
|
||||
first.add(1, "month");
|
||||
}
|
||||
|
||||
$("#month-select").val(moment(new Date()).month());
|
||||
|
||||
calculateDays();
|
||||
}
|
||||
|
||||
function initializeReportView() {
|
||||
checkForExistingSignature();
|
||||
|
||||
initializeYearAndMonths();
|
||||
|
||||
qbFilterSelectionChange();
|
||||
|
||||
filterCheckBoxChange();
|
||||
@@ -204,9 +185,14 @@ function checkForExistingSignature() {
|
||||
}
|
||||
|
||||
var changeDateSelectionUrl = getChangeDateSelectionUrl();
|
||||
|
||||
|
||||
$.get(changeDateSelectionUrl,
|
||||
{startDayString: startDay, endDayString: endDay, monthString: month, yearString: year},
|
||||
{
|
||||
startDayString: startDay,
|
||||
endDayString: endDay,
|
||||
monthString: month,
|
||||
yearString: year
|
||||
},
|
||||
function(result1) {
|
||||
if (result1!=null && result1.length > 1) {
|
||||
var jason = $.parseJSON(result1);
|
||||
@@ -216,9 +202,23 @@ function checkForExistingSignature() {
|
||||
|
||||
var monthName = $("#month-select option:selected").text();
|
||||
|
||||
var isCostbearerChecked = $("#selected-organisation-cb").is(":checked");
|
||||
|
||||
var costbearerOid = isCostbearerChecked === true ? $("#organisation-select option:selected").val() : null;
|
||||
|
||||
logDebug($("#organisation-select option:selected").val());
|
||||
|
||||
var url = getCheckForEmployeeSignatureUrl();
|
||||
|
||||
$.get(url, { customerOidString: customerOid, monthString: month, yearString: year },
|
||||
$.get(url,
|
||||
{
|
||||
customerOidString: customerOid,
|
||||
monthString: month,
|
||||
yearString: year,
|
||||
startDayString: startDay,
|
||||
endDayString: endDay,
|
||||
costbearerOidString: costbearerOid
|
||||
},
|
||||
function(result) {
|
||||
if(result === null || result === undefined || result.length <= 1) {
|
||||
return;
|
||||
@@ -296,4 +296,8 @@ function filterCheckBoxChange() {
|
||||
organisationOidStr: organisationOid,
|
||||
categoryOidStr: categoryOid
|
||||
});
|
||||
}
|
||||
|
||||
function validateReportForm() {
|
||||
|
||||
}
|
||||
@@ -127,17 +127,14 @@ function validateAppointmentForm() {
|
||||
} else {
|
||||
unavailableResourcesMessage = "Eine der ausgewählten Ressourcen (" + names + ") ist zum gewählten Zeitpunkt nicht verfügbar.";
|
||||
}
|
||||
|
||||
|
||||
hideSpinner();
|
||||
$("#messagePopup .modal-body").html('<div class="alert alert-warning" role="alert">' + unavailableResourcesMessage + "<br/><br/>Möchten Sie trotzdem speichern?</div>");
|
||||
showMessagePopup("Fehler");
|
||||
showMessagePopupWithCallback("Überschneidung",
|
||||
null,
|
||||
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"));
|
||||
});
|
||||
|
||||
showWarningMessageBox("Überschneidung", unavailableResourcesMessage, 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);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,10 +136,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
$.get(url, { customerOids: oidString }).done(function(numberOfSelectedCustomers) {
|
||||
$.get("@Url.Action("AddCustomerToAppointment")", { customerOids: oidString }).done(function(numberOfSelectedCustomers) {
|
||||
$("#selected-customers-count-badge").text(numberOfSelectedCustomers);
|
||||
});
|
||||
}
|
||||
|
||||
function deleteTestAppointments() {
|
||||
try {
|
||||
showSpinner();
|
||||
|
||||
$("#deleteAppointmentsForm").submit();
|
||||
} catch (error) {
|
||||
hideSpinner();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@@ -395,8 +405,14 @@ TODO: Einstellungen für Standartwerte?
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">Testtermine erzeugen</button>
|
||||
<div class="col-auto mr-auto">
|
||||
<button type="submit" class="btn btn-primary">Termine erzeugen</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-danger" onclick="deleteTestAppointments()">
|
||||
Termine löschen
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -415,6 +431,7 @@ TODO: Einstellungen für Standartwerte?
|
||||
|
||||
|
||||
</div>
|
||||
@using(Html.BeginForm("DeleteTestAppointments", "Development", FormMethod.Post, new { id = "deleteAppointmentsForm" } )) { }
|
||||
|
||||
<div class="modal" tabindex="-1" role="dialog" id="resources-popup">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
|
||||
@@ -32,8 +32,16 @@
|
||||
$(document).ready(function() {
|
||||
initializeReportView();
|
||||
});
|
||||
|
||||
function validateDates() {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@*
|
||||
TODO: Datumsvalidierung, Standartdatum zu Beginn auf den ersten bis zum letzten Tag des vorherigen Monats setzen
|
||||
*@
|
||||
|
||||
<div class="container-fluid my-3" id="report-form-container">
|
||||
<div class="row">
|
||||
<div class="col col-12 col-md-6 col-lg-5">
|
||||
@@ -116,26 +124,26 @@
|
||||
|
||||
<div class="col-md">
|
||||
<div class="form-group mb-1">
|
||||
<label for="month-select">Monat</label>
|
||||
<select class="form-control" id="month-select" onchange="onMonthOrYearChange()"></select>
|
||||
@Html.LabelFor(m => m.SelectedMonth)
|
||||
@Html.DropDownListFor(m => m.SelectedMonth, Model.Months, new { id = "month-select", onchange = "onMonthOrYearChange()", @class = "form-control" })
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group mb-1">
|
||||
<label for="start-day-select">Vom</label>
|
||||
<select class="form-control" id="start-day-select" onchange="checkForExistingSignature()"></select>
|
||||
@Html.LabelFor(m => m.SelectedStartDay)
|
||||
@Html.DropDownListFor(m => m.SelectedStartDay, Model.Days, new { id = "start-day-select", onchange = "checkForExistingSignature()", @class = "form-control"})
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group mb-1">
|
||||
<label for="end-day-select">Bis</label>
|
||||
<select class="form-control" id="end-day-select" onchange="checkForExistingSignature()"></select>
|
||||
@Html.LabelFor(m => m.SelectedEndDay)
|
||||
@Html.DropDownListFor(m => m.SelectedEndDay, Model.Days, new { id = "end-day-select", onchange = "checkForExistingSignature()", @class = "form-control"})
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group mb-1">
|
||||
<label for="year-select">Jahr</label>
|
||||
<select class="form-control" id="year-select" onchange="onMonthOrYearChange()"></select>
|
||||
@Html.LabelFor(m => m.SelectedYear)
|
||||
@Html.DropDownListFor(m => m.SelectedYear, Model.Years, new { id = "year-select", onchange = "onMonthOrYearChange()", @class = "form-control"})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -4179,5 +4180,81 @@ namespace BeWo.Data.Access
|
||||
|
||||
return GetAllActiveSupportConceptsByCustomers(customerOids, true).ToList();
|
||||
}
|
||||
|
||||
public IEnumerable<SchedulerAppointment> GetAllMobileTestAppointments()
|
||||
{
|
||||
var c = CreateCriteria<SchedulerAppointment>()
|
||||
.Add(Restrictions.Eq(nameof(SchedulerAppointment.Notice), "mob-dev-app"));
|
||||
|
||||
return c.List<SchedulerAppointment>();
|
||||
}
|
||||
|
||||
public bool HasConfirmationReceiptSignature(IEnumerable<long> customerOids, long? employeeOid, long? costbearerOid, long? serviceCategoryOid, DateTimeSpan timeSpan)
|
||||
{
|
||||
var criteria = CreateCriteriaIsActive<ServiceRecord>();
|
||||
|
||||
var timeSpanCriterion = CreateBetweenDateTimesCriterion(timeSpan.StartDate, timeSpan.EndDate, nameof(ServiceRecord.Start), nameof(ServiceRecord.End));
|
||||
|
||||
criteria.Add(timeSpanCriterion);
|
||||
|
||||
if(costbearerOid.HasValue)
|
||||
{
|
||||
criteria = criteria.CreateAlias(nameof(ServiceRecord.CostBearer2SupportConcept), "c2sc", JoinType.InnerJoin)
|
||||
.CreateAlias($"c2sc.{nameof(CostBearer2SupportConcept.CostBearer)}", "c", JoinType.InnerJoin)
|
||||
.Add(Restrictions.Eq($"c.{nameof(BeWoEntityBase.Oid)}", costbearerOid));
|
||||
}
|
||||
|
||||
if(employeeOid.HasValue)
|
||||
{
|
||||
criteria.Add(Restrictions.Eq(nameof(ServiceRecord.EmployeeOid), employeeOid));
|
||||
}
|
||||
|
||||
if(serviceCategoryOid.HasValue)
|
||||
{
|
||||
criteria = criteria.CreateAlias(nameof(ServiceRecord.ServiceDescription), "sd", JoinType.InnerJoin)
|
||||
.CreateAlias($"sd.{nameof(ServiceDescription.ServiceCategory)}", "category", JoinType.InnerJoin)
|
||||
.Add(Restrictions.Eq($"category.{nameof(BeWoEntityBase.Oid)}", serviceCategoryOid));
|
||||
}
|
||||
|
||||
criteria.Add(Restrictions.In(nameof(ServiceRecord.CustomerOid), customerOids.ToArray()));
|
||||
|
||||
var list = criteria.List<ServiceRecord>().Where(w => w.ServiceDescription.ServiceCategory.IsBillable).ToList();
|
||||
|
||||
var debugText = Empty;
|
||||
list.DoForEach(s =>
|
||||
{
|
||||
var debugString = $"{s.Oid} {s.Start:dd.MM.yyyy HH:mm} - {s.End:dd.MM.yyyy HH:mm}; {s.CostBearer2SupportConcept.CostBearer.Organisation.Name}; {s.Customer.Person.LastNameFirstName}; {s.Employee.Person.LastNameFirstName}; {s.ServiceDescription.ServiceCategory.Name}";
|
||||
|
||||
if(s.GroupOid.HasValue)
|
||||
{
|
||||
debugString += $" Gruppenbuchung({s.GroupOid})";
|
||||
}
|
||||
|
||||
debugString += "\n";
|
||||
debugText += debugString;
|
||||
});
|
||||
|
||||
var serviceRecordOids = list.Where(serviceRecord => serviceRecord.Oid.HasValue).Select(serviceRecord => serviceRecord.Oid.Value);
|
||||
|
||||
/*
|
||||
* var liste = CreateCriteriaIsActive<ConfirmationReceiptSignature>()
|
||||
.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.EmployeeOid), employeeOid))
|
||||
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "s", JoinType.InnerJoin)
|
||||
.Add(CreateBetweenDateTimesCriterion(timeSpan.StartDateTime, timeSpan.EndDateTime, "s.Start", "s.End"))
|
||||
*/
|
||||
|
||||
var c = CreateCriteriaIsActive<ConfirmationReceiptSignature>()
|
||||
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "sr", JoinType.InnerJoin)
|
||||
.Add(Restrictions.In(nameof(BeWoEntityBase.Oid), serviceRecordOids.ToArray()));
|
||||
|
||||
var kek = c.List<ConfirmationReceiptSignature>().ToList();
|
||||
|
||||
if(serviceRecordOids.Any())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return false;//criteria.List<ServiceRecord>().Any();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -18,6 +19,10 @@ namespace BeWo.Report.DefaultReports
|
||||
|
||||
public void SetReportDataSource(ServicesOverviewRO pRO)
|
||||
{
|
||||
StackTrace stackTrace = new StackTrace();
|
||||
// Get calling method name
|
||||
Debug.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
|
||||
|
||||
bool hatGruppen = false;
|
||||
|
||||
//if (pRO == null)
|
||||
|
||||
@@ -96,14 +96,24 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
try
|
||||
{
|
||||
pEntity.EmployeeList = DAOFactory.GenericDAO.LoadByIDs<Employee2SchedulerAppointment>(pDataContract.EmployeeList.Select(e => e.Employee2SchedulerAppointmentOid.Value));
|
||||
pEntity.CustomerList = DAOFactory.GenericDAO.LoadByIDs<Customer>(pDataContract.CustomerList.Select(c => c.CustomerOid));
|
||||
pEntity.ResourceList = DAOFactory.GenericDAO.LoadByIDs<Resource>(pDataContract.ResourceList.Select(r => r.ResourceOid.Value));
|
||||
if(pDataContract.EmployeeList != null)
|
||||
{
|
||||
pEntity.EmployeeList = DAOFactory.GenericDAO.LoadByIDs<Employee2SchedulerAppointment>(pDataContract.EmployeeList.Select(e => e.Employee2SchedulerAppointmentOid.Value));
|
||||
}
|
||||
|
||||
if(pDataContract.CustomerList != null)
|
||||
{
|
||||
pEntity.CustomerList = DAOFactory.GenericDAO.LoadByIDs<Customer>(pDataContract.CustomerList.Select(c => c.CustomerOid));
|
||||
}
|
||||
|
||||
if(pDataContract.ResourceList != null)
|
||||
{
|
||||
pEntity.ResourceList = DAOFactory.GenericDAO.LoadByIDs<Resource>(pDataContract.ResourceList.Select(r => r.ResourceOid.Value));
|
||||
}
|
||||
|
||||
if (pDataContract.SupportConceptList != null)
|
||||
{
|
||||
pEntity.SupportConceptList =
|
||||
DAOFactory.GenericDAO.LoadByIDs<SupportConcept>(
|
||||
pDataContract.SupportConceptList.Select(s => s.SupportConceptOid));
|
||||
pEntity.SupportConceptList = DAOFactory.GenericDAO.LoadByIDs<SupportConcept>(pDataContract.SupportConceptList.Select(s => s.SupportConceptOid));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -1016,5 +1016,8 @@ namespace BeWo.Service.ServiceContracts
|
||||
[OperationContract]
|
||||
void DeleteTemplates(List<DokumentvorlageDC> vorlagen);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
bool HasConfirmationReceiptSignature(IEnumerable<long> customerOids, long? employeeOid, long? costbearerOid, long? serviceCategoryOid, DateTimeSpan timeSpan);
|
||||
}
|
||||
}
|
||||
@@ -212,5 +212,9 @@ namespace BeWo.Service.ServiceContracts
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
string ValidateSchedulerAppointment(DateTime start, DateTime end, IEnumerable<long> employees, IEnumerable<long> customers, List<long> resources, long originator, long? appointmentOid, Guid? recurrenceId, int occurrenceIndex = 0, bool shouldSkipResourceAvailability = false);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void DeleteMobileTestAppointments();
|
||||
}
|
||||
}
|
||||
@@ -6789,7 +6789,17 @@ namespace BeWo.Service.ServiceImplementations
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasConfirmationReceiptSignature(IEnumerable<long> customerOids, long? employeeOid, long? costbearerOid, long? serviceCategoryOid, DateTimeSpan timeSpan)
|
||||
{
|
||||
try
|
||||
{
|
||||
return DAOFactory.SearchDAO.HasConfirmationReceiptSignature(customerOids, employeeOid, costbearerOid, serviceCategoryOid, timeSpan);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
item.EmployeeList.ForEach(each =>
|
||||
item.EmployeeList?.ForEach(each =>
|
||||
{
|
||||
each.Employee2SchedulerAppointmentOid = null;
|
||||
each.Employee2SchedulerAppointmentVersion = null;
|
||||
@@ -2265,5 +2265,12 @@ namespace BeWo.Service.ServiceImplementations
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteMobileTestAppointments()
|
||||
{
|
||||
var appointments2Delete = DAOFactory.SearchDAO.GetAllMobileTestAppointments();
|
||||
|
||||
DAOFactory.GenericDAO.Delete(appointments2Delete);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,14 +58,14 @@ namespace BS.Shared.DataContracts
|
||||
[DataMember]
|
||||
public string ReminderInfo { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public List<CompactCustomerDC> CustomerList { get; set; }
|
||||
[DataMember]
|
||||
public List<CompactCustomerDC> CustomerList { get; set; }// = new List<CompactCustomerDC>();
|
||||
|
||||
[DataMember]
|
||||
public List<Employee2SchedulerAppointmentDC> EmployeeList { get; set; }
|
||||
[DataMember]
|
||||
public List<Employee2SchedulerAppointmentDC> EmployeeList { get; set; }// = new List<Employee2SchedulerAppointmentDC>();
|
||||
|
||||
[DataMember]
|
||||
public List<ResourceDC> ResourceList { get; set; }
|
||||
[DataMember]
|
||||
public List<ResourceDC> ResourceList { get; set; }// = new List<ResourceDC>();
|
||||
|
||||
[DataMember]
|
||||
public long? FormerBookingSequenceOid { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user