[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2454] trunk



Revision: 2454
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2454&view=rev
Author:   einhverfr
Date:     2009-02-19 19:26:51 +0000 (Thu, 19 Feb 2009)

Log Message:
-----------
Correcting display issue viewing existing reconciliation sets

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/UI/reconciliation/search.html
    trunk/scripts/recon.pl

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-02-18 22:17:05 UTC (rev 2453)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2009-02-19 19:26:51 UTC (rev 2454)
@@ -296,13 +296,11 @@
     $self->{outstanding_total} = 0;
 
     for my $line (@{$self->{report_lines}}){
-        if ($self->{"cleared_$line->{id}"}){
+        if ($self->{"cleared_$line->{id}"} or $line->{cleared}){
             $our_balance += $line->{our_balance};
             $self->{cleared_total} += $line->{our_balance};
-		print STDERR "$self->{cleared_total}\n"
         } else {
             $self->{outstanding_total} += $line->{our_balance};
-		print STDERR "$self->{outstanding_total}\n"
         } 
     } 
     $self->{our_total} = $our_balance;

Modified: trunk/UI/reconciliation/search.html
===================================================================
--- trunk/UI/reconciliation/search.html	2009-02-18 22:17:05 UTC (rev 2453)
+++ trunk/UI/reconciliation/search.html	2009-02-19 19:26:51 UTC (rev 2454)
@@ -45,9 +45,9 @@
             <div>
 		<?lsmb INCLUDE select element_data = {
 			label = text('Account:'),
-			class = "coa-list",
+			class = "chart_id",
 			options = account_list,
-			text_attr = 'account',
+			text_attr = 'name',
 			value_attr = 'id'
 		} ?>
             </div>

Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl	2009-02-18 22:17:05 UTC (rev 2453)
+++ trunk/scripts/recon.pl	2009-02-19 19:26:51 UTC (rev 2454)
@@ -74,7 +74,7 @@
 sub update_recon_set {
     my ($request) = shift;
     my $recon = LedgerSMB::DBObject::Reconciliation->new(base => $request);
-    $recon->add_entries($recon->import_file());
+    $recon->add_entries($recon->import_file()) if !$recon->{submitted};
     $recon->{dbh}->commit;
     $recon->update();
     _display_report($recon);
@@ -107,6 +107,7 @@
         }
         my $base_url = "recon.pl?action=update_recon_set";
         $columns = {
+            "select" => $request->{_locale}->text('Select'),	
             account     => $request->{_locale}->text('Account'),	
             their_total => $request->{_locale}->text('Balance'),
             end_date    => $request->{_locale}->text('Statement Date'),
@@ -114,9 +115,18 @@
             approved    => $request->{_locale}->text('Approved'), 
         };
 	my $cols = [];
-	@$cols = qw(account end_date their_total approved submitted);
+	my @acts = $search->get_accounts;
+	@$cols = qw(select account end_date their_total approved submitted);
 	my $recon =$search;
 	for my $row(@results){
+            my $act = undef;
+            for (@acts){
+                if ($_->{id} == $row->{chart_id}){
+                    $act = $_->{name};
+                }
+                last if $act;
+            }
+            $row->{account} = $act;
             $row->{their_total} = $recon->format_amount(
 		{amount => $row->{their_total}, money => 1}); 
             $row->{end_date} = {
@@ -150,6 +160,7 @@
         my $recon = LedgerSMB::DBObject::Reconciliation->new(base=>$request, copy=>'all');
         
         @{$recon->{account_list}} = $recon->get_accounts();
+	unshift @{$recon->{account_list}}, {id => '', name => '' };
         my $template = LedgerSMB::Template->new(
             user => $user,
             template=>'search',
@@ -157,7 +168,7 @@
             format=>'HTML',
             path=>"UI/reconciliation",
         );
-        return $template->render();
+        return $template->render($recon);
 }
 
 =pod


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.