1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Bugfix where reset counter date is set but frequency is set to disabled

This commit is contained in:
David Bomba 2023-01-11 13:13:38 +11:00
parent 081d720ce5
commit f28a26d3f9
2 changed files with 21 additions and 0 deletions

View File

@ -479,9 +479,20 @@ trait GeneratesConvertedQuoteCounter
$reset_counter_frequency = (int) $client->getSetting('reset_counter_frequency_id');
if ($reset_counter_frequency == 0) {
if($client->getSetting('reset_counter_date')){
$settings = $client->company->settings;
$settings->reset_counter_date = "";
$client->company->settings = $settings;
$client->company->save();
}
return;
}
$timezone = Timezone::find($client->getSetting('timezone_id'));
$reset_date = Carbon::parse($client->getSetting('reset_counter_date'), $timezone->name);

View File

@ -519,6 +519,16 @@ trait GeneratesCounter
$reset_counter_frequency = (int) $client->getSetting('reset_counter_frequency_id');
if ($reset_counter_frequency == 0) {
if($client->getSetting('reset_counter_date')){
$settings = $client->company->settings;
$settings->reset_counter_date = "";
$client->company->settings = $settings;
$client->company->save();
}
return;
}