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

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



Revision: 4369
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4369&view=rev
Author:   einhverfr
Date:     2012-02-26 14:20:42 +0000 (Sun, 26 Feb 2012)
Log Message:
-----------
Merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Account.pm
    trunk/LedgerSMB/Scripts/account.pm
    trunk/bin/ic.pl
    trunk/sql/modules/Account.sql
    trunk/sql/modules/Assets.sql
    trunk/sql/modules/Roles.sql

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/account.pm
    trunk/LedgerSMB/Scripts/admin.pm
    trunk/LedgerSMB/Scripts/customer.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Scripts/journal.pm
    trunk/LedgerSMB/Scripts/login.pm
    trunk/LedgerSMB/Scripts/menu.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/recon.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Scripts/taxform.pm
    trunk/LedgerSMB/Scripts/vendor.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-4357
   + /branches/1.3:3711-4368

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/Changelog	2012-02-26 14:20:42 UTC (rev 4369)
@@ -45,9 +45,15 @@
 * Corrected permissions on fixed asset depreciation workflow/menu (Chris T)
 * Corrected Perl issues on _db_init when custom fields defined, 5.12 (Chris T)
 * Adding missing permissions for editing parts (Chris T)
+* Clarified string for vendor's part number in parts screen (Frans S)
+* Recon checkbox now is set properly (Chris T)
+* Corrected missing "search assets" menu item (Chris T)
+* Net Book Value report now shows undepreciated assets (Chris T)
+* Permissions fixes to fixed asset module (Chris T)
 
 Hilton D is Hilton Day
-
+Frans S is Frans van der Star
+Chris T is Chris Travers
 Changelog for 1.3.11
 * Fixed outstanding report for payment reversal and partial payments (Chris T)
 * Fixed handling of non-existing roles in menu grants (Chris T)

Modified: trunk/LedgerSMB/DBObject/Account.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Account.pm	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/LedgerSMB/DBObject/Account.pm	2012-02-26 14:20:42 UTC (rev 4369)
@@ -119,6 +119,19 @@
     $self->{has_transactions} = $ref->{'account_has_transactions'};
 } 
 
+=item is_recon
+
+Returns true if is set up for reconciliation.  False otherwise.
+
+=cut
+
+sub is_recon {
+    my $self = shift @_;
+    my ($ref) = $self->exec_method(funcname => 'account__is_recon');
+    $self->{account__is_recon} = $ref->{'account__is_recon'};
+    return $self->{account__is_recon};
+}
+
 =item delete()
 
 Attemps to delete the account.  This will NOT succeed if the account is 

Modified: trunk/LedgerSMB/Scripts/account.pm
===================================================================
--- trunk/LedgerSMB/Scripts/account.pm	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/LedgerSMB/Scripts/account.pm	2012-02-26 14:20:42 UTC (rev 4369)
@@ -113,6 +113,7 @@
     my ($form) = @_;
     my $account = LedgerSMB::DBObject::Account->new({base => $form});
     @{$form->{all_headings}} = $account->list_headings();
+    $form->{recon} = $account->is_recon();
     my $locale = $form->{_locale};
     my $buttons = [];
     my $checked;


Property changes on: trunk/LedgerSMB/Scripts/account.pm
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/1.3/scripts/account.pl:3711-4368


Property changes on: trunk/LedgerSMB/Scripts/admin.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4357
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4368
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/customer.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4357
/branches/1.3/scripts/customer.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4368
/branches/1.3/scripts/customer.pl:4273-4287


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4357
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4368
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310


Property changes on: trunk/LedgerSMB/Scripts/file.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4357
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4368
/branches/1.3/scripts/file.pl:3711-4138


Property changes on: trunk/LedgerSMB/Scripts/journal.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4357
/branches/1.3/scripts/journal.pl:3711-4328
   + /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4368
/branches/1.3/scripts/journal.pl:3711-4328


Property changes on: trunk/LedgerSMB/Scripts/login.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4357
/branches/1.3/scripts/login.pl:3711-4192
   + /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4368
/branches/1.3/scripts/login.pl:3711-4192


Property changes on: trunk/LedgerSMB/Scripts/menu.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4357
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4368
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/payment.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4357
/branches/1.3/scripts/payment.pl:3711-4310
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4368
/branches/1.3/scripts/payment.pl:3711-4310


