mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for reset counter
This commit is contained in:
parent
ea3530e9da
commit
7677cd07a4
@ -532,42 +532,46 @@ trait GeneratesCounter
|
||||
|
||||
switch ($reset_counter_frequency) {
|
||||
case RecurringInvoice::FREQUENCY_DAILY:
|
||||
now()->addDay();
|
||||
$new_reset_date = now()->addDay();
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_WEEKLY:
|
||||
now()->addWeek();
|
||||
$new_reset_date = now()->addWeek();
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_TWO_WEEKS:
|
||||
now()->addWeeks(2);
|
||||
$new_reset_date = now()->addWeeks(2);
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_FOUR_WEEKS:
|
||||
now()->addWeeks(4);
|
||||
$new_reset_date = now()->addWeeks(4);
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_MONTHLY:
|
||||
now()->addMonth();
|
||||
$new_reset_date = now()->addMonth();
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_TWO_MONTHS:
|
||||
now()->addMonths(2);
|
||||
$new_reset_date = now()->addMonths(2);
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_THREE_MONTHS:
|
||||
now()->addMonths(3);
|
||||
$new_reset_date = now()->addMonths(3);
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_FOUR_MONTHS:
|
||||
now()->addMonths(4);
|
||||
$new_reset_date = now()->addMonths(4);
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_SIX_MONTHS:
|
||||
now()->addMonths(6);
|
||||
$new_reset_date = now()->addMonths(6);
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_ANNUALLY:
|
||||
now()->addYear();
|
||||
$new_reset_date = now()->addYear();
|
||||
break;
|
||||
case RecurringInvoice::FREQUENCY_TWO_YEARS:
|
||||
now()->addYears(2);
|
||||
$new_reset_date = now()->addYears(2);
|
||||
break;
|
||||
|
||||
default:
|
||||
$new_reset_date = now()->addYear();
|
||||
break;
|
||||
}
|
||||
|
||||
$settings = $client->company->settings;
|
||||
$settings->reset_counter_date = $reset_date->format('Y-m-d');
|
||||
$settings->reset_counter_date = $new_reset_date->format('Y-m-d');
|
||||
$settings->invoice_number_counter = 1;
|
||||
$settings->quote_number_counter = 1;
|
||||
$settings->credit_number_counter = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user