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

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



Revision: 5079
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5079&view=rev
Author:   einhverfr
Date:     2012-08-02 07:40:30 +0000 (Thu, 02 Aug 2012)
Log Message:
-----------
Detect dates entered into statement balance and throw error

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/scripts/recon.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-08-02 02:19:37 UTC (rev 5078)
+++ branches/1.3/Changelog	2012-08-02 07:40:30 UTC (rev 5079)
@@ -4,6 +4,7 @@
 
 Changelog for 1.3.22
 * Fixed error when trying to save multiple make/models for a part (Chris T)
+* Better error handling when date is entered into statement balance (Chris T)
 
 Changelog for 1.3.21
 * Added a default numberformat in Form.pm (Chris T)

Modified: branches/1.3/scripts/recon.pl
===================================================================
--- branches/1.3/scripts/recon.pl	2012-08-02 02:19:37 UTC (rev 5078)
+++ branches/1.3/scripts/recon.pl	2012-08-02 07:40:30 UTC (rev 5079)
@@ -21,6 +21,7 @@
 use LedgerSMB::Template;
 use LedgerSMB::DBObject::Reconciliation;
 use LedgerSMB::Setting;
+use Try::Tiny;
 
 use Data::Dumper;
 use strict;
@@ -406,7 +407,11 @@
 =cut
 sub new_report {
     my ($request) = @_;
-
+    if ($request->{total} && $request->{total} =~ m|[/-]|){
+        $request->error($request->{_locale}->text(
+           'Invalid statement balance.  Hint: Try entering a number'
+        ));
+    }
     $request->{total} = $request->parse_amount(amount => $request->{total});
     my $template;
     my $return;

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