Hi Ahmed

aroussi_eg wrote:

1. why doesn't the Item Code show in its field on the report? Is there any workaround? I tried to figure out a solution for that but failed.

Once upon a time... somebody commented line 111 in rep209.php out smile. I guess the aim was more space for item description.

aroussi_eg wrote:

2. why does the purchase order report have the form of an invoice (Invoice No., Cust no, Charge To, Please quote Invoice no. when paying....)? It has the title "PURCHASE ORDER", but other header fields are like mentioned. have i messed up something? Is there a simple workaround?

IMHO this is an effect of never finished work with doctext.inc/doctext2.inc. There should be defined another set of field headers for $doctype==18 i.e. purchase order.
I'm afraid, you can find more such problems in reporting module.

Janusz

2,402

(1 replies, posted in Reporting)

1. In whole FA system there is only one generic interface to print current company documents such as invoices, sales orders etc. There is no direct print link/button available for user after document processing. Why this standard feature is not implemented in FA?

2. What is form_items table for? I understand it was established as a table of all available forms for any generated transactions in system as at time of creation.
To fulfill this requirement the table should keep all data (for example bank account number for invoice) which can vary after document creation. But in form_items structure there are only 2 fields which are used to carry inventory location codes, which are anyway available from stock_moves table.

2,403

(2 replies, posted in Setup)

This looks like taxing structure bug.
This is how I understand tax procedures in FA:

We have 3 tax tables:
1. Taxes - all tax rates used in system;
2. Item Tax Types - category of goods (from fiscal authority point of view)
3. Tax Group - defines sources of taxation e.g. domestic sales, export, sales for special subject (tax exemptions).

The tax group selected for any customer makes a filter which (during invoice processing step) selects tax charges specified by item's tax type. Shipping costs are special case, so we can select which Tax Group is appropriate for them (Tax Shipping option).

Such special tax group should be unique, but in Tax Groups page we can set more then one - this is first issue. The second and worse is that in get_tax_for_items() function (tax_calc.inc) shipping tax is calculated for all tax rates of customer tax group, not for this special group with Shipping Tax option set.

This is source of incorrect shipping tax calculation, isn't it?

2,404

(2 replies, posted in Setup)

I set up two Tax Types:  VAT 22% (basic) and VAT 7% (food). In Tax Groups I have group named VAT including those two tax types. Now when I entry invoice (via customer_invoice.php) FA calculates freight tax with both rates  (22 and 7%), not the basic one.
What is wrong with my setup?

2,405

(14 replies, posted in Accounts Receivable)

Looks pretty smile. Some fast remarks:
1) Mozilla 1.7.8:
After click on view/edit icons in last column new window is broken: record data is presented out of the window on the right. All other seems to work fine.
2) Konqueror 3.3.2 seems to be not usable on this page. There is a lot of faults which source can be at browser, not the page code. I do not trust Konqueror at all.

Is FA 2,0 source code based on any template engine ?

Regards
janusz

2,406

(14 replies, posted in Accounts Receivable)

Hi, joe

joe wrote:

You can take a look here for a very early example:
https://frontaccounting.com/grid/sample16.php.
/Joe

Is it really so early that it's simply not existing ? wink

www.frontaccounting.com wrote:

Not Found
The requested URL /grid/sample16.php. was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.frontaccounting.com Port 80

Regards
janusz

2,407

(2 replies, posted in Translations)

Hi joe
I think it is not big problem when such non-native messages are seen in case of fatal/rare errors such as database corruption.
Gettextization of all program messages and leaving rarely used ones untranslated doesn't hurt. On the other hand smaller .pot file meens more potential translators. People are lazy wink.
Any way this is not very important issue, and actual ~1600 messages to translate is far enough for me.

2,408

(2 replies, posted in Translations)

Hi
Why in many files there is some not gettextized strings, mainly error messages , epecially for db_query() function ? Is this because of lack of developers/translators time, or any other reason?

janusz

2,409

(11 replies, posted in Report Bugs here)

Hi joe
I double checked the problem and found that you are partially right.
If the backup tool is used on account with any standard prefix or to install fresh new company from reference files (sql statements with prefix 0_)  all is correct.

But the problem exists. If you are logged on account with no prefix db_export() makes backup file for the whole database (all table sets). And here problems described in my earlier posts arise.

Below is new patch which remove this issue. One issue still exists, but must be changed in report generator module. database xx_reports is backed up only for user which has empty prefix.

Regards
janusz



--- /var/www/frontaccounting/admin/db/maintenance_db.inc    2007-10-01 10:13:28.000000000 +0200
+++ /var/www/fa/admin/db/maintenance_db.inc    2007-12-30 13:20:45.000000000 +0100
@@ -126,7 +126,6 @@
        $line = trim($line);

        $line = str_replace("0_", $connection["tbpref"], $line);
