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

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



Revision: 3461
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3461&view=rev
Author:   einhverfr
Date:     2011-07-07 13:58:44 +0000 (Thu, 07 Jul 2011)

Log Message:
-----------
More doc strings for fixed asset module

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Asset_Report.pm
    trunk/sql/Pg-database.sql

Modified: trunk/LedgerSMB/DBObject/Asset_Report.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Asset_Report.pm	2011-07-07 13:18:22 UTC (rev 3460)
+++ trunk/LedgerSMB/DBObject/Asset_Report.pm	2011-07-07 13:58:44 UTC (rev 3461)
@@ -80,6 +80,15 @@
 
 Saves report to the database.  Sets ID.
 
+For each asset to be added to the report, we see:
+
+for each row, id_$row contains the asset id for that row.  Let this be $id
+
+if asset_$id, the asset is added.  Each asset also has:
+amount_$id
+dm_$id
+percent_$id
+
 =cut
 
 sub save {
@@ -134,12 +143,26 @@
     return;
 }
 
+=item get_nbv
+
+Returns line items for the Net Book Value report.
+
+=cut
+
 sub get_nbv {
     my ($self) = @_;
     return $self->exec_method(funcname => 'asset_nbv_report');
 }
 
+=item generate
 
+Properties used:
+
+* report_id int:  Report to enter the transactions into, 
+* accum_account_id int:  ID for accumulated depreciation.
+
+=cut
+
 sub generate {
     my ($self) = @_;
     @{$self->{assets}} = $self->exec_method(
@@ -152,17 +175,57 @@
     }
 }
 
+=item approve
+
+Properties used:
+
+id
+
+Approves the referenced transaction and creates a GL draft (which must then be 
+approved.
+
+=cut
+
 sub approve {
     my ($self) = @_;
     $self->exec_method(funcname => 'asset_report__approve');
     $self->{dbh}->commit;
 }
 
+=item search
+
+Searches for matching asset reports for review and approval.
+
+Search criteria in properties:
+
+* start_date date
+* end_date date
+* asset_class int
+* approved bool
+* entered_by int
+
+Start and end dates specify the date range (inclusive) and all other matches
+are exact. Undefs match all records.
+
+=cut
+
 sub search {
     my ($self) = @_;
     return $self->exec_method(funcname => 'asset_report__search');
 }
 
+=item get_metadata
+
+Sets the following properties:
+
+* asset_classes:  List of asset classes
+* exp_accounts:  List of expense accounts
+* gain_accounts:  List of gain accounts
+* loss_accounts:  list of loss accounts
+* disp_methods:  List of disposal methods
+
+=cut
+
 sub get_metadata {
     my ($self) = @_;
     @{$self->{asset_classes}} = $self->exec_method(

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2011-07-07 13:18:22 UTC (rev 3460)
+++ trunk/sql/Pg-database.sql	2011-07-07 13:58:44 UTC (rev 3461)
@@ -3465,6 +3465,20 @@
 	unit_class int not null references asset_unit_class(id) 
 );
 
+COMMENT ON TABLE asset_dep_method IS
+$$ Stores asset depreciation methods, and their relevant stored procedures.
+
+The fixed asset system is such depreciation methods can be plugged in via this
+table.$$;
+
+COMMENT ON COLUMN asset_dep_method.sproc IS
+$$The sproc mentioned here is a stored procedure which must have the following
+arguments: (in_asset_ids int[],  in_report_date date, in_report_id int).
+
+Here in_asset_ids are the assets to be depreciated, in_report_date is the date
+of the report, and in_report_id is the id of the report.  The sproc MUST
+insert the relevant lines into asset_report_line. $$;
+
 comment on column asset_dep_method.method IS 
 $$ These are keyed to specific stored procedures.  Currently only "straight_line" is supported$$;
 
@@ -3527,6 +3541,10 @@
 CREATE UNIQUE INDEX asset_item_active_tag_u ON asset_item(tag) 
               WHERE obsolete_by is null; -- part 2 of natural key enforcement
 
+COMMENT ON TABLE asset_item IS 
+$$ Stores details of asset items.  The account fields here are authoritative,
+while the ones in the asset_class table are defaults.$$;
+
 COMMENT ON column asset_item.tag IS $$ This can be plugged into other routines to generate it automatically via ALTER TABLE .... SET DEFAULT.....$$;
 
 CREATE TABLE asset_note (
@@ -3548,6 +3566,10 @@
 INSERT INTO asset_report_class (id, class) values (3, 'import');
 INSERT INTO asset_report_class (id, class) values (4, 'partial disposal');
 
+COMMENT ON TABLE asset_report_class IS 
+$$  By default only four types of asset reports are supported.  In the future
+others may be added.  Please correspond on the list before adding more types.$$;
+
 CREATE TABLE asset_report (
 	id serial primary key,
 	report_date date,
@@ -3563,6 +3585,10 @@
 	submitted bool not null default false
 );
 
+COMMENT ON TABLE asset_report IS
+$$ Asset reports are discrete sets of depreciation or disposal transctions,
+and each one may be turned into no more than one GL transaction.$$;
+
 CREATE TABLE asset_report_line(
 	asset_id bigint references asset_item(id),
         report_id bigint references asset_report(id),


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