else
{
$demo_text = _("Please login here");
- if (@$SysPrefs->allow_password_reset) {
- $demo_text .= " "._("or")." <a href='$path_to_root/index.php?reset=1'>"._("request new password")."</a>";
- }
+ if (@$SysPrefs->allow_password_reset) {
+ $demo_text .= " "._("or")." <a href='$path_to_root/index.php?reset=1'>"._("request new password")."</a>";
+ }
}
if (check_faillog())
echo "</select>\n";
echo "</td></tr>";
} else {
-// $coy = $def_coy;
text_row(_("Company"), "company_login_nickname", "", 20, 50);
}
start_row();
text_row(_("Email"), "email_entry_field", "", 20, 30);
- $coy = user_company();
- if (!isset($coy))
- $coy = $def_coy;
- if (!@$SysPrefs->text_company_selection) {
- echo "<tr><td>"._("Company")."</td><td><select name='company_login_name'>\n";
- for ($i = 0; $i < count($db_connections); $i++)
- echo "<option value=$i ".($i==$coy ? 'selected':'') .">" . $db_connections[$i]["name"] . "</option>";
- echo "</select>\n";
- echo "</td></tr>";
- } else {
-// $coy = $def_coy;
- text_row(_("Company"), "company_login_nickname", "", 20, 50);
- }
- start_row();
- label_cell("Please enter your e-mail", "colspan=2 align='center' id='log_msg'");
- end_row();
+ $coy = user_company();
+ if (!isset($coy))
+ $coy = $def_coy;
+ if (!@$SysPrefs->text_company_selection) {
+ echo "<tr><td>"._("Company")."</td><td><select name='company_login_name'>\n";
+ for ($i = 0; $i < count($db_connections); $i++)
+ echo "<option value=$i ".($i==$coy ? 'selected':'') .">" . $db_connections[$i]["name"] . "</option>";
+ echo "</select>\n";
+ echo "</td></tr>";
+ } else {
+ text_row(_("Company"), "company_login_nickname", "", 20, 50);
+ }
+ start_row();
+ label_cell("Please enter your e-mail", "colspan=2 align='center' id='log_msg'");
+ end_row();
end_table(1);
echo "<center><input type='submit' value=' "._("Send password -->")." ' name='SubmitReset'
onclick='set_fullmode();'></center>\n";
$type = ($row['filetype']) ? $row['filetype'] : 'application/octet-stream';
header("Content-type: ".$type);
header('Content-Length: '.$row['filesize']);
- //if ($type == 'application/octet-stream')
- // header('Content-Disposition: attachment; filename='.$row['filename']);
- //else
- header("Content-Disposition: inline");
+ header("Content-Disposition: inline");
echo file_get_contents(company_path(). "/attachments/".$row['unique_name']);
exit();
}
elseif ($Mode == 'ADD_ITEM' && !isset($_FILES['filename']))
display_error(_("Select attachment file."));
elseif ($Mode == 'ADD_ITEM' && ($_FILES['filename']['error'] > 0)) {
- if ($_FILES['filename']['error'] == UPLOAD_ERR_INI_SIZE)
- display_error(_("The file size is over the maximum allowed."));
- else
- display_error(_("Select attachment file."));
- }
+ if ($_FILES['filename']['error'] == UPLOAD_ERR_INI_SIZE)
+ display_error(_("The file size is over the maximum allowed."));
+ else
+ display_error(_("Select attachment file."));
+ }
else {
//$content = base64_encode(file_get_contents($_FILES['filename']['tmp_name']));
$tmpname = $_FILES['filename']['tmp_name'];
}
$err = remove_connection($id);
if ($err == 0)
- display_error(_("Error removing Database: ") . $dbase . _(", please remove it manually"));
+ display_error(_("Error removing Database: ") . $id . _(", please remove it manually"));
if ($def_coy == $id)
$def_coy = 0;
if ($new)
$tb_pref_counter++;
- $n = count($db_connections);
$msg = "<?php\n\n";
$msg .= "/*Connection Information for the database\n";
$msg .= "\$def_coy - the default company that is pre-selected on login\n\n";
global $path_to_root, $installed_languages, $dflt_lang;
$installed_languages = array_natsort($installed_languages, 'code', 'code');
- $n = count($installed_languages);
$msg = "<?php\n\n";
$msg .= "/* How to make new entries here for non-packaged languages:\n\n";
$out.="\n";
}
- //$out.="use ".$db.";\n"; we don't use this option.
-
if (db_fixed())
{
db_set_encoding();
$out.="DROP TABLE IF EXISTS `".$tablename."`;\n\n";
$out.=$table_sql[$tablename];
- // add auto_increment value
-// if ($auto_incr[$tablename])
-// $out.=" AUTO_INCREMENT=".$auto_incr[$tablename];
$out.=" ;";
$out.="\n\n";
return false;
}
- //if ($zip == "zip")
- // $zip = $time;
if (save_to_file($backupfile, $zip, $out))
{
$out = "";
db_query($sql, "could not delete user $id");
}
-//-----------------------------------------------------------------------------------------------
-//
-// Obsolete, to be removed in 2.4. This function as been spleet into get_user_auth/get_user_by_login
-// in FA 2.3.6
-//
-function get_user_for_login($user_id, $password)
-{
- set_global_connection();
-
-// do not exclude inactive records or you lost access after source upgrade
-// on sites using pre 2.2 database
- $sql = "SELECT * FROM ".TB_PREF."users WHERE user_id = ".db_escape($user_id)." AND"
- ." password=".db_escape($password);
-
- return db_query($sql, "could not get validate user login for $user_id");
-}
-
//-----------------------------------------------------------------------------------------------
function get_user_auth($user_id, $password)
if ($result)
$this->log_error(_("Upgrade failed. Original database content restored successfully."), 'Info');
else
- $thi->log_error(sprintf(_("Database restore operation failed. Original database content is in %s file."), $this->backup));
+ $this->log_error(sprintf(_("Database restore operation failed. Original database content is in %s file."), $this->backup));
$this->post_fail($this->cur_company);
}
} else {
alt_table_row_color($k);
-// label_cell(is_array($ext['Descr']) ? $ext['Descr'][0] : $ext['Descr']);
label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']);
label_cell($id === null ? _("None") :
alt_table_row_color($k);
-// label_cell(is_array($ext['Descr']) ? $ext['Descr'][0] : $ext['Descr']);
label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']);
label_cell($id === null ? _("None") :
$th = array(_("Company"), _("Table set"), _("Current version"), _("Last log"), _('Upgrade'));
start_table(TABLESTYLE);
table_header($th);
+$k = 0; //row colour counter
$uptodate = true;
foreach($site_status as $i => $comp)
function get_reports() {
global $path_to_root, $SysPrefs;
-if ($SysPrefs->go_debug || !isset($_SESSION['reports'])) {
+ if ($SysPrefs->go_debug || !isset($_SESSION['reports'])) {
// to save time, store in session.
$paths = array (
$path_to_root.'/reporting/',
company_path(). '/reporting/');
$reports = array( '' => _('Default printing destination'));
- foreach($paths as $dirno => $path) {
- $repdir = opendir($path);
- while(false !== ($fname = readdir($repdir)))
- {
- // reports have filenames in form rep(repid).php
- // where repid must contain at least one digit (reports_main.php is not ;)
- if (is_file($path.$fname)
-// && preg_match('/.*[^0-9]([0-9]+)[.]php/', $fname, $match))
- && preg_match('/rep(.*[0-9]+.*)[.]php/', $fname, $match))
+ foreach($paths as $dirno => $path) {
+ $repdir = opendir($path);
+ while(false !== ($fname = readdir($repdir)))
{
- $repno = $match[1];
- $title = '';
-
- $line = file_get_contents($path.$fname);
- if (preg_match('/.*(FrontReport\()\s*_\([\'"]([^\'"]*)/', $line, $match)) {
- $title = trim($match[2]);
- }
- else // for any 3rd party printouts without FrontReport() class use
+ // reports have filenames in form rep(repid).php
+ // where repid must contain at least one digit (reports_main.php is not ;)
+ if (is_file($path.$fname)
+ && preg_match('/rep(.*[0-9]+.*)[.]php/', $fname, $match))
+ {
+ $repno = $match[1];
+ $title = '';
+
+ $line = file_get_contents($path.$fname);
+ if (preg_match('/.*(FrontReport\()\s*_\([\'"]([^\'"]*)/', $line, $match)) {
+ $title = trim($match[2]);
+ }
+ else // for any 3rd party printouts without FrontReport() class use
if (preg_match('/.*(\$Title).*[\'"](.*)[\'"].+/', $line, $match)) {
$title = trim($match[2]);
}
- $reports[$repno] = $title;
+ $reports[$repno] = $title;
+ }
}
+ closedir();
}
- closedir();
- }
ksort($reports);
$_SESSION['reports'] = $reports;
}
function check_delete($name)
{
-// check if selected profile is used by any user
+ // check if selected profile is used by any user
if ($name=='') return 0; // cannot delete system default profile
return key_in_foreign_table($name, 'users', 'print_profile');
}
$prof[$rep] = $val;
}
if ($_POST['profile_id']=='')
- $_POST['profile_id'] = get_post('name');
+ $_POST['profile_id'] = get_post('name');
update_printer_profile($_POST['profile_id'], $prof);
if ($selected_id == '') {
if(get_post('delete'))
{
- if (!check_delete(get_post('name'))) {
- delete_printer_profile($selected_id);
- display_notification(_('Selected printing profile has been deleted'));
- clear_form();
- }
+ if (!check_delete(get_post('name'))) {
+ delete_printer_profile($selected_id);
+ display_notification(_('Selected printing profile has been deleted'));
+ clear_form();
+ }
}
if(get_post('_profile_id_update')) {
$row = get_security_role($id);
$_POST['description'] = $row['description'];
$_POST['name'] = $row['role'];
-// if ($row['inactive']
-// $_POST['inactive'] = 1;
-
$_POST['inactive'] = $row['inactive'];
$access = $row['areas'];
$sections = $row['sections'];
$ext = $newext;
$sec = $newsec;
$m = $parms[0] & ~0xff;
-// if(!isset($security_sections[$m]))
-// display_error(sprintf("Bad section %X:", $m));
label_row($security_sections[$m].':',
checkbox( null, 'Section'.$m, null, true,
_("On/off set of features")),
return false;
case ST_COSTUPDATE : // it's a stock cost update
return false;
- break;
}
return true;
{
display_error(_("The selected transaction was closed for edition and cannot be voided."));
set_focus('trans_no');
- return;
+ return false;
}
if (!is_date($_POST['date_']))
{
define('MENU_SETTINGS', 'menu_settings');
define('MENU_SYSTEM', 'menu_system');
- class menu_item
+ class menu_item
{
var $label;
var $link;
var $label;
var $link;
var $access;
- var $category;
+ var $category;
function app_function($label,$link,$access='SA_OPEN',$category='')
{
function add_lapp_function($label,$link="",$access='SA_OPEN',$category='')
{
$appfunction = new app_function($label,$link,$access,$category);
- //array_push($this->lappfunctions,$appfunction);
$this->lappfunctions[] = $appfunction;
return $appfunction;
}
function add_rapp_function($label,$link="",$access='SA_OPEN',$category='')
{
$appfunction = new app_function($label,$link,$access,$category);
- //array_push($this->rappfunctions,$appfunction);
$this->rappfunctions[] = $appfunction;
return $appfunction;
}
function add_module($name, $icon = null)
{
$module = new module($name,$icon);
- //array_push($this->modules,$module);
$this->modules[] = $module;
return $module;
}
//
function report_class_url($class)
{
- global $installed_extensions;
-
- // TODO : konwencja lub ?
- $classno = 7;
-// if (file_exists($path_to_root.'/'.$mod['path'].'/'.$entry['url']
-// .'/'.'reporting/reports_custom.php'))
- return "reporting/reports_main.php?Class=".$class;
-// else
-// return '';
+ return "reporting/reports_main.php?Class=".$class;
}
}
$Ajax->addDisable(true, 'OpenOnly', $disable);
if ($disable) {
-// $Ajax->addFocus(true, 'OrderNumber');
set_focus('OrderNumber');
} else
set_focus('type_');
function edit_link($row)
{
- //return $row["closed"] ? '' :
- // pager_link(_("Edit"),
- // "/dimensions/dimension_entry.php?trans_no=" . $row["id"], ICON_EDIT);
return pager_link(_("Edit"),
"/dimensions/dimension_entry.php?trans_no=" . $row["id"], ICON_EDIT);
}
$amount_bank = $amount;
$amount_bank = round2($amount_bank, user_price_dec());
- // Also store the rate to the home
- //$BankToHomeCurrencyRate = get_exchange_rate_to_home_currency($bank_account_currency, $date_);
-
$sql = "INSERT INTO ".TB_PREF."bank_trans (type, trans_no, bank_act, ref,
trans_date, amount, person_type_id, person_id) ";
SET amount=0
WHERE type=".db_escape($type)." AND trans_no=".db_escape($type_no);
- $result = db_query($sql, "could not void bank transactions for type=$type and trans_no=$type_no");
+ db_query($sql, "could not void bank transactions for type=$type and trans_no=$type_no");
void_gl_trans($type, $type_no, true);
// We have to calculate all the currency accounts belonging to the GL account
// upto $date_ and calculate with the exchange rates. And then compare with the GL account balance.
- // 2010-02-23 Joe Hunt with help of Ary Wibowo
- $sql = "SELECT SUM(bt.amount) AS for_amount, ba.bank_curr_code
+ $sql = "SELECT SUM(bt.amount) AS for_amount, ba.bank_curr_code
FROM ".TB_PREF."bank_trans bt, ".TB_PREF."bank_accounts ba
WHERE ba.id = bt.bank_act AND ba.account_code = ".db_escape($account)." AND bt.trans_date<='".date2sql($date_)."'
- GROUP BY ba.bank_curr_code";
+ GROUP BY ba.bank_curr_code";
$result = db_query($sql, "Transactions for bank account $acc_id could not be calculated");
while ($row = db_fetch($result))
{
$trans_no = get_next_trans_no(ST_JOURNAL);
$ref = $Refs->get_next(ST_JOURNAL);
- add_journal(ST_JOURNAL, $trans_no, $diff, $date_ , $currency, $ref, '', $rate, $date_, $date_);
+ add_journal(ST_JOURNAL, $trans_no, $diff, $date_ , get_company_currency(), $ref, '', 1, $date_, $date_);
$Refs->save(ST_JOURNAL, $trans_no, $ref);
add_audit_trail(ST_JOURNAL, $trans_no, $date_);
- add_comments(ST_JOURNAL, $trans_no, $date_, $memo);
if ($person_type_id == null)
$person_type_id = PT_MISC;
add_gl_trans(ST_JOURNAL, $trans_no, $date_, $account, 0, 0, _("Exchange Variance"),
$diff, null, $person_type_id, $person_id);
- // positive change in value is positive variance for AR and bank accounts, and negative for AP
- $variance_act = ($diff < 0 && $person_id==PT_SUPPLIER) || ($diff > 0 && $person_id != PT_SUPPLIER)
- ? 'exchange_diff_act' : 'exchange_diff_neg_act';
add_gl_trans(ST_JOURNAL, $trans_no, $date_, get_company_pref('exchange_diff_act'), 0, 0,
_("Exchange Variance"), -$diff, null, $person_type_id, $person_id);
commit_transaction();
return false;
}
-//------------- New helper functions for revaluation of customer/supplier currencies 2011-05-08 Joe Hunt.
function add_cust_supp_revaluation($ledger_act, $ex_act, $date, $amount, $person_type_id, $person_id, $memo)
{
global $Refs;
$trans_no = get_next_trans_no(ST_JOURNAL);
$ref = $Refs->get_next(ST_JOURNAL);
- add_journal(ST_JOURNAL, $trans_no, $amount, $date, $currency, $ref, '', $rate, $date, $date);
+ add_journal(ST_JOURNAL, $trans_no, $amount, $date, get_company_currency(), $ref, '', 1, $date, $date);
$Refs->save(ST_JOURNAL, $trans_no, $ref);
add_audit_trail(ST_JOURNAL, $trans_no, $date);
$amount, $target_amount=0)
{
$dbResult = get_bank_trans(ST_BANKTRANSFER, $trans_no);
- if (2 != db_num_rows($dbResult)) {
- // How are errors handled? Throw an exception would be nice. CP 2014-10
- }
$old_from = db_fetch($dbResult);
$old_to = db_fetch($dbResult);
{
if (is_company_currency($curr_code))
display_db_error("Exchange rates cannot be set for company currency", "", true);
-
+
$date = date2sql($date_);
-
+
$sql = "UPDATE ".TB_PREF."exchange_rates SET rate_buy=$buy_rate, rate_sell=".db_escape($sell_rate)
." WHERE curr_code=".db_escape($curr_code)." AND date_='$date'";
-
+
db_query($sql, "could not add exchange rate for $curr_code");
}
display_db_error("Exchange rates cannot be set for company currency", "", true);
$date = date2sql($date_);
-
+
$sql = "INSERT INTO ".TB_PREF."exchange_rates (curr_code, date_, rate_buy, rate_sell)
VALUES (".db_escape($curr_code).", '$date', ".db_escape($buy_rate)
.", ".db_escape($sell_rate).")";
{
$filename = "/d/quotes.csv?s={$curr_a}{$curr_b}=X&f=sl1d1t1ba&e=.csv"; // new URL's for YAHOO
$site = "download.finance.yahoo.com";
- //$filename = "/q?s={$curr_a}{$curr_b}=X"; // Let old code be here for a while, Joe.
- //$site = "finance.yahoo.com";
}
elseif ($provider == 'GOOGLE')
{
{ // first check with curl as we can set short timeout;
$retry = 1;
do {
- $ch = curl_init();
- curl_setopt ($ch, CURLOPT_URL, 'http://'.$site.$filename);
- curl_setopt ($ch, CURLOPT_COOKIEJAR, "$path_to_root/tmp/cookie.txt");
- curl_setopt ($ch, CURLOPT_HEADER, 0);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- // prevent warning while safe_mode/open_basedir on (redireciton doesn't occur at least on ECB page)
- if (!ini_get('safe_mode') && !ini_get('open_basedir'))
- curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt ($ch, CURLOPT_TIMEOUT, 3);
- $contents = curl_exec ($ch);
- curl_close($ch);
+ $ch = curl_init();
+ curl_setopt ($ch, CURLOPT_URL, 'http://'.$site.$filename);
+ curl_setopt ($ch, CURLOPT_COOKIEJAR, "$path_to_root/tmp/cookie.txt");
+ curl_setopt ($ch, CURLOPT_HEADER, 0);
+ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
+ // prevent warning while safe_mode/open_basedir on (redireciton doesn't occur at least on ECB page)
+ if (!ini_get('safe_mode') && !ini_get('open_basedir'))
+ curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
+ curl_setopt ($ch, CURLOPT_TIMEOUT, 3);
+ $contents = curl_exec ($ch);
+ curl_close($ch);
// due to resolver bug in some curl versions (e.g. 7.15.5)
// try again for constant IP.
- $site="172.230.157.137";
- } while( ($contents == '') && $retry--);
+ $site="172.230.157.137";
+ } while( ($contents == '') && $retry--);
} else {
$contents = url_get_contents("http://".$site.$filename);
$val = $array[1];
if ($val != 0)
$val = 1 / $val;
- /* Let old code be here for a while, Joe.
- //if (preg_match('/Last\sTrade:(.*?)Trade\sTime/s', $contents, $matches)) {
- $val = strip_tags($matches[1]);
- $val = str_replace(',', '', $val);
- if ($val != 0)
- $val = 1 / $val;
- }
- */
}
elseif ($provider == 'GOOGLE')
{
FROM ".TB_PREF."exchange_rates "
."WHERE curr_code=".db_escape($curr)."
ORDER BY date_ DESC";
- return $sql;
+ return $sql;
}
if(!$tax_type) return; // $gl_code is not tax account
$tax = get_tax_type($tax_type);
- //if ($gl_code == $tax['sales_gl_code'])
if ($trans_type == ST_SALESINVOICE || $trans_type == ST_CUSTDELIVERY || $trans_type == ST_CUSTCREDIT)
$amount = -$amount;
// we have to restore net amount as we cannot know the base amount
if ($net_amount===null) {
if ($tax['rate'] == 0) {
-// display_warning(_("You should not post gl transactions
-// to tax account with zero tax rate."));
$net_amount = 0;
} else {
// calculate net amount
$sql = "UPDATE ".TB_PREF."journal SET amount=0
WHERE type=".db_escape($type)." AND trans_no=".db_escape($type_no);
- $result = db_query($sql, "could not void journal transaction for type=$type and trans_no=$type_no");
+ db_query($sql, "could not void journal transaction for type=$type and trans_no=$type_no");
void_bank_trans($type, $type_no, true);
-// void_gl_trans($type, $type_no, true); // this is done above
-// void_trans_tax_details($type, $type_no); // ditto
-// void_supp_allocations($type, $type_no); // ditto
-// void_cust_allocations($type, $type_no); // ditto
-
if ($use_transaction)
commit_transaction();
}
***********************************************************************/
function display_bank_header(&$order)
{
- global $Ajax, $Refs;
+ global $Ajax;
$payment = $order->trans_type == ST_BANKPAYMENT;
$customer_error = false;
text_row_ex($payment ?_("To the Order of:"):_("Name:"),
'person_id', 40, 50);
break;
- //case PT_WORKORDER :
- // workorders_list_row(_("Work Order:"), 'person_id', null);
- // break;
case PT_SUPPLIER :
supplier_list_row(_("Supplier:"), 'person_id', null, false, true, false, true);
break;
amount_row($qid['base_desc'].":", 'totamount', price_format($qid['base_amount']),
null, " ".submit('go', _("Go"), false, false, true));
break;
- //case payment_person_types::Project() :
- // dimensions_list_row(_("Dimension:"), 'person_id', $_POST['person_id'], false, null, true);
- // break;
}
table_section(3, "33%");
if ($dim == 2)
$th = array(_("Account Code"), _("Account Description"), _("Dimension")." 1",
_("Dimension")." 2", _("Amount"), _("Memo"), "");
- else if ($dim == 1)
+ elseif ($dim == 1)
$th = array(_("Account Code"), _("Account Description"), _("Dimension"),
_("Amount"), _("Memo"), "");
else
label_cell(get_dimension_string($item->dimension_id, true));
if ($dim > 1)
label_cell(get_dimension_string($item->dimension2_id, true));
- //amount_cell(abs($item->amount));
if ($order->trans_type == ST_BANKDEPOSIT)
amount_cell(-$item->amount);
else
$_POST['amount'] = price_format(0);
$_POST['dimension_id'] = 0;
$_POST['dimension2_id'] = 0;
- //$_POST['LineMemo'] = ""; // let memo go to next line Joe Hunt 2010-05-30
if(isset($_POST['_code_id_update'])) {
$Ajax->activate('code_id');
}
$acc = get_supplier_accounts($_POST['person_id']);
$_POST['code_id'] = $acc['payable_account'];
}
- //elseif ($_POST['PayType'] == PT_WORKORDER)
- // $_POST['code_id'] = get_company_pref('default_assembly_act');
else {
$_POST['code_id'] =
get_company_pref($payment ? 'default_cogs_act':'default_inv_sales_act');
if ($dim == 2)
$th = array(_("Account Code"), _("Account Description"), _("Dimension")." 1",
_("Dimension")." 2", _("Debit"), _("Credit"), _("Memo"), "");
- else if ($dim == 1)
+ elseif ($dim == 1)
$th = array(_("Account Code"), _("Account Description"), _("Dimension"),
_("Debit"), _("Credit"), _("Memo"), "");
else
$parent1 = $acctype1["parent"];
if ($drilldown && $parent1 == $_POST["AccGrp"])
//END Patch#2
- //elseif ($drilldown && $type != $_POST["AccGrp"])
{
$url = "<a href='$path_to_root/gl/inquiry/balance_sheet.php?TransFromDate="
. $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
$lclose = 0.0;
$calculateclose = 0.0;
- $parent = -1;
-
//Get classes for BS
$classresult = get_account_classes(false, 1);
$classclose = 0.0;
$convert = get_class_type_convert($class["ctype"]);
$ctype = $class["ctype"];
- $classname = $class["class_name"];
//Print Class Name
table_section_title($class["class_name"]);
//Get Account groups/types under this group/type
$typeresult = get_account_types(false, $class['cid'], -1);
-
+
+ $k = 0;
while ($accounttype=db_fetch($typeresult))
{
$TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to,
if ($dim == 2)
$dim_cols = array(_("Dimension")." 1", _("Dimension")." 2");
- else if ($dim == 1)
+ elseif ($dim == 1)
$dim_cols = array(_("Dimension"));
else
$dim_cols = array();
}
}
- //$prev = get_balance(null, $begin, $_POST['TransFromDate'], false, false);
- //$curr = get_balance(null, $_POST['TransFromDate'], $_POST['TransToDate'], true, true);
- //$tot = get_balance(null, $begin, $_POST['TransToDate'], false, true);
if (!check_value('Balance'))
{
start_row("class='inquirybg' style='font-weight:bold'");
//----------------------------------------------------------------------------------------------------
function display_type ($type, $typename, $from, $to, $begin, $end, $compare, $convert,
- &$dec, &$pdec, &$rep, $dimension=0, $dimension2=0, $drilldown, $path_to_root)
+ $dimension=0, $dimension2=0, $drilldown, $path_to_root)
{
global $levelptr, $k;
while ($accounttype=db_fetch($result))
{
$totals_arr = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end,
- $compare, $convert, $dec, $pdec, $rep, $dimension, $dimension2, $drilldown, $path_to_root);
+ $compare, $convert, $dimension, $dimension2, $drilldown, $path_to_root);
$per_balance_total += $totals_arr[0];
$acc_balance_total += $totals_arr[1];
}
else
$drilldown = 0; // Root level
- $dec = 0;
- $pdec = user_percent_dec();
-
if ($compare == 0 || $compare == 2)
{
$end = $to;
if (!$drilldown) //Root Level
{
- $parent = -1;
- $classper = 0.0;
- $classacc = 0.0;
$salesper = 0.0;
$salesacc = 0.0;
//Get Account groups/types under this group/type
$typeresult = get_account_types(false, $class['cid'], -1);
+ $k = 0; // row color
while ($accounttype=db_fetch($typeresult))
{
$TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end, $compare, $convert,
- $dec, $pdec, $rep, $dimension, $dimension2, $drilldown, $path_to_root);
+ $dimension, $dimension2, $drilldown, $path_to_root);
$class_per_total += $TypeTotal[0];
$class_acc_total += $TypeTotal[1];
echo $tableheader;
$classtotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end, $compare, $convert,
- $dec, $pdec, $rep, $dimension, $dimension2, $drilldown, $path_to_root);
+ $dimension, $dimension2, $drilldown, $path_to_root);
}
function show_results()
{
- global $path_to_root;
-
/*Now get the transactions */
div_start('trans_tbl');
start_table(TABLESTYLE);
table_header($th);
$k = 0;
$total = 0;
- $bdate = date2sql($_POST['TransFromDate']);
- $edate = date2sql($_POST['TransToDate']);
$taxes = get_tax_summary($_POST['TransFromDate'], $_POST['TransToDate']);