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

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



Revision: 3463
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3463&view=rev
Author:   einhverfr
Date:     2011-07-08 01:44:54 +0000 (Fri, 08 Jul 2011)

Log Message:
-----------
Missing grants to Roles.sql

Modified Paths:
--------------
    trunk/scripts/asset.pl
    trunk/sql/modules/Roles.sql

Modified: trunk/scripts/asset.pl
===================================================================
--- trunk/scripts/asset.pl	2011-07-07 14:03:05 UTC (rev 3462)
+++ trunk/scripts/asset.pl	2011-07-08 01:44:54 UTC (rev 3463)
@@ -1,7 +1,17 @@
 =pod 
 
-=head1 LedgerSMB Asset Management workflow script
+=head1 NAME 
 
+LedgerSMB::Scripts::asset
+
+=head1 SYNPOSIS
+
+Asset Management workflow script
+
+=head1 METHODS
+
+=over
+
 =cut
 
 package LedgerSMB::Scripts::asset;
@@ -19,7 +29,15 @@
 our $default_dep_account = '5010'; # Override in custom/asset.pl
 our $default_asset_account = '1300'; # Override in custom/asset.pl
 
+=item begin_depreciation_all
 
+Displays the depreciation screen for all asset classes.
+
+No inputs required.  Those inputs expected for depreciate_all can be used to
+set defaults here.
+
+=cut
+
 sub begin_depreciation_all {
     my ($request) = @_;
     my $template = LedgerSMB::Template->new(
@@ -32,6 +50,14 @@
     $template->render($request);
 }
 
+=item depreciate_all
+
+Creates a depreciation report for each asset class.  Depreciates all assets 
+
+Expects report_date to be set.
+
+=cut
+
 sub depreciate_all {
     my ($request) = @_;
     my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
@@ -57,6 +83,15 @@
     
 }
 
+=item asset_category_screen
+
+Asset class (edit create class)
+
+No inputs required.  Standard properties for asset_class used to populate form
+if they are provided.
+
+=cut
+
 sub asset_category_screen {
     my ($request) = @_;
     if ($request->{id}){
@@ -76,6 +111,14 @@
     $template->render($ac);
 }
 
+=item asset_category_save
+
+Saves the asset class information provided.  
+See LedgerSMB::DBObject::Asset_report for standard properties.  ID is optional.
+Others are required.
+
+=cut
+
 sub asset_category_save {
     my ($request) = @_;
     my $ac = LedgerSMB::DBObject::Asset_Class->new(base => $request);
@@ -90,6 +133,8 @@
     $template->render($ac);
 }
 
+# Is this even working at the moment?  Not documenting unil I know.
+
 sub asset_category_search {
     my ($request) = @_;
     my $template = LedgerSMB::Template->new(
@@ -102,13 +147,12 @@
     $template->render($request);
 }
 
-sub edit_asset_class {
-   my ($request) = @_;
-   my $ac = LedgerSMB::DBObject::Asset_Class->new(base => $request);
-   $ac->get_asset_class;
-   asset_category_screen($ac);
-}
+=item asset_category_results
 
+Displays a list of all asset classes.  No inputs required.
+
+=cut
+
 sub asset_category_results {
     my ($request) = @_;
     my $ac = LedgerSMB::DBObject::Asset_Class->new(base => $request);
@@ -167,6 +211,25 @@
    });
 }
 
+=item edit_asset_class
+
+Edits an asset class.  Expects id to be set.
+
+=cut
+
+sub edit_asset_class {
+   my ($request) = @_;
+   my $ac = LedgerSMB::DBObject::Asset_Class->new(base => $request);
+   $ac->get_asset_class;
+   asset_category_screen($ac);
+}
+
+=item asset_edit
+
+Displats the edit screen for an asset item.  Tag or id must be set.
+
+=cut
+
 sub asset_edit {
     my ($request) = @_;
     my $asset = LedgerSMB::DBObject::Asset->new(base => $request);
@@ -177,8 +240,16 @@
     }
     asset_screen($asset);
 }
-   
 
