Invoice a "0" cost service with it's name indicating "Usual cost $..." ?
3,851 09/28/2015 01:17:30 pm
Re: Displaying Discount amount on invoice (13 replies, posted in Reporting)
3,852 09/28/2015 01:03:25 pm
Re: More detail needed for dimensions (16 replies, posted in Reporting)
Unfortunately, this report has not been coded for excel and hence the choice is not there in the menu.
The simulation of the sql in the function getTransactions() in reporting/rep108.php using the en_US-demo.sql Chart of Accounts is illustrated in the attachment herein - it contains the raw table data and the sql results which includes the CUSTCREDIT entries as well. The Simulation SQL is:
SET @date_due := '2014-09-23';
SET @date_now := '2014-07-25';
SET @debtor_no := 3;
SET @dimension_id := 2; -- Dimension 1
-- SET @dimension2_id := 2; -- Dimension 2
-- Taken from defines in includes/types.inc
-- ST_SALESINVOICE = 10
-- ST_CUSTCREDIT = 11
-- ST_CUSTDELIVERY = 13
SELECT dt.*,
(ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) AS TotalAmount, alloc AS Allocated,
((TYPE = 10) AND due_date < @date_now) AS OverDue
FROM 1_debtor_trans dt
WHERE tran_date <= @date_due
AND debtor_no = @debtor_no
AND TYPE <> 13
AND ABS(ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) > 1e-6
-- if (!$show_also_allocated)
-- AND ABS(ABS(ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount) - alloc) > 1e-6
-- Dimension 1
AND dimension_id = @dimension_id
-- Dimension 2
-- AND dimension2_id = @dimension2_id
ORDER BY tran_date;FLOAT_COMP_DELTA defined as a FA constant in PHP is used instead of 1e-6 in some places.
You may use the above in any MySQL client and execute them all on your database and check the results.
I see no reason why your output does not conform to what is expected. Please clear your report and js cache and try it again and use appropriate values for the constants defined in the code above on your database and verify the results to see if it matches your output.
The dimension name comes from another table and you will have to alter the sql to join it to that table like:
SELECT ....., d1.name AS D1Name
-- Dimension 2 if used
-- , d2. name A D2Name
FROM 1_debtor_trans dt
LEFT JOIN 1_dimensions d1 ON (dt.dimension_id=d1.id)
-- Dimension 2 if used
-- LEFT JOIN 1_dimensions d2 ON (dt.dimension2_id=d2.id)
WHERE ......
ORDER BY tran_date;Then use the D1Name (and D2Name if appropriate) as desired in the report. Experiment with INNER JOIN instead of LEFT JOIN for the first or both instances as desired.
3,853 09/27/2015 03:52:05 am
Re: deactivate_extension not dropping tables (18 replies, posted in Report Bugs here)
FA 2.3.x is designed for PHP 5 to 5.3 and a few have reported success with PHP 5.4 possibly with some mods.
In case you are testing with PHP 5.6+, please see what functions are deprecated / dropped in 5.4, 5.5 and then 5.6 and make sure you make appropriate changes / replacements.
There is no intention of the devs and myself in supporting any later versions of PHP other than 5.3 for FA v2.3.x. You are pretty much on your own here.
To assist others however, you may post your findings in a separate thread for such later PHP versions. Such findings posted in this thread will only serve to confuse end users - yes, it will make for big consultancy business...... but FA has been designed with simplicity in mind and for self service.
The code portion for activating extensions has not been touched in this fix and if it doesn't work for you now, then it never did in the first place prior to this fix as well.
3,854 09/26/2015 09:13:46 pm
Re: deactivate_extension not dropping tables (18 replies, posted in Report Bugs here)
Fixed it! Pull it in from my repo.
There was a missing function deactivate_hooks() which has now been added.
3,855 09/26/2015 05:50:30 pm
Re: Session destroy warnings (1 replies, posted in Setup)
@joe: Can pull it in from my repo.
3,856 09/26/2015 12:21:01 pm
Re: deactivate_extension not dropping tables (18 replies, posted in Report Bugs here)
@joe: any pointers on the "official" way to get FA to drop tables created by extensions when they get deactivated for a specific company?
3,857 09/26/2015 02:58:21 am
Re: deactivate_extension not dropping tables (18 replies, posted in Report Bugs here)
The $hooks->deactivate_extension() is not being called anywhere in FA and hence the drop.sql is not being executed when an extension is deactivated. The Ajax on the Web UI just looks after the tick mark in the checkbox and removes the entry in the $installed extensions arrays in the installed_extensions.php files.
3,858 09/26/2015 12:29:27 am
Topic: deactivate_extension not dropping tables (18 replies, posted in Report Bugs here)
Even if $check_only = false;, the $ok fails the test in function update_databases() in includes/hooks.inc as the function check_table() called in it and defined in admin/db/maintenance_db.inc as:
function check_table($pref, $table, $field=null, $properties=null)
{
$tables = @db_query("SHOW TABLES LIKE '".$pref.$table."'");
if (!db_num_rows($tables))
return 1; // no such table or error
$fields = @db_query("SHOW COLUMNS FROM ".$pref.$table);
if (!isset($field))
return 0; // table exists
while( $row = db_fetch_assoc($fields))
{
if ($row['Field'] == $field)
{
if (!isset($properties))
return 0;
foreach($properties as $property => $value)
{
if ($row[$property] != $value)
return 3; // failed type/length check
}
return 0; // property check ok.
}
}
return 2; // field not found
}attempts to evaluate $fields = SHOW COLUMNS FROM... even when there is no $field argument available when dropping tables during deactivate_extensions! Hence the said function should be corrected to be:
function check_table($pref, $table, $field=null, $properties=null)
{
$tables = @db_query("SHOW TABLES LIKE '".$pref.$table."'");
if (!db_num_rows($tables))
return 1; // no such table or error
if (!isset($field))
return 0; // table exists
$fields = @db_query("SHOW COLUMNS FROM ".$pref.$table);
while( $row = db_fetch_assoc($fields))
{
if ($row['Field'] == $field)
{
if (!isset($properties))
return 0;
foreach($properties as $property => $value)
{
if ($row[$property] != $value)
return 3; // failed type/length check
}
return 0; // property check ok.
}
}
return 2; // field not found
}Please confirm it being a fix.
3,859 09/25/2015 10:16:54 pm
Topic: Files ending in newlines in FA 2.3 (0 replies, posted in Setup)
Listing all FA files ending in multiple newlines:
$ find -type f -exec sh -c '[ -z "$(sed -n "\$p" "$1")" ] && echo "$1"' _ {} \;
./access/logout.php
./doc/2.2_Beta.txt
./doc/access_levels.txt
./doc/calculate_price.txt
./doc/CHANGELOG.old.txt
./doc/license.txt
./gl/inquiry/balance_sheet.php
./gl/inquiry/gl_trial_balance.php
./includes/db/sql_functions.inc
./install/lang/ar_EG/LC_MESSAGES/ar_EG.po
./install/lang/da_DK/LC_MESSAGES/da_DK.po
./install/lang/de_DE/LC_MESSAGES/de_DE.po
./install/lang/el_GR/LC_MESSAGES/el_GR.po
./install/lang/es_MX/LC_MESSAGES/es_MX.po
./install/lang/fr_FR/LC_MESSAGES/fr_FR.po
./install/lang/id_ID/LC_MESSAGES/id_ID.po
./install/lang/it_IT/LC_MESSAGES/it_IT.po
./install/lang/ka_GE/LC_MESSAGES/ka_GE.po
./install/lang/new_language_template/LC_MESSAGES/empty.po
./install/lang/nl_BE/LC_MESSAGES/nl_BE.po
./install/lang/pl_PL/LC_MESSAGES/pl_PL.po
./install/lang/pt_BR/LC_MESSAGES/pt_BR.po
./install/lang/pt_PT/LC_MESSAGES/pt_PT.po
./install/lang/sv_SE/LC_MESSAGES/sv_SE.po
./install/lang/zh_CN/LC_MESSAGES/zh_CN.po
./js/JsHttpRequest.js
./manufacturing/view/wo_issue_view.php
./manufacturing/view/wo_production_view.php
./purchasing/po_receive_items.php
./sales/inquiry/sales_deliveries_view.php
./sql/alter.sql
./sql/alter2.1.sql
./sql/en_US-new.sql
./taxes/db/tax_groups_db.incThese excess newlines can be removed for atleast those files other than docs/*.* and *.po files.
3,860 09/25/2015 10:02:54 pm
Topic: Session destroy warnings (1 replies, posted in Setup)
A look at tmp/error.log in FA (on XAMPP in Windows) will show:
0::logout.php:50: session_destroy() [<a href='function.session-destroy'>function.session-destroy</a>]: Session object destruction failedeach time one logs out.
This is because session_destroy() is attempted after a session_unset() in access/logout.php - the "@" notwithstanding. If this is required for some installations, then the following can replace the last 2 statements in it:
session_unset();
if (session_id() != '') session_destroy();For PHP 5.4+, use the following:
session_unset();
if (session_status() == PHP_SESSION_ACTIVE) session_destroy();3,861 09/25/2015 09:35:53 pm
Re: Session Abandoned Error in Windows Server Systems (6 replies, posted in Announcements)
The variable $no_check_edit_conflicts can now be removed from FA and the file sales/includes/sales_ui.inc can have it's last function:
function check_edit_conflicts($cartname='Items')
{
global $Ajax, $no_check_edit_conflicts;
if ((!isset($no_check_edit_conflicts) || $no_check_edit_conflicts==0) && get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.'));
$Ajax->activate('_page_body');
display_footer_exit();
}
}changed to:
function check_edit_conflicts($cartname='Items')
{
global $Ajax;
if (!empty($_SESSION[$cartname]->cart_id) && get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.'));
$Ajax->activate('_page_body');
display_footer_exit();
}
}Steps to check in a fresh FA v2.3 install on Windows XAMPP using en_US-demo.sql:
Sales => Direct Invoice => Customer => Ghostbusters
No error should crop up.
3,863 09/25/2015 09:29:47 pm
Re: Customer Address hides when payment is due in zero days. (2 replies, posted in Accounts Receivable)
You can put in the Address in the Comments for now.
Another solution would be to make a Cash Customer and keep editing their address in it before choosing it in Direct Invoice each time.
3,864 09/25/2015 04:33:08 am
Re: This Error Comes Up (3 replies, posted in Setup)
Check if you have the file C:\xampp\htdocs\account\sales\includes\cart_class.inc.
If so, then try to hardcode the path into line 23 of C:\xampp\htdocs\account\sales\sales_order_entry.php like:
include_once("C:/xampp/htdocs/account/sales/includes/cart_class.inc");and report the results.
Also state what menu sequence of clicks lead to such a situation.
First, close all browser instances, clear browser cache and try it - only if it fails should you need to try the above.
3,865 09/25/2015 04:22:51 am
Re: Charge HST on Fees and Withholding Pension and Union dues on Same Fees (2 replies, posted in Banking and General Ledger)
Have a Salary Account where the $113/- Salary+Taxes of all Musicians are debited and the respective musicians accounts get credited with 89.5% (100-2-8.5) of the salaries whilst 8.5% gets credited to the Pension Plan Account and 2% gets credited to the Musicians Union Account. Also credit the GST payable Account with 5% and credit the PST Payable Account with 8%. All of this can be a single Journal Voucher probably made for each week / month / event.
Unless you have PayRoll module made and customised for your needs (Musicians payout rates, etc), QuickEntries would be a cludge of a substitute, a tad better than making a set of direct SQL executions generated from some spreadsheet (=CONCATENATE("INSERT INTO...) and possibly programmed into a trigger in MySQL. PM me for assistance in implementing the latter.
Raising a Supplier (Govt Body, Pension plans, etc) Invoice for services (withheld tax/deductions) and settlement under normal means would qualify as a Standard Operating Procedure in FA. Recurrent Invoices will need editing amounts....
3,866 09/22/2015 05:41:01 am
Re: Attachment Print (2 replies, posted in Accounts Receivable)
Wikied under FAQs.
3,867 09/21/2015 04:21:09 pm
Re: Advice on setting up FA for nonprofit fund accounting (7 replies, posted in Setup)
Wiki-ed it.
3,868 09/21/2015 04:16:09 pm
Re: Work for replacing frontaccounting grid with jQuery datatables (3 replies, posted in Jobs wanted/offered, non-free offers)
Checked out the 3rd company with the above credentials - you're pretty competent to get it done yourself. Open a GitHub account and post your extensions there so that the community can assist you in coding and testing as well. Also you may want to upgrade to v2.3.24+ from the v2.3.22 you are using (136 files in 48 folders have changed).
3,869 09/20/2015 03:22:55 pm
Re: INVOICE NUMBER - PREVENT CHANGE BY USER (9 replies, posted in Accounts Receivable)
It is possible to make all Reference fields in new element forms to be readonly. The attached screenshots are for making just one form (Direct Invoice) or all forms to have their Reference field as non-editable.
Apart from being defined in includes/ui/ui_input.inc, there are 17 files that use the function ref_row - once each. The said function is currently not used in any standard extension.
Placed on Wiki.
3,870 09/20/2015 02:06:56 pm
Re: INVOICE NUMBER - PREVENT CHANGE BY USER (9 replies, posted in Accounts Receivable)
The before and after depiction of the code changes suggested for pass 1 of the function synch is attached herein.
3,871 09/20/2015 01:35:54 pm
Re: Dimensions and liabilites (5 replies, posted in Dimensions)
Dimensions are generally used for cost centres. Try Tags first before using dimensions - these are just for groups of transactions pertaining to a specific deal.
3,872 09/20/2015 05:46:10 am
Re: FA Planet announced (www.faplanet.pl) (17 replies, posted in FA Modifications)
It remains sticky for the nice discussions in it and it being a work-in-progress for FA 2.4.
3,874 09/20/2015 05:27:29 am
Re: INVOICE NUMBER - PREVENT CHANGE BY USER (9 replies, posted in Accounts Receivable)
The same could have been achieved easily with a flag based readonly attribute in the input tag.
I have re-factored the includes/ui/ui_input.inc 's text_cells and text_cells_ex functions to have the same argument names and bunching similar code for ease of understanding before the inclusion of the $inparams in the latter function where the readonly can be inserted. This will also server to clarify the code.
The real solution will be to have a flag in the sys_prefs table that removes the field altogether and in the processing script acquires the next reference and then populates the tables, showing the end result in the browser.
3,875 09/18/2015 05:59:54 am
Re: Adding new debtors/customers, country field empty (5 replies, posted in Accounts Receivable)
Short of creating an extension for your extended CRM needs with a 1:1 table mapped to an existing branch/person FA table, the non field db data method "abusing" large fields like notes will be the "documented" way out.
Use a permanent holding table (managed externally with the likes of Adminer or phpMyEdit) or a spreadsheet for your separate fields and combine them into the large FA field each time anything changes!
