1

(5 replies, posted in Installation)

Ok, I resolved the problem. It is the fact that date_diff() exists as a function in php 5.3 and also in FA... so I renamed the 3 occurrances of the use of date_diff in FA to diff_date and it works. But now I'm concerned about the possibility of other functions and stuff causing problems down the road.

So now that I've got FA 2.0.6 up and running on the new server, I am back to my original question... can someone help me figure out how to upgrade to 2.2.9?

Thanks
Rob

2

(5 replies, posted in Installation)

Thanks for the tip Worrab... now instead of a login screen, or a blank page, I get:

Fatal error: Cannot redeclare date_diff() in C:\xampp\htdocs\erp\includes\date_functions.inc  on line 430

Maybe this can shed some light on the problem for you or someone else? It doesn't mean much to me. I'm going to look into it, but I don't have high hopes of figuring it out myself.

Thanks

3

(5 replies, posted in Installation)

I will be relocating my front accounting installation to a new server and thought this would be a good opportunity to upgrade the software to the lastest version. However, I have not been able to find much information regarding upgrading from 2.0.6 to 2.2.9

I have modified my code a bit, and a few tables, so the upgrade will not be straight forward, but I am willing to lose the changes I made in an effort to get to a clean new installation with my company data.

In the event that this process is unfeasable, I have already copied the 2.0.6 tables and files to the new server, but I can't get the login page to come up. it's just blank. no errors. PHP and MySQL are working. Its a shiny new xampp installation.

Can anyone please offer me some help? Or at least point me to a forum topic I may have missed?

4

(3 replies, posted in Report Bugs here)

Ok. It looks like I have it fixed. I have no idea why this happened.

To fix it I had to hard code the session save path to the proper path on the server. For some reason it was set to /var/php_sessions. This isn't right, and I don't think that value ever would have been right. I think someone at the host company screwed with the php config file.

Anyway, it seems to be working now. phew....

5

(3 replies, posted in Report Bugs here)

Thanks for your quick reply. Here's the errors:

Warning: Unknown(): open(/var/php_sessions/sess_42ecdd7a42558decc583509b7582d644, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/php_sessions) in Unknown on line 0


I am going to keep looking into this... but any help would be greatly appreciated!!!

I have been successfully using FrontAccounting 2.0.6 for a few months now, up until this morning.

I entered a few payments this morning, and everything was fine.

I went back to log in, I logged in successfully, and then I clicked on the Banking and General Ledger tab and it logged me out of the system. I closed my browser and reopened it and tried again but every time its the same thing. I log in, it takes me to the main menu, and no matter what option I click, it takes me back to the login page!

I have tried multiple browsers, and every user account. They all behave the same way.

Suddenly the system has become unusable. What on earth could have caused this?!

This sounds like an elegant solution. Essentially the same thing as updating the tables in the database...

Thanks!

Now that I have been using FrontAccounting for a while, I have created a small problem for my company.

We sell many products, and the list of products has grown to the point where users are missing existing products and creating new, duplicate products. As a result, I have decided to institute a product code policy that should eliminate the creation of duplicate products by making existing products easier to find. My problem now is that I can't simply rename the item codes for existing items, and I can't delete the items because they've been sold.

I am sure I  am not telling anyone anything they don't already know.

However, I am not so far gone that if I could find a clean, back-door, method of renaming item codes for existing items, I would be ok.

So my question is, can anyone help in any of these ways:

1. Has anyone written a script that will update all occurrences of an item code with a replacement item code?

