# HG changeset patch
# User Stefan Hühner <stefan.huehner@openbravo.com>
# Date 1490382406 -3600
#      Fri Mar 24 20:06:46 2017 +0100
# Node ID 85ca840c1ab954a31398914ba8d8e4c286e8d095
# Parent  336dfa229d38e2b0a51e29db5bd70fd38cc16913
Delete pl function spellnumericvalue as it breaks create.database on oracle
and no single user seems to exist. So easier to remove instead of trying to
debug and fix.

diff --git a/src-db/database/model/functions/PHMDF_SPELLNUMERICVALUE.xml b/src-db/database/model/functions/PHMDF_SPELLNUMERICVALUE.xml
deleted file mode 100644
--- a/src-db/database/model/functions/PHMDF_SPELLNUMERICVALUE.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-  <database name="FUNCTION PHMDF_SPELLNUMERICVALUE">
-    <function name="PHMDF_SPELLNUMERICVALUE" type="CLOB">
-      <parameter name="pvalue" type="NUMERIC" mode="in">
-        <default/>
-      </parameter>
-      <body><![CDATA[_dollar bigint = TRUNC(pValue)::text;
-  _cents int = ((pValue - TRUNC(pValue))*100)::int;
-  _spelledAmount text = '' ; 
-  _brokenOut int[] ;
-  _pos INTEGER = 0;
-  _word text ;
-  _tempVal int = 0 ;
-BEGIN
- 
-	--break the number down into separate elements each containing a max of 3
-        --digits.  Number 23321456 is broken in array like so {456,321,23}
-	WHILE _dollar > 0 LOOP
-		_brokenOut = array_append(_brokenOut, (_dollar%1000)::int);
-		_dollar = TRUNC(_dollar/1000);
-		_pos = _pos + 1;
-	END LOOP;
- 
-	--this works on numbers between 1 to 999 transforming into english words, then goes to the
-	--next set of numbers in the array working backwards as the array was loaded backwards
-	--Meaning the highest value is the last element of the array _brokenOut
-	--This assumes words thousands millions, billions... occurs every 10^3  
-	WHILE _pos > 0 LOOP
-		_tempVal = _brokenOut[_pos] ;  --use _tempVal to work on using the array directly has big performance hit. 
-		IF _tempVal >99 THEN
-			IF    _tempVal > 899 THEN _spelledAmount = _spelledAmount || 'nine hundred ' ;
-			ELSIF _tempVal > 799 THEN _spelledAmount = _spelledAmount || 'eight hundred ' ;
-			ELSIF _tempVal > 699 THEN _spelledAmount = _spelledAmount || 'seven hundred ' ;
-			ELSIF _tempVal > 599 THEN _spelledAmount = _spelledAmount || 'six hundred ' ;
-			ELSIF _tempVal > 499 THEN _spelledAmount = _spelledAmount || 'five hundred ' ;
-			ELSIF _tempVal > 399 THEN _spelledAmount = _spelledAmount || 'four hundred ' ;
-			ELSIF _tempVal > 299 THEN _spelledAmount = _spelledAmount || 'three hundred ' ;
-			ELSIF _tempVal > 199 THEN _spelledAmount = _spelledAmount || 'two hundred ' ;
-			ELSIF _tempVal > 99 THEN  _spelledAmount = _spelledAmount || 'one hundred ' ;
-			END IF ;
-		END IF;
- 
-		IF    _tempVal%100 = 10 THEN _spelledAmount = _spelledAmount || 'ten ';
-		ELSIF _tempVal%100 = 11 THEN _spelledAmount = _spelledAmount || 'eleven ';
-		ELSIF _tempVal%100 = 12 THEN _spelledAmount = _spelledAmount || 'twelve ';
-		ELSIF _tempVal%100 = 13 THEN _spelledAmount = _spelledAmount || 'thirteen ';
-		ELSIF _tempVal%100 = 14 THEN _spelledAmount = _spelledAmount || 'fourteen ';
-		ELSIF _tempVal%100 = 15 THEN _spelledAmount = _spelledAmount || 'fifteen ';
-		ELSIF _tempVal%100 = 16 THEN _spelledAmount = _spelledAmount || 'sixteen ';
-		ELSIF _tempVal%100 = 17 THEN _spelledAmount = _spelledAmount || 'seventeen ';
-		ELSIF _tempVal%100 = 18 THEN _spelledAmount = _spelledAmount || 'eighteen ';
-		ELSIF _tempVal%100 = 19 THEN _spelledAmount = _spelledAmount || 'nineteen ';
-		ELSIF _tempVal/10%10 =2 THEN _spelledAmount = _spelledAmount || 'twenty '; 
-		ELSIF _tempVal/10%10 =3 THEN _spelledAmount = _spelledAmount || 'thirty ' ;
-		ELSIF _tempVal/10%10 =4 THEN _spelledAmount = _spelledAmount || 'fourty ' ;
-		ELSIF _tempVal/10%10 =5 THEN _spelledAmount = _spelledAmount || 'fifty ' ;
-		ELSIF _tempVal/10%10 =6 THEN _spelledAmount = _spelledAmount || 'sixty ' ;
-		ELSIF _tempVal/10%10 =7 THEN _spelledAmount = _spelledAmount || 'seventy ' ;
-		ELSIF _tempVal/10%10 =8 THEN _spelledAmount = _spelledAmount || 'eighty ' ;
-		ELSIF _tempVal/10%10 =9 THEN _spelledAmount = _spelledAmount || 'ninety ' ;
-		END IF ;
- 
- 
-		IF _tempVal%100 < 10 OR _tempVal%100 > 20 THEN
-			IF    _tempVal%10 = 1 THEN _spelledAmount = _spelledAmount || 'one ';
-			ELSIF _tempVal%10 = 2 THEN _spelledAmount = _spelledAmount || 'two ';
-			ELSIF _tempVal%10 = 3 THEN _spelledAmount = _spelledAmount || 'three ';
-			ELSIF _tempVal%10 = 4 THEN _spelledAmount = _spelledAmount || 'four ';
-			ELSIF _tempVal%10 = 5 THEN _spelledAmount = _spelledAmount || 'five ';
-			ELSIF _tempVal%10 = 6 THEN _spelledAmount = _spelledAmount || 'six ';
-			ELSIF _tempVal%10 = 7 THEN _spelledAmount = _spelledAmount || 'seven ';
-			ELSIF _tempVal%10 = 8 THEN _spelledAmount = _spelledAmount || 'eight ';
-			ELSIF _tempVal%10 = 9 THEN _spelledAmount = _spelledAmount || 'nine ';
-			END IF ;
-		END IF ;
- 
-                --Based on array element tells us which word to use.  
-                --As the array is loaded backwards the highest value is
-                --highest array element number. To take it higher values all
-                --one needs to do is add more elsif statements. 
-		IF _pos = 2 THEN
-			_spelledAmount = _spelledAmount || 'thousand ';
-		ELSIF _pos = 3  THEN
-			_spelledAmount = _spelledAmount || 'million ';
-		ELSIF _pos = 4  THEN
-			_spelledAmount = _spelledAmount || 'billion ';
-		ELSIF _pos = 5 THEN
-			_spelledAmount = _spelledAmount || 'trillion ';
-		ELSIF _pos = 6 THEN
-			_spelledAmount = _spelledAmount || 'quadrillion ';
-		ELSIF _pos = 7 THEN
-			_spelledAmount = _spelledAmount || 'quintillion ';
-		ELSE 
-			_spelledAmount = _spelledAmount || '';
-		END IF;
- 
-		_pos = _pos-1;
-	END LOOP;
- 
-	RETURN _SpelledAmount;
-END PHMDF_SPELLNUMERICVALUE
-]]></body>
-    </function>
-  </database>
