| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod ValidateInput ( | 
|   output String feedback, | 
|   MacroPlan owner, | 
|   ChangeLossSetting old, | 
|   Unit unit, | 
|   Product_MP product1, | 
|   Product_MP product2, | 
|   Date startdate, | 
|   Date enddate, | 
|   String number | 
| ) as Boolean | 
| { | 
|   TextBody: | 
|   [* | 
|     // 甄兰鸽 Jun-5-2024 (created) | 
|     feedback := ''; | 
|     if( [Real]number < 0 ){ | 
|       feedback := Translations::MP_ChangeLossSettingExcel_Import_PositiveInteger(); | 
|     } | 
|     if( isnull( unit ) or isnull( product1 ) or isnull( product2 ) or [Real]number = 0 ){ | 
|       feedback := Translations::MP_ChangeLossSetting_CheckNull(); | 
|     } | 
|     if( product1 = product2 ){ | 
|       feedback := Translations::MP_ChangeLossSetting_SameProduct(); | 
|     } | 
|     if( startdate > enddate ){ | 
|       feedback := Translations::MP_LibCal_Event_ValidDatePeriod(); | 
|     } | 
|     if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit and not ( cls.StartDate() > enddate or cls.EndDate() < startdate ) | 
|                 and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){ | 
|     //            and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 )  | 
|     //                  or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){ | 
|       feedback := Translations::MP_ChangeLossSetting_Exist() | 
|     } | 
|     if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit  and not ( cls.StartDate() > enddate or cls.EndDate() < startdate ) | 
|                 and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){ | 
|     //            and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 )  | 
|     //                  or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){ | 
|       feedback := Translations::MP_ChangeLossSetting_DateCoincide() | 
|     } | 
|      | 
|     return feedback = ''; | 
|   *] | 
| } |