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

SF.net SVN: ledger-smb:[4943] trunk/LedgerSMB/DBObject/Report/Unapproved



Revision: 4943
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4943&view=rev
Author:   einhverfr
Date:     2012-06-22 06:47:08 +0000 (Fri, 22 Jun 2012)
Log Message:
-----------
HREF's for draft search and voucher list

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Report/Unapproved/Batch_Detail.pm
    trunk/LedgerSMB/DBObject/Report/Unapproved/Drafts.pm

Modified: trunk/LedgerSMB/DBObject/Report/Unapproved/Batch_Detail.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Unapproved/Batch_Detail.pm	2012-06-22 06:19:02 UTC (rev 4942)
+++ trunk/LedgerSMB/DBObject/Report/Unapproved/Batch_Detail.pm	2012-06-22 06:47:08 UTC (rev 4943)
@@ -208,8 +208,17 @@
                 }]);
     my @rows = $self->exec_method({funcname => 'batch__search'});
     for my $r (@rows){
-       # TODO hrefs
-       $r->{row_id} = $r->{id};
+    for my $ref (@rows){
+        my $script;
+        my $class_to_script = {
+           1 => 'ap',
+           2 => 'ar',
+           5 => 'gl',
+           8 => 'is',
+           9 => 'ir',
+        };
+        $script = $class_to_script->{$ref->{batch_class}};
+        $ref->{reference_href_suffix} = "$script.pl?action=edit&id=$ref->{id}";
     }
     $self->rows(..hidden..);
 }

Modified: trunk/LedgerSMB/DBObject/Report/Unapproved/Drafts.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Unapproved/Drafts.pm	2012-06-22 06:19:02 UTC (rev 4942)
+++ trunk/LedgerSMB/DBObject/Report/Unapproved/Drafts.pm	2012-06-22 06:47:08 UTC (rev 4943)
@@ -213,7 +213,14 @@
 sub run_report{
     my ($self) = @_;
     my @rows = $self->exec_method({funcname => 'draft__search'});
-    # TODO:  Add URL handling
+    for my $ref (@rows){
+        my $script = $self->type;
+        if ($ref->{invoice}){
+            $script = 'is' if $self->type eq 'ar';
+            $script = 'ir' if $self->type eq 'ap';
+        }
+        $ref->{reference_href_suffix} = "$script.pl?action=edit&id=$ref->{id}";
+    }
     $self->rows(..hidden..);
 }
 

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