Topic: Achieved 999% (error?) in Profit and Loss statement
When the denominator is 0, the percentage is shown a 999% for achieved %.
Attached is the screenshot.
Is this the intended denotation for error or out of range values?
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Reporting → Achieved 999% (error?) in Profit and Loss statement
When the denominator is 0, the percentage is shown a 999% for achieved %.
Attached is the screenshot.
Is this the intended denotation for error or out of range values?
This is not an error, but a constant for out of range value.
Joe
Where in the wiki should we indicate this fact. Should a translatable string be used in FA 2.4?
I don't know Apmuthu. We have had this all the time. Maybe you can find somewhere suitable in the Wiki to put this. Isn't it mostly used in the balance Sheet and Profit and Loss Statements?
I my opinion, I Think we can continue with this.
/Joe
Then let it be like that except that a constant string can be defined for now as '999' and used in the function Achieve();
Lines 137 to 147 in reporting/rep707.php:
function Achieve($d1, $d2)
{
if ($d1 == 0 && $d2 == 0)
return 0;
elseif ($d2 == 0)
return 999;
$ret = ($d1 / $d2 * 100.0);
if ($ret > 999)
$ret = 999;
return $ret;
}
can be
define('OUT_OF_RANGE', 999);
function Achieve($d1, $d2)
{
if ($d1 == 0 && $d2 == 0)
return 0;
elseif ($d2 == 0)
return OUT_OF_RANGE;
$ret = ($d1 / $d2 * 100.0);
if ($ret > OUT_OF_RANGE)
$ret = OUT_OF_RANGE;
return $ret;
}
The define can be placed into the file that contains the other constants.
The said function Achieve() is duplicated in gl/inquiry/profit_loss.php.
In reporting/includes/excel_report.inc we find that 9999999 is used to represent "infinity".
In includes/ui/ui_view.inc, the value 999999999999 is used to represent "infinity".
In includes/date_functions.inc, the value 9999 is used to represent the max year.
In admin/view_print_transaction.php and admin/void_transaction.php, the value 999999 is used to represent the max ToTransNo.
FrontAccounting forum → Reporting → Achieved 999% (error?) in Profit and Loss statement
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.