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

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



Revision: 4686
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4686&view=rev
Author:   einhverfr
Date:     2012-04-26 10:52:44 +0000 (Thu, 26 Apr 2012)
Log Message:
-----------
Merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/AM.pm
    trunk/LedgerSMB/Tax.pm
    trunk/LedgerSMB/Taxes/Simple.pm
    trunk/UI/am-taxes.html
    trunk/bin/am.pl
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Account.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-4680
   + /branches/1.3:3711-4685

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/Changelog	2012-04-26 10:52:44 UTC (rev 4686)
@@ -57,10 +57,13 @@
 * Correcting ordering of aging reports so currencies are clustered (Chris T)
 * Fixed curr totals not showing for aging rpts (Chris T, 3512591, h/t John L)
 * Fixed new user screen not respecting default country (Chris T, 3513760)
-* Fixed hasn(...) in HTML payment receipt (Chris T, 3515924, h/t Michael R)
+* Fixed hash(...) in HTML payment receipt (Chris T, 3515924, h/t Michael R)
+* Fixed errors about Concat() not found on Pg 8.4 (Erik H)
+* Fixed can't edit templates with absolute templates path (Chris T 3516725)
+* Added API for minimum value for taxes for local tax modules (Chris T)
 
 John L is John Locke
-Michael R is Michael Robinson
+Michael R is Michael Richardson
 
 
 Changelog for 1.3.15

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/LedgerSMB/AM.pm	2012-04-26 10:52:44 UTC (rev 4686)
@@ -1199,7 +1199,11 @@
     my ( $self, $myconfig, $form ) = @_;
 
     my @allowedsuff = qw(css tex txt html xml);
