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

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



Revision: 3879
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3879&view=rev
Author:   einhverfr
Date:     2011-10-17 23:22:07 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
Cleaning up some code in AM.pm that's not currently used
Merging other changes from branches/1.3

Modified Paths:
--------------
    trunk/CONTRIBUTORS
    trunk/LedgerSMB/AM.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB/Template/TXT.pm
    trunk/account.pl
    trunk/admin.pl
    trunk/bin/aa.pl
    trunk/bin/is.pl
    trunk/customer.pl
    trunk/doc/manual/LedgerSMB-manual.tex
    trunk/drafts.pl
    trunk/file.pl
    trunk/journal.pl
    trunk/login.pl
    trunk/recon.pl
    trunk/setup.pl
    trunk/upgrade.pl
    trunk/vouchers.pl

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-3853
   + /branches/1.3:3711-3878

Modified: trunk/CONTRIBUTORS
===================================================================
--- trunk/CONTRIBUTORS	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/CONTRIBUTORS	2011-10-17 23:22:07 UTC (rev 3879)
@@ -22,85 +22,85 @@
 
 Other Committers:
 ==================
+Erik Huelsmann <ehuels @ gmail.com> has provided bugfixes.
+
 Jeff Kowalczyk [email omitted] contributed the ledger-smb-smallgray.css and has submitted numerous bug fixes.
 
-Erik Huelsmann <ehuels @ gmail.com> has provided bugfixes.
+Herman Vierendeels <herman.vierendeels @ gmail.com> Contributed a number of 
+bugfixes.
 
 Other Contributors:
 ========================
-Dave van Ginneken <davevg @ gmail.com> fixed many HTML errors and has patched 
-the setup.diff.
-
-Angus Carr <apcarr @ users.sourceforge.net> Has provided some corrections to 
-the documentation.
-
 David Bandel <david.bandel @ gmail.com> Provided some bug fixes and 
 documentation corrections.
 
+Josh Berkus <josh @ agliodbs.com> has helped provide assistance in promotion,
+advocacy, and other assistance.
+
 Christopher Browne <cbrowne @ acm.org> provided some corrections to the 
 documentation, the Pg-tables.sql, and a setup file for replication.
 
-Mads Kiilerich <mads @ kiilerich.com> has provided the RPM spec file and
-numerous bug fixes.
+Tony Brummett <tony @ blight.com> contributed a bug fix for avgcost and lastcost
+updates.
 
+Angus Carr <apcarr @ users.sourceforge.net> Has provided some corrections to 
+the documentation.
+
+Chifung Fan [email omitted] contributed bugfixes.
+
 Tony Fraser <tony @ sybaspace.com> provided some database fixes.
 
+Dave van Ginneken <davevg @ gmail.com> fixed many HTML errors and has patched 
+the setup.diff.
+
+Ashley Gittins contributed <agittins @ purple.dropbear.id.au> has contributed 
+some performance fixes and has contributed a great deal of work to our web site.
+
+Ian Goodacre [email omitted] has provided numerous bugfixes.
+
 John Hasler <john @ dhh.gt.org> has provided some double-entry information for
 the manual and miscellaneous documentation corrections.
 
-Louis B. Moore <lbmlist @ hethcote.com> has provided the documentation on the 
-command-line API and helped with upgrade scripts, both for 1.2 and 1.3.
+Mads Kiilerich <mads @ kiilerich.com> has provided the RPM spec file and
+numerous bug fixes.
 
-Rich Walker <rw @ shadowrobot.com> has provided assistance in the dists/deb 
-documentation for Debian installations.
+Alexey Klyukin (Command Prompt) has contributed code particularly to end of 
+year routines, and helped address scalability issues.
 
-Chifung Fan [email omitted] contributed bugfixes.
+John Locke (Freelock Consulting) <john @ freelock.com> Contributed a number of 
+bug fixes and provided extensive feedback and assistance.
 
+Louis B. Moore <lbmlist @ hethcote.com> has provided the documentation on the 
+command-line API and helped with upgrade scripts, both for 1.2 and 1.3.
 
-Matt S Trout, <mst @ shadowcatsystems.co.uk> CPAN: MSTROUT, 
-IRC: mst#irc.perl.org contributed the initial Makefile.PL
+David Mora contributed the new Payment template/system.
 
 Chris Nighswonger, <cnighswonger @ foundations.edu> contributed the
 shebang-strawberry.pl
 
-Ashley Gittins contributed <agittins @ purple.dropbear.id.au> has contributed 
-some performance fixes and has contributed a great deal of work to our web site.
-
-Donna Robinson [email omitted] contributed some fixes to the HTML code.
-
-Victor Sterpu <victor @ ambra.ro> has contributed some bug fixes to COGS 
-handling.
-
 Chad Phillips [email omitted]  Various bugfixes.  Also contributed a template
 widget system for 1.3.
 
