From 4eb6f16a70cbb5c5dff4d8994fb8c042d25dbac2 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期四, 06 六月 2024 14:14:26 +0800
Subject: [PATCH] 换型损失设置新增编辑完成

---
 _Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl b/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
index 55452d1..b5ed7dc 100644
--- a/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
+++ b/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
@@ -1,6 +1,7 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod ValidateInput (
+  output String feedback,
   MacroPlan owner,
   ChangeLossSetting old,
   Unit unit,
@@ -13,13 +14,19 @@
   [*
     // 鐢勫叞楦� Jun-5-2024 (created)
     feedback := '';
+    
     if( isnull( unit ) or isnull( product1 ) or isnull( product2 ) or number < 1 ){
       feedback := Translations::MP_ChangeLossSetting_CheckNull();
     }
-    if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){
+    if( product1 = product2 ){
+      feedback := Translations::MP_ChangeLossSetting_SameProduct();
+    }
+    if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit 
+                and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) 
+                      or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
       feedback := Translations::MP_ChangeLossSetting_Exist()
     }
-        
+    
     return feedback = '';
   *]
 }

--
Gitblit v1.9.3