Monatsunterschriften werden im Muster-Quittierungsbeleg angezeigt.

MoK:
Die Prüfung, ob für einen ServiceRecord eine Monatsunterschrift existiert wurde gefixt.
This commit is contained in:
2023-06-19 16:03:55 +02:00
parent 3c6c7b578c
commit bf57aa891c
7 changed files with 119 additions and 23 deletions

View File

@@ -2026,12 +2026,12 @@ namespace BeWoPlanerMobil.Controllers
var serviceRecord = Model.ServiceRecords.FirstOrDefault(f => f.ServiceRecordOid.HasValue && f.ServiceRecordOid.Value.Equals(oid)) ?? OperationsService.GetServiceRecordById(oid);
if(!serviceRecord?.ServiceRecordOid.HasValue ?? false)
if(serviceRecord?.ServiceRecordOid is null)
{
return null;
}
var hasMonatsunterschrift = OperationsService.HasConfirmationReceiptSignature(new List<long> { serviceRecord.ServiceRecordOid.Value }, SignatureType.Customer);
var hasMonatsunterschrift = OperationsService.CheckForConfirmationReceiptSignatureForServiceRecord(serviceRecord.ServiceRecordOid.Value, SignatureType.Customer);
var serviceRecord2Monatsunterschrift = new ServiceRecord2Monatsunterschrift(serviceRecord, hasMonatsunterschrift);

View File

@@ -73,7 +73,7 @@ function initializeSignature(selectedServiceRecordOid) {
var serviceRecord2Monatsunterschrift = $.parseJSON(jsonServiceRecord2Monatsunterschrift);
var hasMonatsunterschrift = serviceRecord2Monatsunterschrift.HasMonatsunterschrift;
logInfo(typeof hasMonatsunterschrift + ": " + hasMonatsunterschrift);
var record = serviceRecord2Monatsunterschrift.ServiceRecord;
@@ -95,22 +95,24 @@ function initializeSignature(selectedServiceRecordOid) {
$("#signature-employee").text(record.Employee.FirstName + " " + record.Employee.LastName);
$("#signature-date-time").text(datum + " " + startDate + " - " + endDate);
var customerFirstName = record.Customer.FirstName;
var customerLastName = record.Customer.LastName;
if (hasMonatsunterschrift === true) {
var customerFirstName = record.Customer.FirstName;
var customerLastName = record.Customer.LastName;
var customerName = "";
var customerName = "";
if (isEmptyOrSpaces(customerFirstName) && isEmptyOrSpaces(customerLastName) === false) {
customerName = customerLastName;
} else if (isEmptyOrSpaces(customerLastName) && false === isEmptyOrSpaces(customerFirstName)) {
customerName = customerFirstName;
} else {
customerName = customerLastName + ", " + customerFirstName;
if (isEmptyOrSpaces(customerFirstName) && isEmptyOrSpaces(customerLastName) === false) {
customerName = customerLastName;
} else if (isEmptyOrSpaces(customerLastName) && false === isEmptyOrSpaces(customerFirstName)) {
customerName = customerFirstName;
} else {
customerName = customerLastName + ", " + customerFirstName;
}
$("#signature-alert").html("Für diesen Eintrag (" + datum + " " + startDate + " - " + endDate + ") existiert bereits eine Monatsunterschrift von " + customerName + ".<br /><br />Das Leisten dieser Unterschrift ist nicht notwendig.");
$("#signature-alert").removeClass("d-none");
}
$("#signature-alert").html("Für diesen Eintrag (" + datum + " " + startDate + " - " + endDate + ") existiert bereits eine Monatsunterschrift von " + customerName + ".<br /><br />Das Leisten dieser Unterschrift ist nicht notwendig.");
$("#signature-alert").removeClass("d-none");
resizeCanvas("#sketch-pad", "#canvas-row");
var canvas = document.getElementById("sketch-pad");

View File

@@ -4359,7 +4359,7 @@ namespace BeWo.Data.Access
public bool HasConfirmationReceiptSignature(IList<long> serviceRecordOids, SignatureType signatureType)
{
// Prüfen, ob alle ServiceRecords mit ein und derselben Mitarbeiterunterschrift verknüpft sind.
// Prüfen, ob alle ServiceRecords mit ein und derselben Unterschrift verknüpft sind.
// Eine Unterschrift kann mehrere ServiceRecords in der LinkListe haben, die nicht in der zu prüfenden Oid-Liste sind.
var c = CreateCriteriaIsActive<ConfirmationReceiptSignature>()
.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.SignatureType), signatureType))
@@ -5155,5 +5155,52 @@ namespace BeWo.Data.Access
return c.List<SchedulerAppointment>().ToList();
}
/*
* public bool HasConfirmationReceiptSignature(IList<long> serviceRecordOids, SignatureType signatureType)
{
// Prüfen, ob alle ServiceRecords mit ein und derselben Unterschrift verknüpft sind.
// Eine Unterschrift kann mehrere ServiceRecords in der LinkListe haben, die nicht in der zu prüfenden Oid-Liste sind.
var c = CreateCriteriaIsActive<ConfirmationReceiptSignature>()
.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.SignatureType), signatureType))
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "sr", JoinType.InnerJoin)
.Add(Restrictions.In($"sr.{nameof(BeWoEntityBase.Oid)}", serviceRecordOids.ToArray()));
var signatures = c.List<ConfirmationReceiptSignature>().ToList();
var result = false;
if(serviceRecordOids.Any() && signatures.Any())
{
var blubb = new List<long>();
signatures.DoForEach(s =>
{
s.ServiceRecords.DoForEach(sr =>
{
if(sr.Oid.HasValue)
{
blubb.AddIfNotIn(sr.Oid.Value);
}
});
});
result = serviceRecordOids.ContainsSameItemsAs(blubb);
}
return result;
}
*/
public bool CheckForConfirmationReceiptSignatureForServiceRecord(long serviceRecordOid, SignatureType signatureType)
{
var critreria = CreateCriteriaIsActive<ConfirmationReceiptSignature>()
.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.SignatureType), signatureType))
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "serviceRecords", JoinType.InnerJoin)
.Add(Restrictions.Eq($"serviceRecords.{nameof(BeWoEntityBase.Oid)}", serviceRecordOid));
var signature = critreria.List<ConfirmationReceiptSignature>().ToList();
return signature.Count == 1;
}
}
}

