Fixes for things not understood.. ^^

This commit is contained in:
Daniel Schick 2025-08-04 18:06:47 +02:00
parent e620c2d0e5
commit 9ad543e705
6 changed files with 39 additions and 32 deletions

View File

@ -838,8 +838,21 @@ namespace ENI2.DetailViewControls
foreach (Message message in this.Messages) foreach (Message message in this.Messages)
{ {
// Evaluate a number of criteria for messages that should not be preselected for sending
if (((message.ViolationCount ?? 0) > 0) || ((message.ErrorCount ?? 0) > 0)) continue; // these need more work if (((message.ViolationCount ?? 0) > 0) || ((message.ErrorCount ?? 0) > 0)) continue; // these need more work
if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) continue; // avoid suspend on empty list classes if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) continue; // avoid suspend on empty list classes
if ((message.MessageNotificationClass == Message.NotificationClass.HAZA) && !XtraSendLogic.ShouldSendMessage(message)) continue;
if ((message.MessageNotificationClass == Message.NotificationClass.HAZD) && !XtraSendLogic.ShouldSendMessage(message)) continue;
if (message.MessageNotificationClass == Message.NotificationClass.BPOL)
{
if (message.Elements.Count > 0)
{
if (message.Elements[0] is BPOL bpol)
{
if (bpol.PortOfItineraries.Count == 0) continue;
}
}
}
readyToSendMessages.Add(message.MessageNotificationClass); readyToSendMessages.Add(message.MessageNotificationClass);
} }

View File

@ -90,23 +90,7 @@ namespace ENI2.EditControls
(aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) || (aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.WAS) || (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.WAS_RCPT) (aMessage.MessageNotificationClass == Message.NotificationClass.WAS_RCPT)
)) continue; )) continue;
if(!IsImportMode)
{
// Speziallogik, was außerdem nicht zu Versand vorgeschlagen werden soll
if ((aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && !XtraSendLogic.ShouldSendMessage(aMessage)) continue;
if ((aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && !XtraSendLogic.ShouldSendMessage(aMessage)) continue;
if(aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) {
if (aMessage.Elements.Count > 0)
{
if (aMessage.Elements[0] is BPOL bpol)
{
if (bpol.PortOfItineraries.Count == 0) continue;
}
}
}
}
SelectClass sc = new SelectClass(); SelectClass sc = new SelectClass();
sc.Name = Enum.GetName(typeof(Message.NotificationClass), aMessage.MessageNotificationClass); sc.Name = Enum.GetName(typeof(Message.NotificationClass), aMessage.MessageNotificationClass);

View File

@ -1281,17 +1281,18 @@ namespace ENI2.Excel
if (waste.WasteType == 3000) waste.WasteType = 401; if (waste.WasteType == 3000) waste.WasteType = 401;
waste.WasteDisposalAmount_MTQ = reader.ReadNumber(wasteAmount); waste.WasteDisposalAmount_MTQ = reader.ReadNumber(wasteAmount);
if (!waste.WasteDisposalAmount_MTQ.HasValue && reader.ReadText(wasteAmount).IsNullOrEmpty()) waste.WasteDisposalAmount_MTQ = 0;
waste.WasteCapacity_MTQ = reader.ReadNumber(wasteCapacity); waste.WasteCapacity_MTQ = reader.ReadNumber(wasteCapacity);
if (!waste.WasteCapacity_MTQ.HasValue && reader.ReadText(wasteCapacity).IsNullOrEmpty()) waste.WasteCapacity_MTQ = 0;
waste.WasteAmountRetained_MTQ = reader.ReadNumber(wasteRetained); waste.WasteAmountRetained_MTQ = reader.ReadNumber(wasteRetained);
if (!waste.WasteAmountRetained_MTQ.HasValue && reader.ReadText(wasteRetained).IsNullOrEmpty()) waste.WasteAmountRetained_MTQ = 0;
waste.WasteDisposalPort = reader.ReadSSNLocode(wastePort); // aka RemainingWasteDisposalPort waste.WasteDisposalPort = reader.ReadSSNLocode(wastePort); // aka RemainingWasteDisposalPort
if ((waste.WasteDisposalPort != null) && (waste.WasteDisposalPort == string.Empty)) if ((waste.WasteDisposalPort == null) && reader.ReadText(wastePort).IsNullOrEmpty()) waste.WasteDisposalPort = "ZZUKN";
{
waste.WasteDisposalPort = "ZZUKN";
}
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumber(amountGen); waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumber(amountGen);
if (!waste.WasteAmountGeneratedTillNextPort_MTQ.HasValue && reader.ReadText(amountGen).IsNullOrEmpty()) waste.WasteAmountGeneratedTillNextPort_MTQ = 0;
if (!waste.WasteType.HasValue || (waste.WasteType > 999)) if (!waste.WasteType.HasValue || (waste.WasteType > 999))
{ {
@ -1299,7 +1300,7 @@ namespace ENI2.Excel
} }
} }
was.AddMissingWaste(); was.AddMissingWaste(false);
return true; return true;
} }

