Overview
Comment:Allow to do an opening balance from nothing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 99bb6ee70fc5fb8dd2c4f98cc1442af7c8527524
User & Date: bohwaz on 2020-12-08 17:47:59
Other Links: manifest | tags
Context
2020-12-08
18:04
Fix count for simple tracking check-in: 3db9fbfa3d user: bohwaz tags: trunk
17:47
Allow to do an opening balance from nothing check-in: 99bb6ee70f user: bohwaz tags: trunk
17:08
Allow to just subscribe a user to a service, without adding a payment check-in: 481cf0b000 user: bohwaz tags: trunk, stable
Changes

Modified src/www/admin/acc/years/balance.php from [1c5fd61cf1] to [19f637ea79].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
	throw new UserException('Exercice inconnu.');
}

if ($year->closed) {
	throw new UserException('Impossible de modifier un exercice clôturé.');
}

if (f('next') && !f('from_year')) {
	Utils::redirect('/admin/acc/years/');
}

if (f('save') && $form->check('acc_years_balance_' . $year->id()))
{
	try {
		$transaction = new Transaction;
		$transaction->importFromBalanceForm($year);
		$transaction->save();








<
<
<
<







16
17
18
19
20
21
22




23
24
25
26
27
28
29
	throw new UserException('Exercice inconnu.');
}

if ($year->closed) {
	throw new UserException('Impossible de modifier un exercice clôturé.');
}





if (f('save') && $form->check('acc_years_balance_' . $year->id()))
{
	try {
		$transaction = new Transaction;
		$transaction->importFromBalanceForm($year);
		$transaction->save();

41
42
43
44
45
46
47

48
49
50
51
52
53
54
55

$previous_year = null;
$chart_change = false;
$lines = [[]];
$lines_accounts = [[]];
$years = Years::listClosed();


if (!count($years)) {
	$previous_year = 0;
}
elseif (null !== f('from_year')) {
	$previous_year = (int)f('from_year');
	$previous_year = Years::get($previous_year);

	if (!$previous_year) {







>
|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

$previous_year = null;
$chart_change = false;
$lines = [[]];
$lines_accounts = [[]];
$years = Years::listClosed();

// Empty balance
if (!count($years) || f('from_year') === '') {
	$previous_year = 0;
}
elseif (null !== f('from_year')) {
	$previous_year = (int)f('from_year');
	$previous_year = Years::get($previous_year);

	if (!$previous_year) {