From 13a94bbf789a9c9b41f052c4f230e9acf9fbc105 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 14 Oct 2008 20:26:40 +0000 Subject: Correcting handling of blank inputs. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2370 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/RP.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'LedgerSMB') diff --git a/LedgerSMB/RP.pm b/LedgerSMB/RP.pm index dfff734f..816980de 100644 --- a/LedgerSMB/RP.pm +++ b/LedgerSMB/RP.pm @@ -1453,6 +1453,12 @@ sub trial_balance { my $datefrom = $dbh->quote($form->{fromdate}); my $dateto = $dbh->quote($form->{todate}); my $safe_project_id = $dbh->quote($project_id); + if ($datefrom eq "''") { + $datefrom = "NULL"; + } + if ($dateto eq "''") { + $dateto = "NULL"; + } $query = "SELECT c.id AS chart_id, c.accno, c.description, c.contra, c.category, SUM(CASE WHEN ac.transdate < $datefrom -- cgit v1.2.3