From 844d438034876c31d6255996b972276f85da2c6f Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期一, 25 九月 2023 19:35:50 +0800
Subject: [PATCH] Merge branch 'feature/kevin_addsanitycheck' into dev

---
 _Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl b/_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl
new file mode 100644
index 0000000..09ae8ea
--- /dev/null
+++ b/_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl
@@ -0,0 +1,38 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetHasValidOperationInputOutput (
+  output Strings feedback_o,
+  output Strings sanitycheckfeedback_o
+) declarative remote #extension
+{
+  TextBody:
+  [*
+    // desmondt Oct-3-2014 (created)
+    feedback := '';
+    sanitycheckfeedback := ''
+    
+    if( ( this.Unit().QuantityToProcess() = GlobalParameters_MP::GetQTProcessIn()
+          or not this.Unit().IsSupplier() ) // Tianma change 20230925: If the unit is not a supplier, raise a data issue if there's no input
+        and this.OperationInput( relsize ) = 0 )
+    {
+      feedback := Translations::MP_Operation_ViolateHasValidOperationInputOutput_NoOperationInput();
+      sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() );
+    }
+    else if( this.Unit().QuantityToProcess() = GlobalParameters_MP::GetQTProcessOut()
+             and this.OperationOutput( relsize ) = 0 )
+    {
+      feedback := Translations::MP_Operation_ViolateHasValidOperationInputOutput_NoOperationOutput();
+      sanitycheckfeedback := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
+    }
+    
+    if( not isnull( feedback_o ) and feedback <> '' )
+    {
+      name := MacroPlan::GetSubstituteName( this.Name() ); // To avoid empty name/name too long
+      feedback_o.Add( SanityCheckMessage::GetFormattedMessage( Translations::MP_Process_Instance( this.DefinitionName(), name ),
+                                                               feedback ) );
+      sanitycheckfeedback_o.Add( sanitycheckfeedback );
+    }
+    
+    return feedback = '';
+  *]
+}

--
Gitblit v1.9.3