Overview
Comment:Fix: error message when line ID is not found
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev | 1.0.0-alpha4
Files: files | file ages | folders
SHA1: 514825be77624be47005883c9d27fffa6ed70901
User & Date: bohwaz on 2020-11-05 12:50:22
Other Links: branch diff | manifest | tags
Context
2020-11-05
19:53
Fix: account label check-in: de3cca9b2e user: bohwaz tags: dev
12:50
Fix: error message when line ID is not found check-in: 514825be77 user: bohwaz tags: dev, 1.0.0-alpha4
12:02
Fix: Avoid 'Undefined variable: l' in import, improve export file name check-in: 0df6faebfe user: bohwaz tags: dev, 1.0.0-alpha4
Changes

Modified src/include/lib/Garradin/Accounting/Transactions.php from [a14d2193c0] to [dc047e6ef2].

207
208
209
210
211
212
213


214
215




216
217
218
219
220
221
222

				$id_account = $accounts->getIdFromCode($row->account);

				if (!$id_account) {
					throw new UserException(sprintf('le compte "%s" n\'existe pas dans le plan comptable', $row->account));
				}



				if ($row->line_id) {
					$line = $transaction->getLine($row->line_id);




				}
				else {
					$line = new Line;
				}

				$line->importForm([
					'credit'     => $row->credit ?: 0,







>
>

|
>
>
>
>







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

				$id_account = $accounts->getIdFromCode($row->account);

				if (!$id_account) {
					throw new UserException(sprintf('le compte "%s" n\'existe pas dans le plan comptable', $row->account));
				}

				$row->line_id = trim($row->line_id);

				if ($row->line_id) {
					$line = $transaction->getLine((int)$row->line_id);

					if (!$line) {
						throw new UserException(sprintf('le numéro de ligne "%s" n\'existe pas dans l\'écriture "%s"', $row->line_id, $transaction->id ?: 'à créer'));
					}
				}
				else {
					$line = new Line;
				}

				$line->importForm([
					'credit'     => $row->credit ?: 0,

Modified src/templates/acc/years/import.tpl from [3d4f5255f7] to [12bb51f776].

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

	{else}

	<fieldset>
		<legend>Import d'écritures</legend>
		<dl>
			<dt><label for="f_type_garradin">Format de fichier</label></dt>
			{input type="radio" name="type" value="garradin" label="Journal général, format Garradin"}
			{input type="radio" name="type" value="csv" label="Journal au format CSV libre"}
			<dd class="help">
				Règles à suivre pour créer le fichier CSV&nbsp;:
				<ul>
					<li>Il est recommandé d'utiliser LibreOffice pour créer le fichier CSV</li>
					<li>Le fichier doit être en UTF-8</li>
					<li>Le séparateur doit être le point-virgule ou la virgule</li>







|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

	{else}

	<fieldset>
		<legend>Import d'écritures</legend>
		<dl>
			<dt><label for="f_type_garradin">Format de fichier</label></dt>
			{input type="radio" name="type" value="garradin" label="Journal général au format CSV Garradin"}
			{input type="radio" name="type" value="csv" label="Journal au format CSV libre"}
			<dd class="help">
				Règles à suivre pour créer le fichier CSV&nbsp;:
				<ul>
					<li>Il est recommandé d'utiliser LibreOffice pour créer le fichier CSV</li>
					<li>Le fichier doit être en UTF-8</li>
					<li>Le séparateur doit être le point-virgule ou la virgule</li>