-David Mora contributed the new Payment template/system.
+Lacey Powers (Command Prompt) has contributed code, and helped reduce the number
+of warnings coming from the inherited codebase.
 
-Tony Brummett <tony @ blight.com> contributed a bug fix for avgcost and lastcost updates.
+Donna Robinson [email omitted] contributed some fixes to the HTML code.
 
 Jason Rodrigues <jasonjayr+ledgersmb @ gmail.com> provided the logic to force 
 the password change in the admin.pl.  He maintains the Gentoo Ebuilds packages.
 
-Josh Berkus <josh @ agliodbs.com> has helped provide assistance in promotion,
-advocacy, and other assistance.
+Victor Sterpu <victor @ ambra.ro> has contributed some bug fixes to COGS 
+handling.
 
-Ian Goodacre [email omitted] has provided numerous bugfixes.
+Andrew Sullivan (formerly with Command Prompt) has addressed scalability in the 
+batch payment system.
 
-Herman Vierendeels <herman.vierendeels @ gmail.com> Contributed a number of 
-bugfixes.
+Matt S Trout, <mst @ shadowcatsystems.co.uk> CPAN: MSTROUT, 
+IRC: mst#irc.perl.org contributed the initial Makefile.PL
 
-John Locke (Freelock Consulting) <john @ freelock.com> Contributed a number of 
-bug fixes and provided extensive feedback and assistance.
+Rich Walker <rw @ shadowrobot.com> has provided assistance in the dists/deb 
+documentation for Debian installations.
 
-Lacey Powers (Command Prompt) has contributed code, and helped reduce the number
-of warnings coming from the inherited codebase.
-
-Alexey Klyukin (Command Prompt) has contributed code particularly to end of 
-year routines, and helped address scalability issues.
-
-Andrew Sullivan (formerly with Command Prompt) has addressed scalability in the 
-batch payment system.
-
 Original Authors of SQL-Ledger:
 ===================================
 Dieter Simader <dsimader @ sql-ledger.com>

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/LedgerSMB/AM.pm	2011-10-17 23:22:07 UTC (rev 3879)
@@ -56,158 +56,6 @@
 use LedgerSMB::Tax;
 use LedgerSMB::Sysconfig;
 
