Analysing what and how to backport from Unstable 2.4 to Stable 2.3.13 Mer Build 3141:

Copy over reporting/includes/reporting.inc from Unstable to Stable
Others can be backported directly for orientation:
101 - 106, 114, 201-204, 301-306, 401, 501, 701, 704-710
rep 107, 110 & 113 (can backport block of logic), must exclude new FA 2.4 field while backporting
rep 108, 109, 111, 409 block of logic can be backported with / without orientation
rep 112 backport with removal of inline deprecated function (3027 mer build done in unstable) with / without orientation
rep 209 - beware that get_tax_for_items() function has changed due to new tax_algorithm field in 2 tables.
rep 210 - backport with removal of inline deprecated function get_allocations_for_remittance() (3027 mer build done in unstable) with / without orientation

rep 601 - only beware of new fa 2.4 function get_counterparty_name in includes/types.inc used instead of older function payment_person_name which is still available
rep 702 - only beware of new fa 2.4 function get_subaccount_name() in gl/includes/db/gl_db_accounts.inc used instead of older function payment_person_name


function payment_person_name from includes/types.inc used in reports 601, 702 and 704 (in 602 [copy of 601 with reconcile] and 704 in unstable as well)
function get_subaccount_name() [rep 702] and is_subledger_account() in FA 2.4 in gl/includes/db/gl_db_accounts.inc

5,777

(9 replies, posted in Setup)

Please state the exact numbers involved in the division / multiplication like base amount and / or final amount, taxrate(21%), erroneous amount (29.29, 29.30) name, etc.
Also one navigation is given as General Ledger > Tax Inquiry and what is the other navigation for invoice?

Whilst the stable v2.3.x code seems to have been following the PHP 5.3 standards in some places, the Unstable v2.4 seems to be lagging - example the file:
Line 3121 reporting/includes/Workbook.php:

if (ereg("^\"[^\"]{0,255}\"$", $this->_current_token)) {

should follow the stable version and be:

if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) {

The above is the only instance of the leftover ereg function.

Please open a separate topic for Unstable / FA v2.4.

Attached here is a one difference found in the file reporting/includes/pdf_report.inc between the stable and unstable branches:

--- FA3140_Stable/reporting/includes/pdf_report.inc    Fri Nov 23 11:45:56 2012
+++ FA3140_UnStable/reporting/includes/pdf_report.inc    Tue Jan 15 18:28:07 2013
@@ -386,7 +386,7 @@
            'DebtorName', 'supp_account_no', 'wo_ref', 'debtor_ref','type', 'trans_no',
            'StockItemName', 'tax_id', 'order_', 'delivery_date', 'units_issued',
            'due_date', 'required_by', 'payment_terms', 'curr_code',
-            'ov_freight', 'ov_gst', 'ov_amount', 'requisition_no', 'contact'),
+            'ov_freight', 'ov_gst', 'ov_amount', 'prepaid', 'requisition_no', 'contact'),
        'branch' => array('br_address', 'br_name', 'salesman', 'disable_branch'),
        'sales_order' => array('deliver_to', 'delivery_address', 'customer_ref'),
        'bankaccount' => array('bank_name', 'bank_account_number', 'payment_service')

There is no such difference between the respective reporting/includes/excel_report.inc files.

Currently prepaid seems to be used only in one report, viz., reporting/rep107.php.

In both stable and unstable branches, there are 2 reports rep502.php (Dimensions) and rep703.php (GL Account Group Summary) that are commented out in the file reporting/main_report.inc - any info on this?

Also, in the FA v2.4 Unstable branch, there is one report - rep602.php (Bank Statements with Reconcile) that does not seem to appear anywhere in reporting/main_report.inc ! This report has not been updated as yet for the Orientation feature.

The maximum number of parameters used in reports are in rep707.php where PARAM_0 to PARAM_10 (total 11) are used.

In table 0_debtor_trans , a new TINYINT field tax_included has been introduced in FA 2.4 Unstable that has changes in some of it's reports - 107, 110, 113. This must be taken into account if reports are to be backported to the stable version.

Then a synch of essential changes from 2.3 into 2.4 is overdue.

