webERP v4.15.2 PHP 8.2.25: Warning: Undefined array key "IDR" in /weberp/includes/MiscFunctions.php on line 144 #241
Replies: 5 comments
-
|
I think this is related to the update exchange rates code. Can you
download the latest MiscFunctions.php that I uploaded earlier. And
make sure your system settings are set to update from the ECB - it
does include the Indonesian rupiah in it's list.
Thanks
Tim
…On Fri, 15 Nov 2024 at 09:26, pakricard ***@***.***> wrote:
Hi all:
In Currencies.php, it throws Warning: Undefined array key "IDR" in /weberp/includes/MiscFunctions.php on line 144 because $CurrencyRatesArray is an empty array set in Currencies.php line 329.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
--
www.weberp.org
@TimSchofield2
Blog: https://kwamoja.home.blog/
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Tim: The warning is caused because $CurrencyRatesArray is an empty array set in Currencies.php line 329 (my code executes the else structure as I have $_SESSION['UpdateCurrencyRatesDaily'] set to false. and in line 358 when it is passed to GetCurrencyRate(),
as I don't use auto update it goes to line 167 of GetCurrencyRate()
and it is causing the warning there |
Beta Was this translation helpful? Give feedback.
-
|
Sorry Ricard, that was my bad for not reading correctly.
You're right that CurrencyRatesArray is initialised as an empty array,
but then in lines 353 to 356 of Currencies.php (in the latest GitHub
version) it should populate any empty items with a zero rate:
if (!array_key_exists($MyRow['currabrev'], $CurrencyRatesArray)) {
$CurrencyRatesArray[$FunctionalCurrency] = 0;
$CurrencyRatesArray[$MyRow['currabrev']] = 0;
}
It seems that this is not working properly. Can you add the line
var_dump($CurrencyRatesArray); straight after this code and see what
it outputs?
Thanks for your work on this,
Tim
…On Mon, 25 Nov 2024 at 08:22, pakricard ***@***.***> wrote:
Hi Tim:
It must be unrelated as I am not using the auto-update from ECB. I think it is because $CurrencyRatesArray is an empty array set in Currencies.php line 329 (my code executes the else structure as I have $_SESSION['UpdateCurrencyRatesDaily'] set to false.
if ($_SESSION['UpdateCurrencyRatesDaily'] != '0') {
$CurrencyRatesArray = GetECBCurrencyRates();
} else {
$CurrencyRatesArray = array();
}
and in line 358 when it is passed to GetCurrencyRate(),
$Rate = GetCurrencyRate($MyRow['currabrev'],$CurrencyRatesArray);
as I don't use auto update it goes to line 167 of GetCurrencyRate()
if ($CurrenciesArray[$_SESSION['CompanyRecord']['currencydefault']] == 0) {
and it is causing the warning there
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
--
www.weberp.org
@TimSchofield2
Blog: https://kwamoja.home.blog/
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Tim: |
Beta Was this translation helpful? Give feedback.
-
|
No worries, thanks for testing
…On Tue, 26 Nov 2024 at 00:59, pakricard ***@***.***> wrote:
Hi Tim:
It is working fine with the latest GitHib Currencies.php. I mixed up, as I
was testing the 4.15.2 distribution, but now with latest file it is OK.
Sorry for the mess.
—
Reply to this email directly, view it on GitHub
<#241 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAL6LG653X7RFJPSDQMMW32CPBX5AVCNFSM6AAAAABR2YPRK2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZXHA2DENA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all:
In Currencies.php, it throws Warning: Undefined array key "IDR" in /weberp/includes/MiscFunctions.php on line 144 because $CurrencyRatesArray is an empty array set in Currencies.php line 329.
Beta Was this translation helpful? Give feedback.
All reactions