Service/Account/Balance/Calc.php
private function getDateBalanceClose($dateResetFrom, $daysToReset)
    {
        if (!empty($dateResetFrom)) {
            $applied = $this->hlpPeriod->getPeriodCurrent($dateResetFrom);
            $result = $this->hlpPeriod->getPeriodPrev($applied);
        } else {
            $days = abs((int)$daysToReset);
            if ($days < 0) {
                $days = self::DEF_DAYS_TO_RESET;
            }
            $dtNow = $this->hlpDate->getUtcNow();
            $dtMod = $dtNow->modify("-$days days");
            $result = $this->hlpPeriod->getPeriodCurrent($dtMod);
        }
        return $result;
    }
private function getDateBalanceClose($dateResetFrom, $daysToReset)
    {
        if (!empty($dateResetFrom)) {
            $applied = $this->hlpPeriod->getPeriodCurrent($dateResetFrom);
            $result = $this->hlpPeriod->getPeriodPrev($applied);
        } else {
            $days = abs((int)$daysToReset);
            if ($days < 0) {
                $days = self::DEF_DAYS_TO_RESET;
            }
            $dtNow = $this->hlpDate->getUtcNow();
            $dtMod = $dtNow->modify("-$days days");
            $result = $this->hlpPeriod->getPeriodCurrent($dtMod);
        }
        return $result;
    }
Calculate datestamp for the last day of balances to leave w/o reset.

@param string $daysToReset
@param int $daysToReset
@return string YYYYMMDD