2. Provide me with all the tables that contain the item codes so that I could create a script? Also any caveats in creating such a script (I envision a simple series of update table_name set item_code='newid' where item_code='oldid', but things often aren't that simple.)

3. Can someone offer me another solution? I really want to get these existing products fixed and implement the new naming system before the list gets unmanageable.

Thanks
Rob

9

(15 replies, posted in FA Modifications)

I might have been a little too excited when I submitted it...

I have noticed a few things that need to be added to make it usable to everyone (not just me).

Beginning balance needs to editable. It shouldn't need to be changed, but the first time you reconcile an account you may need to enter it. It will be populated automatically, but editable as well.

I need to include a reset button on the form. I'm not going to do a check all/check none, but the ability to start from scratch without refreshing the page is worthwhile.

I will probably do these changes over the weekend and re-email the page to you. it will only require changes to the new page.

Thanks. This is the first time I've contributed to an open source project, and I'm hooked. I don't think you've heard the last of me!

Rob

10

(15 replies, posted in FA Modifications)

Joe, I emailed the page, and the change to the generalledger.php menu to you.

11

(15 replies, posted in FA Modifications)

I'm done with what I set out to accomplish. It completely suites my needs but for it to be a fully featured utility it should have a little more flexibility.

As the program works now, there is no method for postponing a reconciliation. This can be frustrating if you begin the process, and then need to go back and make entries to correct balance errors. Currently, this would mean that you need to abandon your current reconciliation, make your entries, and then start the reconciliation over.

For me, this is usually not a big deal, since i reconcile every week or so (it's addicting... sometimes I do it every day. Anyone in my situation knows what I mean.)

That being said, it works great for me, it's very simple to use. So how do I get this to you so you?

To install, it requires the following PHP changes:
the menu entry in /applications/generalledger.php
the new page: /gl/bank_account_reconcile.php

and the following MySQL changes:
the column reconciled int(1) at the end of the bank_trans table
the columns last_reconciled_date timestamp,beginning_reconcile_balance double, and ending_reconcile_balance double at the end of the bank_accounts table

A few notes... for the most part, the code is clean, and I tried to adhere to your coding practices, use your ui functions, etc..., but because it uses javascript for tracking running totals as the user clicks the checkboxes, I needed to create my own checkbox element (not the check_cells function). Also the javascript is a little sloppy in places.. I was having trouble with string to number conversion, rounding, etc... and the final result was the best I could get it. It's right, but occasionally it displays more than 2 decimal places and I cant seem to make that stop (ie 250.35000 instead of 250.35). Honestly, once the numbers were calculating right, I just left it alone. With as touchy as javascript is, I didnt even want to mess with cleaning it up.

Feel free to clean it up, or enhance it as you see fit. I am excited to share this with you.
Rob

12

(15 replies, posted in FA Modifications)

I have technicians who work for me. They collect customer checks throughout the week, and enter the invoices into the system. All customer payments are put in a 'Bank Deposit Holding' bank account.

At the end of the week the checks are sent to me and I make a deposit, and a transfer entry from 'Bank Deposit Holding' to 'Checking Account'. This way my deposit entry matches my actual bank deposit.

In addition, some goods are purchased for resale locally, some online, some phone orders using a debit card. The same is true for other expenses.

This makes for lots of transactions, many happening before they are entered into the system, and inevitably some are missed. Bank account reconciliation ensures that if there are debits to my bank account that I am unaware of I can go back and make the correct entries in the system so that my books match my bank's records. Is this that uncommon?! I guess justifying this feature seems strange to me. But I've always done business this way, so it's all I know.

It's not going to hurt anything by being there... and from what I've been reading online, the lack of bank account reconciliation is one of the reasons why people don't adopt this software. I'm sure you've read this article, but I'll post it here in case:

http://www.nmqb.co.uk/open-source-billing-applications/

You guys come out on top, but your lack of reconciliation was one of two reasons it wasn't chosen... 

Your software is free to use, but I make money using it, and I love to program. If I can contribute to your success by offering this enhancement, it would be my pleasure. It's the least I can do.

Rob

13

(15 replies, posted in FA Modifications)

Thanks. I will try that when I get home.

I am using this software to replace quickbooks. I have gone from one location to 2, and by May I will have 5 locations, so quickbooks was no longer able to suite my needs.

I dont really know how to answer your question... Why wouldnt everyone want to be able to reconcile their bank account? My bank account gl account matches my bank statement line-for-line. I reconcile my account once a week at least.

When I get the application finished I will let you know. I would be glad to share it if you'd like to use it.

Thanks for your quick responses. As a programmer and a business owner, its nice to know there's support out there!

14

(15 replies, posted in FA Modifications)

Thats exactly right. Except I also plan on maintaining a reconciled date, and ending balance (which would become the beginning balance for the next reconciliation)

I've written a page like this before, from scratch, and in PHP, so the logic and complexity arent my issue. My issue is doing it within the constraints of your coding practices.

How bout this? Here's the code, maybe you can tell me why it doesn't retrieve the ShowReconciled value when I try to get it from the $_POST array:

<?php

$page_security = 8;
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");

include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.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/banking.inc");

$js = "";
if ($use_popup_windows)
    $js .= get_js_open_window(800, 500);
if ($use_date_picker)
    $js .= get_js_date_picker();
page(_("Reconcile Bank Account"), false, false, "", $js);

check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));

