| | |
| | | Unit unit, |
| | | Product_MP product1, |
| | | Product_MP product2, |
| | | Date startdate, |
| | | Date enddate, |
| | | Number number |
| | | ) as Boolean |
| | | { |
| | |
| | | if( product1 = product2 ){ |
| | | feedback := Translations::MP_ChangeLossSetting_SameProduct(); |
| | | } |
| | | if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit |
| | | 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 ) |
| | | or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){ |
| | | feedback := Translations::MP_ChangeLossSetting_Exist() |
| | | } |
| | | if( exists( owner, ChangeLossSetting, cls, cls <> old and not ( cls.StartDate() > enddate or cls.EndDate() < startdate ) ) ){ |
| | | feedback := Translations::MP_ChangeLossSetting_DateCoincide() |
| | | } |
| | | |
| | | return feedback = ''; |
| | | *] |