If currency not given then supposed to be the default one (id=0)

This commit is contained in:
Dany De Bontridder 2019-10-24 10:30:47 +02:00
parent bc89fb193b
commit e1be2ee3ef
2 changed files with 4 additions and 3 deletions

View file

@ -27,7 +27,8 @@ require_once NOALYSS_INCLUDE."/database/v_currency_last_value_sql.class.php";
/**
* @class
* @brief display currency , convert to euro , and save them if used
* @brief display currency , convert to euro , and save them if used. The default currency has the id 0 and is
* normally EUR
*/
class Acc_Currency
{

View file

@ -1332,8 +1332,8 @@ class Acc_Ledger extends jrn_def_sql
$count=0;
// currency
$currency_code=$http->extract($p_array, "p_currency_code","number");
$currency_rate=$http->extract($p_array, "p_currency_rate","number");
$currency_code=$http->extract($p_array, "p_currency_code","number",0);
$currency_rate=$http->extract($p_array, "p_currency_rate","number",1);
$currency_rate_ref=new Acc_Currency($this->db, $currency_code);
for ($i=0; $i<$nb_item; $i++)