projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added message when no file is selected for view or download.
[fa-stable.git]
/
reporting
/
rep707.php
diff --git
a/reporting/rep707.php
b/reporting/rep707.php
index 5dd9c1b2e282484590a78c4f4885f381820cec11..0516c17ec53e8e6250a7f438052bad2cb0950414 100644
(file)
--- a/
reporting/rep707.php
+++ b/
reporting/rep707.php
@@
-9,7
+9,7
@@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =
2
;
+$page_security =
'SA_GLANALYTIC'
;
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
@@
-154,6
+154,10
@@
function print_profit_and_loss_statement()
$salesacc = 0.0;
$last = -1;
$salesacc = 0.0;
$last = -1;
+ $closeclass = false;
+ $convert = 1;
+ $ctype = 0;
+
$accounts = get_gl_accounts_all(0);
while ($account=db_fetch($accounts))
$accounts = get_gl_accounts_all(0);
while ($account=db_fetch($accounts))
@@
-187,14
+191,14
@@
function print_profit_and_loss_statement()
{
for ( ; $level >= 0, $typename[$level] != ''; $level--)
{
{
for ( ; $level >= 0, $typename[$level] != ''; $level--)
{
- if ($account['parent'] == $closing[$level] || $account['parent'] < $last)
+ if ($account['parent'] == $closing[$level] || $account['parent'] < $last
|| $account['parent'] <= 0 || $closeclass
)
{
$rep->row += 6;
$rep->Line($rep->row);
$rep->NewLine();
$rep->TextCol(0, 2, _('Total') . " " . $typename[$level]);
{
$rep->row += 6;
$rep->Line($rep->row);
$rep->NewLine();
$rep->TextCol(0, 2, _('Total') . " " . $typename[$level]);
- $rep->AmountCol(2, 3, $typeper[$level], $dec);
- $rep->AmountCol(3, 4, $typeacc[$level], $dec);
+ $rep->AmountCol(2, 3, $typeper[$level]
* $convert
, $dec);
+ $rep->AmountCol(3, 4, $typeacc[$level]
* $convert
, $dec);
$rep->AmountCol(4, 5, Achieve($typeper[$level], $typeacc[$level]), $pdec);
if ($graphics)
{
$rep->AmountCol(4, 5, Achieve($typeper[$level], $typeacc[$level]), $pdec);
if ($graphics)
{
@@
-216,8
+220,8
@@
function print_profit_and_loss_statement()
$rep->NewLine();
$rep->Font('bold');
$rep->TextCol(0, 2, _('Total') . " " . $classname);
$rep->NewLine();
$rep->Font('bold');
$rep->TextCol(0, 2, _('Total') . " " . $classname);
- $rep->AmountCol(2, 3, $classper, $dec);
- $rep->AmountCol(3, 4, $classacc, $dec);
+ $rep->AmountCol(2, 3, $classper
* $convert
, $dec);
+ $rep->AmountCol(3, 4, $classacc
* $convert
, $dec);
$rep->AmountCol(4, 5, Achieve($classper, $classacc), $pdec);
$rep->Font();
$salesper += $classper;
$rep->AmountCol(4, 5, Achieve($classper, $classacc), $pdec);
$rep->Font();
$salesper += $classper;
@@
-239,6
+243,7
@@
function print_profit_and_loss_statement()
$last = $account['parent'];
$typename[$level] = $account['AccountTypeName'];
$closing[$level] = $account['parent'];
$last = $account['parent'];
$typename[$level] = $account['AccountTypeName'];
$closing[$level] = $account['parent'];
+
$rep->row -= 4;
$rep->TextCol(0, 5, $account['AccountTypeName']);
$rep->row -= 4;
$rep->row -= 4;
$rep->TextCol(0, 5, $account['AccountTypeName']);
$rep->row -= 4;
@@
-246,11
+251,13
@@
function print_profit_and_loss_statement()
$rep->NewLine();
}
$classname = $account['AccountClassName'];
$rep->NewLine();
}
$classname = $account['AccountClassName'];
-
+ $ctype = $account['ClassType'];
+ $convert = get_class_type_convert($ctype);
+
if ($account['account_code'] != null)
{
if ($account['account_code'] != null)
{
- $per_balance *= -1;
- $acc_balance *= -1;
+
//
$per_balance *= -1;
+
//
$acc_balance *= -1;
for ($i = 0; $i <= $level; $i++)
{
for ($i = 0; $i <= $level; $i++)
{
@@
-262,8
+269,8
@@
function print_profit_and_loss_statement()
$rep->TextCol(0, 1, $account['account_code']);
$rep->TextCol(1, 2, $account['account_name']);
$rep->TextCol(0, 1, $account['account_code']);
$rep->TextCol(1, 2, $account['account_name']);
- $rep->AmountCol(2, 3, $per_balance, $dec);
- $rep->AmountCol(3, 4, $acc_balance, $dec);
+ $rep->AmountCol(2, 3, $per_balance
* $convert
, $dec);
+ $rep->AmountCol(3, 4, $acc_balance
* $convert
, $dec);
$rep->AmountCol(4, 5, Achieve($per_balance, $acc_balance), $pdec);
$rep->NewLine();
$rep->AmountCol(4, 5, Achieve($per_balance, $acc_balance), $pdec);
$rep->NewLine();
@@
-288,14
+295,14
@@
function print_profit_and_loss_statement()
{
for ( ; $level >= 0, $typename[$level] != ''; $level--)
{
{
for ( ; $level >= 0, $typename[$level] != ''; $level--)
{
- if ($account['parent'] == $closing[$level] || $account['parent'] < $last)
+ if ($account['parent'] == $closing[$level] || $account['parent'] < $last
|| $account['parent'] <= 0 || $closeclass
)
{
$rep->row += 6;
$rep->Line($rep->row);
$rep->NewLine();
$rep->TextCol(0, 2, _('Total') . " " . $typename[$level]);
{
$rep->row += 6;
$rep->Line($rep->row);
$rep->NewLine();
$rep->TextCol(0, 2, _('Total') . " " . $typename[$level]);
- $rep->AmountCol(2, 3, $typeper[$level], $dec);
- $rep->AmountCol(3, 4, $typeacc[$level], $dec);
+ $rep->AmountCol(2, 3, $typeper[$level]
* $convert
, $dec);
+ $rep->AmountCol(3, 4, $typeacc[$level]
* $convert
, $dec);
$rep->AmountCol(4, 5, Achieve($typeper[$level], $typeacc[$level]), $pdec);
if ($graphics)
{
$rep->AmountCol(4, 5, Achieve($typeper[$level], $typeacc[$level]), $pdec);
if ($graphics)
{
@@
-321,14
+328,14
@@
function print_profit_and_loss_statement()
$rep->Font('bold');
$rep->TextCol(0, 2, _('Total') . " " . $classname);
$rep->Font('bold');
$rep->TextCol(0, 2, _('Total') . " " . $classname);
- $rep->AmountCol(2, 3, $classper, $dec);
- $rep->AmountCol(3, 4, $classacc, $dec);
+ $rep->AmountCol(2, 3, $classper
* $convert
, $dec);
+ $rep->AmountCol(3, 4, $classacc
* $convert
, $dec);
$rep->AmountCol(4, 5, Achieve($classper, $classacc), $pdec);
$rep->NewLine(2);
$rep->TextCol(0, 2, _('Calculated Return'));
$rep->AmountCol(4, 5, Achieve($classper, $classacc), $pdec);
$rep->NewLine(2);
$rep->TextCol(0, 2, _('Calculated Return'));
- $rep->AmountCol(2, 3, $calculateper
, $dec);
- $rep->AmountCol(3, 4, $calculateacc, $dec);
+ $rep->AmountCol(2, 3, $calculateper
*-1, $dec); // always convert
+ $rep->AmountCol(3, 4, $calculateacc
* -1
, $dec);
$rep->AmountCol(4, 5, Achieve($calculateper, $calculateacc), $pdec);
if ($graphics)
{
$rep->AmountCol(4, 5, Achieve($calculateper, $calculateacc), $pdec);
if ($graphics)
{