From 4b72b21a945ca894f6f5f9d761498bfa5ff00f75 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 5 Dec 2006 23:20:30 +0000 Subject: Minor change to parse_amount which allow returning zero on undef or empty string (necessary for some things) git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@727 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 2ff0be22..cf89c9e7 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -479,8 +479,8 @@ sub parse_amount { my ($self, $myconfig, $amount) = @_; - if ($amount eq '') { - return undef; + if (($amount eq '') or ($amount eq undef)) { + return 0; } if (UNIVERSAL::isa($amount, 'Math::BigFloat')){ # Amount may not be an object -- cgit v1.2.3