View File

@ -2175,7 +2175,10 @@ namespace ENI2.Properties {
/// <summary> /// <summary>
/// Looks up a localized string similar to The existing value for the waste disposal service provider will be overwritten. /// Looks up a localized string similar to The existing value for the waste disposal service provider will be overwritten.
///Current entry:{0} New entry:{1} ///
///Current entry: {0}
///New entry: {1}
///
///Proceed?. ///Proceed?.
/// </summary> /// </summary>
public static string textConfirmWSDPOverwrite { public static string textConfirmWSDPOverwrite {

View File

@ -2259,7 +2259,10 @@
</data> </data>
<data name="textConfirmWSDPOverwrite" xml:space="preserve"> <data name="textConfirmWSDPOverwrite" xml:space="preserve">
<value>The existing value for the waste disposal service provider will be overwritten. <value>The existing value for the waste disposal service provider will be overwritten.
Current entry:{0} New entry:{1}
Current entry: {0}
New entry: {1}
Proceed?</value> Proceed?</value>
</data> </data>
</root> </root>

View File

@ -502,7 +502,7 @@ namespace bsmd.database
/// Convenience Methode, die fehlende Waste Einträge ergänzt. Verbesserte Version, aus ENI-2 herüberkopiert, damit es auch im /// Convenience Methode, die fehlende Waste Einträge ergänzt. Verbesserte Version, aus ENI-2 herüberkopiert, damit es auch im
/// Excel_Reader nutzbar wird /// Excel_Reader nutzbar wird
/// </summary> /// </summary>
public void AddMissingWaste() public void AddMissingWaste(bool fixExisting = true)
{ {
foreach (string wasteCodeString in WAS.WasteCodes) foreach (string wasteCodeString in WAS.WasteCodes)
@ -538,12 +538,15 @@ namespace bsmd.database
} }
else else
{ {
if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0; if (fixExisting)
if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0; {
if (!foundWaste.WasteCapacity_MTQ.HasValue) foundWaste.WasteCapacity_MTQ = 0; if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
if (foundWaste.WasteDescription.IsNullOrEmpty() && foundWaste.IsDashWasteCode) foundWaste.WasteDescription = "-"; if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0;
if (!foundWaste.WasteDisposalAmount_MTQ.HasValue) foundWaste.WasteDisposalAmount_MTQ = 0; if (!foundWaste.WasteCapacity_MTQ.HasValue) foundWaste.WasteCapacity_MTQ = 0;
if (foundWaste.WasteDisposalPort.IsNullOrEmpty()) foundWaste.WasteDisposalPort = "ZZUKN"; if (foundWaste.WasteDescription.IsNullOrEmpty() && foundWaste.IsDashWasteCode) foundWaste.WasteDescription = "-";
if (!foundWaste.WasteDisposalAmount_MTQ.HasValue) foundWaste.WasteDisposalAmount_MTQ = 0;
if (foundWaste.WasteDisposalPort.IsNullOrEmpty()) foundWaste.WasteDisposalPort = "ZZUKN";
}
} }
} }
} }