Overview
Comment:Use todays date in new transaction
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7efebf836dfe35b1aaa5277cf9f6c3ac2994fbdf
User & Date: bohwaz on 2020-12-10 12:17:29
Other Links: manifest | tags
Context
2020-12-10
12:40
Fix migration from 0.9.8 check-in: 7da1bb41de user: bohwaz tags: trunk
12:17
Use todays date in new transaction check-in: 7efebf836d user: bohwaz tags: trunk
02:16
Don't hide print button on mobile check-in: 6aa5d87f22 user: bohwaz tags: trunk, stable
Changes

Modified src/www/admin/acc/transactions/new.php from [7173ab8670] to [bb4740dd64].

80
81
82
83
84
85
86


87









88
89
90
91
92
93
94
95
96
80
81
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106







+
+
-
+
+
+
+
+
+
+
+
+









		Utils::redirect(Utils::getSelfURL(false) . '?ok=' . $transaction->id());
	}
	catch (UserException $e) {
		$form->addError($e->getMessage());
	}
}

$date = new \DateTime;

$tpl->assign('date', $session->get('acc_last_date') ?: $current_year->start_date->format('d/m/Y'));
if ($session->get('acc_last_date')) {
	$date = \DateTime::createFromFormat('!d/m/Y', $session->get('acc_last_date'));
}

if (!$date || ($date < $current_year->start_date || $date > $current_year->end_date)) {
	$date = $current_year->start_date;
}

$tpl->assign('date', $date->format('d/m/Y'));
$tpl->assign(compact('transaction', 'payoff_for', 'amount', 'lines'));
$tpl->assign('payoff_targets', implode(':', [Account::TYPE_BANK, Account::TYPE_CASH, Account::TYPE_OUTSTANDING]));
$tpl->assign('ok', (int) qg('ok'));

$tpl->assign('types_details', Transaction::getTypesDetails());
$tpl->assign('chart_id', $chart->id());

$tpl->assign('analytical_accounts', ['' => '-- Aucun'] + $accounts->listAnalytical());
$tpl->display('acc/transactions/new.tpl');