477 lines
21 KiB
Plaintext
477 lines
21 KiB
Plaintext
@using BeWoPlanerMobil.Models
|
|
@using BeWoPlanerMobil.Util
|
|
@using BeWoPlanerMobil.Util.ReportUtils
|
|
@using BS.Shared
|
|
@model BeWoPlanerMobil.Models.ReportModel
|
|
|
|
@{
|
|
if(TempData[TempDataConstants.DoLogoutKey] is bool doLogout && doLogout)
|
|
{
|
|
<text>
|
|
<script type="text/javascript">
|
|
$("#second-logout-form").submit();
|
|
</script>
|
|
</text>
|
|
}
|
|
|
|
var plural = Model.ConfirmationReceiptObject.NumberOfServiceRecords > 1 ? "en" : string.Empty;
|
|
|
|
var leistungsplurarl = Model.ConfirmationReceiptObject.NumberOfServiceRecords > 1 ? "en" : string.Empty;
|
|
|
|
var sigInfo = $"Unterschrift{plural} von {Model.Quittierungsbelegsunterschriftenobjekt.PersonName} für {Model.Quittierungsbelegsunterschriftenobjekt.ServiceRecordCount} erbrachte Leistung{leistungsplurarl} von {Model.Quittierungsbelegsunterschriftenobjekt.CustomerName} ({Model.Quittierungsbelegsunterschriftenobjekt.TimeSpanInfo})";
|
|
}
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
$(".left-col").width(window.getMaxWidth("left-col"));
|
|
});
|
|
</script>
|
|
|
|
<div class="container-fluid lg-max-width">
|
|
<div class="row">
|
|
<div class="col">
|
|
<button type="button" class="btn btn-primary float-right" id="qb-sig-cancel-btn">
|
|
<span class="fas fa-times-circle"></span>
|
|
</button>
|
|
<h4 class="d-inline" id="qb-sig-info-col">@sigInfo</h4>
|
|
@{
|
|
|
|
var xyz = Model.Quittierungsbelegsunterschriftenobjekt;
|
|
|
|
var isEmployeeSignature = Model.Quittierungsbelegsunterschriftenobjekt.IsEmployeeSignature;
|
|
var confirmationReceiptSignature = Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.FirstOrDefault(f => f.CustomerOid.Equals(xyz.CustomerOid));
|
|
|
|
string message = null;
|
|
string message2 = null;
|
|
|
|
if(confirmationReceiptSignature != null)
|
|
{
|
|
if(isEmployeeSignature)
|
|
{
|
|
if(confirmationReceiptSignature.EmployeeSignatureState == SignatureState.Some)
|
|
{
|
|
message = "Es wurde eine Unterschrift für mehrere Termine geleistet. Danach ist mindestens ein Termin verändert worden oder neu dazugekommen.<br /><br />Ihre Unterschrift muss deshalb erneut erfolgen, um auf dem Quittierunsbeleg angezeigt zu werden.";
|
|
}
|
|
|
|
if(confirmationReceiptSignature.EmployeeSignatureState == SignatureState.All)
|
|
{
|
|
message2 = "Es wurde für alle Termine eine Unterschrift hinterlegt.<br /><br />Die Unterschrift wird auf dem Quittierungsbeleg angezeigt.";
|
|
}
|
|
|
|
if(confirmationReceiptSignature.EmployeeSignatureState == SignatureState.AllOwnServiceRecords)
|
|
{
|
|
// Wenn die eigenen Einträge unterschrieben sind, die der anderen Mitarbeiter aber noch nicht und daher wird auch auf dem QB keine Unterschrift angezeigt.
|
|
message = "Es wurden nicht für alle Einträge anderer Mitarbeiter eine Mitarbeiterunterschrift geleistet.<br /><br />Die Unterschrift wird nicht auf dem Quittierungsbeleg angezeigt.";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(confirmationReceiptSignature.CustomerSignatureState == SignatureState.Some)
|
|
{
|
|
message = "Es wurde eine Unterschrift für mehrere Termine geleistet. Danach ist mindestens ein Termin verändert worden oder neu dazugekommen.<br /><br />Die Unterschrift des Klienten muss deshalb erneut erfolgen, um auf dem Quittierunsbeleg angezeigt zu werden.";
|
|
}
|
|
|
|
if(confirmationReceiptSignature.CustomerSignatureState == SignatureState.All)
|
|
{
|
|
message2 = "Es wurde für alle Termine eine Unterschrift hinterlegt.<br /><br />Die Unterschrift wird auf dem Quittierungsbeleg angezeigt.";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@if(message != null)
|
|
{
|
|
<div class="alert alert-primary mt-4 w-auto" role="alert">
|
|
@Html.Raw(message)
|
|
</div>
|
|
}
|
|
|
|
@if(message2 != null)
|
|
{
|
|
<div class="alert alert-success mt-4 mx-auto" style="width: fit-content;" role="alert">
|
|
@Html.Raw(message2)
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div id="qb-sig-container" class="row justify-content-center">
|
|
@functions
|
|
{
|
|
public string GetColumnClass()
|
|
{
|
|
// md: 1 -> 12, ab 2 -> 6
|
|
// lg: 1 -> 12, 2 -> 6, ab 3 -> 4
|
|
// xl: 1 -> 12, 2 -> 6, 3 -> 4, ab 4 -> 3
|
|
|
|
var count = Model.SelectedConfirmationReceiptSignatures.Count;
|
|
|
|
var colMd = string.Empty;
|
|
var colLg = string.Empty;
|
|
var colXl = string.Empty;
|
|
|
|
if(count < 2)
|
|
{
|
|
colMd += "12";
|
|
colLg += "3";
|
|
colXl += "4";
|
|
}
|
|
else
|
|
{
|
|
switch(count)
|
|
{
|
|
case 2:
|
|
colMd += "6";
|
|
colLg += "6";
|
|
colXl += "6";
|
|
break;
|
|
case 3:
|
|
colLg += "4";
|
|
colXl += "4";
|
|
break;
|
|
case 4:
|
|
colXl += "3";
|
|
break;
|
|
default:
|
|
colMd += "6";
|
|
colLg += "3";
|
|
colXl += "4";
|
|
break;
|
|
}
|
|
}
|
|
|
|
return $"col-sm-12 col-md-{colMd} col-lg-{colLg} col-xl-{colXl}";
|
|
}
|
|
}
|
|
|
|
@foreach(var signature in Model.SelectedConfirmationReceiptSignatures)
|
|
{
|
|
var blubb = $"{(signature.NumberOfServiceRecords == 1 ? "eine" : signature.NumberOfServiceRecords.ToString())} erbrachte Leistung{(signature.NumberOfServiceRecords != 1 ? "en" : string.Empty)}";
|
|
|
|
<div class="card signature-card mt-4 mx-1">
|
|
<div>
|
|
@* max-width: 100% !important; *@
|
|
<img style="display: block; margin-left: auto; margin-right: auto;" src="@signature.ImageStr" alt="Unterschrift von @signature.PersonName geleistet am @signature.InsTsStr" />
|
|
</div>
|
|
<div class="card-body p-1 mb-0 pb-0">
|
|
<table class="table table-sm service-record-table my-0">
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Unterschrift von:
|
|
</td>
|
|
<td>
|
|
@signature.PersonName
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Geleistet am:
|
|
</td>
|
|
<td>
|
|
@signature.InsTsStr
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="card w-100">
|
|
<div class="card-header" onclick="cardHeaderClick2(this)">
|
|
<div class="d-inline-flex">
|
|
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-test-collapsible"></i>
|
|
</div>
|
|
<div class="d-inline-flex text-primary h-100">
|
|
<button type="button" class="btn btn-link">
|
|
@blubb
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="collapse @Html.GetCollapsibleClass(Model.Collapsibles2IsShown, $"c-qb-{signature.Identifier}")" id="c-qb-@signature.Identifier">
|
|
<div class="card-body p-1">
|
|
<div class="container p-0">
|
|
@foreach(var serviceRecord in signature.ServiceRecords)
|
|
{
|
|
if(serviceRecord.Start is null || serviceRecord.End is null)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
var start = serviceRecord.Start.Value;
|
|
var end = serviceRecord.End.Value;
|
|
var hasSignatureStr = serviceRecord.SignatureOid.HasValue ? "JA" : "NEIN";
|
|
|
|
var duration = (end - start).TotalMinutes;
|
|
|
|
var roundedDuration = MobileUtils.GetDecimalValueWithMaxDecimal(serviceRecord.RoundedDuration, 2);
|
|
|
|
if(serviceRecord.ServiceDescription.Category.Percentage > 0 && serviceRecord.ServiceDescription.Category.Percentage < 100)
|
|
{
|
|
roundedDuration = roundedDuration * serviceRecord.ServiceDescription.Category.Percentage / 100;
|
|
}
|
|
|
|
var durationStr = serviceRecord.GroupOid.HasValue ? string.Format("{0:###0.#} ({0:###0.#})", roundedDuration) : $"{duration:###0.#} ({roundedDuration:###0.#})";
|
|
|
|
var massnahmenString = string.Empty;
|
|
var zieleString = string.Empty;
|
|
|
|
if(serviceRecord.Goals != null && serviceRecord.Goals.Count > 0)
|
|
{
|
|
foreach(var goal in serviceRecord.Goals.Where(g => g.Type == ValueListEntryType.SupportConceptGoalType || g.Type == ValueListEntryType.SupportConceptIndividualGoalType))
|
|
{
|
|
if(goal.Abbreviation != null && goal.TypeDescription != null)
|
|
{
|
|
massnahmenString += $"{goal.Abbreviation}: {goal.TypeDescription}";
|
|
}
|
|
else if(goal.Abbreviation is null && goal.TypeDescription != null)
|
|
{
|
|
massnahmenString += goal.TypeDescription;
|
|
}
|
|
else if(goal.Abbreviation != null && goal.TypeDescription is null)
|
|
{
|
|
massnahmenString += goal.Abbreviation;
|
|
}
|
|
|
|
#if DEBUG
|
|
if(goal.RatingTypeOid.HasValue)
|
|
{
|
|
var goalRating = Model.GoalRatingTypes.FirstOrDefault(g => g.RatingTypeOid.HasValue && g.RatingTypeOid.Equals(goal.RatingTypeOid.Value));
|
|
|
|
if(goalRating?.DisplayName != null && goalRating.DisplayName.Length > 0)
|
|
{
|
|
massnahmenString += $" <strong style='color: blue;'>({goalRating.DisplayName})</strong>";
|
|
}
|
|
}
|
|
#endif
|
|
|
|
if(serviceRecord.Goals.IndexOf(goal) < serviceRecord.Goals.Count - 1)
|
|
{
|
|
massnahmenString += ", ";
|
|
}
|
|
}
|
|
|
|
if(serviceRecord.ServiceRecordOid.HasValue && Model.ServiceRecordOids2GoalHeader.ContainsKey(serviceRecord.ServiceRecordOid.Value))
|
|
{
|
|
var ziele = serviceRecord.Goals.Where(g => g.Type == ValueListEntryType.SupportConceptIndividualGoalCategoryType || g.Type == ValueListEntryType.SupportConceptGoalCategoryType).ToList();
|
|
|
|
foreach(var ziel in ziele)
|
|
{
|
|
if(ziel.Abbreviation != null && ziel.TypeDescription != null)
|
|
{
|
|
zieleString += $"{ziel.Abbreviation}: {ziel.TypeDescription} ";
|
|
}
|
|
else if(ziel.Abbreviation is null && ziel.TypeDescription != null)
|
|
{
|
|
zieleString += ziel.TypeDescription;
|
|
}
|
|
else if(ziel.Abbreviation != null && ziel.TypeDescription is null)
|
|
{
|
|
zieleString += ziel.Abbreviation;
|
|
}
|
|
|
|
#if DEBUG
|
|
if(ziel.RatingTypeOid.HasValue)
|
|
{
|
|
var zielbewertung = Model.GoalRatingTypes.FirstOrDefault(goalRatingType => goalRatingType.RatingTypeOid.HasValue && goalRatingType.RatingTypeOid.Equals(ziel.RatingTypeOid.Value));
|
|
|
|
if(zielbewertung?.DisplayName != null && zielbewertung.DisplayName.Length > 0)
|
|
{
|
|
zieleString += $" <strong style='color: blue;'>({zielbewertung.DisplayName})</strong>";
|
|
}
|
|
}
|
|
#endif
|
|
|
|
zieleString += ", ";
|
|
}
|
|
}
|
|
|
|
zieleString = zieleString.TrimEnd(' ').TrimEnd(',');
|
|
}
|
|
|
|
<div class="card mt-1">
|
|
<div class="card-body p-1">
|
|
<div class="card-title m-1 text-primary">
|
|
@MainModel.GetServiceRecordTimeHeader(serviceRecord, true)
|
|
</div>
|
|
<table class="table table-sm table-striped service-record-table" my-0>
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Minuten (gerundet):
|
|
</td>
|
|
<td class="text-info">
|
|
@durationStr
|
|
</td>
|
|
</tr>
|
|
@if(Model.ShowDistanceField && serviceRecord.DistanceInMeterDecimal != null && serviceRecord.DistanceInMeterDecimal.Value > 0)
|
|
{
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Gefahrene Kilometer:
|
|
</td>
|
|
<td>
|
|
@($"{serviceRecord.DistanceInMeterDecimal:0.##}")
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
@if(serviceRecord.Goals != null && serviceRecord.Goals.Count > 0)
|
|
{
|
|
if(!string.IsNullOrEmpty(zieleString))
|
|
{
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Ziele:
|
|
</td>
|
|
<td>
|
|
@(new HtmlString(zieleString))
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
if(serviceRecord.Goals.Any(goal => goal.Type == ValueListEntryType.SupportConceptGoalType || goal.Type == ValueListEntryType.SupportConceptIndividualGoalType))
|
|
{
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Maßnahmen:
|
|
</td>
|
|
<td>
|
|
@(new HtmlString(massnahmenString))
|
|
</td>
|
|
</tr>
|
|
}
|
|
}
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Leistungskategorie:
|
|
</td>
|
|
<td>
|
|
@serviceRecord.ServiceDescription.CategoryName
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Leistung:
|
|
</td>
|
|
<td>
|
|
@serviceRecord.ServiceDescription.Name
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Angelegt für:
|
|
</td>
|
|
<td>
|
|
@serviceRecord.Employee.FirstNameLastName
|
|
</td>
|
|
</tr>
|
|
@if(Model.ShowServiceRecordInsertedOn)
|
|
{
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Angelegt von:
|
|
</td>
|
|
<td>
|
|
@serviceRecord.InsUser
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Angelegt am:
|
|
</td>
|
|
<td>
|
|
@serviceRecord.InsertedOn
|
|
</td>
|
|
</tr>
|
|
}
|
|
@if(Model.ShowBetrag && serviceRecord.Betrag.HasValue && serviceRecord.Betrag.Value > 0)
|
|
{
|
|
var betrag = serviceRecord.Betrag.Value.ToString("#.00") + " €";
|
|
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Betrag:
|
|
</td>
|
|
<td>
|
|
@betrag
|
|
</td>
|
|
</tr>
|
|
}
|
|
@{
|
|
var header1 = "Dokumentation";
|
|
if(Model.NumberOfDokuTypes >= 1)
|
|
{
|
|
header1 = Model.Dokutypes[0].TypeDescription;
|
|
}
|
|
|
|
<tr>
|
|
<td class="text-secondary">
|
|
@header1:
|
|
</td>
|
|
<td>
|
|
@Html.Raw(MobileUtils.ToHtml(serviceRecord.Notice, false))
|
|
</td>
|
|
</tr>
|
|
|
|
for(var i = 1; i < serviceRecord.NoticeList.Count; i++)
|
|
{
|
|
var notice = serviceRecord.NoticeList[i];
|
|
|
|
if(string.IsNullOrWhiteSpace(notice) || Model.NumberOfDokuTypes <= i)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
var header = $"Dokumentation {i + 1}";
|
|
|
|
if(Model.NumberOfDokuTypes >= 2)
|
|
{
|
|
if(Model.NumberOfDokuTypes <= i)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
header = Model.Dokutypes[i].TypeDescription;
|
|
}
|
|
<tr>
|
|
<td class="text-secondary">
|
|
@header:
|
|
</td>
|
|
<td>
|
|
@Html.Raw(MobileUtils.ToHtml(notice, false))
|
|
</td>
|
|
</tr>
|
|
}
|
|
}
|
|
<tr>
|
|
<td class="text-secondary">
|
|
Unterschrieben:
|
|
</td>
|
|
<td>
|
|
@hasSignatureStr
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="row mt-3 signingContent">
|
|
<div class="col">
|
|
<div class="alert alert-primary d-none" role="alert" id="qb-sig-override-alert">
|
|
Achtung, Sie sind dabei eine vorhandene Unterschrift zu ersetzen!
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3 signingContent" id="qb-sig-canvas-row">
|
|
<div class="canvas-container" id="qb-sig-canvas-container">
|
|
<canvas id="qb-sig-sketch-pad" width="500" height="200" style="border: 1px solid #343A40" class="bg-white rounded"></canvas>
|
|
</div>
|
|
</div>
|
|
<div class="row signingContent">
|
|
<div class="col-12">
|
|
<button type="button" class="btn btn-primary float-right" id="qb-sig-save-btn">Speichern</button>
|
|
<button type="button" class="btn btn-secondary float-right mr-3" id="qb-sig-clear-canvas-btn">Neu</button>
|
|
</div>
|
|
</div>
|
|
</div> |