From 7daee80066b1c1a34eda1ca79ca5a82adc4fc434 Mon Sep 17 00:00:00 2001 From: Chris Travers Date: Tue, 7 Oct 2014 06:44:10 -0700 Subject: [PATCH 1/6] Fixing bug 1239, reopening books when over an existing close point throws error --HG-- extra : source : 6225d8b119f19a57d536ae7e52d61ed22ed676cb --- Changelog | 1 + sql/modules/EndOfYear.sql | 36 +++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Changelog b/Changelog index 67ad7020a4..fbc3f1fab2 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,7 @@ Changelog for 1.3.45 * Fixed pricematrix prices not respected for vendors (Chris T, bug 1230) * Added tests for Sysconfig (Chris T, bug 1232) * Added first-rate starman/plack support (Chris T) +* Fixed bug 1239, reopening on previous close throws error (Chris T) Chris T is Chris Travers diff --git a/sql/modules/EndOfYear.sql b/sql/modules/EndOfYear.sql index 2c0b62c614..eb7daf0eb1 100644 --- a/sql/modules/EndOfYear.sql +++ b/sql/modules/EndOfYear.sql @@ -179,6 +179,27 @@ $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eoy_reopen_books(in_end_date date) IS $$ Removes checkpoints and reverses yearend transactions on in_end_date$$; +CREATE OR REPLACE FUNCTION eoy__reopen_books_at(in_reopen_date date) +RETURNS BOOL +LANGUAGE SQL AS +$$ + + SELECT eoy_reopen_books(end_date) + FROM (SELECT end_date + FROM account_checkpoint + WHERE end_date >= $1 + GROUP BY end_date) eoy_dates + ORDER BY end_date; + +SELECT CASE WHEN (SELECT count(*) > 0 from account_checkpoint + where end_date = $1 - 1) + THEN true + ELSE eoy_create_checkpoint($1 - 1) > 0 + END; + +$$; + + CREATE OR REPLACE FUNCTION account__obtain_balance (in_transdate date, in_account_id int) RETURNS numeric AS @@ -222,19 +243,4 @@ COMMENT ON FUNCTION eoy_earnings_accounts() IS $$ Lists equity accounts for the retained earnings dropdown.$$; -CREATE OR REPLACE FUNCTION eoy__reopen_books_at(in_reopen_date date) -RETURNS BOOL -LANGUAGE SQL AS -$$ - - SELECT eoy_reopen_books(end_date) - FROM (SELECT end_date - FROM account_checkpoint - WHERE end_date >= $1 - GROUP BY end_date) eoy_dates - ORDER BY end_date; - -SELECT eoy_create_checkpoint($1 - 1) > 0; - -$$; COMMIT; From 1cff70bb0ca464b3a54a4ee6b8de366fe4238a5b Mon Sep 17 00:00:00 2001 From: Chris Travers Date: Wed, 8 Oct 2014 03:18:31 -0700 Subject: [PATCH 2/6] Quieting some template tests. --- Changelog | 1 + UI/Contact/contact.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index fbc3f1fab2..87e92c997d 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,7 @@ Changelog for 1.3.45 * Added tests for Sysconfig (Chris T, bug 1232) * Added first-rate starman/plack support (Chris T) * Fixed bug 1239, reopening on previous close throws error (Chris T) +* Quited some of the test cases (Chris T) Chris T is Chris Travers diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html index 62734973d0..48e8021a44 100644 --- a/UI/Contact/contact.html +++ b/UI/Contact/contact.html @@ -580,7 +580,7 @@ label = text('Threshold') class = "numeric" } ?> - 0 ?> +
- 0 ?> + Date: Tue, 14 Oct 2014 05:05:38 -0700 Subject: [PATCH 3/6] Fixing bug 1244, manually entered tax crashes edit screen --- Changelog | 3 ++- bin/is.pl | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index 87e92c997d..f1884d60b6 100644 --- a/Changelog +++ b/Changelog @@ -8,7 +8,8 @@ Changelog for 1.3.45 * Added tests for Sysconfig (Chris T, bug 1232) * Added first-rate starman/plack support (Chris T) * Fixed bug 1239, reopening on previous close throws error (Chris T) -* Quited some of the test cases (Chris T) +* Quieted some of the test cases (Chris T) +* Fixed bug 1244, manually entered tax crashes invoice on edit (Chris T) Chris T is Chris Travers diff --git a/bin/is.pl b/bin/is.pl index 5c8168c0b6..526075fbd4 100644 --- a/bin/is.pl +++ b/bin/is.pl @@ -744,15 +744,15 @@ sub form_footer { $form->{"${taccno}_description"} format_amount(\%myconfig, $form->{"mt_amount_$item"}) .qq|" size="10"/> format_amount(\%myconfig, $form->{"mt_rate_$item"}) .qq|" size="4"/> format_amount(\%myconfig, $form->{"mt_basis_$item"}) .qq|" size="10"/>