diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs index 65c45fa9..adb5dd7b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs @@ -411,7 +411,27 @@ namespace VEPROMS.CSLA.Library OnPropertyChanged("Print_RevDate"); } } - //new changebar_date + [Category("Print Settings")] + [Browsable(false)] + [DisplayName("User Selected ChangeBarDate View")] + [RefreshProperties(RefreshProperties.All)] + [Description("The view change bars starting date stored in ChangeBarDate")] + // B2023-015 this allows us to better determine if a change bar should be view/printed for child (slave) procedures + // when the user selects view change bars starting date, it's stored in the procedure config under "ChangeBarDate" + // (see the Set for Print_ChangeBarDate) + public DateTime? Print_ViewableStartingChangeBarDate + { + get + { + DateTime? dt = null; + string s = _Xp["Procedure", "ChangeBarDate"]; + if (s!= null && s!="") + dt = DateTime.Parse(s); + return dt; + } + } + + //new changebar_date [Category("Print Settings")] //Note that this print setting is stored under 'Procedure' element [Browsable(false)] [DisplayName("Revision ChangeBarDate")] diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index c1621f55..ad6c9c02 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -3634,7 +3634,14 @@ namespace VEPROMS.CSLA.Library if (ii == null) return false; // when deleting a source step, this was causing a crash (null ii) return (ii.MyContent.DTS > MyProcedure.ChangeBarDate); } - // if there is no override & return whether there was a change to the text. + // B2023-015 When user sets PROMS to show changebars after a specific date, we store that in the procedure config to Print_ChangeBarDate + // (ProcConfig.cs), but it actually get saved to "ChangeBarDate". Also when we get the value of Print_ChangeBarDate when processing a + // Child (slave), it returns the ChangeBarDate of the child instead of the date set by the user (to show change bars after a specific + // date). Print_ViewableAfterChangeBarDate was created to get only that user specified date, if it exists. If it does exist, we compare + // that with the Content datetime, otherwise we proceed as before. + DateTime? viewableStartingDateTime = (MyProcedure.MyConfig as ProcedureConfig).Print_ViewableStartingChangeBarDate; + if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate) + return (MyContent.DTS > viewableStartingDateTime); return (MyContent.DTS > MyProcedure.ChangeBarDate); } }