mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
Merge pull request #6668 from turbo124/v5-develop
Fixes for recurring expenses counter
This commit is contained in:
commit
8252d171f4
@ -43,7 +43,6 @@ class InvoiceViewedActivity implements ShouldQueue
|
||||
|
||||
$fields = new stdClass;
|
||||
|
||||
|
||||
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->invitation->invoice->user_id;
|
||||
|
||||
$fields->user_id = $user_id;
|
||||
|
@ -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();
|
||||
|
@ -311,6 +311,9 @@ trait MakesInvoiceValues
|
||||
$data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client);
|
||||
|
||||
$data[$key][$table_type.'.line_total'] = Number::formatMoney($item->line_total, $this->client);
|
||||
|
||||
/* need to test here as this is new - 18/09/2021*/
|
||||
if(array_key_exists($table_type.'.gross_line_total', $data[$key]))
|
||||
$data[$key][$table_type.'.gross_line_total'] = Number::formatMoney($item->gross_line_total, $this->client);
|
||||
|
||||
if (isset($item->discount) && $item->discount > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user