Significant changes to work with the new account/ledger structure. Removed much of the auto-generated model association code. Added helper functions into the models to perform model related work, such as model 'stats' (a bad name for a function to return a summary of pertinent financial information from a given model instance). There is a ton of cleanup to do, but first I want to get it all captured.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@81 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-10 02:41:23 +00:00
parent 3dcd83229b
commit ffd1b64580
41 changed files with 1441 additions and 916 deletions

View File

@@ -31,17 +31,16 @@ if (isset($paginator)) {
$rows = array();
foreach ($accounts as $account) {
$extra = null;
if (isset($account[0])) {
$extra = $account[0];
unset($account[0]);
}
//pr($account);
if (isset($account[0]))
$stats = $account[0];
else
$stats = $account;
// Move our pointer to the meat
if (isset($account['Account']))
$account = $account['Account'];
if (isset($extra))
$account = array_merge($account, $extra);
$rows[] = array($html->link($account['name'],
array('controller' => 'accounts',
'action' => 'view',
@@ -49,10 +48,10 @@ foreach ($accounts as $account) {
$account['type'],
$account['external_name'],
$account['external_account'],
$account['entries'],
FormatHelper::currency($account['debits']),
FormatHelper::currency($account['credits']),
FormatHelper::currency($account['balance']),
$stats['entries'],
FormatHelper::currency($stats['debits']),
FormatHelper::currency($stats['credits']),
FormatHelper::currency($stats['balance']),
$account['comment'],
);
}