Overview
Comment:Do not change description and type when updating an account from update of installed chart
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 0854f561154dc6f5c724e5d4fdc54e02856f29de9b95be5e037c48d416d38ae7
User & Date: bohwaz on 2022-09-05 12:28:28
Other Links: manifest | tags
Context
2022-09-05
12:45
Restore old description and type from accounting chart check-in: 74a273af6e user: bohwaz tags: trunk, stable, 1.1.30
12:28
Do not change description and type when updating an account from update of installed chart check-in: 0854f56115 user: bohwaz tags: trunk, stable
2022-09-04
22:06
Fkx right amount when nothing is paid for a service subscription check-in: 1c25a42adb user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Accounting/Accounts.php from [cd19034123] to [96252f6415].

260
261
262
263
264
265
266
267


268


269
270



271
272
273
274
275
276
277
					if (!isset($positions[$row['position']])) {
						throw new ValidationException('Position inconnue : ' . $row['position']);
					}

					if (!isset($types[$row['type']])) {
						throw new ValidationException('Type inconnu : ' . $row['type']);
					}



					$row['position'] = $positions[$row['position']];


					$row['type'] = $types[$row['type']];
					$row['user'] = empty($row['added']) ? 0 : 1;




					$account->importForm($row);
					$account->save();
				}
				catch (ValidationException $e) {
					throw new UserException(sprintf('Ligne %d : %s', $line, $e->getMessage()));
				}








>
>
|
>
>
|
|
>
>
>







260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
					if (!isset($positions[$row['position']])) {
						throw new ValidationException('Position inconnue : ' . $row['position']);
					}

					if (!isset($types[$row['type']])) {
						throw new ValidationException('Type inconnu : ' . $row['type']);
					}

					// Don't update user-set values
					if ($account->exists()) {
						unset($row['type'], $row['description']);
					}
					else {
						$row['type'] = $types[$row['type']];
						$row['user'] = empty($row['added']) ? 0 : 1;
					}

					$row['position'] = $positions[$row['position']];

					$account->importForm($row);
					$account->save();
				}
				catch (ValidationException $e) {
					throw new UserException(sprintf('Ligne %d : %s', $line, $e->getMessage()));
				}