-        $line = str_replace("Y_", "0_", $line);
        // the last line did not belong to a 'create' sql query
        if (!$table)
        {
@@ -321,7 +320,8 @@
     $all_tables = array();
     while($row = db_fetch($res))
     {
-        if ($conn["tbpref"] == "" || strpos($row['Name'], $conn["tbpref"]) !== false)
+        if (($conn["tbpref"] == '' && !preg_match('/[0-9]+_/', $row['Name']))
+         || ($conn["tbpref"] != '' && strpos($row['Name'], $conn["tbpref"]) !== false))
             $all_tables[] = $row;
     }

2,410

(5 replies, posted in Reporting)

Ok.  If it works it is no sense to change it. Let's treat my post as last resort for those, which do have problems with encoding.

BTW. On the screenshot of Arabic Balance sheet there is any bargage in a header (some squares instead of regular chars) . It looks like font substitution problem.

2,411

(0 replies, posted in Wish List)

In current version of FA there is no possibility to deliver inventory items on sales order without invoicing in the same time. In real world often the goods/services are sell to customer in some parts, but invoice is placed for example ones a month. This situation is implemented  in purchases module, but not in sales.

2,412

(11 replies, posted in Report Bugs here)

Hello  joe
May be my previous post was not clear, but sorry - english is not my native language. I'll try again.

joe wrote:

#2. A temporarily fix to the Report Generator is to limit the access to Admins only.

Yes, it is. This suggests backup of whole database in a manner which makes possible restoring all table sets for all companies from admin generated sql file. But:
1. db_import() function doesn't restore 0_ prefix.
2. what about such case:  you have in database 2 sets of tables for 2 companies with prefixes: 0_, 1_ . Assuming you are logged on admin account with '1_' prefix, after export you have sql backup file with  statements creating table sets with prefixes: '1_' and '1_' (once again). How will look your database after restoring from such backup file? Answer: as before restore operation, or worse - dataset '1_' will be updated with '0_'.


joe wrote:

The problem here is that all the various chart of accounts have been implemented with this 0_ prefix. What do you say to this? When we have solved this we can update the CVS repository.

This is no problem. If you want to use backup module to make 'reference' sql files on development system - you can. Play with database with only one table set with prefix '0_', logging from its account. Then none prefix substitution is necessary.

joe wrote:

Again, did you see my answer to your PDF presentation? If we are sure about that we can include this also.

I've answered in that thread.

Regards
janusz

2,413

(5 replies, posted in Reporting)

I can't remember what was exact source of troubles with another encodings used with R&OS, but some people wasted a lot of time to make it run. With no effects. I personally tried to use it with iso8859-2 (Eastern Europe) encoded fonts, and I give up. To use FPDF with foreign encodings you must recode fonts too. And it works with no troubles for such exotic languages as Japan, Chinesee, Korean or even Polish wink.
I've working FA test instalation for the latest option. If you want I can send you via email or ftp whole package with prepared fonts to test.

Regards
janusz

2,414

(5 replies, posted in Report Bugs here)

joe wrote:

Regarding the Invoice No/Reference no. Most companies use their own number series for their Invoice Numbers (the Reference) instead of the autoincremented Invoice No. This is the reason that we chose to use the Reference instead. We could probably use a switch inside config.php for doing this.

Ok. This make sense, but most (if not all) fiscal autorithies require invoice numbers to be unique and sequential. Here manual edition can be source of legal problems. Most frequently invoice numbers consists serial number + any pre- or postfix. If I can suggest, optimal solution seems to be formating string defined in config.php (sth like "%d/2007"),  used to format default value, which can be edited. Anyway - now default value for field 'Invoice No.' on printing (from reference db field) ) is number of sales order which is not the adequate.

Regarding your suggestions with directing the pdf, we have used this before, but had some problems with some browsers. This was the reason to use our own presentation. Are you sure that this is browser safe now? If you are, then we will try it again.

I cannot guarantee that it will work in any browser (all my hw works on Linux), but JS version do not works at least for Mozilla. Version which I send is simply cut&paste from webERP and is well tested by their community smile.

Regards
janusz

2,415

(5 replies, posted in Reporting)

The PDF generator from R&OS used in frontaccaunting is not usable for charsets other then iso-8859-1. This subject was heavily discussed on webERP lists some years ago. Because this issue is still existing in current FA version I had to use FPDF class for report generation. I use slightly changed class.pdf.inc wrapper which I've written for webERP project. If anybody is interested in it, let me know.

janusz

2,416

(11 replies, posted in Report Bugs here)