Any chance of porting the reports to the stable branch or are they directly usable with the stable branch?

5,782

(16 replies, posted in Wish List)

See this thread - It works in Foxit Reader as well.

In Foxit Reader:
Edit -> Preferences -> Trust Manager -> Enable Safe Reading Mode -> Uncheck

It works with latest Foxit Reader v5.4.4 on WinXP SP3. See screenshots.

In Foxit Reader:
Edit -> Preferences -> Trust Manager -> Enable Safe Reading Mode -> Uncheck

All recent versions of PDF Readers disallow Web access by default. We need to enable it when we are sure.

5,784

(9 replies, posted in Setup)

What version of MySQL / PHP are you using - is it possible that it is a quirk of some computation rounding off errors in some versions? What are the numbers involved - Tax Rate, Amount given, Amount expected?

Which PDF reader?

Adobe Acrobat / SumatraPDF Readers work.

5,786

(16 replies, posted in Wish List)

Works in Adobe Acrobat Reader X
Works in the Browser plugin in MS IE 8 and FF 18.0
Works from Sumatra PDF Reader v2.2.1 - 2.5 MB

Please let me know which PDF Reader it did not work.

If the PayPal Link is necessary to be shown in full, maybe we can add a config variable (all companies) for it or a setup preference (sys_prefs) variable for it (per company basis). The patch contains the native way to populate a link in TCPDF with no dependency of FPDF parsers. The latest TCPDF also has ShotCodes, Extended barcodes / QCodes as well.

1. Backup v2.3.11 - SQL, config_db.php, config.php, installed_extensions.php lang/linstalled_languages.inc
2. Uninstall all extensions.
3. Backup SQL again along with the said files
4. rename the frontaccounting folder.
5. extract latest mercurial build onto new frontaccounting folder
6. install FA to another dummy db.
7. compare the saved files (config_db.php, config.php, installed_extensions.php lang/linstalled_languages.inc) with the currently installed ones and make changes to use the old db.
8. Login to the 0 company and go to Setup -> Software Upgrade and force an upgrade.

Post your php.ini file along with the output of:
uname -a
php -m

Better still, VNC your desktop which can be chrooted into your cloud server.

Report Generator extension is broken / unsafe for FA v2.3.13+

Thanks Joe, Mer Build 3136 fixes the login company field width.

5,789

(16 replies, posted in Wish List)

Lines 205 and 209 in the file reporting/includes/header2.inc attached in the previous post are both:

$this->row -= $this->lineHeight;

If the said lines are commented out, the blank line in the middle of the footer disappears.

Attached herein is the before and after picture set of an invoice.

Hope you have a pre-upgrade db backup and the original config.php file with you.
Expect it is a linux install.
Did you have any extensions installed?
What languages / locales are you using?
Have you tried one of the current mercurial builds available - like the one here?

PM me access details of server or VNC while you watch.

5,791

(16 replies, posted in Wish List)

Your Pretty Link is done!
Replace file reporting/includes/header2.inc with the one attached.

Yes, Joe, the fields can be spaced out intelligently - no need to scale columns like ID, Amount, and restrict scaling up from portrait to Landscape only for text fields

Also for Chris instance where his company name is quite long, the 30 character limit may not suffice - needs to be extended in atleast 2 files (for the non select textbox method as well):

access/login.inc -> Line 110
admin/create_coy.php Line 336
make maxlength from 30 to 50 atleast

Fixed this issue natively using TCPDF class base methods itself. Fully backwards compatible from TCPDF induction into FA onwards.

Patch for reporting/includes/header2.inc attached.
This patch is for current Mercurial Build 3135.

The function AddLink is defined in class TCPDF in line 2722 of reporting/includes/tcpdf.php.

This class TCPDF extended by class FPDF in reporting/includes/fpdi/fpdi2tcpdf_bridge.php .

The class FPDF is further extended by class FPDF_TPL in reporting/ncludes/fpdi/fpdf_tpl.php where the error override function AddLink is defined in Line 306 to redirect to it's namesake in the original grandparent class TCPDF.

