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

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



Revision: 6791
          http://sourceforge.net/p/ledger-smb/code/6791
Author:   einhverfr
Date:     2014-02-07 06:06:39 +0000 (Fri, 07 Feb 2014)
Log Message:
-----------
Timecard report now displays correctly

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Timecards.pm
    trunk/sql/modules/Timecards.sql

Modified: trunk/LedgerSMB/Report/Timecards.pm
===================================================================
--- trunk/LedgerSMB/Report/Timecards.pm	2014-02-07 05:48:55 UTC (rev 6790)
+++ trunk/LedgerSMB/Report/Timecards.pm	2014-02-07 06:06:39 UTC (rev 6791)
@@ -92,7 +92,7 @@
 sub columns {
     return [
     {col_id => 'weekstarting',
-       name => LedgerSMB::Report::text('Date'),
+       name => LedgerSMB::Report::text('Week Starting'),
        type => 'text',
      pwidth => '2', },
     {col_id => 'business_unit_code',
@@ -105,7 +105,8 @@
      pwidth => '4', },
     {col_id => 'id',
        name => LedgerSMB::Report::text('ID'),
-       type => 'text',
+       type => 'href',
+  href_base => 'timecard.pl?action=edit&id=',
      pwidth => '1', },
     {col_id => 'partnumber',
        name => LedgerSMB::Report::text('Partnumber'),
@@ -182,7 +183,8 @@
     my ($self) = @_;
     my @rows = $self->exec_method({ funcname => 'timecard__report' });
     for my $row (@rows){
-        $row->{"day$row->{dow}"} = $row->{qty};
+        $row->{"day$row->{weekday}"} = $row->{qty};
+        $row->{"row_id"} = $row->{id};
     }
     $self->rows(\@rows);
 }

Modified: trunk/sql/modules/Timecards.sql
===================================================================
--- trunk/sql/modules/Timecards.sql	2014-02-07 05:48:55 UTC (rev 6790)
+++ trunk/sql/modules/Timecards.sql	2014-02-07 06:06:39 UTC (rev 6791)
@@ -118,7 +118,7 @@
 WITH RECURSIVE bu_tree (id, path) AS (
      SELECT id, id::text AS path, control_code, description
        FROM business_unit
-      WHERE id = any($1)
+      WHERE id = any($1) OR ($1 = '{}' OR $1 IS NULL and parent_id IS NULL)
       UNION
      SELECT bu.id, bu_tree.path || ',' || bu.id, bu.control_code, bu.description
        FROM business_unit bu

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


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits