Decided to look at the code change that we applied from Oracle's ESU. Looks like there is a couple of places where they reverted code back to how it was on the Add 1 Day Line and also the IF statement that occurs before it. Look at the comments and the code marked with 34077246.
if (lpDS->cProrateAutoPay == _J('1'))
{
/* Determine whether Date Pay Starts is within Pay Period. If so, prorate Salary Amount */
lDays1 = DateDifference(&lpDS->jdPayrollBeginningDate, &lpdsControl->dsMultipleJobsCache.jdJobStartDate);
/*31485364 - Made condition to be ">=" from just ">" to include the start date on PPED*/
/*34077246 Reverted 31485364 fix ,made condition from ">=" to ">"*/
if (lDays1 > 0)
{
/* Date Pay Starts is > Payroll Beginning Date. Prorate Salary */
nDaysWorkedInPayPeriod = DateDifference(&lpdsControl->dsMultipleJobsCache.jdJobStartDate, &lpDS->jdPayrollEndingDate);
/*31485364 Due to code moved out of IF scope this is not needed - */
/*34077246 Reverted 31485364 fix ,uncomment below line*/
nDaysWorkedInPayPeriod += 1; /* Add 1 Day */
IntToMathNumeric(nDaysWorkedInPayPeriod, &lpdsControl->jdDaysWorkedInPayPeriod);
/* Calculate Factor = Days Worked/Total Days in Pay Period */
MathDivide(&mnFactor, &mnRemainder, &lpdsControl->jdDaysWorkedInPayPeriod, &lpdsControl->jdSavedTotalDaysPayPeriod, &nDecimals, &nRoundFlag);
MathMultiply(&dsPayPeriodSliceCache.mnAutoPayTotalGross, &dsPayPeriodSliceCache.mnAutoPayTotalGross, &mnFactor);
MathRound(&dsPayPeriodSliceCache.mnAutoPayTotalGross, &dsPayPeriodSliceCache.mnAutoPayTotalGross, &nRoundDecimals);
/* SAR 8559511 - Since the payment start date is after the pay period start date, redefine the pay period
start date, so the correct date effective instructions are retrieved and the timecard from date is correct. */
lpDS->jdPayrollBeginningDate = lpdsControl->dsMultipleJobsCache.jdJobStartDate;
dsPayPeriodSliceCache.jdTimecardFromDate = lpDS->jdPayrollBeginningDate;
/* SAR 8559511 End */
}
/* SAR# 7888137 - Determine whether Date Pay Stops is within Pay Period. If so, prorate Salary Amount */
/*31485364 - For some reason the null date started working unexpectedly in date difference function in Aug 2020.
So additional check made*/
if (!(IsJDEDATENull(&lpdsControl->dsMultipleJobsCache.jdJobEndDate)))
{
lDays2 = DateDifference(&lpdsControl->dsMultipleJobsCache.jdJobEndDate, &lpDS->jdPayrollEndingDate);
/*34077246 Reverted 31485364 fix ,made condition from ">=" to ">"*/
if (lDays2 > 0) /*31485364 - made > to >= to include pay stop on the pay period start date*/
{
/* SAR 8559511 - Since the payment end date is before the pay period end date, redefine the pay period end
date, so the correct date effective instructions are retrieved and the timecard thru date is correct. */
lpDS->jdPayrollEndingDate = lpdsControl->dsMultipleJobsCache.jdJobEndDate;
dsPayPeriodSliceCache.jdTimecardThruDate = lpDS->jdPayrollEndingDate;
/* SAR 8559511 End */
/* Date Pay Stops is < Payroll Ending Date. Prorate Salary */
nDaysWorkedInPayPeriod = DateDifference(&lpDS->jdPayrollBeginningDate, &lpDS->jdPayrollEndingDate);
nDaysWorkedInPayPeriod += 1; /* Add 1 Day */
IntToMathNumeric(nDaysWorkedInPayPeriod, &lpdsControl->jdDaysWorkedInPayPeriod);
/* Calculate Factor = Days Worked/Total Days in Pay Period */
MathDivide(&mnFactor, &mnRemainder, &lpdsControl->jdDaysWorkedInPayPeriod, &lpdsControl->jdSavedTotalDaysPayPeriod, &nDecimals, &nRoundFlag);
MathMultiply(&dsPayPeriodSliceCache.mnAutoPayTotalGross, &dsPayPeriodSliceCache.mnAutoPayTotalGross, &mnFactor);