X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep706.php;h=1ef4a9d72bc7877f3eb8783fd3baec3f1aa6abcc;hb=5040e3d0e0f8f5d6d08e0121f12308320abaa6c2;hp=91261cf8dab5a04b9a9cced5f3062ea71173e814;hpb=1a5b277431e6804654cbca16aaed5ee3a5a729eb;p=fa-stable.git diff --git a/reporting/rep706.php b/reporting/rep706.php index 91261cf8..1ef4a9d7 100644 --- a/reporting/rep706.php +++ b/reporting/rep706.php @@ -9,7 +9,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 2; +$page_security = 'SA_GLANALYTIC'; // ---------------------------------------------------------------- // $ Revision: 2.0 $ // Creator: Joe Hunt @@ -112,6 +112,12 @@ function print_balance_sheet() $assetsopen = 0.0; $assetsperiod = 0.0; $assetsclose = 0.0; + $equityopen = 0.0; + $equityperiod = 0.0; + $equityclose = 0.0; + $lopen = 0.0; + $lperiod = 0.0; + $lclose = 0.0; $typeopen = array(0,0,0,0,0,0,0,0,0,0); $typeperiod = array(0,0,0,0,0,0,0,0,0,0); @@ -123,6 +129,7 @@ function print_balance_sheet() $last = -1; $closeclass = false; + $ctype = 0; $convert = 1; $rep->NewLine(); @@ -157,7 +164,7 @@ function print_balance_sheet() { 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) { $rep->row += 6; $rep->Line($rep->row); @@ -189,6 +196,18 @@ function print_balance_sheet() $rep->AmountCol(3, 4, $classperiod * $convert, $dec); $rep->AmountCol(4, 5, $classclose * $convert, $dec); $rep->Font(); + if ($ctype == CL_EQUITY) + { + $equityopen += $classopen; + $equityperiod += $classperiod; + $equityclose += $classclose; + } + if ($ctype == CL_LIABILITIES) + { + $lopen += $classopen; + $lperiod += $classperiod; + $lclose += $classclose; + } $assetsopen += $classopen; $assetsperiod += $classperiod; $assetsclose += $classclose; @@ -215,8 +234,9 @@ function print_balance_sheet() $rep->Line($rep->row); $rep->NewLine(); } - $convert = get_account_class_convert($account['ClassID']); $classname = $account['AccountClassName']; + $ctype = $account['ClassType']; + $convert = get_class_type_convert($ctype); if ($account['account_code'] != null) { @@ -254,11 +274,14 @@ function print_balance_sheet() } if ($account['AccountTypeName'] != $typename[$level]) { + //$rep->NewLine(); + //$rep->TextCol(0, 5, "type = ".$account['AccountType'].", level = $level, closing[0]-[1]-[2]-[3] = ".$closing[0]." ".$closing[1]." ".$closing[2]." ".$closing[3]." type[parent] = ".$account['parent']." last = ".$last); + //$rep->NewLine(); if ($typename[$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) { $rep->row += 6; $rep->Line($rep->row); @@ -284,6 +307,12 @@ function print_balance_sheet() $calculateopen = -$assetsopen - $classopen; $calculateperiod = -$assetsperiod - $classperiod; $calculateclose = -$assetsclose - $classclose; + if ($ctype == CL_EQUITY) + { + $equityopen += $classopen; + $equityperiod += $classperiod; + $equityclose += $classclose; + } $rep->row += 6; $rep->Line($rep->row); $rep->NewLine(); @@ -304,6 +333,18 @@ function print_balance_sheet() $rep->AmountCol(4, 5, -$assetsclose * $convert, $dec); $rep->Font(); $rep->NewLine(); + if ($equityopen != 0.0 || $equityperiod != 0.0 || $equityclose != 0.0 || + $lopen != 0.0 || $lperiod != 0.0 || $lclose != 0.0) + { + $rep->NewLine(); + $rep->Font('bold'); + $rep->TextCol(0, 2, _('Total') . " " . _('Liabilities') . _(' and ') . _('Equities')); + $rep->AmountCol(2, 3, ($lopen + $equityopen + $calculateopen) * -1, $dec); + $rep->AmountCol(3, 4, ($lperiod + $equityperiod + $calculateperiod) * -1, $dec); + $rep->AmountCol(4, 5, ($lclose + $equityclose + $calculateclose) * -1, $dec); + $rep->Font(); + $rep->NewLine(); + } } } }