Overview
Comment:Fix quick bank deposit: checkboxes were forgotten when an error was raised
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 441b36e9ae6721aeb884bf41f25210c88ac838dd
User & Date: bohwaz on 2020-11-01 01:44:20
Other Links: branch diff | manifest | tags
Context
2020-11-01
02:31
Fix display of account sum check-in: c590a1590d user: bohwaz tags: dev
01:44
Fix quick bank deposit: checkboxes were forgotten when an error was raised check-in: 441b36e9ae user: bohwaz tags: dev
01:37
Implement simple view in favourite accounts list, add button to create a transaction quickly from an account journal check-in: f9a9d244e3 user: bohwaz tags: dev
Changes

Modified src/templates/acc/accounts/deposit.tpl from [981f4f25b1] to [fd9abf6849].

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
				<td colspan="5"></td>
				<td class="money">{if $line.sum > 0}-{/if}{$line.sum|abs|raw|html_money:false}</td>
				<th>Solde au {$line.date|date_fr:'d/m/Y'}</th>
				<td colspan="2"></td>
			</tr>
			{else}
			<tr>
				<td class="check"><input type="checkbox" name="deposit[{$line.id}]" value="1" data-debit="{$line.debit}" data-credit="{$line.credit}" /></td>
				<td class="num"><a href="{$admin_url}acc/transactions/details.php?id={$line.id}">#{$line.id}</a></td>
				<td>{$line.date|date_fr:'d/m/Y'}</td>
				<td>{$line.reference}</td>
				<td>{$line.line_reference}</td>
				<th>{$line.label}</th>
				<td class="money">{$line.debit|raw|html_money}</td> {* Not a bug! Credit/debit is reversed here to reflect the bank statement *}
				<td class="money">{if $line.running_sum > 0}-{/if}{$line.running_sum|abs|raw|html_money:false}</td>







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
				<td colspan="5"></td>
				<td class="money">{if $line.sum > 0}-{/if}{$line.sum|abs|raw|html_money:false}</td>
				<th>Solde au {$line.date|date_fr:'d/m/Y'}</th>
				<td colspan="2"></td>
			</tr>
			{else}
			<tr>
				<td class="check"><input type="checkbox" name="deposit[{$line.id}]" value="1" data-debit="{$line.debit}" data-credit="{$line.credit}" {if array_key_exists($line.id, $checked)}checked="checked"{/if} /></td>
				<td class="num"><a href="{$admin_url}acc/transactions/details.php?id={$line.id}">#{$line.id}</a></td>
				<td>{$line.date|date_fr:'d/m/Y'}</td>
				<td>{$line.reference}</td>
				<td>{$line.line_reference}</td>
				<th>{$line.label}</th>
				<td class="money">{$line.debit|raw|html_money}</td> {* Not a bug! Credit/debit is reversed here to reflect the bank statement *}
				<td class="money">{if $line.running_sum > 0}-{/if}{$line.running_sum|abs|raw|html_money:false}</td>

Modified src/www/admin/acc/accounts/deposit.php from [a3727a4d5c] to [a23c633170].

44
45
46
47
48
49
50

51
52
53
54
55
56

57
58
59
$date = new \DateTime;

if ($date > $current_year->end_date) {
	$date = $current_year->end_date;
}

$target = $account::TYPE_BANK;


$tpl->assign(compact(
	'account',
	'journal',
	'date',
	'target'

));

$tpl->display('acc/accounts/deposit.tpl');







>





|
>



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
$date = new \DateTime;

if ($date > $current_year->end_date) {
	$date = $current_year->end_date;
}

$target = $account::TYPE_BANK;
$checked = f('deposit') ?: [];

$tpl->assign(compact(
	'account',
	'journal',
	'date',
	'target',
	'checked'
));

$tpl->display('acc/accounts/deposit.tpl');

Modified src/www/admin/static/scripts/global.js from [dc757df630] to [6bb07a39b4].

237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
		i.appendChild(span);
		g.closeDialog();
		i.firstChild.focus();
	};

	g.formatMoney = (v) => {
		v = '' + v;
		return (v.substr(0, v.length-2) || '0') + ',' + (v + '00').substr(-2);
	};

	// Sélecteurs de listes
	g.onload(() => {
		var inputs = $('form .input-list > button');

		inputs.forEach((i) => {







|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
		i.appendChild(span);
		g.closeDialog();
		i.firstChild.focus();
	};

	g.formatMoney = (v) => {
		v = '' + v;
		return (v.substr(0, v.length-2) || '0') + ',' + v.substr(-2);
	};

	// Sélecteurs de listes
	g.onload(() => {
		var inputs = $('form .input-list > button');

		inputs.forEach((i) => {