Konflikte gelöst

This commit is contained in:
2026-05-11 12:42:57 +02:00
222 changed files with 19063 additions and 1960 deletions

View File

@@ -1,5 +1,4 @@
using Antlr.Runtime.Tree;
using BeWo.Data.Access;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.AI;
using BeWo.Service.DCEntityMapper;
@@ -28,6 +27,7 @@ using System.Net.Sockets;
using System.Text;
using System.Web.Mvc;
using System.Windows.Forms;
using NHibernate;
using static BeWoPlanerMobil.Util.MobileUtils;
using static BS.Shared.ServiceRecordValidationResult;
using FormCollection = System.Web.Mvc.FormCollection;
@@ -302,9 +302,7 @@ namespace BeWoPlanerMobil.Controllers
}
}
}
}
}
if(Model.IsInEditingMode && Model.SelectedServiceRecordOid.HasValue)
@@ -346,7 +344,7 @@ namespace BeWoPlanerMobil.Controllers
Model.ShowServiceRecordInsertedOn = !UserSettingsUtils.GetSettingValueAsBool(Model.Mandator.Settings, SettingsKeys.HideServiceRecordInsertedByAndInsertedOn);
Model.ShowSignature = UserSettingsUtils.GetSettingValueAsBool(Model.Mandator.Settings, SettingsKeys.ShowSignature) && Model.HasRightToProvideSingleSignature;
Model.ShowDistanceField = UserSettingsUtils.GetSettingValueAsBool(Model.Mandator.Settings, SettingsKeys.ShowDistanceFields);
var settingsValue = GetSettingValue(Model.Mandator.Settings, SettingsKeys.IsServiceRecordNoticeMandatory);
@@ -578,16 +576,29 @@ namespace BeWoPlanerMobil.Controllers
public ServiceRecordDC GetServiceRecordDC(long serviceRecordOid, bool getCompact)
{
ServiceRecordDC dc = null;
if (_Model != null)
if(_Model != null)
{
dc = _Model.FindServiceRecord(serviceRecordOid);
}
if (dc == null)
if(dc is null)
{
var sr = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(serviceRecordOid);
if (getCompact)
try
{
dc = new ServiceRecordDC()
NHibernateUtil.Initialize(sr);
}
catch(ObjectNotFoundException exception)
{
TempData[TempDataConstants.ErrorAlertPopupMessage] = "Der ausgewählte Eintrag wurde in der Zwischenzeit gelöscht. Bearbeiten nicht möglich.";
return null;
}
if(getCompact)
{
dc = new ServiceRecordDC
{
Betrag = sr.Betrag,
CostBearer2SupportConceptOid = sr.CostBearer2SupportConceptOid,
@@ -616,8 +627,10 @@ namespace BeWoPlanerMobil.Controllers
ServiceRecordOid = sr.Oid,
Start = sr.Start
};
return dc;
}
dc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(sr);
}
@@ -1530,27 +1543,28 @@ namespace BeWoPlanerMobil.Controllers
if(false == Model.IsInEditingMode)
{
if(Model.NewServiceRecord.CostBearer != null && Model.ShowSignature)
//if(Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m))
//{
var valRes = OperationsService.ValidateServiceRecord(Model.NewServiceRecord, null, 0, null, null);
var doppelt = valRes.Count > 0 && valRes.FirstOrDefault(v => v.ResultType == DoppelterEintrag) != null;
if(!doppelt)
{
var valRes = OperationsService.ValidateServiceRecord(Model.NewServiceRecord, null, 0, null, null);
var doppelt = valRes.Count > 0 && valRes.FirstOrDefault(v => v.ResultType == DoppelterEintrag) != null;
var oidList = OperationsService.InsertNewServiceRecords(new List<ServiceRecordDC> { Model.NewServiceRecord });
if(!doppelt)
Model.LastCreatedServiceRecordOid = oidList[0];
if(Model.IsAllowedToCreateSignature(Model.NewServiceRecord))
{
var oidList = OperationsService.InsertNewServiceRecords(new List<ServiceRecordDC> { Model.NewServiceRecord });
Model.LastCreatedServiceRecordOid = oidList[0];
if(Model.IsAllowedToCreateSignature(Model.NewServiceRecord))
if(Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m))
{
if(Model.NewServiceRecord.CostBearer != null && Model.ShowSignature && (Model.NewServiceRecord.ServiceDescription.Category.IsBillable || Model.NewServiceRecord.ServiceDescription.Category.BillableAmount > 0m || Model.NewServiceRecord.ServiceDescription.BillableAmount > 0m))
{
TempData[TempDataConstants.ShowSignatureSuggestionPopup] = true;
}
TempData[TempDataConstants.ShowSignatureSuggestionPopup] = true;
}
}
}
//}
// Es wird ein Termin aus dem Kalender in die Zeiterfassung übertragen
if(appointmentPrototype is object)
{
var serviceRecord = OperationsService.GetServiceRecordById(Model.LastCreatedServiceRecordOid);
@@ -1593,7 +1607,7 @@ namespace BeWoPlanerMobil.Controllers
Model.NewServiceRecord = new ServiceRecordDC();
}
catch (Exception e)
catch(Exception e)
{
Log.Error(e.Message, e);
}

View File

@@ -1332,11 +1332,11 @@ namespace BeWoPlanerMobil.Controllers
var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
var hasCustomerSignature = srOids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Customer, a));
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Customer, a));
var employeeSignatureState2 = GetSignatureState(srOids, serviceRecordOidsWithSignature, SignatureType.Employee);
var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
var customerSignatureState = GetSignatureState(srOids, serviceRecordOidsWithSignature, SignatureType.Customer);
var customerSignatureState = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Customer);
var customerSignatureOid = hasCustomerSignature ? customerSignatures.FirstOrDefault(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value)))?.ConfirmationReceiptSignatureOid : null;
var sigs = customerSignatures.Where(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value))).ToList();