-=item AM->get_account($myconfig, $form);
-
-Populates the $form attributes accno, description, charttype, gifi_accno,
-category, link, and contra with details about the account that has the id
-$form->{id}.  If there are no acc_trans entries that refer to that account,
-$form->{orphaned} is made true, otherwise $form->{orphaned} is set to false.
-
-Also populates 'inventory_accno_id', 'income_accno_id', 'expense_accno_id',
-'fxgain_accno_id', and 'fxloss_accno_id' with the values from defaults.
-
-$myconfig is unused.
-
-=cut
-
-sub get_account {
-
-    my ( $self, $myconfig, $form ) = @_;
-
-    my $dbh = $form->{dbh};
-
-    my $query = qq|
-		SELECT accno, description, charttype, gifi_accno,
-		       category, link, contra
-		  FROM chart
-		 WHERE id = ?|;
-
-    my $sth = $dbh->prepare($query);
-    $sth->execute( $form->{id} ) || $form->dberror($query);
-
-    my $ref = $sth->fetchrow_hashref(NAME_lc);
-    for ( keys %$ref ) { $form->{$_} = $ref->{$_} }
-    $sth->finish;
-
-    # get default accounts
-    $query = qq|
-		SELECT (SELECT value FROM defaults
-		         WHERE setting_key = 'inventory_accno_id')
-		       AS inventory_accno_id,
-		       (SELECT value FROM defaults
-		         WHERE setting_key = 'income_accno_id')
-		       AS income_accno_id, 
-		       (SELECT value FROM defaults
-		         WHERE setting_key = 'expense_accno_id')
-		       AS expense_accno_id,
-		       (SELECT value FROM defaults
-		         WHERE setting_key = 'fxgain_accno_id')
-		       AS fxgain_accno_id, 
-		       (SELECT value FROM defaults
-		         WHERE setting_key = 'fxloss_accno_id')
-		       AS fxloss_accno_id|;
-
-    $sth = $dbh->prepare($query);
-    $sth->execute || $form->dberror($query);
-
-    $ref = $sth->fetchrow_hashref(NAME_lc);
-    for ( keys %$ref ) { $form->{$_} = $ref->{$_} }
-    $sth->finish;
-
-    # check if we have any transactions
-    $query = qq|
-		SELECT trans_id 
-		  FROM acc_trans
-		 WHERE chart_id = ? 
-		 LIMIT 1|;
-    $sth = $dbh->prepare($query);
-    $sth->execute( $form->{id} );
-    ( $form->{orphaned} ) = $sth->fetchrow_array();
-    $form->{orphaned} = !$form->{orphaned};
-
-    $dbh->commit;
-}
-
-=item AM->delete_account($myconfig, $form);
-
-Deletes the account with the id $form->{id}.  Calls $form->error if there are
-any acc_trans entries that reference it.  If any parts have that account for
-an inventory, income, or COGS (expense) account, switch the part to using the
-default account for that type.  Also deletes all tax, partstax, customertax, and
-vendortax table entries for the account.
-
-$myconfig is unused.
-
-=cut
-
-sub delete_account {
-
-    my ( $self, $myconfig, $form ) = @_;
-
-    # connect to database, turn off AutoCommit
-    my $dbh = $form->{dbh};
-    my $sth;
-    my $query = qq|
-		SELECT count(*)
-		  FROM acc_trans
-		 WHERE chart_id = ?|;
-    $sth = $dbh->prepare($query);
-    $sth->execute( $form->{id} );
-    my ($rowcount) = $sth->fetchrow_array();
-
-    if ($rowcount) {
-        $form->error( "Cannot delete accounts with associated transactions!" );
-    }
-
-    # delete chart of account record
-    $query = qq|
-		DELETE FROM chart
-		      WHERE id = ?|;
-
-    $sth = $dbh->prepare($query);
-    $sth->execute( $form->{id} ) || $form->dberror($query);
-
-    # set inventory_accno_id, income_accno_id, expense_accno_id to defaults
-    $query = qq|
-		UPDATE parts
-		   SET inventory_accno_id = (SELECT value::int
-		                               FROM defaults
-					      WHERE setting_key = 
-							'inventory_accno_id')
-		 WHERE inventory_accno_id = ?|;
-
-    $sth = $dbh->prepare($query);
-    $sth->execute( $form->{id} ) || $form->dberror($query);
-
-    for (qw(income_accno_id expense_accno_id)) {
-        $query = qq|
-			UPDATE parts
-			   SET $_ = (SELECT value::int
-			               FROM defaults
-			              WHERE setting_key = '$_')
-			 WHERE $_ = ?|;
-
-        $sth = $dbh->prepare($query);
-        $sth->execute( $form->{id} ) || $form->dberror($query);
-        $sth->finish;
-    }
-
-    foreach my $table (qw(partstax customertax vendortax tax)) {
-        $query = qq|
-			DELETE FROM $table
-			      WHERE chart_id = ?|;
-
-        $sth = $dbh->prepare($query);
-        $sth->execute( $form->{id} ) || $form->dberror($query);
-        $sth->finish;
-    }
-
-    # commit and redirect
-    my $rc = $dbh->commit;
-
-    $rc;
-}
-
 =item AM->gifi_accounts($myconfig, $form);
 
 Populates the list referred to as $form->{ALL} with hashes of gifi numbers and
@@ -275,7 +123,7 @@
     $query = qq|
 		SELECT count(*) 
 		  FROM acc_trans a
-		  JOIN chart c ON (a.chart_id = c.id)
+		  JOIN account c ON (a.chart_id = c.id)
 		  JOIN gifi g ON (c.gifi_accno = g.accno)
 		 WHERE g.accno = ?|;
 


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-3853
/branches/1.3/scripts/employee.pl:3842-3843
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-3878
/branches/1.3/scripts/employee.pl:3842-3843

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/LedgerSMB/Sysconfig.pm	2011-10-17 23:22:07 UTC (rev 3879)
@@ -118,7 +118,7 @@
     eval { require Template::Latex }; # Trap errors loading this optional module
     if ($!) { # Couldn't load  Template::Latex
         print STDERR "WARNING: LedgerSMB configured to use LaTeX but module ";
-        print STDERR "Template::Latex did not load: $!\n";
+        print STDERR "Template::Latex did not load: ..hidden..";
         print STDERR "Disabling LaTeX support\n";
         $latex = 0;
     };

Modified: trunk/LedgerSMB/Template/TXT.pm
===================================================================
--- trunk/LedgerSMB/Template/TXT.pm	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/LedgerSMB/Template/TXT.pm	2011-10-17 23:22:07 UTC (rev 3879)
@@ -7,6 +7,9 @@
 
 =over
 
+=item get_extension
+Private method to get extension.  Do not call directly.
+
 =item get_template ($name)
 
 Returns the appropriate template filename for this format.

Modified: trunk/account.pl
===================================================================
--- trunk/account.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/account.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -6,9 +6,4 @@
 }
 
 require "lsmb-request.pl";
-#!/usr/bin/perl
 
-require "lsmb-request.pl";
-#!/usr/bin/perl
-
-require "lsmb-request.pl";

Modified: trunk/admin.pl
===================================================================
--- trunk/admin.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/admin.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
 
