Overview
Comment:Fix error when trying to duplicate a transaction where a line has an account that does not exist in new chart
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 976684d358aac54cfdb720bb744bdaba39a69ce084b26709cbb167527a3bbc49
User & Date: bohwaz on 2021-11-08 18:38:56
Other Links: manifest | tags
Context
2021-12-04
00:42
Merge missing commits check-in: eb07375d4b user: bohwaz tags: dev
2021-11-08
18:41
use isset instead of === null check-in: 035e6e47ea user: bohwaz tags: trunk, stable
18:38
Fix error when trying to duplicate a transaction where a line has an account that does not exist in new chart check-in: 976684d358 user: bohwaz tags: trunk, stable
18:32
Fix errors when some browsers are returning bullshit check-in: c0dff3ffef user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Entities/Accounting/Transaction.php from [d712e54f3f] to [0979e203f6].

319
320
321
322
323
324
325

326





327
328
329
330
331
332
333
			$year->chart()->id,
			$year->chart()->id,
			$this->id()
		);

		foreach ($lines as $l) {
			$line = new Line;

			foreach ($copy as $field) {





				$line->$field = $l->$field;
			}

			$new->addLine($line);
		}

		return $new;







>

>
>
>
>
>







319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
			$year->chart()->id,
			$year->chart()->id,
			$this->id()
		);

		foreach ($lines as $l) {
			$line = new Line;

			foreach ($copy as $field) {
				if (null === $l->field && $field === 'id_account') {
					// Do not copy NULL accounts
					continue;
				}

				$line->$field = $l->$field;
			}

			$new->addLine($line);
		}

		return $new;