<commit_before><?php

/**
 * @package         Billing
 * @copyright       Copyright (C) 2012-2016 S.D.O.C. LTD. All rights reserved.
 * @license         GNU Affero General Public License Version 4; see LICENSE.txt
 */

/**
 * Handle the logic of an auto renew monthly record.
 *
 */
class Billrun_Autorenew_Month extends Billrun_Autorenew_Record {

	/**
	 * Get the next renew date for this recurring plan.
	 * @return Next update date.
	 */
	protected function getNextRenewDate() {
		$lastDayOfMonth = strtotime('last day of this month 23:59:59');
		if ($this->data['eom'] == 1) {
			return new MongoDate($lastDayOfMonth);
		}

		$lastDayNextMonth = strtotime('last day of next month 23:59:59');
		$nextMonth = strtotime("+1 month -1 day 23:59:59");
		if ($nextMonth > $lastDayNextMonth) {<commit_msg>Fixed the eom logic now when we update on the day instead of the next day<commit_after><?php

/**
 * @package         Billing
 * @copyright       Copyright (C) 2012-2016 S.D.O.C. LTD. All rights reserved.
 * @license         GNU Affero General Public License Version 4; see LICENSE.txt
 */

/**
 * Handle the logic of an auto renew monthly record.
 *
 */
class Billrun_Autorenew_Month extends Billrun_Autorenew_Record {

	/**
	 * Get the next renew date for this recurring plan.
	 * @return Next update date.
	 */
	protected function getNextRenewDate() {
		$lastDayNextMonth = strtotime('last day of next month 23:59:59');
		if ($this->data['eom'] == 1) {
			return new MongoDate($lastDayNextMonth);
		}

		$nextMonth = strtotime("+1 month -1 day 23:59:59");
		if ($nextMonth > $lastDayNextMonth) {
{'fraction_non_alphanumeric': 0.120625, 'fraction_numerical': 0.03375, 'mean_word_length': 3.4472222222222224, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5377480', 'n_tokens_mistral': 569, 'n_tokens_neox': 501, 'n_words': 168}