View File

@@ -0,0 +1,59 @@
@using BS.Shared.Extensions
@model BeWoPlanerMobil.Models.AppointmentModel
@{
var areAllSelected = Model.SelectedCustomerOids.AreListEqual(Model.PossibleCustomers.Select(customer => customer.CustomerOid).ToList());
var allChecked = areAllSelected ? "checked" : string.Empty;
}
<div class="dropdown w-100" id="customers-dropdown">
<button class="btn btn-bewo-customers dropdown-toggle w-100" type="button" data-toggle="dropdown">
Klienten <span class="badge badge-light">@Model.SelectedCustomerOids.Count</span>
</button>
<div class="dropdown-menu" onclick="event.stopPropagation();">
<div class="dropdown-item py-1 px-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text">
<input type="checkbox" @allChecked onclick="selectAllEmployeeCustomerResource('cus')" id="apt-cus-select-all">
</div>
</div>
<input type="text" class="form-control" id="cus-drop-search-input" placeholder="Suchen ..." oninput="onNewSearchInput('cus')">
<div class="input-group-append">
<button type="button" class="btn btn-outline-secondary" onclick="resetNewSearch('cus')">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
<div class="dropdown-divider"></div>
<div id="dropdown-cus-itm-container">
@for(var i = 0; i < Model.PossibleCustomers.Count; i++)
{
var customer = Model.PossibleCustomers[i];
var isChecked = Model.SelectedCustomerOids.Contains(customer.CustomerOid) ? "checked" : string.Empty;
var dNone = i / Model.CustomerPageLimit + 1 != 1 ? " d-none" : string.Empty;
<div class="dropdown-item w-100 @dNone" id="dropdown-item-@i">
<form class="form-inline justify-content-between">
<div class="form-group form-check">
<input class="form-check-input" type="checkbox" id="apt-edit-cus-@customer.CustomerOid" @isChecked onclick="updateEmployeeCustomerResourceSelection('cus')" />
<label for="apt-edit-cus-@customer.CustomerOid" class="form-check-label">
@customer.DetailDescription
</label>
</div>
</form>
</div>
}
</div>
<div class="dropdown-divider" id="apt-cus-pag-divider"></div>
<div class="dropdown-item" id="apt-cus-pag-dropdow-item">
<nav id="apt-cus-pag-nav">
<ul class="pagination justify-content-center" id="apt-cus-pagination">
</ul>
</nav>
</div>
</div>
</div>

View File