//-----------------------------------------------------------------------------------
// Ajax updates
//
if (get_post('Show'))
{
    $Ajax->activate('trans_tbl');
}
//------------------------------------------------------------------------------------------------


start_form();
start_table("class='tablestyle_noborder'");
start_row();
bank_accounts_list_cells(_("Account:"), 'bank_account', null);

date_cells(_("From:"), 'TransAfterDate', '', null, -30);
date_cells(_("To:"), 'TransToDate');
//Added 1/8/09
yesno_list_cells(_("Show Reconciled:"), 'ShowReconciled', 1);

submit_cells('Show',_("Show"),'','', true);
end_row();
end_table();
end_form();

//------------------------------------------------------------------------------------------------

//Added 1/8/09 DEBUG
$show_reconciled=get_post('ShowReconciled');
echo ">>>>>>>>".$show_reconciled."<<<<<<<<<<<";

$date_after = date2sql($_POST['TransAfterDate']);
$date_to = date2sql($_POST['TransToDate']);

if (!isset($_POST['bank_account']))
    $_POST['bank_account'] = "";
    $sql = "SELECT ".TB_PREF."bank_trans.*,name AS BankTransType FROM ".TB_PREF."bank_trans, ".TB_PREF."bank_trans_types
    WHERE ".TB_PREF."bank_trans.reconciled=0 and ".TB_PREF."bank_trans.bank_act = '" . $_POST['bank_account'] . "'
    AND trans_date >= '$date_after'
    AND trans_date <= '$date_to'
    AND ".TB_PREF."bank_trans_types.id = ".TB_PREF."bank_trans.bank_trans_type_id
    ORDER BY trans_date,".TB_PREF."bank_trans.id";
$result = db_query($sql,"The transactions for '" . $_POST['bank_account'] . "' could not be retrieved");

div_start('trans_tbl');
$act = get_bank_account($_POST["bank_account"]);
display_heading($act['bank_account_name']." - ".$act['bank_curr_code']);

start_table($table_style);

$th = array(_("Type"), _("#"), _("Reference"), _("Type"), _("Date"),
    _("Debit"), _("Credit"), _("Balance"), _("Person/Item"), "");
table_header($th);

$sql = "SELECT SUM(amount) FROM ".TB_PREF."bank_trans WHERE bank_act='" . $_POST['bank_account'] . "'
    AND trans_date < '$date_after'";
$before_qty = db_query($sql, "The starting balance on hand could not be calculated");

start_row("class='inquirybg'");
label_cell("<b>"._("Opening Balance")." - ".$_POST['TransAfterDate']."</b>", "colspan=5");
$bfw_row = db_fetch_row($before_qty);
$bfw = $bfw_row[0];
display_debit_or_credit_cells($bfw);
label_cell("");

