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

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



Revision: 4403
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4403&view=rev
Author:   einhverfr
Date:     2012-03-07 11:57:29 +0000 (Wed, 07 Mar 2012)
Log Message:
-----------
After adding app modules, business class list now lists again.  Now must test saving changes to module list

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/App_Module.pm
    trunk/LedgerSMB/Scripts/business_unit.pm
    trunk/UI/business_units/list_classes.html
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Business_Unit.sql

Modified: trunk/LedgerSMB/DBObject/App_Module.pm
===================================================================
--- trunk/LedgerSMB/DBObject/App_Module.pm	2012-03-07 11:04:51 UTC (rev 4402)
+++ trunk/LedgerSMB/DBObject/App_Module.pm	2012-03-07 11:57:29 UTC (rev 4403)
@@ -68,13 +68,13 @@
     return $self->new($ref);
 }
 
-=item list_all()
+=item list()
 
 This returns a list of all modules, ordered by id.
 
 =cut
 
-sub list_all{
+sub list{
     my ($self) = @_;
     my @results = $self->call_procedure(procname => 'lsmb_module__list');
     for my $ref(@results){

Modified: trunk/LedgerSMB/Scripts/business_unit.pm
===================================================================
--- trunk/LedgerSMB/Scripts/business_unit.pm	2012-03-07 11:04:51 UTC (rev 4402)
+++ trunk/LedgerSMB/Scripts/business_unit.pm	2012-03-07 11:57:29 UTC (rev 4403)
@@ -6,6 +6,7 @@
 
 package LedgerSMB::Scripts::business_unit;
 use LedgerSMB::DBObject::Business_Unit_Class;
+use LedgerSMB::DBObject::App_Module;
 use LedgerSMB::DBObject::Business_Unit;
 use LedgerSMB::Template;
 use Carp;
@@ -29,7 +30,9 @@
 sub list_classes {
     my ($request) = @_;
     my $bu_class = LedgerSMB::DBObject::Business_Unit_Class->new(%$request);
+    my $lsmb_modules = LedgerSMB::DBObject::App_Module->new(%$request);
     @{$request->{classes}} = $bu_class->list;
+    @{$request->{modules}} = $lsmb_modules->list;
     my $template = LedgerSMB::Template->new(
         user =>$request->{_user},
         locale => $request->{_locale},

Modified: trunk/UI/business_units/list_classes.html
===================================================================
--- trunk/UI/business_units/list_classes.html	2012-03-07 11:04:51 UTC (rev 4402)
+++ trunk/UI/business_units/list_classes.html	2012-03-07 11:57:29 UTC (rev 4403)
@@ -11,8 +11,8 @@
     <th><?lsmb text('Label') ?></th>
     <th><?lsmb text('Active') ?></th>
     <th><?lsmb text('Ordering') ?></th>
-  <?lsmb FOR mod IN modules ?>
-    <th><?lsmb text(mod.label) ?></th>
+  <?lsmb FOREACH m IN modules ?>
+    <th><?lsmb text(m.label) ?></th>
   <?lsmb END ?>
     <th>&nbsp;</th>
     <th>&nbsp;</th>
@@ -45,13 +45,6 @@
 } ?>
 </td>
 <td><?lsmb PROCESS input element_data = {
-    type = "checkbox"
-   value = "1"
-    name = "non-accounting"
- checked = (c.non-accounting)? 'CHECKED' : ''
-} ?>
-</td>
-<td><?lsmb PROCESS input element_data = {
     type = "text"
    class = "ordering"
     name = "ordering"
@@ -59,9 +52,9 @@
     size = 4
 } ?>
 </td>
-  <?lsmb FOR mod IN modules ?>
+  <?lsmb FOREACH m IN modules ?>
     <td><?lsmb 
-    IF c.modules.grep(mod.id);
+    IF c.modules.grep(m.id);
         checked = 'checked';
     ELSE; 
         checked = '';
@@ -69,7 +62,7 @@
     PROCESS input element_data = {
        type = 'checkbox'
     checked = checked
-       name = "module_" _ mod.id
+       name = "module_" _ m.id
       value = 1
     } ?> </td>
   <?lsmb END ?>

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2012-03-07 11:04:51 UTC (rev 4402)
+++ trunk/sql/Pg-database.sql	2012-03-07 11:57:29 UTC (rev 4403)
@@ -1067,11 +1067,12 @@
     insert_time TIMESTAMPTZ NOT NULL DEFAULT now(),
     trans_type text, 
     post_date date,
-    ledger_id int references acc_trans(entry_id),
+    ledger_id int,
     overlook boolean not null default 'f',
     cleared boolean not null default 'f'
 );
 
+
 COMMENT ON TABLE cr_report_line IS
 $$ This stores line item data on transaction lines and whether they are 
 cleared.$$;
@@ -4523,4 +4524,5 @@
  This reasoning is hacky and i hope it can dissapear when we get to 1.4 - D.M.
 $$;
 
+ALTER TABLE cr_report_line ADD FOREIGN KEY(ledger_id) REFERENCES acc_trans(entry_id);
 commit;

Modified: trunk/sql/modules/Business_Unit.sql
===================================================================
--- trunk/sql/modules/Business_Unit.sql	2012-03-07 11:04:51 UTC (rev 4402)
+++ trunk/sql/modules/Business_Unit.sql	2012-03-07 11:57:29 UTC (rev 4403)
@@ -98,9 +98,9 @@
 CREATE FUNCTION business_unit_class__get_modules(in_id int)
 RETURNS SETOF lsmb_module AS
 $$ SELECT * FROM lsmb_module 
-    WHERE id IN (select module_id from bu_class_to_module where bu_class_id = $1);
+    WHERE id IN (select module_id from bu_class_to_module where bu_class_id = $1)
  ORDER BY id;
-$$;
+$$ language sql;
 
 CREATE OR REPLACE FUNCTION business_unit_class__save 
 (in_id int, in_label text, in_active bool, in_ordering int)

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