+
 require 'lsmb-request.pl';

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/bin/aa.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -947,11 +947,9 @@
     # type=submit $locale->text('Update')
     # type=submit $locale->text('Print')
     # type=submit $locale->text('Post')
-    # type=submit $locale->text('Print and Post')
     # type=submit $locale->text('Schedule')
     # type=submit $locale->text('Ship to')
     # type=submit $locale->text('Post as new')
-    # type=submit $locale->text('Print and Post as new')
     # type=submit $locale->text('Delete')
 
     if ( !$form->{readonly} ) {
@@ -970,11 +968,6 @@
             'print' =>
               { ndx => 2, key => 'P', value => $locale->text('Print') },
             'post' => { ndx => 3, key => 'O', value => $locale->text('Post') },
-            'print_and_post' => {
-                ndx   => 4,
-                key   => 'R',
-                value => $locale->text('Print and Post')
-            },
             'schedule' =>
               { ndx => 7, key => 'H', value => $locale->text('Schedule') },
             'delete' =>

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/bin/is.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -895,11 +895,9 @@
     # type=submit $locale->text('Update')
     # type=submit $locale->text('Print')
     # type=submit $locale->text('Post')
-    # type=submit $locale->text('Print and Post')
     # type=submit $locale->text('Schedule')
     # type=submit $locale->text('Ship to')
     # type=submit $locale->text('Post as new')
-    # type=submit $locale->text('Print and Post as new')
     # type=submit $locale->text('E-mail')
     # type=submit $locale->text('Delete')
     # type=submit $locale->text('Sales Order')
@@ -922,18 +920,6 @@
               { ndx => 4, key => 'T', value => $locale->text('Ship to') },
             'e_mail' =>
               { ndx => 5, key => 'E', value => $locale->text('E-mail') },
-            'print_and_post' => {
-                ndx   => 6,
-                key   => 'R',
-                value => $locale->text('Print and Post')
-            },
-            'post_as_new' =>
-              { ndx => 7, key => 'N', value => $locale->text('Post as new') },
-            'print_and_post_as_new' => {
-                ndx   => 8,
-                key   => 'W',
-                value => $locale->text('Print and Post as new')
-            },
             'sales_order' =>
               { ndx => 9, key => 'L', value => $locale->text('Sales Order') },
             'schedule' =>

Modified: trunk/customer.pl
===================================================================
--- trunk/customer.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/customer.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
 
+
 require 'lsmb-request.pl';

Modified: trunk/doc/manual/LedgerSMB-manual.tex
===================================================================
--- trunk/doc/manual/LedgerSMB-manual.tex	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/doc/manual/LedgerSMB-manual.tex	2011-10-17 23:22:07 UTC (rev 3879)
@@ -2957,7 +2957,7 @@
 requires an embedded postscript graphic, while PDF requires any type
 of graphic other than embedded postscript. Usually one uses a PNG's
 for PDF's, though GIF's could be used as well. The logo for a \LaTeX{}\ document
-resides in the users directory.
+must be fully qualified as to its path.
 
 HTML documents can have logos in many different formats. PNG's are
 generally preferred for printing reasons. The image can be stored

Modified: trunk/drafts.pl
===================================================================
--- trunk/drafts.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/drafts.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
 
+
 require 'lsmb-request.pl';

Modified: trunk/file.pl
===================================================================
--- trunk/file.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/file.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
 
+
 require 'lsmb-request.pl';

Modified: trunk/journal.pl
===================================================================
--- trunk/journal.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/journal.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -6,9 +6,3 @@
 }
 
 require "lsmb-request.pl";
-#!/usr/bin/perl
-
-require "lsmb-request.pl";
-#!/usr/bin/perl
-
-require "lsmb-request.pl";

Modified: trunk/login.pl
===================================================================
--- trunk/login.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/login.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
 
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
 require 'lsmb-request.pl';

Modified: trunk/recon.pl
===================================================================
--- trunk/recon.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/recon.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
 
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
 require 'lsmb-request.pl';

Modified: trunk/setup.pl
===================================================================
--- trunk/setup.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/setup.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
 
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
 require 'lsmb-request.pl';


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-3853
/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-3878
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

Modified: trunk/upgrade.pl
===================================================================
--- trunk/upgrade.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/upgrade.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-`perl -ibak -pe 's|<\%(\.)\%>|<?lsmb $1 ?>|g' templates/*`

Modified: trunk/vouchers.pl
===================================================================
--- trunk/vouchers.pl	2011-10-17 23:03:56 UTC (rev 3878)
+++ trunk/vouchers.pl	2011-10-17 23:22:07 UTC (rev 3879)
@@ -1,3 +1,8 @@
 #!/usr/bin/perl
 
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
 require 'lsmb-request.pl';

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