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

SF.net SVN: ledger-smb:[4615] branches/1.3



Revision: 4615
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4615&view=rev
Author:   einhverfr
Date:     2012-03-28 09:29:12 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
Early payment discount fixed for single payment workflow

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/doc/release_notes
    branches/1.3/scripts/payment.pl
    branches/1.3/sql/modules/Payment.sql

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-03-28 09:23:46 UTC (rev 4614)
+++ branches/1.3/Changelog	2012-03-28 09:29:12 UTC (rev 4615)
@@ -6,6 +6,7 @@
 * Adding Perl-based database-setup and teardown scripts (Chris B)
 * Corrected build issues w/Makefile due to inclusion of LedgerSMB.pm (Chris T)
 * ledgersmb.conf.default : Update default PATH (H Sorli, item 3430019)
+* Fixed imballanced payments when early payment discount processed (Chris T)
 
 Chris B is Chris Bennet
 Chris T is Chris Travers

Modified: branches/1.3/doc/release_notes
===================================================================
--- branches/1.3/doc/release_notes	2012-03-28 09:23:46 UTC (rev 4614)
+++ branches/1.3/doc/release_notes	2012-03-28 09:29:12 UTC (rev 4615)
@@ -125,24 +125,8 @@
 gain/loss will be realized per the time when the payment was in effect and 
 not reversed.
 
-3.3:  Early Payment Discounts not properly handled
+3.3:  Missing Annual Daily Straight Line Stored Procedure
 
-Two issues with LedgerSMB 1.3.x were discovered during the LedgerSMB 1.3.14
-release candidate process.  These are expected to be fixed in 1.3.15, but until
-then this feature should not be used.  Due to the severity and obviousness of 
-these issues, it is not believed that anyone is using these features now, and 
-these features are not present in 1.2.x.
-
-The first is that the account mappings to early payment discounts are not
-properly saved.  This means that the accounting software cannot find the
-appropriate accounts to store discounts in.  It isn't clear yet whether the fact
-that early payment discounts are also listing as unbalanced transactions is due
-to this or something else.
-
-Please don't use this feature until 1.3.15.
-
-3.4:  Missing Annual Daily Straight Line Stored Procedure
-
 Apparently the stored procedure for handling asset depreciation where the annual
 daily straight line method is selected is missing.  More typically, the annual
 monthly method is used.  For now, use that method instead.

Modified: branches/1.3/scripts/payment.pl
===================================================================
--- branches/1.3/scripts/payment.pl	2012-03-28 09:23:46 UTC (rev 4614)
+++ branches/1.3/scripts/payment.pl	2012-03-28 09:29:12 UTC (rev 4615)
@@ -1265,6 +1265,8 @@
 #
 # Ok, we want to use the disccount information in order to do some accounting movements,
 # we will process it with the same logic for a regular payment, and see where does this leave us.
+#
+$Payment->{vc_name} = $Payment->{company_name};
 @array_options = $Payment->get_entity_credit_account();# We need to know the disccount account
 my $discount_account_id = $array_options[0]->{discount};
 @array_options = $Payment->get_open_invoices(); 

Modified: branches/1.3/sql/modules/Payment.sql
===================================================================
--- branches/1.3/sql/modules/Payment.sql	2012-03-28 09:23:46 UTC (rev 4614)
+++ branches/1.3/sql/modules/Payment.sql	2012-03-28 09:29:12 UTC (rev 4615)
@@ -636,6 +636,9 @@
 DECLARE old_exchangerate numeric;
 DECLARE fx_gain_loss_amount numeric;
 BEGIN
+      IF array_upper(in_amount, 1) <> array_upper(in_cash_account_id, 1) THEN
+          RAISE EXCEPTION 'Wrong number of accounts';
+      END IF;
         
         SELECT * INTO default_currency  FROM defaults_get_defaultcurrency(); 
         SELECT * INTO current_exchangerate FROM currency_get_exchangerate(in_curr, in_datepaid, in_account_class);

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