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

SF.net SVN: ledger-smb:[3865] addons/1.3/budgetting/trunk



Revision: 3865
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3865&view=rev
Author:   einhverfr
Date:     2011-10-14 23:15:44 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
More budgetting fixes

Modified Paths:
--------------
    addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm
    addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget_Report.pm
    addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql

Modified: addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm
===================================================================
--- addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm	2011-10-14 10:11:41 UTC (rev 3864)
+++ addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm	2011-10-14 23:15:44 UTC (rev 3865)
@@ -90,7 +90,7 @@
 =item   @lines 
    These are the actual lines of the budget.  Each one is a hashref containing
 
-=over 
+=over
 
 =item $budget_id int
    Optional.  Don't use.  Use the $id field of the parent instead.
@@ -112,7 +112,8 @@
 =item @notes
 Where each note is a hashref containing
 
-=over
+=over 
+
 =item $subject string
    Subject of note
 
@@ -161,6 +162,7 @@
 values.  The properties used are:
 
 =over
+
 =item start_date
 Matches the start date of the budget.  Full match only.
 
@@ -274,6 +276,10 @@
 =cut
 
 sub list_projects {
+    my ($self) = @_;
+    my $effective_date = $self->{start_date} || 'today';
+    return $self->call_procedure(procname => 'project_list_open', 
+                                     args =>[$effective_date]);
 } 
 
 =item list_departments
@@ -282,6 +288,8 @@
 =cut
 
 sub list_departments {
+    my ($self) = @_;
+    return $self->call_procedure(procname => 'department_list');
 }
 
 1;

Modified: addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget_Report.pm
===================================================================
--- addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget_Report.pm	2011-10-14 10:11:41 UTC (rev 3864)
+++ addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget_Report.pm	2011-10-14 23:15:44 UTC (rev 3865)
@@ -30,6 +30,7 @@
 =head1 PROPERTIES
 
 =over
+
 =item id
 The id of the budget
 
@@ -88,6 +89,7 @@
 Lines of the report.  Each line is a hashref containing:
 
 =over
+
 =item accno
 Account number for the account in question
 
@@ -116,6 +118,7 @@
 =head1 METHODS
 
 =over
+
 =item run_report($id);
 
 Takes a blank (base) object and populates with the variance report data provided
@@ -140,6 +143,10 @@
 =cut
 
 sub list_projects {
+    my ($self) = @_;
+    my $effective_date = $self->{start_date} || 'today';
+    return $self->call_procedure(procname => 'project_list_open', 
+                                     args =>[$effective_date]);
 } 
 
 =item list_departments
@@ -148,6 +155,8 @@
 =cut
 
 sub list_departments {
+    my ($self) = @_;
+    return $self->call_procedure(procname => 'department_list');
 }
 
 1;

Modified: addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql
===================================================================
--- addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql	2011-10-14 10:11:41 UTC (rev 3864)
+++ addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql	2011-10-14 23:15:44 UTC (rev 3865)
@@ -11,7 +11,6 @@
    entered_at timestamp not null default now(),
    approved_at timestamp,
    obsolete_at timestamp,
-   obsolete_by int references entity(id),
    check (start_date < end_date)
 );
 
@@ -27,7 +26,7 @@
     primary key (budget_id)
 );
 
-CREATE OR REPLACE budget_line (
+CREATE TABLE budget_line (
     budget_id int not null references budget_info(id),
     account_id int not null references account(id),
     description text,
@@ -37,8 +36,8 @@
 
 INSERT INTO note_class (id, class) values ('6', 'Budget');
 
-CREATE OR REPLACE budget_note (
+CREATE TABLE budget_note (
     primary key(id),
     check (note_class = 6),
     foreign key(ref_key) references budget_info(id)
-);
+) INHERITS (note);

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