Property changes on: trunk/LedgerSMB/Scripts/recon.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4357
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4368
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4357
/branches/1.3/scripts/setup.pl:3711-4216,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4368
/branches/1.3/scripts/setup.pl:3711-4216,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/taxform.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4357
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4368
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/vendor.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4357
/branches/1.3/scripts/vendor.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4368
/branches/1.3/scripts/vendor.pl:4273-4287

Modified: trunk/bin/ic.pl
===================================================================
--- trunk/bin/ic.pl	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/bin/ic.pl	2012-02-26 14:20:42 UTC (rev 4369)
@@ -2808,7 +2808,7 @@
       <table width=100%>
 	<tr>
 	  <th class="listheading">| . $locale->text('Vendor') . qq|</th>
-	  <th class="listheading">| . $locale->text('Number') . qq|</th>
+	  <th class="listheading">| . $locale->text('Vendor Reference Number') . qq|</th>
 	  <th class="listheading">| . $locale->text('Cost') . qq|</th>
 	  $currency
 	  <th class="listheading">| . $locale->text('Leadtime') . qq|</th>
@@ -3931,21 +3931,21 @@
           . qq|</td>|;
         $column_data{rop} =
             qq|<td align=right>|
-          . $form->format_amount( \%myconfig, $ref->{rop}, '', "&nbsp;" )
-          . qq|</td>|;
-        $column_data{stock} =
-            qq|<td width=10%><input name="qty_$i" size="10" value="|
-          . $form->format_amount( \%myconfig, $ref->{stock} )
-          . qq|"></td>
-    <input type=hidden name="stock_$i" value="$ref->{stock}">|;
-
-        $j++;
-        $j %= 2;
-        print
-qq|<tr class=listrow$j><input name="id_$i" type=hidden value="$ref->{id}">\n|;
-
-        for (@column_index) { print "\n$column_data{$_}" }
-
+          . $form->format_amount( \%myconfig, $ref->{rop}, '', "&nbsp;" )
+          . qq|</td>|;
+        $column_data{stock} =
+            qq|<td width=10%><input name="qty_$i" size="10" value="|
+          . $form->format_amount( \%myconfig, $ref->{stock} )
+          . qq|"></td>
+    <input type=hidden name="stock_$i" value="$ref->{stock}">|;
+
+        $j++;
+        $j %= 2;
+        print
+qq|<tr class=listrow$j><input name="id_$i" type=hidden value="$ref->{id}">\n|;
+
+        for (@column_index) { print "\n$column_data{$_}" }
+
         print qq|
 	</tr>
 |;

Modified: trunk/sql/modules/Account.sql
===================================================================
--- trunk/sql/modules/Account.sql	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/sql/modules/Account.sql	2012-02-26 14:20:42 UTC (rev 4369)
@@ -10,6 +10,17 @@
 $$ Returns the account where the accno field matches (excatly) the 
 in_accno provided.$$;
 
+CREATE OR REPLACE FUNCTION account__is_recon(in_accno text) RETURNS BOOL AS
+$$ SELECT count(*) > 0 
+     FROM cr_coa_to_account c2a
+     JOIN account ON account.id = c2a.chart_id 
+    WHERE accno = $1; $$
+LANGUAGE SQL;
+
+COMMENT ON FUNCTION account__is_recon(in_accno text) IS
+$$ Returns true if account is set up for reconciliation, false otherwise.
+Note that returns false on invalid account number too$$;
+
 CREATE OR REPLACE FUNCTION account__get_taxes()
 RETURNS setof account AS
 $$

Modified: trunk/sql/modules/Assets.sql
===================================================================
--- trunk/sql/modules/Assets.sql	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/sql/modules/Assets.sql	2012-02-26 14:20:42 UTC (rev 4369)
@@ -1,3 +1,5 @@
+BEGIN;
+
 CREATE OR REPLACE FUNCTION asset_dep__straight_line_base
 (in_base_life numeric, in_life numeric, in_used numeric, in_basis numeric, 
 in_dep_to_date numeric)
@@ -211,6 +213,7 @@
 COMMENT ON FUNCTION asset_class__list() is
 $$ Returns an alphabetical list of asset classes.$$;
 