View File

@@ -46,7 +46,6 @@ namespace BeWo.Demo
this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule();
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel();
@@ -86,6 +85,9 @@ namespace BeWo.Demo
this.fieldBillableFLS = new DevExpress.XtraReports.UI.CalculatedField();
this.fieldAbrechenbareFLS = new DevExpress.XtraReports.UI.CalculatedField();
this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox();
this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
@@ -278,10 +280,6 @@ namespace BeWo.Demo
this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell2.Weight = 0.19570704439348488D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// formattingRuleStartDate
//
this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]";
@@ -553,6 +551,8 @@ namespace BeWo.Demo
// ReportFooter
//
this.ReportFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrPictureBox1,
this.xrPictureBox2,
this.xrLabel7,
this.xrLabel8,
this.xrLabel2,
@@ -708,6 +708,29 @@ namespace BeWo.Demo
this.GroupHeader1.RepeatEveryPage = true;
this.GroupHeader1.StylePriority.UseFont = false;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// xrPictureBox2
//
this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "CustomerSignature")});
this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(435.1247F, 141.6667F);
this.xrPictureBox2.Name = "xrPictureBox2";
this.xrPictureBox2.SizeF = new System.Drawing.SizeF(197F, 35.50002F);
this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// xrPictureBox1
//
this.xrPictureBox1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "EmployeeSignature")});
this.xrPictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(183.1248F, 141.6667F);
this.xrPictureBox1.Name = "xrPictureBox1";
this.xrPictureBox1.Scripts.OnBeforePrint = "xrPictureBox1_BeforePrint";
this.xrPictureBox1.SizeF = new System.Drawing.SizeF(216.8751F, 35.50002F);
this.xrPictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// Stundenzettel
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -808,5 +831,7 @@ namespace BeWo.Demo
private DevExpress.XtraReports.UI.CalculatedField fieldAbrechenbareFLS;
private DevExpress.XtraReports.UI.XRLabel xrLabel14;
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1;
private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox2;
private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox1;
}
}

View File

@@ -17,7 +17,7 @@ namespace BeWo.Service.Plugins
#if DEBUG
var t = "demo";
t = "irgendwaswasesnichtgibt";
//t = "irgendwaswasesnichtgibt";
//t = "5473568546"; //Interner Chat
//t = "2356097460"; // Lebenshilfe Würzburg
//t = "1234567890"; // Präsentationsdatenbank
@@ -144,7 +144,7 @@ namespace BeWo.Service.Plugins
//t = "9975231461"; // Selwo
//t = "8181286349"; // BeWo am Rhein
//t = "4595275645"; // Eigenständig
t = "7912635399"; // Prof. Dr. Eggers Stiftung
//t = "7912635399"; // Prof. Dr. Eggers Stiftung
//t = "3549726254"; // Socia
//t = "1992495802"; // Monvita
//t = "7381352241"; // Ressource e.V.

View File

@@ -1307,5 +1307,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void DeleteSignature(long signatureOid, long serviceRecordOid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
bool CheckForConfirmationReceiptSignatureForServiceRecord(long serviceRecordOid, SignatureType signatureType);
}
}

View File

@@ -7956,5 +7956,23 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
/// <summary>
/// Prüft, ob der angegebene ServiceRecord auch eine Monatsunterschrift(ConfirmationReceiptSignature) hat.
/// </summary>
/// <param name="serviceRecordOid">Oid des ServiceRecords</param>
/// <param name="signatureType">Mitarbeiter- oder Klientenunterschrift</param>
/// <returns>Ob der ServiceRecord mit einer Monatsunterschrift verknüpft ist</returns>
public bool CheckForConfirmationReceiptSignatureForServiceRecord(long serviceRecordOid, SignatureType signatureType)
{
try
{
return DAOFactory.SearchDAO.CheckForConfirmationReceiptSignatureForServiceRecord(serviceRecordOid, signatureType);
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
}
}