diff --git a/app/Constants.php b/app/Constants.php index da5228033f..d2357e7fb1 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -230,6 +230,7 @@ if (! defined('APP_NAME')) { define('FREQUENCY_FOUR_MONTHS', 7); define('FREQUENCY_SIX_MONTHS', 8); define('FREQUENCY_ANNUALLY', 9); + define('FREQUENCY_TWO_YEARS', 10); define('REPORT_FREQUENCY_DAILY', 'daily'); define('REPORT_FREQUENCY_WEEKLY', 'weekly'); diff --git a/app/Models/Traits/GeneratesNumbers.php b/app/Models/Traits/GeneratesNumbers.php index 9f19038731..041d67baf7 100644 --- a/app/Models/Traits/GeneratesNumbers.php +++ b/app/Models/Traits/GeneratesNumbers.php @@ -358,6 +358,9 @@ trait GeneratesNumbers case FREQUENCY_ANNUALLY: $resetDate->addYear(); break; + case FREQUENCY_TWO_YEARS: + $resetDate->addYears(2); + break; } $this->reset_counter_date = $resetDate->format('Y-m-d'); diff --git a/app/Models/Traits/HasRecurrence.php b/app/Models/Traits/HasRecurrence.php index e35c186525..e2620b8d2d 100644 --- a/app/Models/Traits/HasRecurrence.php +++ b/app/Models/Traits/HasRecurrence.php @@ -70,6 +70,8 @@ trait HasRecurrence return $monthsSinceLastSent >= 6; case FREQUENCY_ANNUALLY: return $monthsSinceLastSent >= 12; + case FREQUENCY_TWO_YEARS: + return $monthsSinceLastSent >= 24; default: return false; } @@ -112,6 +114,9 @@ trait HasRecurrence case FREQUENCY_ANNUALLY: $rule = 'FREQ=YEARLY;'; break; + case FREQUENCY_TWO_YEARS: + $rule = 'FREQ=YEARLY;INTERVAL=2;'; + break; } if ($this->end_date) { diff --git a/database/seeds/FrequencySeeder.php b/database/seeds/FrequencySeeder.php index 4935c57af3..8dfd762857 100644 --- a/database/seeds/FrequencySeeder.php +++ b/database/seeds/FrequencySeeder.php @@ -18,6 +18,7 @@ class FrequencySeeder extends Seeder ['name' => 'Four months', 'date_interval' => '4 months'], ['name' => 'Six months', 'date_interval' => '6 months'], ['name' => 'Annually', 'date_interval' => '1 year'], + ['name' => 'Two years', 'date_interval' => '2 years'], ]; foreach ($frequencies as $frequency) { diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index a8c1d6fc9f..5de58b6afa 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1389,6 +1389,7 @@ $LANG = array( 'freq_four_months' => 'Four months', 'freq_six_months' => 'Six months', 'freq_annually' => 'Annually', + 'freq_two_years' => 'Two years', // Payment types 'payment_type_Apply Credit' => 'Apply Credit',