Topic: Bank Account Reconciliation
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.