Overview
Comment:Don't repeat similar label if fee label is same as service label
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 416d123b086809f3fe671d921acbf1d36e911658
User & Date: bohwaz on 2020-12-08 15:50:17
Other Links: manifest | tags
Context
2020-12-08
16:02
Fix saved search edit form check-in: 6bf2abf9df user: bohwaz tags: trunk
15:50
Don't repeat similar label if fee label is same as service label check-in: 416d123b08 user: bohwaz tags: trunk
02:06
Fix reference value was missing in simple transaction edit check-in: c8034ab481 user: bohwaz tags: trunk
Changes

Modified src/include/lib/Garradin/Entities/Services/Service_User.php from [d694479106] to [2a1fc75349].

1
2
3
4
5
6

7
8
9
10
11
12
13
<?php

namespace Garradin\Entities\Services;

use Garradin\DB;
use Garradin\Entity;

use Garradin\ValidationException;
use Garradin\Services\Fees;
use Garradin\Services\Services;
use Garradin\Entities\Accounting\Transaction;

class Service_User extends Entity
{






>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

namespace Garradin\Entities\Services;

use Garradin\DB;
use Garradin\Entity;
use Garradin\Membres;
use Garradin\ValidationException;
use Garradin\Services\Fees;
use Garradin\Services\Services;
use Garradin\Entities\Accounting\Transaction;

class Service_User extends Entity
{
99
100
101
102
103
104
105








106
107
108
109
110
111
112
113
		$transaction->id_year = $this->fee()->id_year;

		$source['type'] = Transaction::TYPE_REVENUE;
		$key = sprintf('account_%d_', $source['type']);
		$source[$key . '0'] = [$this->fee()->id_account => ''];
		$source[$key . '1'] = isset($source['account']) ? $source['account'] : null;









		$source['label'] = 'Règlement activité - ' . $this->service()->label . ' - ' . $this->fee()->label;
		$source['date'] = $this->date->format('d/m/Y');

		$transaction->importFromNewForm($source);
		$transaction->save();
		$transaction->linkToUser($this->id_user, $this->id());

		return $transaction;







>
>
>
>
>
>
>
>
|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
		$transaction->id_year = $this->fee()->id_year;

		$source['type'] = Transaction::TYPE_REVENUE;
		$key = sprintf('account_%d_', $source['type']);
		$source[$key . '0'] = [$this->fee()->id_account => ''];
		$source[$key . '1'] = isset($source['account']) ? $source['account'] : null;

		$label = $this->service()->label;

		if ($this->fee()->label != $label) {
			$label .= ' - ' . $this->fee()->label;
		}

		$label .= sprintf(' (%s)', (new Membres)->getNom($this->id_user));

		$source['label'] = $label;
		$source['date'] = $this->date->format('d/m/Y');

		$transaction->importFromNewForm($source);
		$transaction->save();
		$transaction->linkToUser($this->id_user, $this->id());

		return $transaction;