diff --git a/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs b/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs index 186ee1148..20f275717 100644 --- a/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs +++ b/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs @@ -143,16 +143,24 @@ namespace BeWo.Service.DCEntityMapper if(customer is object) { - pDataContract.CustomerOid = customer.Oid.Value; - pDataContract.CustomerFirstName = customer.Person.FirstName; - pDataContract.CustomerLastName = customer.Person.LastName; + try + { + pDataContract.CustomerOid = customer.Oid.Value; + pDataContract.CustomerFirstName = customer.Person.FirstName; + pDataContract.CustomerLastName = customer.Person.LastName; - var error = GkvValidator.ValidateCustomer(customer.InsuranceNumber, customer.VersichertenStatus); - if (error is null) - error = GkvValidator.ValidateInvoiceBase(pDataContract); + var error = GkvValidator.ValidateCustomer(customer.InsuranceNumber, customer.VersichertenStatus); + if (error is null) + error = GkvValidator.ValidateInvoiceBase(pDataContract); - pDataContract.IsGkvValidError = error; - pDataContract.IsGkvValid = error is null; + pDataContract.IsGkvValidError = error; + pDataContract.IsGkvValid = error is null; + } + catch (Exception e) + { + pDataContract.IsGkvValidError = e.ToString(); + pDataContract.IsGkvValid = false; + } } pDataContract.XRechnungStoredFile = MapperFactory.StoredFile.CreateOrMapToNewDC(pEntity.XRechnungStoredFile, true);