Thanks Janusz for the clarification:
Maybe the temporary variable name $void_entry is misleading, but the
codelogic is right. The voiding action is abandoned if the selected
transaction has been voided before.Janusz
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Posts by apmuthu
Thanks Janusz for the clarification:
Maybe the temporary variable name $void_entry is misleading, but the
codelogic is right. The voiding action is abandoned if the selected
transaction has been voided before.Janusz
In the file admin/void_transaction.php, lines 271-302 are:
function handle_void_transaction()
{
if (check_valid_entries()==true)
{
$void_entry = get_voided_entry($_POST['filterType'], $_POST['trans_no']);
if ($void_entry != null)
{
display_error(_("The selected transaction has already been voided."), true);
unset($_POST['trans_no']);
unset($_POST['memo_']);
unset($_POST['date_']);
set_focus('trans_no');
return;
}
$ret = void_transaction($_POST['filterType'], $_POST['trans_no'],
$_POST['date_'], $_POST['memo_']);
if ($ret)
{
display_notification_centered(_("Selected transaction has been voided."));
unset($_POST['trans_no']);
unset($_POST['memo_']);
unset($_POST['date_']);
}
else {
display_error(_("The entered transaction does not exist or cannot be voided."));
set_focus('trans_no');
}
}
}
Shouldn't the second if condition have it's logic inverted?
The line above:
if ($void_entry != null)
will probably need to become
if ($void_entry == null)
This should actually mean that unless there are entries to be voided, do not attempt to void any (since none exist).
However, in @dedode's case, he must find out why a "missing" transaction was sought to be voided in the first place! Possibly attempting to void an already voided transaction - using the back button in the browser and re-submitting it or some browser cache issue.......
A slightly rehashed Italian SQL (need to choose the accounts for setup defaults) that you can start with.
Hope you are not using Lira.....
Since Euro is used by most EU countries, take any of their Chart of Accounts from the repo and translate the head of accounts.....
All Extensions/Languages/Themes/Charts are expanded out and placed in my unofficial GitHub Repo. Place the resultant translated file by naming it like chart_it_IT-general-2.3.18-1.sql and place it in the sql folder.
Void Invoice and then make a new one.
or
Make sales orders instead of direct invoices and then let the staff edit them and proceed to convert them into delivery orders and invoices thereafter.
The installed_extensions.php determines the default company - do not make the default company the active company for real accounts.
Also hide links in config file setting for inaccessible menu items.
Any change in browser / browser version since it last worked?
The link was provided only for an insight into what it does. Yes, as Elax says, install from within FA unless you follow the wiki to manually install it.
Use different table prefixes if you want to install into the same database. Since you are running WAMP in your own machine, you can choose to install FA on different databases for each instance. If both the Apache2 and MySQL are on the same machine, then the hostname can remain localhost or sometimes 127.0.0.1
You can create a new company only from the default company - see installed_extensions.php file in the root folder.
The said function that does the job is in sales/includes/db/cust_trans_db.inc
function get_customer_trans_version($type, $trans_no) {
if (!is_array($trans_no))
$trans_no = array( $trans_no );
$sql= 'SELECT trans_no, version FROM '.TB_PREF. 'debtor_trans
WHERE type='.db_escape($type).' AND (';
foreach ($trans_no as $key=>$trans)
$trans_no[$key] = 'trans_no='.db_escape($trans_no[$key]);
$sql .= implode(' OR ', $trans_no) . ')';
$res = db_query($sql, 'document version retreival');
$vers = array();
while($mysql=db_fetch($res)) {
$vers[$mysql['trans_no']] = $mysql['version'];
}
return $vers;
}
If there are no transaction or just one transaction only then what would happen to the orphaned OR?
Also, there may be a typo in the field name 'type' being 'tpe' since both exist. The table definition is:
CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
`trans_no` int(11) unsigned NOT NULL default '0',
`type` smallint(6) unsigned NOT NULL default '0',
`version` tinyint(1) unsigned NOT NULL default '0',
`debtor_no` int(11) unsigned default NULL,
`branch_code` int(11) NOT NULL default '-1',
`tran_date` date NOT NULL default '0000-00-00',
`due_date` date NOT NULL default '0000-00-00',
`reference` varchar(60) NOT NULL default '',
`tpe` int(11) NOT NULL default '0',
`order_` int(11) NOT NULL default '0',
`ov_amount` double NOT NULL default '0',
`ov_gst` double NOT NULL default '0',
`ov_freight` double NOT NULL default '0',
`ov_freight_tax` double NOT NULL default '0',
`ov_discount` double NOT NULL default '0',
`alloc` double NOT NULL default '0',
`rate` double NOT NULL default '1',
`ship_via` int(11) default NULL,
`dimension_id` int(11) NOT NULL default '0',
`dimension2_id` int(11) NOT NULL default '0',
`payment_terms` int(11) default NULL,
PRIMARY KEY (`type`,`trans_no`),
KEY `debtor_no` (`debtor_no`,`branch_code`),
KEY `tran_date` (`tran_date`)
) ENGINE=InnoDB;
Should the line:
$trans_no[$key] = 'trans_no='.db_escape($trans_no[$key]);
be
$trans_no[$key] = 'trans_no='.db_escape($value);
?
The file includes/ui/ui_lists.inc has:
function sales_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false, $editkey=false)
{
if ($editkey)
set_editor('item', $name, $editkey);
if ($label != null)
echo "<td>$label</td>\n";
echo sales_items_list($name, $selected_id, $all_option, $submit_on_change,
'', array('cells'=>true));
}
The file sales/includes/ui/sales_order_ui.inc uses it in:
else // prepare new line
{
sales_items_list_cells(null,'stock_id', null, false, true, true);
if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('units');
$Ajax->activate('qty');
$Ajax->activate('line_total');
}
asset_register module uses MySQL Functions apart from tables and indexes. Hence the database user for the FA database should be privileged to create, alter, drop and use them.
You will have to uninstall the asset_register, delete any tables associated with it and then re-install the module only after enabling the user privileges and flushing privileges (or restarting MySQL server).
The field definition for it is:
`collapsed` tinyint(4) NOT NULL
Check your databse if there is any default value such as 0 for the said field. Also see if changing it to NULL or VARCHAR makes any difference.
CREATE TABLE IF NOT EXISTS `0_dashboard_widgets` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`app` varchar(50) NOT NULL,
`column_id` int(11) NOT NULL,
`sort_no` int(11) NOT NULL,
`collapsed` tinyint(4) NOT NULL,
`widget` varchar(100) NOT NULL,
`description` varchar(100) NOT NULL,
`param` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
Wonder why the AUTO_INCREMENT was set to 6 !
Wonder why the tinyint(4) should not be tinyint(1) !
The relevant function that updates it is:
function update_dashboard_widget($selected_id, $app, $user_id, $column_id, $sort_no, $collapsed, $widget, $description, $param)
{
$sql = "UPDATE ".TB_PREF."dashboard_widgets SET user_id=" . db_escape($user_id)
. ",app=" . db_escape($app)
. ",column_id=" . db_escape($column_id)
. ",sort_no=" . db_escape($sort_no)
. ",collapsed=" . db_escape($collapsed)
. ",widget=" . db_escape($widget)
. ",description=" . db_escape($description)
. ",param=" . db_escape($param)
. " WHERE id = " .db_escape($selected_id);
db_query($sql,"The widget could not be updated");
}
The simplest fix may yet be:
function update_dashboard_widget($selected_id, $app, $user_id, $column_id, $sort_no, $collapsed, $widget, $description, $param)
{
$sql = "UPDATE ".TB_PREF."dashboard_widgets SET user_id=" . db_escape($user_id)
. ",app=" . db_escape($app)
. ",column_id=" . db_escape($column_id)
. ",sort_no=" . db_escape($sort_no)
. ",collapsed=" . ((isset($collapsed) && $collapsed <> 1) ? 0 : 1)
. ",widget=" . db_escape($widget)
. ",description=" . db_escape($description)
. ",param=" . db_escape($param)
. " WHERE id = " .db_escape($selected_id);
db_query($sql,"The widget could not be updated");
}
You will have to create your own theme with ajax auto-complete for it. The grouping system works on a hierarchial self lookup for parent-child entries. Any higher level groups created will be available for being the parent group of a new entry that needs to be under it.
I have updated the Wiki on this score.
Search for
$rep->SetHeaderType('Header2');
in some of the reporting/*.php files and you will see how and where to include the function name.
Please pm me your backup from within FA for the said company. Also attach your config.inc.php file after deleting the db password.
Looks like it is a clear case of either some new variables with backward compatibility options not conforming to your specific choices or a database schema incompatibility. The latter would be so if you have been using FA for quite some time and have been incrementally upgrading it as versions change.
State whether you are using Linux or Windows or Mac and the webserver, php and mysql versions. Will try to hammer out a sql that you can restore to get it working. Also please check the charset and collations used.
There are some errors in the Norweigian COA - one extra field is present there and some are mis-ordered besides some default diffs. Attached are the corrections that may be taken into the appropriate package in the FA repo.
Try to rename .htaccess to x.htaccess and see if it works.
Lines 363-370 of sales/includes/sales_db.inc:
$sql = "SELECT parent.*
FROM
".TB_PREF."$par_tbl parent
LEFT JOIN ".TB_PREF."debtor_trans_details trans
ON trans.src_id=parent.id
WHERE
trans.debtor_trans_type=".db_escape($trans_type)
." AND trans.debtor_trans_no=".db_escape($trans_no);
This file was last changed in 2011-02-14.
No significant changes since v2.3.14 (2013-01-18) in the sql schema for the US standard 4 digit Chart of Accounts.
What Chart of Accounts are you using? Compare with the current one and see if there is any significant difference that might cause this kind of trouble.
Take a backup zip of your company's database and check.
Try upgrading directly to v2.3.18+Git.
Just do not take them into stock at all and make it as a direct expense voucher.
Make sure that php5-curl and php-xmlrpc have been installed
check file and folder permissions within the company folder and for the temp and cache folders.
can be latin1_unicode_ci too or latin_swedish_ci - but keep all the string fields and db collations the same.
Number of boxes would be useful for rough and ready administrative counting even if apples boxes are added to oranges boxes - they are still boxes at heart!
FrontAccounting forum → Posts by apmuthu
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.