Hi joe
Ad 1. Diff folows.

Ad 2. Nope. Report generator stores all reports (for all users and all companies) in one MySQL table xx_reports. This is not good solution, because all users has access to all other company data via 'Test the SQL statement' button. This is serious security issue.

On the other way if backup system is available for Admins only this implies backing up whole database, not only for one company. In one database can coexist table sets with 0_, 1_ etc prefixes and with no prefix at all. So why the code changes only tables with prefix 0_, but the others are backed up with table names leaved intact?

So is the diff:

--- /var/www/frontaccounting/admin/db/maintenance_db.inc    2007-10-01 10:13:28.000000000 +0200
+++ /var/www/fa/admin/db/maintenance_db.inc    2007-12-27 21:36:05.000000000 +0100
@@ -125,8 +125,8 @@
    {
        $line = trim($line);

-        $line = str_replace("0_", $connection["tbpref"], $line);
-        $line = str_replace("Y_", "0_", $line);
+//        $line = str_replace("0_", $connection["tbpref"], $line);
+//        $line = str_replace("Y_", "0_", $line);
        // the last line did not belong to a 'create' sql query
        if (!$table)
        {
@@ -397,7 +397,7 @@
                    for ($k = 0; $k < $nf = db_num_fields($res2); $k++)
                    {
                        // identify null values and save them as null instead of ''
-                        if ($field_type[$k] != "" && $row2[$k] == "")
+                        if ($field_type[$k] != "" && $field_type[$k] != "NO" && $row2[$k] == "")
                            $out .= "NULL";
                        else
                            $out .= "'" . db_escape($row2[$k]) . "'";

2,417

(5 replies, posted in Report Bugs here)

Hi, joe
AFAIK there is simple way to do it in JS. Below are changes to pdf_report.inc which are simply and effective.

Regards
janusz

BTW. On the invoice printing there was reference text placed instead od invoice #. Below this mistake is removed too.
jd

--- /var/www/frontaccounting/reporting/includes/pdf_report.inc    2007-09-06 22:15:37.000000000 +0200
+++ /var/www/fa/reporting/includes/pdf_report.inc    2007-12-29 11:07:23.000000000 +0100
@@ -341,7 +341,7 @@
        else if ($doctype == 9) // SO
            $this->Text($mcol, $myrow['order_no'] ." ".$myrow['customer_ref'], $mcol + 90);
        else // INV/CRE/STA   
-            $this->Text($mcol, $myrow['reference'], $mcol + 90);
+            $this->Text($mcol, $myrow['trans_no'], $mcol + 90);
        $this->Text($mcol + 90, $myrow['debtor_no'], $mcol + 180);
        if ($doctype == 8 || $doctype == 9)
            $this->Text($mcol + 180, sql2date($myrow['ord_date']));
@@ -696,16 +696,13 @@
            }
            else
            {
-                echo '<html>
-                        <head>
-                            <SCRIPT LANGUAGE="JavaScript"><!--
-                          function go_now () { window.location.href = "'.$fname.'"; }
-                          //--></SCRIPT>
-                      </head>
-                      <body onLoad="go_now()"; >
-                        <a href="'.$fname.'">click here</a> if you are not re-directed.
-                      </body>
-                    </html>';
+
+                header('Content-type: application/pdf');
+                header('Content-Disposition: inline; filename=PriceListing.pdf');
+                header('Expires: 0');
+                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+                header('Pragma: public');
+                $this->Stream();
            }        
            // also have a look through the directory, and remove the files that are older than a week
            // rather want to save 'em

2,418

(11 replies, posted in Report Bugs here)

Hi joe

I found 2 bugs in admin/db/maintenance_db.inc:

1. Backup files made on MySQL (as of version 5.0.32) are unusable. This is because of bad interpretation of NULL fields in response of 'SHOW COLUMNS xxx' clause at db_export() function. These fields are filled with with 'NO' value (not empty field) at least in above MySQL version.

2. At start of function db_import() there are 2 lines with str_replace() calls which seems to be garbage from any earlier FA version. Anyway with these two lines uncommented database is corrupted after export/import cycle.

BTW I think available range of backup (all tables vs data for one company) could depend on current user privileges. However this implies separate per user folders.

PS. If you want I can send diff for above changes.

janusz

2,419

(5 replies, posted in Report Bugs here)

After choose Price List printing in Report/Analysis I can print price list at first time, but any data changes in database are not visible on next time display. This is because of javascript redirection to pdf file in reporting/pdf_file dir. The redirected file has no expiration limit set, so browser (Mozilla 1.7.8 in my case) get it from cache, not from server.
This bug is browser-dependent but as far as I know Mozilla is not the one suffred browser.