From 4dd9f147aa40741c5f70214d20fd1b2031348b6c Mon Sep 17 00:00:00 2001 From: tetragon Date: Thu, 16 Nov 2006 00:48:16 +0000 Subject: Fix project creation with NULL dates git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@629 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/PE.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'LedgerSMB/PE.pm') diff --git a/LedgerSMB/PE.pm b/LedgerSMB/PE.pm index fe84ed1d..58d7a6cf 100755 --- a/LedgerSMB/PE.pm +++ b/LedgerSMB/PE.pm @@ -212,6 +212,10 @@ sub save_project { $form->{projectnumber} = $form->update_defaults($myconfig, "projectnumber", $dbh) unless $form->{projectnumber}; + my $enddate; + my $startdate; + $enddate = $form->{enddate} if $form->{enddate}; + $startdate = $form->{startdate} if $form->{startdate}; if ($form->{id}) { @@ -233,7 +237,7 @@ sub save_project { $sth = $dbh->prepare($query); $sth->execute( $form->{projectnumber}, $form->{description}, - $form->{startdate}, $form->{enddate}, $form->{customer_id} + $startdate, $enddate, $form->{customer_id} ) || $form->dberror($query); $form->run_custom_queries('project', 'UPDATE'); -- cgit v1.2.3