Overview
Comment:Add line number to error message
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: 3b68e279be7d51ca3af964c2abbb8d4afac24072
User & Date: bohwaz on 2021-01-05 17:52:13
Other Links: manifest | tags
Context
2021-01-05
18:05
Add message and leave selector empty for report of previous year result check-in: c750b2eb54 user: bohwaz tags: trunk, stable
17:52
Add line number to error message check-in: 3b68e279be user: bohwaz tags: trunk, stable
17:13
Only save if required check-in: 57b6eb0cc9 user: bohwaz tags: trunk, stable, 1.0.1
Changes

Modified src/include/lib/Garradin/Entities/Accounting/Transaction.php from [80f76fcebd] to [560406ee34].

525
526
527
528
529
530
531
532
533


534
535




536
537
538
539
540
541
542
		}
		catch (\LogicException $e) {
			throw new ValidationException('Aucun compte sélectionné pour certaines lignes.');
		}

		$debit = $credit = 0;

		foreach ($lines as $line) {
			$line['id_account'] = @count($line['account']) ? key($line['account']) : null;


			$line = (new Line)->importForm($line);
			$this->addLine($line);





			$debit += $line->debit;
			$credit += $line->credit;
		}

		if ($debit != $credit) {
			// Add final balance line







|

>
>
|
|
>
>
>
>







525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
		}
		catch (\LogicException $e) {
			throw new ValidationException('Aucun compte sélectionné pour certaines lignes.');
		}

		$debit = $credit = 0;

		foreach ($lines as $k => $line) {
			$line['id_account'] = @count($line['account']) ? key($line['account']) : null;

			try {
				$line = (new Line)->importForm($line);
				$this->addLine($line);
			}
			catch (ValidationException $e) {
				throw new ValidationException(sprintf('Ligne %d : %s', $k+1, $e->getMessage()), 0, $e);
			}

			$debit += $line->debit;
			$credit += $line->credit;
		}

		if ($debit != $credit) {
			// Add final balance line