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

Add recurring_expense property if it doesn't exist.

This commit is contained in:
= 2021-09-18 08:10:44 +10:00
parent b6b4ca0267
commit 6696d2ba36

View File

@ -335,6 +335,15 @@ trait GeneratesCounter
{
$this->resetCompanyCounters($expense->company);
// - 18/09/21 need to set this property if it doesn't exist. //todo refactor this for other properties
if(!property_exists($expense->company->settings, 'recurring_expense_number_counter')){
$settings = $expense->company->settings;
$settings->recurring_expense_number_counter = 1;
$settings->recurring_expense_number_pattern = '';
$expense->company->settings = $settings;
$expense->company->save();
}
$counter = $expense->company->settings->recurring_expense_number_counter;
$setting_entity = $expense->company->settings->recurring_expense_number_counter;
@ -585,6 +594,7 @@ trait GeneratesCounter
$settings->project_number_counter = 1;
$settings->task_number_counter = 1;
$settings->expense_number_counter = 1;
$settings->recurring_expense_number_counter =1;
$company->settings = $settings;
$company->save();