Old hooks superseded by new hooks API.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 13 Nov 2010 09:18:47 +0000 (09:18 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 13 Nov 2010 09:18:47 +0000 (09:18 +0000)
gl/includes/db/gl_db_rates.inc
includes/ui/ui_view.inc
reporting/rep709.php

index ceaddcc7966bf476f57cb8c4b62ce19820268e17..a6dc58e7d59f5e4377e2705e7253e519be1c144b 100644 (file)
@@ -76,12 +76,10 @@ function delete_exchange_rate($rate_id)
 //
 function retrieve_exrate($curr_b, $date)
 {
-       global $Hooks;
-
-       if (method_exists($Hooks, 'retrieve_exrate'))
-               return $Hooks->retrieve_exrate($curr_b, $date);
-       else
-               return get_extern_rate($curr_b, 'ECB', $date);
+       return $rate = hook_retrieve_exrate($curr_b, $date);
+       if (is_numeric($rate))
+               return $rate;
+       return get_extern_rate($curr_b, 'ECB', $date);
 }
 //-----------------------------------------------------------------------------
 
index 9306aa5d0a84ba1d1598dc9ead62afe924d4d83a..69810222a0ea2f6489c5748126404a5f08c2c5d4 100644 (file)
@@ -734,12 +734,11 @@ function _number_to_words($number)
 
 function price_in_words($amount, $document=0)
 {
-       global $Hooks;
        // use local price_in_words() if the hook is defined
-       if (method_exists($Hooks, 'price_in_words'))
-       {
-               return $Hooks->price_in_words($amount, $document);
-       }
+       $price = hook_price_in_words($amount, $document);
+       if ($price) 
+               return $price;
+
        // Only usefor Remittance and Receipts as default
        if (!($document == ST_SUPPAYMENT || $document == ST_CUSTPAYMENT || $document == ST_CHEQUE))
                return "";
index 3e7b9d79861fa559552606682a032c33220edc7f..e52f293395c08b265a20e203b0eb4cce09a88daa 100644 (file)
@@ -71,7 +71,7 @@ function getTaxInfo($id)
 
 function print_tax_report()
 {
-       global $path_to_root, $trans_dir, $Hooks, $systypes_array;
+       global $path_to_root, $trans_dir, $systypes_array;
        
        $from = $_POST['PARAM_0'];
        $to = $_POST['PARAM_1'];
@@ -202,10 +202,7 @@ function print_tax_report()
        $rep->Font();
        $rep->NewLine();
 
-       if (method_exists($Hooks, 'tax_report_done'))
-       {
-               $Hooks->tax_report_done();
-       }
+       hook_tax_report_done();
 
        $rep->End();
 }