end_row();
$running_total = $bfw;
$j = 1;
$k = 0; //row colour counter
while ($myrow = db_fetch($result))
{

    alt_table_row_color($k);

    $running_total += $myrow["amount"];

    $trandate = sql2date($myrow["trans_date"]);
    label_cell(systypes::name($myrow["type"]));
    label_cell(get_trans_view_str($myrow["type"],$myrow["trans_no"]));
    label_cell(get_trans_view_str($myrow["type"],$myrow["trans_no"],$myrow['ref']));
    label_cell($myrow["BankTransType"]);
    label_cell($trandate);
    display_debit_or_credit_cells($myrow["amount"]);
    amount_cell($running_total);
    label_cell(payment_person_types::person_name($myrow["person_type_id"],$myrow["person_id"]));
    label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"]));
    end_row();
    //Removed by Rob Mallon on 1/8/09
    //if ($j == 12)
    //{
    //    $j = 1;
    //    table_header($th);
    //}
    //$j++;
}
//end of while loop

start_row("class='inquirybg'");
label_cell("<b>" . _("Ending Balance")." - ". $_POST['TransToDate']. "</b>", "colspan=5");
display_debit_or_credit_cells($running_total);
label_cell("");
end_row();
end_table(2);
div_end();
//------------------------------------------------------------------------------------------------

end_page();

?>

All I did so far was what I explained in my first post... I added a Yes/No select to the form, and tried to display it's value in a debugging echo statement.

I understand that $show_reconciled will have no value the first time the page is displayed, but I can't understand why $show_reconciled has no value when the 'Show' button is used to submit the form.

(In case you missed it in my first post, I am using /gl/inquiry/bank_inquiry.php as my base page. With the exception of the changes I mentioned, this page should look very familiar to you smile

Thanks for your quick response. I am the business owner as well as a PHP developer. I am EXTREMELY interested in using this program to run my business, but the lack of bank account reconciliation is a deal breaker. I figured adding it myself would be good for me, as well as the entire FrontAccounting community.

15

(15 replies, posted in FA Modifications)

I am working on a bank account reconciliation enhancement. Simple to start, and then enhance with ability to postpone reconciliation, etc.

I started by adding a column to the bank_trans table called 'reconciled'. I copied the page '/gl/inquiry/bank_inquiry.php' and called it '/gl/bank_account_reconcile.php' and began modifying it. That page was the closest page to what I was looking for, so I thought it would be a good start.

I did all the basic changes: added a menu item in the GL/Banking menu, change the $path_to_root, changed the page name...

It didnt take me long to run into a problem.

Using your functions to create the form fields, I add the ability to display unreconciled lines only, or all lines.

Here's the form... All I did was add the yesno_list_cells function call.

start_form();
start_table("class='tablestyle_noborder'");
start_row();
bank_accounts_list_cells(_("Account:"), 'bank_account', null);

date_cells(_("From:"), 'TransAfterDate', '', null, -30);
date_cells(_("To:"), 'TransToDate');

//Added 1/8/09
yesno_list_cells(_("Show Reconciled:"), 'ShowReconciled', 1);

submit_cells('Show',_("Show"),'','', true);
end_row();
end_table();
end_form();

Then prior to the creation of $sql, it retrieves the values of the from and to dates:

$date_after = date2sql($_POST['TransAfterDate']);
$date_to = date2sql($_POST['TransToDate']);

I added the following lines immediately after the above two lines:

//Added 1/8/09 DEBUG
$show_reconciled=$POST['ShowReconciled'];
echo ">>>>>>>>".$show_reconciled."<<<<<<<<<<<";

The HTML looks good, 'ShowReconciled' is part of the form that is submitted, but no matter what I do, $show_reconciled has no value when the form is submitted...

I've done a fair amount of PHP programming, and I've spent way too much time trying to figure this out on my own. Can someone tell me why I can't retrieve the value of this form field when the form is submitted? And, not just why I can't, but an example of how I can?

Once this is done I plan on creating a full blown bank reconciliation function. I have searched online, and it doesn't appear as if anyone else has done it, and I would be happy to give the code to the community once it's working.