summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-06 23:35:23 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-06 23:35:23 +0000
commit84dc3479cfed7f6b812390f75f770a12df1f4d59 (patch)
tree9da5318e6ee4418f7b2e6be89ca3cc12055211dd
parent9e42bb3c1477d4622172b9ac49f67270db14ee7b (diff)
Correcting location saving issues
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2238 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--sql/modules/Location.sql8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/modules/Location.sql b/sql/modules/Location.sql
index b90e11c7..4e0cb6b1 100644
--- a/sql/modules/Location.sql
+++ b/sql/modules/Location.sql
@@ -38,11 +38,11 @@ BEGIN
SELECT * INTO location_row FROM location
WHERE line_one = in_address1 AND
- line_two = in_address2 AND
- line_three = in_address3 AND
+ coalesce(line_two, '') = coalesce(in_address2, '') AND
+ coalesce(line_three, '') = coalesce(in_address3, '') AND
city = in_city AND
- state = in_state AND
- mail_code = in_zipcode AND
+ coalesce(state, '') = coalesce(in_state, '') AND
+ coalesce(mail_code, '') = coalesce(in_zipcode, '') AND
country_id = in_country
LIMIT 1;
IF FOUND THEN