How can I display Year To Date values for all components on Custom Payslips, regardless of their presence on the current Payslip?

This feature is available on Master edition
To display Year To Date values for all components on custom payslips, even if there’s no current payslip value for the period, enable the "Show Year to Date value regardless of current value" option in the Payroll Settings section under General Settings.
Navigate > Config > Basic Settings > Company Settings > General Settings > Payroll Settings