-    if ( $form->{file} =~ /^(.:)*?\/|:|\.\.\// ) {
+    my $test = $form->{file};
+    if ($LedgerSMB::Sysconfig::templates =~ /^(.:)*?\//){
+        $test =~ s#^$LedgerSMB::Sysconfig::templates/?\\?##;
+    }
+    if ( $test =~ /^(.:)*?\/|:|\.\.\// ) {
         $form->error("Directory transversal not allowed.");
     }
     if ( $form->{file} =~ /^${LedgerSMB::Sysconfig::backuppath}\// ) {
@@ -1567,7 +1571,7 @@
     my $query = qq|
 		  SELECT c.id, c.accno, c.description, 
 		         t.rate * 100 AS rate, t.taxnumber, t.validto,
-			 t.pass, m.taxmodulename
+			 t.minvalue, t.pass, m.taxmodulename
 		    FROM chart c
 		    LEFT JOIN
                      (tax t JOIN taxmodule m 
@@ -1655,11 +1659,11 @@
         $form->{"pass_$i"} = 0 if not $form->{"pass_$i"};
         delete $form->{"old_validto_$i"} if ! $form->{"old_validto_$i"};
 
-        $sth = $dbh->prepare('select account__save_tax(?,?,?,?,?,?,?)');         
+        $sth = $dbh->prepare('select account__save_tax(?,?,?,?,?,?,?,?)');         
         my @queryargs = (
-            $chart_id, $validto, $rate, $form->{"taxnumber_$i"},
-            $form->{"pass_$i"}, $form->{"taxmodule_id_$i"},
-            $form->{"old_validto_$i"}
+            $chart_id, $validto, $rate, $form->{"minvalue_$i"},
+            $form->{"taxnumber_$i"}, $form->{"pass_$i"}, 
+            $form->{"taxmodule_id_$i"}, $form->{"old_validto_$i"}
         );
        $sth->execute(@queryargs) ||$form->dberror($query);
        $sth->finish;


Property changes on: trunk/LedgerSMB/Scripts/account.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4680
/branches/1.3/scripts/account.pl:3711-4368
   + /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4685
/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-4680
/branches/1.3/scripts/admin.pl:3711-4678
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4685
/branches/1.3/scripts/admin.pl:3711-4678


Property changes on: trunk/LedgerSMB/Scripts/customer.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4680
/branches/1.3/scripts/customer.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4685
/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-4680
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4685
/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-4680
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4685
/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-4680
/branches/1.3/scripts/journal.pl:3711-4328
   + /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4685
/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-4680
/branches/1.3/scripts/login.pl:3711-4192
   + /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4685
/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-4680
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4685
/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-4680
/branches/1.3/scripts/payment.pl:3711-4680
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4685
/branches/1.3/scripts/payment.pl:3711-4680


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


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4680
/branches/1.3/scripts/setup.pl:3711-4550
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4685
/branches/1.3/scripts/setup.pl:3711-4550


Property changes on: trunk/LedgerSMB/Scripts/taxform.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4680
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4685
/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-4680
/branches/1.3/scripts/vendor.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4685
/branches/1.3/scripts/vendor.pl:4273-4287

Modified: trunk/LedgerSMB/Tax.pm
===================================================================
--- trunk/LedgerSMB/Tax.pm	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/LedgerSMB/Tax.pm	2012-04-26 10:52:44 UTC (rev 4686)
@@ -51,7 +51,7 @@
     }
     my $query = qq|
 		SELECT t.taxnumber, c.description,
-			t.rate, t.chart_id, t.pass, m.taxmodulename
+			t.rate, t.chart_id, t.pass, m.taxmodulename, t.minvalue
 			FROM tax t INNER JOIN chart c ON (t.chart_id = c.id)
 			INNER JOIN taxmodule m 
 				ON (t.taxmodule_id = m.taxmodule_id)
@@ -82,6 +82,7 @@
         $tax->chart( $ref->{'chart'} );
         $tax->description( $ref->{'description'} );
         $tax->value( Math::BigFloat->bzero() );
+        $tax->minvalue($ref->{'minvalue'});
 
         push @taxes, $tax;
         $sth->finish;#should this not be out of foreach loop?, to examine

Modified: trunk/LedgerSMB/Taxes/Simple.pm
===================================================================
--- trunk/LedgerSMB/Taxes/Simple.pm	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/LedgerSMB/Taxes/Simple.pm	2012-04-26 10:52:44 UTC (rev 4686)
@@ -36,6 +36,7 @@
     chart       => '$',
     account     => '$',
     value       => 'Math::BigFloat',
+    minvalue    => 'Math::BigFloat', #Ignored in Simple Tax rules
     pass        => '$'
 };
 

Modified: trunk/UI/am-taxes.html
===================================================================
--- trunk/UI/am-taxes.html	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/UI/am-taxes.html	2012-04-26 10:52:44 UTC (rev 4686)
@@ -10,6 +10,7 @@
 	<tr>
 	  <th></th>
 	  <th><?lsmb text('Rate (%)') ?></th>
+	  <th><?lsmb text('Min Taxable') ?></th>
 	  <th><?lsmb text('Number') ?></th>
 	  <th><?lsmb text('Valid To') ?></th>
 	  <th><?lsmb text('Ordering') ?></th>
@@ -19,6 +20,7 @@
 	<tr>
 	  <th align="right"><?lsmb row.0 ?></th>
 	  <td><input name="taxrate_<?lsmb i ?>" size="6" value="<?lsmb form.item("taxrate_$i") ?>" /></td>
+	  <td><input name="minvalue_<?lsmb i ?>" size="6" value="<?lsmb form.item("minvalue_$i") ?>" /></td>
 	  <td><input name="taxnumber_<?lsmb i ?>" value="<?lsmb form.item("taxnumber_$i") ?>" /></td>
 	  <td><input class="date" name="validto_<?lsmb i ?>" size="11" value="<?lsmb form.item("validto_$i") ?>" title="<?lsmb user.dateformat ?>" /></td>
 	  <td><input name="pass_<?lsmb i ?>" size="6" value="<?lsmb form.item("pass_$i") ?>" /></td>

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/bin/am.pl	2012-04-26 10:52:44 UTC (rev 4686)
@@ -1354,6 +1354,9 @@
     $i = 0;
     foreach $ref ( @{ $form->{taxrates} } ) {
         $i++;
+        $form->{"minvalue_$i"} = 
+          $form->format_amount( \%myconfig, $ref->{minvalue}) || 0;
+        
         $form->{"taxrate_$i"} =
           $form->format_amount( \%myconfig, $ref->{rate} );
         $form->{"taxdescription_$i"} = $ref->{description};

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/sql/Pg-database.sql	2012-04-26 10:52:44 UTC (rev 4686)
@@ -1742,6 +1742,7 @@
 CREATE TABLE tax (
   chart_id int REFERENCES account(id),
   rate numeric,
+  minvalue numeric,
   taxnumber text,
   validto timestamp not null default 'infinity',
   pass integer DEFAULT 0 NOT NULL,

Modified: trunk/sql/modules/Account.sql
===================================================================
--- trunk/sql/modules/Account.sql	2012-04-26 08:39:51 UTC (rev 4685)
+++ trunk/sql/modules/Account.sql	2012-04-26 10:52:44 UTC (rev 4686)
@@ -254,14 +254,20 @@
 $$ Returns a list of all account headings, currently ordered by account number.
 $$;
 
+DROP FUNCTION IF EXISTS account__save_tax
+(in_chart_id int, in_validto date, in_rate numeric, in_taxnumber text,
+in_pass int, in_taxmodule_id int, in_old_validto date);
+
 CREATE OR REPLACE FUNCTION account__save_tax
-(in_chart_id int, in_validto date, in_rate numeric, in_taxnumber text, 
+(in_chart_id int, in_validto date, in_rate numeric, in_minvalue numeric, 
+in_taxnumber text, 
 in_pass int, in_taxmodule_id int, in_old_validto date)
 returns bool as
 $$
 BEGIN
 	UPDATE tax SET validto = in_validto,
                rate = in_rate,
+               minvalue = in_minvalue,
                taxnumber = in_taxnumber,
                pass = in_pass,
                taxmodule_id = in_taxmodule_id
@@ -271,9 +277,10 @@
              return true;
          END IF;
 
-         INSERT INTO tax(chart_id, validto, rate, taxnumber, pass, taxmodule_id)
-         VALUES (in_chart_id, in_validto, in_rate, in_taxnumber, in_pass,
-                 in_taxmodule_id);
+         INSERT INTO tax(chart_id, validto, rate, minvalue, taxnumber, pass, 
+                        taxmodule_id)
+         VALUES (in_chart_id, in_validto, in_rate, in_minvalue, in_taxnumber, 
+                in_pass, in_taxmodule_id);
 
          RETURN TRUE;
 
@@ -281,6 +288,6 @@
 $$ language plpgsql;
 
 COMMENT ON FUNCTION account__save_tax
-(in_chart_id int, in_validto date, in_rate numeric, in_taxnumber text,
-in_pass int, in_taxmodule_id int, in_old_validto date) IS
+(in_chart_id int, in_validto date, in_rate numeric, in_minval numeric, 
+in_taxnumber text, in_pass int, in_taxmodule_id int, in_old_validto date) IS
 $$ This saves tax rates.$$; 


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-4680
/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-4685
/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.