|
From: Stewart S. <st...@fl...> - 2006-04-05 06:22:36
|
I was getting SQL syntax errors on creating a new invoice. the following
patch fixed it for me.
revno: 9
committer: Stewart Smith <st...@fl...>
branch nick: bms.stewart
timestamp: Wed 2006-04-05 16:21:50 +1000
message:
fix for default discountid.
Without this patch you can end up with an invalid INSERT.
modified:
modules/bms/include/invoices_addedit_include.php
=3D=3D=3D modified file 'modules/bms/include/invoices_addedit_include.php'
--- modules/bms/include/invoices_addedit_include.php=09
+++ modules/bms/include/invoices_addedit_include.php=09
@@ -187,7 +187,7 @@
$therecord["postalcode"]=3D"";
$therecord["country"]=3D"";
=20
- $therecord["taxareaid"]=3DNULL;
+ $therecord["taxareaid"]=3D0;
$therecord["taxpercentage"]=3DNULL;
$therecord["shippingmethod"]=3DNULL;
$therecord["tax"]=3D0;
@@ -264,7 +264,7 @@
=20
$discountamount=3Dereg_replace("\\\$|,","",$variables["discountamount"=
]);
$querystatement.=3D"discountamount=3D".$discountamount.", ";
- if($variables["discountid"]=3D"")$variables["discountid"]=3D"NULL";
+ if($variables["discountid"]=3D=3D"")$variables["discountid"]=3D"NULL";
$querystatement.=3D"discountid=3D".$variables["discountid"].", ";=20
=20
if($variables["invoicedate"]=3D=3D"" || $variables["invoicedate"]=3D=
=3D"0/0/0000") $tempdate=3D"NULL";
@@ -391,8 +391,8 @@
$querystatement.=3D$tempdate.", ";=20
=20
$discountamount=3Dereg_replace("\\\$|,","",$variables["discountamount"=
]);
- $querystatement.=3D$discountamount.", "; =09
- if($variables["discountid"]=3D"")$variables["discountid"]=3D"NULL";
+ $querystatement.=3D$discountamount.", ";
+ if($variables["discountid"]=3D=3D"")$variables["discountid"]=3D"NULL";
$querystatement.=3D$variables["discountid"].", ";=20
=20
if($variables["invoicedate"]=3D=3D"" || $variables["invoicedate"]=3D=
=3D"0/0/0000") $tempdate=3D"NULL";
@@ -528,4 +528,4 @@
break;
}
}
-?>
\ No newline at end of file
+?>
--=20
Stewart Smith (st...@fl...)
http://www.flamingspork.com/
|