diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs index 616d1f7c5..e0da9fd4e 100644 --- a/Service/ServiceImplementations/CustomerServiceImp.cs +++ b/Service/ServiceImplementations/CustomerServiceImp.cs @@ -1016,7 +1016,7 @@ namespace BeWo.Service.ServiceImplementations var lOriginal = DAOFactory.GenericDAO.LoadByID(oid); object[] Lists = GetFromNHibernateDecoupledCustomerRelatedLists(lOriginal); - HistoryCreator.MakeCustomerHistoryEntry(lOriginal, MapperFactory.CustomerDC_Customer.MapToNewDC(lOriginal), lOriginal.Oid.Value, StatementType.Insert, Lists[0] as List, Lists[1] as List, Lists[2] as List); + HistoryCreator.MakeCustomerHistoryEntry(lOriginal, pCustomerDC, lOriginal.Oid.Value, StatementType.Insert, Lists[0] as List, Lists[1] as List, Lists[2] as List); OwnChatHelper.StartOwnChatSync(); return oid; @@ -1250,11 +1250,13 @@ namespace BeWo.Service.ServiceImplementations object[] Lists = GetFromNHibernateDecoupledCustomerRelatedLists(lOriginal); + HistoryCreator.MakeCustomerHistoryEntry(lOriginal, pCustomerDC, null, StatementType.Update, Lists[0] as List, Lists[1] as List, Lists[2] as List); + MapperFactory.CustomerDC_Customer.MergeWithEntity(pCustomerDC, lOriginal); DAOFactory.GenericDAO.Update(lOriginal); - HistoryCreator.MakeCustomerHistoryEntry(lOriginal, MapperFactory.CustomerDC_Customer.MapToNewDC(lOriginal), null, StatementType.Update, Lists[0] as List, Lists[1] as List, Lists[2] as List); + CheckUpdatedReferenceNumbers(pCustomerDC, lOriginal);