+DROP TYPE IF EXISTS asset_class_result CASCADE;
 CREATE TYPE asset_class_result AS (
 	id int,
 	asset_account_id int,
@@ -513,8 +516,6 @@
 	item record;
 	method_text text;
 BEGIN
-	DELETE FROM asset_report_line where report_id = in_id;
-
 	UPDATE asset_report 
 	set asset_class = in_asset_class,
 		report_class = in_report_class,
@@ -570,6 +571,7 @@
 in_percent_disposed numeric) IS
 $$ Disposes of an asset.  in_dm is the disposal method id.$$;
 
+DROP TYPE IF EXISTS asset_disposal_report_line CASCADE;
 CREATE TYPE asset_disposal_report_line 
 AS (
        id int,
@@ -620,6 +622,8 @@
 $$ Returns a set of lines of disposed assets in a disposal report, specified
 by the report id.$$;
 
+DROP TYPE IF EXISTS asset_nbv_line CASCADE;
+
 CREATE TYPE asset_nbv_line AS (
     id int, 
     tag text,
@@ -651,7 +655,7 @@
      JOIN asset_dep_method adm ON (adm.id = ac.method)
 LEFT JOIN asset_report_line rl ON (ai.id = rl.asset_id)
 LEFT JOIN asset_report r on (rl.report_id = r.id)
-    WHERE r.approved_at IS NOT NULL
+    WHERE r.id IS NULL OR r.approved_at IS NOT NULL
  GROUP BY ai.id, ai.tag, ai.description, ai.start_depreciation, ai.purchase_date,
           adm.short_name, ai.usable_life, ai.purchase_value, salvage_value
    HAVING (NOT 2 = ANY(as_array(r.report_class))) 
@@ -662,7 +666,8 @@
 
 COMMENT ON FUNCTION asset_nbv_report () IS
 $$ Returns the current net book value report.$$;
-      
+
+DROP TYPE IF EXISTS partial_disposal_line CASCADE;      
 CREATE TYPE partial_disposal_line AS (
 id int,
 tag text,
@@ -827,6 +832,7 @@
 COMMENT ON FUNCTION asset_report__get(in_id int) IS
 $$ Returns the asset_report line identified by id.$$;
 
+DROP TYPE IF EXISTS asset_report_line_result CASCADE;
 CREATE TYPE asset_report_line_result AS(
      tag text,
      start_depreciation date,
@@ -877,6 +883,7 @@
 COMMENT ON FUNCTION asset_report__get_lines(in_id int) IS
 $$ Returns the lines of an asset depreciation report.$$;
 
+DROP TYPE IF EXISTS asset_report_result CASCADE;
 CREATE TYPE asset_report_result AS (
         id int,
         report_date date,
@@ -1272,3 +1279,5 @@
 -- needed to go here because dependent on other functions in other modules. --CT
 alter table asset_report alter column entered_by 
 set default person__get_my_entity_id();
+
+COMMIT;

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2012-02-25 14:35:36 UTC (rev 4368)
+++ trunk/sql/modules/Roles.sql	2012-02-26 14:20:42 UTC (rev 4369)
@@ -1679,7 +1679,7 @@
 TO "lsmb_<?lsmb dbname ?>__assets_administer";
 
 INSERT INTO menu_acl(role_name, acl_type, node_id)
-values('lsmb_<?lsmb dbname ?>__assets_enter', 'allow', 237);
+values('lsmb_<?lsmb dbname ?>__assets_administer', 'allow', 237);
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__assets_enter" NOLOGIN INHERIT;
@@ -1704,6 +1704,7 @@
 CREATE ROLE "lsmb_<?lsmb dbname ?>__assets_depreciate" NOLOGIN INHERIT;
 GRANT SELECT, INSERT ON asset_report, asset_report_line, asset_item, asset_class
 TO "lsmb_<?lsmb dbname ?>__assets_depreciate";
+GRANT UPDATE ON asset_report TO "lsmb_<?lsmb dbname ?>__assets_depreciate";
 
 GRANT ALL ON asset_report_id_seq TO "lsmb_<?lsmb dbname ?>__assets_depreciate"; 
 


Property changes on: trunk/sql/upgrade/1.2-1.3-manual.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4357
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710
   + /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4368
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

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