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

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



Revision: 3469
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3469&view=rev
Author:   einhverfr
Date:     2011-07-09 06:33:58 +0000 (Sat, 09 Jul 2011)

Log Message:
-----------
Correcting some errors on account screen

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Account.pm
    trunk/UI/accounts/edit.html
    trunk/scripts/account.pl
    trunk/sql/Pg-database.sql

Added Paths:
-----------
    trunk/sql/upgrade/3467-assets.sql

Modified: trunk/LedgerSMB/DBObject/Account.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Account.pm	2011-07-08 14:46:31 UTC (rev 3468)
+++ trunk/LedgerSMB/DBObject/Account.pm	2011-07-09 06:33:58 UTC (rev 3469)
@@ -148,7 +148,7 @@
     my @links;
     my @descriptions = $self->exec_method(funcname =>
                                           'get_link_descriptions');
-   foreach my $d (@descriptions) {
+    foreach my $d (@descriptions) {
        my $l = $d->{description};
        if ($self->{$l}) {
            $is_summary++ if ($d->{summary} == 1);
@@ -157,10 +157,10 @@
                 $self->error($self->{_locale}->text("Too many links on summary account!"));
            }
            push (@links, $l);
-       }
-   }
+        }
+     }
  
-    $self->{link} = $self->_db_array_scalars(@links);
+     $self->{link} = $self->_db_array_scalars(@links);
 }
 
 =item list_headings

Modified: trunk/UI/accounts/edit.html
===================================================================
--- trunk/UI/accounts/edit.html	2011-07-08 14:46:31 UTC (rev 3468)
+++ trunk/UI/accounts/edit.html	2011-07-09 06:33:58 UTC (rev 3469)
@@ -321,7 +321,7 @@
 <div class="inputline" id="assets-line">
    <label class="line"><?lsmb text('Fixed Assets') ?></label>
    <div class="inputgroup">
-      <?lsmb IF form.fixed_asset;fixed_asset= 'CHECKED'; END;
+      <?lsmb IF form.Fixed_Asset;fixed_asset= 'CHECKED'; END;
          INCLUDE input element_data={
               name = 'Fixed_Asset',
               type = 'checkbox',
@@ -330,7 +330,7 @@
              value = 'Fixed_Asset'} ?>
    </div>
    <div class="inputgroup">
-      <?lsmb IF form.accum_dep;accum_dep = 'CHECKED'; END;
+      <?lsmb IF form.Asset_Dep;asset_dep = 'CHECKED'; END;
          INCLUDE input element_data={
               name = 'Asset_Dep',
               type = 'checkbox',

Modified: trunk/scripts/account.pl
===================================================================
--- trunk/scripts/account.pl	2011-07-08 14:46:31 UTC (rev 3468)
+++ trunk/scripts/account.pl	2011-07-09 06:33:58 UTC (rev 3469)
@@ -110,7 +110,7 @@
     $logger->debug("scripts/account.pl Locale: $locale");
 
     foreach my $item ( split( /:/, $form->{link} ) ) {
-        $form->{$item} = "checked";
+        $form->{$item} = 1;
     }
  
     $hiddens->{type} = 'account';

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2011-07-08 14:46:31 UTC (rev 3468)
+++ trunk/sql/Pg-database.sql	2011-07-09 06:33:58 UTC (rev 3469)
@@ -103,8 +103,14 @@
 ('IC_taxpart',     FALSE, FALSE),
 ('IC_taxservice',  FALSE, FALSE),
 ('IC_income',      FALSE, FALSE),
-('IC_expense',     FALSE, FALSE);
+('IC_expense',     FALSE, FALSE),
+('Asset_Dep',      FALSE, FALSE),
+('Fixed_Asset',    FALSE, FALSE),
+('asset_expense',  FALSE, FALSE),
+('asset_gain',     FALSE, FALSE),
+('asset_loss',     FALSE, FALSE);
 
+
 CREATE TABLE account_link (
    account_id int references account(id),
    description text references account_link_description(description),

Added: trunk/sql/upgrade/3467-assets.sql
===================================================================
--- trunk/sql/upgrade/3467-assets.sql	                        (rev 0)
+++ trunk/sql/upgrade/3467-assets.sql	2011-07-09 06:33:58 UTC (rev 3469)
@@ -0,0 +1,33 @@
+BEGIN;
+INSERT INTO account_link_description  (description, summary, custom)
+VALUES 
+('Asset_Dep',            FALSE, FALSE),
+('Fixed_Asset',          FALSE, FALSE),
+('asset_expense',        FALSE, FALSE),
+('asset_gain',           FALSE, FALSE),
+('asset_loss',           FALSE, FALSE);
+
+
+CREATE TEMPORARY TABLE menu_import (node_id int, key text);
+
+INSERT INTO menu_import
+values (menu_insert(0, 17, 'Fixed Assets'), 'main_menu');
+
+INSERT INTO menu_attribute (node_id, attribute, value)
+VALUES (currval('menu_node_id_seq')::int, 'menu', '1');
+
+
+SELECT menu_insert(
+    (select id FROM menu_node
+      where parent = (select id from menu_node
+                       where parent = 0 and position = 17
+                             and label = 'Fixed Assets')
+            and position = 2),
+    2, 'Search Assets');
+
+INSERT INTO menu_attribute (node_id, attribute, value)
+VALUES (currval('menu_node_id_seq')::int, 'module', 'asset.pl');
+INSERT INTO menu_attribute (node_id, attribute, value)
+VALUES (currval('menu_node_id_seq')::int, 'action', 'asset_search');
+
+COMMIT;


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