@@ -0,0 +1,128 @@
@using BS.Shared.Core.Utilities
@using BeWoPlanerMobil.Util
@model BeWoPlanerMobil.Models.AppointmentModel
@{
var j = 0;
var areAllSelected = true;
foreach(var category2Resources in Model.ResourceCategories2Resources)
{
var resourceOids = category2Resources.Value.Select(resource => resource.ResourceOid.Value).ToList();
if(false == resourceOids.All(oid => Model.SelectedResourceOids.Contains(oid)))
{
areAllSelected = false;
break;
}
}
var checkedValue = areAllSelected ? "checked" : string.Empty;
}
<div class="dropdown w-100" id="resources-dropdown">
<button class="btn btn-bewo-resource dropdown-toggle w-100" type="button" data-toggle="dropdown">
Ressourcen <span class="badge badge-light">@Model.SelectedResourceOids.Count</span>
</button>
<div class="dropdown-menu" onclick="event.stopPropagation();">
<div class="dropdown-item py-1 px-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<div class="input-group-text">
<input type="checkbox" @checkedValue onclick="selectAllEmployeeCustomerResource('res')" id="apt-res-select-all">
</div>
</div>
<input type="text" class="form-control" id="res-drop-search-input" placeholder="Suchen ..." oninput="onNewResourceSeachInput()">
<div class="input-group-append">
<button type="button" class="btn btn-outline-secondary" onclick="resetNewResourceSearch()">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
<div class="dropdown-divider py-0 px-2"></div>
<div id="dropdown-res-itm-container">
@{
foreach(var category2Resources in Model.ResourceCategories2Resources)
{
var category = category2Resources.Key;
var resources = category2Resources.Value;
var dNone = j / Model.ResourcePageLimit + 1 != 1 ? " d-none" : string.Empty;
<div class="dropdown-item w-100 py-0 px-2 @dNone" id="dropdown-item-@j">
<div class="card mb-1 category-card" id="res-cat-@category.ValueListEntryOid">
<div class="card-header tree-card-header px-2 py-1" onclick="categoryCardHeaderClick('collapsable-res-cat-@category.ValueListEntryOid')">
<div class="d-flex align-items-center m-0">
<h6 class="mr-auto mb-0">@category.DisplayName</h6>
<div class="btn-group" role="group">
<span class="fas fa-chevron-down text-primary"></span>
</div>
</div>
</div>
<div class="collapse @Html.GetCollapsibleClass(Model.Collapsibles2IsShown, $"collapsable-res-cat-{category.ValueListEntryOid}")" id="collapsable-res-cat-@category.ValueListEntryOid">
<div class="card-body resource-list px-2 py-1">
@foreach(var resource in resources)
{
var isChecked = resource.ResourceOid.HasValue && Model.SelectedResourceOids.Contains(resource.ResourceOid.Value) ? "checked" : string.Empty;
<form class="form-inline justify-content-between">
<div class="form-group form-check">
<input class="form-check-input" type="checkbox" id="apt-edit-res-@resource.ResourceOid.Value" @isChecked onclick="updateEmployeeCustomerResourceSelection('res')"/>
<label for="apt-edit-res-@resource.ResourceOid.Value" class="form-check-label">
@resource.DetailDescription
</label>
</div>
@if(WebUtils.CheckColorString(resource.Color))
{
<div class="float-right" style="width: 10px; height: 10px; background-color: @resource.Color; border: 1px solid @resource.Color; border-radius: 3px;"></div>
}
</form>
}
</div>
</div>
</div>
</div>
j++;
}
}
</div>
<div class="dropdown-divider" id="apt-res-pag-divider"></div>
<div class="dropdown-item" id="apt-res-pag-dropdow-item">
<nav id="apt-res-pag-nav">
<ul class="pagination justify-content-center" id="apt-res-pagination">
</ul>
</nav>
</div>
</div>
</div>
@* ToDo: Mit den Kategorien wie im alten Kalendermodul bauen!
@for(var i = 0; i < Model.PossibleResources.Count; i++)
{
var resource = Model.PossibleResources[i];
var isChecked = resource.ResourceOid.HasValue && Model.SelectedResourceOids.Contains(resource.ResourceOid.Value) ? "checked" : string.Empty;
var dNone = i / Model.ResourcePageLimit + 1 != 1 ? " d-none" : string.Empty;
<div class="dropdown-item w-100 @dNone" id="dropdown-item-@i">
<form class="form-inline justify-content-between">
<div class="form-group form-check">
<input class="form-check-input" type="checkbox" id="apt-edit-res-@resource.ResourceOid.Value" @isChecked onclick="updateEmployeeCustomerResourceSelection('res')"/>
<label for="apt-edit-res-@resource.ResourceOid.Value" class="form-check-label">
@resource.DetailDescription
</label>
</div>
@if(WebUtils.CheckColorString(resource.Color))
{
<div class="float-right" style="width: 10px; height: 10px; background-color: @resource.Color; border: 1px solid @resource.Color; border-radius: 3px;"></div>
}
</form>
</div>
}*@