Permalink
Browse files

Merge pull request #106 from garyhgohoos/21977

Issue #21977:conditionally update shiphead_shipchrg
  • Loading branch information...
2 parents ebd8710 + 299980b commit ed583d68813423885278c860e4d3aef73d9f86bc @gpazo gpazo committed Jan 2, 2014
Showing with 4 additions and 1 deletion.
  1. +4 −1 dbscripts/triggers/cohead.sql
View
5 dbscripts/triggers/cohead.sql
@@ -485,7 +485,10 @@ BEGIN
OR (OLD.cohead_freight != NEW.cohead_freight)
OR (OLD.cohead_shipvia != NEW.cohead_shipvia)) THEN
UPDATE shiphead SET
- shiphead_shipchrg_id=NEW.cohead_shipchrg_id,
+ shiphead_shipchrg_id=
+ CASE WHEN (NEW.cohead_shipchrg_id <= 0) THEN NULL
+ ELSE NEW.cohead_shipchrg_id
+ END,
shiphead_freight=NEW.cohead_freight,
shiphead_shipvia=NEW.cohead_shipvia
WHERE ((shiphead_order_type='SO')

0 comments on commit ed583d6

Please sign in to comment.