projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improvement of Customer Detail Listing and Supplier Detail Listing (General notes...
[fa-stable.git]
/
reporting
/
rep705.php
diff --git
a/reporting/rep705.php
b/reporting/rep705.php
index 2c14360d8aa08920bebafec8f9cafb916f631bbc..395a68d34d531b142525083bfb3a6beb91049971 100644
(file)
--- a/
reporting/rep705.php
+++ b/
reporting/rep705.php
@@
-22,6
+22,7
@@
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
+include_once($path_to_root . "/admin/db/tags_db.inc");
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
@@
-71,7
+72,7
@@
function getPeriods($yr, $mo, $account, $dimension, $dimension2)
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
-function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dimension, $dimension2)
+function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dimension, $dimension2
, $tags
)
{
$ctotal = array(1 => 0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$total = array(1 => 0,0,0,0,0,0,0,0,0,0,0,0,0,0);
{
$ctotal = array(1 => 0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$total = array(1 => 0,0,0,0,0,0,0,0,0,0,0,0,0,0);
@@
-83,6
+84,11
@@
function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dime
$result = get_gl_accounts(null, null, $type);
while ($account=db_fetch($result))
{
$result = get_gl_accounts(null, null, $type);
while ($account=db_fetch($result))
{
+ if ($tags != -1 && is_array($tags) && $tags[0] != false)
+ {
+ if (!is_record_in_tags($tags, TAG_ACCOUNT, $account['account_code']))
+ continue;
+ }
$bal = getPeriods($yr, $mo, $account["account_code"], $dimension, $dimension2);
if (!$bal['per01'] && !$bal['per02'] && !$bal['per03'] && !$bal['per04'] && !$bal['per05'] &&
!$bal['per06'] && !$bal['per07'] && !$bal['per08'] && !$bal['per09'] && !$bal['per10'] &&
$bal = getPeriods($yr, $mo, $account["account_code"], $dimension, $dimension2);
if (!$bal['per01'] && !$bal['per02'] && !$bal['per03'] && !$bal['per04'] && !$bal['per05'] &&
!$bal['per06'] && !$bal['per07'] && !$bal['per08'] && !$bal['per09'] && !$bal['per10'] &&
@@
-130,7
+136,7
@@
function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dime
$rep->NewLine();
}
$rep->NewLine();
}
- $totals_arr = display_type($accounttype["id"], $accounttype["name"], $yr, $mo, $convert, $dec, $rep, $dimension, $dimension2);
+ $totals_arr = display_type($accounttype["id"], $accounttype["name"], $yr, $mo, $convert, $dec, $rep, $dimension, $dimension2
, $tags
);
for ($i = 1; $i <= 12; $i++)
{
$total[$i] += $totals_arr[$i];
for ($i = 1; $i <= 12; $i++)
{
$total[$i] += $totals_arr[$i];
@@
-167,27
+173,34
@@
function print_annual_expense_breakdown()
$year = $_POST['PARAM_0'];
$dimension = $_POST['PARAM_1'];
$dimension2 = $_POST['PARAM_2'];
$year = $_POST['PARAM_0'];
$dimension = $_POST['PARAM_1'];
$dimension2 = $_POST['PARAM_2'];
- $comments = $_POST['PARAM_3'];
- $destination = $_POST['PARAM_4'];
+ $tags = (isset($_POST['PARAM_3']) ? $_POST['PARAM_3'] : -1);
+ $comments = $_POST['PARAM_4'];
+ $orientation = $_POST['PARAM_5'];
+ $destination = $_POST['PARAM_6'];
}
else if ($dim == 1)
{
$year = $_POST['PARAM_0'];
$dimension = $_POST['PARAM_1'];
}
else if ($dim == 1)
{
$year = $_POST['PARAM_0'];
$dimension = $_POST['PARAM_1'];
- $comments = $_POST['PARAM_2'];
- $destination = $_POST['PARAM_3'];
+ $tags = (isset($_POST['PARAM_2']) ? $_POST['PARAM_2'] : -1);
+ $comments = $_POST['PARAM_3'];
+ $orientation = $_POST['PARAM_4'];
+ $destination = $_POST['PARAM_5'];
}
else
{
$year = $_POST['PARAM_0'];
}
else
{
$year = $_POST['PARAM_0'];
- $comments = $_POST['PARAM_1'];
- $destination = $_POST['PARAM_2'];
+ $tags = (isset($_POST['PARAM_1']) ? $_POST['PARAM_1'] : -1);
+ $comments = $_POST['PARAM_2'];
+ $orientation = $_POST['PARAM_3'];
+ $destination = $_POST['PARAM_4'];
}
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
}
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
+ $orientation = ($orientation ? 'L' : 'P');
$dec = 1;
//$pdec = user_percent_dec();
$dec = 1;
//$pdec = user_percent_dec();
@@
-237,7
+250,8
@@
function print_annual_expense_breakdown()
'from' => get_dimension_string($dimension), 'to' => ''),
3 => array('text' => _("Dimension")." 2",
'from' => get_dimension_string($dimension2), 'to' => ''),
'from' => get_dimension_string($dimension), 'to' => ''),
3 => array('text' => _("Dimension")." 2",
'from' => get_dimension_string($dimension2), 'to' => ''),
- 4 => array('text' => _('Info'), 'from' => _('Amounts in thousands'),
+ 4 => array('text' => _('Tags'), 'from' => get_tag_names($tags), 'to' => ''),
+ 5 => array('text' => _('Info'), 'from' => _('Amounts in thousands'),
'to' => ''));
}
else if ($dim == 1)
'to' => ''));
}
else if ($dim == 1)
@@
-247,7
+261,8
@@
function print_annual_expense_breakdown()
'from' => $year, 'to' => ''),
2 => array('text' => _('Dimension'),
'from' => get_dimension_string($dimension), 'to' => ''),
'from' => $year, 'to' => ''),
2 => array('text' => _('Dimension'),
'from' => get_dimension_string($dimension), 'to' => ''),
- 3 => array('text' => _('Info'), 'from' => _('Amounts in thousands'),
+ 3 => array('text' => _('Tags'), 'from' => get_tag_names($tags), 'to' => ''),
+ 4 => array('text' => _('Info'), 'from' => _('Amounts in thousands'),
'to' => ''));
}
else
'to' => ''));
}
else
@@
-255,15
+270,18
@@
function print_annual_expense_breakdown()
$params = array( 0 => $comments,
1 => array('text' => _("Year"),
'from' => $year, 'to' => ''),
$params = array( 0 => $comments,
1 => array('text' => _("Year"),
'from' => $year, 'to' => ''),
- 2 => array('text' => _('Info'), 'from' => _('Amounts in thousands'),
+ 2 => array('text' => _('Tags'), 'from' => get_tag_names($tags), 'to' => ''),
+ 3 => array('text' => _('Info'), 'from' => _('Amounts in thousands'),
'to' => ''));
}
'to' => ''));
}
- $rep = new FrontReport(_('Annual Expense Breakdown'), "AnnualBreakDown", user_pagesize());
+ $rep = new FrontReport(_('Annual Expense Breakdown'), "AnnualBreakDown", user_pagesize(), 9, $orientation);
+ if ($orientation == 'L')
+ recalculate_cols($cols);
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
- $rep->
Header
();
+ $rep->
NewPage
();
$sales = Array(1 => 0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$sales = Array(1 => 0,0,0,0,0,0,0,0,0,0,0,0,0,0);
@@
-283,7
+301,8
@@
function print_annual_expense_breakdown()
$typeresult = get_account_types(false, $class['cid'], -1);
while ($accounttype=db_fetch($typeresult))
{
$typeresult = get_account_types(false, $class['cid'], -1);
while ($accounttype=db_fetch($typeresult))
{
- $classtotal = display_type($accounttype["id"], $accounttype["name"], $yr, $mo, $convert, $dec, $rep, $dimension, $dimension2);
+ $classtotal = display_type($accounttype["id"], $accounttype["name"], $yr, $mo, $convert, $dec, $rep, $dimension,
+ $dimension2, $tags);
for ($i = 1; $i <= 12; $i++)
$ctotal[$i] += $classtotal[$i];
}
for ($i = 1; $i <= 12; $i++)
$ctotal[$i] += $classtotal[$i];
}