+=item
+
+Screen to create a new asset.
+
+No inputs required, any standard properties from LedgerSMB::DBObject::Asset
+can be used to set defaults.
+
+=cut
+
 sub asset_screen {
     my ($request) = @_;
     my $asset = LedgerSMB::DBObject::Asset->new(base => $request);
@@ -186,7 +257,6 @@
     if (!$asset->{tag}){
         $asset->get_next_tag;
     }
-    $asset->debug({file => '/tmp/asset'});
     $asset->{title} = $request->{_locale}->text('Add Asset') 
                  unless $asset->{title};
     my $template = LedgerSMB::Template->new(
@@ -199,6 +269,42 @@
     $template->render($asset);
 }
 
+=item asset_search
+
+Displays the search screen for asset items.  No inputs required.
+
+Any inputs for asset_results can be used here to set defaults.
+
+=cut
+
+sub asset_search {
+    my ($request) = @_;
+    my $asset = LedgerSMB::DBObject::Asset->new(base => $request);
+    $asset->get_metadata;
+    unshift @{$asset->{asset_classes}}, {}; 
+    unshift @{$asset->{locations}}, {}; 
+    unshift @{$asset->{departments}}, {}; 
+    unshift @{$asset->{asset_accounts}}, {}; 
+    unshift @{$asset->{dep_accounts}}, {}; 
+    my $template = LedgerSMB::Template->new(
+        user =>$request->{_user}, 
+        locale => $request->{_locale},
+        path => 'UI/asset',
+        template => 'search_asset',
+        format => 'HTML'
+    );
+    $template->render($asset);
+}
+
+=item asset_results
+
+Searches for asset items and displays them
+
+See LedgerSMB::DBObject::Asset->search() for a list of search criteria that can
+be set.
+
+=cut
+
 sub asset_results { 
     my ($request) = @_;
     my $locale = $request->{_locale};
@@ -264,6 +370,17 @@
          columns => $columns,
    });
 }
+
+=item asset_save
+
+Saves the asset.  See LedgerSMB::DBObject::Asset->save() for more info.
+
+Additionally this also creates a note with the vendor number and invoice number
+for future reference, since this may not have been entered specifically as a
+vendor transaction in LedgerSMB.
+
+=cut
+
 sub asset_save {
     my ($request) = @_;
     my $asset = LedgerSMB::DBObject::Asset->new(base => $request);
@@ -285,25 +402,14 @@
     asset_screen($newasset);
 }
 
-sub asset_search {
-    my ($request) = @_;
-    my $asset = LedgerSMB::DBObject::Asset->new(base => $request);
-    $asset->get_metadata;
-    unshift @{$asset->{asset_classes}}, {}; 
-    unshift @{$asset->{locations}}, {}; 
-    unshift @{$asset->{departments}}, {}; 
-    unshift @{$asset->{asset_accounts}}, {}; 
-    unshift @{$asset->{dep_accounts}}, {}; 
-    my $template = LedgerSMB::Template->new(
-        user =>$request->{_user}, 
-        locale => $request->{_locale},
-        path => 'UI/asset',
-        template => 'search_asset',
-        format => 'HTML'
-    );
-    $template->render($asset);
-}
+=item new_report
 
+Starts the new report workflow.  No inputs required.
+
+report_init inputs can be used to set defaults.
+
+=cut
+
 sub new_report {
     my ($request) = @_;
     my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
@@ -318,6 +424,16 @@
     $template->render($report);
 }
 
+=item report_init
+
+Creates a report and populates the screen with possible report lines.
+
+Inputs expected:
+* report_id int:  Report to enter the transactions into, 
+* accum_account_id int:  ID for accumulated depreciation.
+
+=cut
+
 sub report_init {
     my ($request) = @_;
     my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
@@ -325,13 +441,20 @@
     display_report($report);
 }
 
+=item report_save
+
+Saves the report.
+
+see LedgerSMB::DBObject::Asset_Report->save() for expected inputs.
+
+=cut
+
 sub report_save{
     my ($request) = @_;
     my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
     $report->{asset_ids} = [];
     for my $count (0 .. $request->{rowcount}){
         my $id = $request->{"id_$count"};
-        print STDERR "$count, $id, ".$request->{"asset_$count"}."\n";
         if ($request->{"asset_$count"}){
            push @{$report->{asset_ids}}, $id;
         }
@@ -933,4 +1056,12 @@
 
 eval { do "scripts/custom/asset.pl"};
 
+=back
+
+=head1 CUSTOMIZATION NOTES
+
+The handling of CSV imports of fixed assets is handled by 
+
+
+
 1;

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2011-07-07 14:03:05 UTC (rev 3462)
+++ trunk/sql/modules/Roles.sql	2011-07-08 01:44:54 UTC (rev 3463)
@@ -1623,7 +1623,7 @@
 GRANT SELECT ON lsmb_roles TO public;
 GRANT SELECT ON employee_search TO PUBLIC;
 GRANT SELECT ON warehouse TO public;
-GRANT select ON account_link_description TO PUBLIC;
+GRANT select ON account, account_link, account_link_description TO PUBLIC;
 GRANT select ON sic TO public;
 GRANT SELECT ON parts_translation,  project_translation TO public;
 GRANT SELECT ON asset_report_class, asset_rl_to_disposal_method,


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