FPDF_TPL is now extended by class FPDI in reporting/includes/fpdi/fpdi.php

There is no reference to the function addLink() in any of these classes (note case). The function addLink is used twice in reporting/includes/header2.inc :

Line 116:

$this->addLink($url, $c2col, $this->row, $mcol, $this->row + $this->lineHeight);

Line 202:   

$this->addLink($txt, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row + $this->lineHeight);

If we assume that it is a typo and correct it to AddLink, then the function description states that it is an internal link within the document only but our usage in FA is for external links which require the SetLink method of TCPDF.

Commenting out the said lines (tested commenting out line 202) results in no loss in functionality - the link is clickable in the PDF. This means that when any URL is sent to the TextWrap method that preceeded the addLink, it will intelligently be rendered clickable.

Which parameter is then to be used in setting the display text for the link if it needs to be other than the url?

5,795

(16 replies, posted in Wish List)

Obtained the backup sql of your system and am testing it out in an OpenVZ VPS - a sort of test ride  troubleshooting using it.

The changes from the stock FA v2.3.13 to the Mercurial Build now as far as the database is concerned is only the following statements (You are using company 0 with a table prefix of "f1_"):

# Default value is not '1' but blank
ALTER TABLE `f1_users` 
    CHANGE `print_profile` `print_profile` varchar(30)  COLLATE latin1_swedish_ci NOT NULL DEFAULT '' after `pos`;

# InnoDB needed for Foreign Keys - not mere unique key
ALTER TABLE `f1_tag_associations` 
    ADD PRIMARY KEY(`record_id`,`tag_id`), 
    DROP KEY `record_id`, ENGINE=InnoDB; 

ALTER TABLE `f1_tags` ENGINE=InnoDB; 

# New feature in Mercurial build needs it
INSERT INTO `f1_sys_prefs` VALUES ('bcc_email', 'setup.company', 'varchar', '100', NULL);

Typo in Company Name - Extraordinaire.

The config.php must be matched with the config.default.php to make up for the missing/changed entries. Stick to default themes for now till the other themes are updated to accommodate the changed function locations that affect the renderer.php in the older themes.

The choice of white background in your logo blends well with stock white paper invoice!
COA has Retained Earnings, Owner's Drawings and Owner's Equity in Owner's Capital type(7).

Working on the prettier link without having to change the code much.....

A working mercurial build is available for download here.

It is possibly easier than it appears.

The form input page can have a dropdown of various paper sizes - A4, Letter, etc.

The reports can remain the existing repXXX.php - no duplication is required.

The horizontal layout of the report for each page size for heading and detail can have their numbers in arrays - one of which is chosen based on the flag taken from form input data. In all other cases, where separate arrays are not available for different page sizes, the Landscape should be the same as the Portrait except that the longest field if any may be expanded to fill the slack space.

The Vertical Layout remains the same as long as the headers and detail elements add from the top and the footer elements subtract from the bottom and the page size determines the number of lines inbetween - that is all automatic in tcpdf used.

5,798

(9 replies, posted in Setup)

This happens when not rounding off as would occur in integer division. The only place in gl/includes/db/gl_db_trans.inc where such a calculation occurs is at line 360:

$net_amount = $amount/$tax['rate']*100;

What needs to be done is how the $dec is being used from the Page Preferences > Decimal Places > Prices/Amounts.

Each element is populated in the report only if the variable exists.
unsetting the "not required" elements of variable $this->company like $this->company['gst_no'] during report population and the setting it back would suffice.

As for number to words, use a function price_in_words() in your language locale.inc (this does not seem to be documented yet).

Price in words. $doc_type is set to document type and can be used to suppress
price in words printing for selected document types.
Used instead of built in simple english price_in_words() function.

The default function price_in_words() is defined in includes/ui/ui_view.inc and the default documents it is used in are when $document is any of ST_SUPPAYMENT / ST_CUSTPAYMENT / ST_CHEQUE

The actual number to words conversion is done in the function _number_to_words() in the same file.

Joe, this can be accommodated using a flag in the form data input - Report Mode -> Portrait / Landscape.
Also hope the numbers pertain to A4 as well.