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

SF.net SVN: ledger-smb: [145] trunk/LedgerSMB



Revision: 145
          http://svn.sourceforge.net/ledger-smb/?rev=145&view=rev
Author:   einhverfr
Date:     2006-09-24 17:45:13 -0700 (Sun, 24 Sep 2006)

Log Message:
-----------
Revides the dbquote to use DBI::quote.

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/IS.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2006-09-24 22:09:11 UTC (rev 144)
+++ trunk/LedgerSMB/Form.pm	2006-09-25 00:45:13 UTC (rev 145)
@@ -1381,17 +1381,13 @@
 
 sub dbquote {
 
-	my ($self, $var, $type) = @_;
+	my ($self, $var) = @_;
 
-	# DBI does not return NULL for SQL_DATE if the date is empty
-	if ($type eq 'SQL_DATE') {
-		$_ = ($var) ? "'$var'" : "NULL";
+	if ($var eq ''){
+		$_ = "NULL";
+	} else {
+		$_ = $self->{dbh}->quote($var);
 	}
-
-	if ($type eq 'SQL_INT') {
-		$_ = $var * 1;
-	}
-
 	$_;
 }
 

Modified: trunk/LedgerSMB/IS.pm
===================================================================
--- trunk/LedgerSMB/IS.pm	2006-09-24 22:09:11 UTC (rev 144)
+++ trunk/LedgerSMB/IS.pm	2006-09-25 00:45:13 UTC (rev 145)
@@ -998,7 +998,7 @@
   my $till = ($form->{till}) ? qq|'$form->{till}'| : "NULL";
 
   $form->{invnumber} = $form->update_defaults($myconfig, "sinumber", $dbh) unless $form->{invnumber};
-  
+
   # save AR record
   $query = qq|UPDATE ar set
               invnumber = |.$dbh->quote($form->{invnumber}).qq|,


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