826

(18 replies, posted in Setup)

@joe: How do we handle such rounding errors in a standardised way to avoid adjustment journal entries?

827

(18 replies, posted in Setup)

Try this piece of code in a test php file:

<?php
if (1.7 >= 17 * 0.1) {
  echo '1.7 is greater than or equal to ' . 17 * 0.1;
} else {
  echo '1.7 is NOT greater than or equal to ' . 17 * 0.1;
}

echo "<br>\n" . (0.1 + 0.2);

?>

In XAMPP 1.7.3 (PHP 5.3.1) we get:

1.7 is NOT greater than or equal to 1.7000000000000002
0.30000000000000004

This is because native operator are indeed interpreted in base 2, and most base 10 decimal converts badly in base 2.

If you need precision, you need to either only manipulate integers (converts perfectly to base 2) or use a dedicated lib such as bcmath (checkout the wrapper to ease bcmath usage Math).

Ref as of 2 months ago:
https://stackoverflow.com/questions/58744298/php-floating-point-multiplication-and-comparison-issue

Ref as of nearly 11 years ago:
https://stackoverflow.com/questions/588004/is-floating-point-math-broken

Ref in PHP.net:
https://bugs.php.net/bug.php?id=74534

Floating point arithmetic for programmers

828

(18 replies, posted in Setup)

$config_allocation_settled_allowance value in config.php.

829

(18 replies, posted in Setup)

Then play with the delta value in config.php

Explain how you wish to treat admin expenses on accrual basis.
Normal journal entries should suffice.
Otherwise, if inventorable goods are used and wish to be tracked, then open a sales order and keep adding to it and keep delivering it in part and when all are done, "invoice" it by allocating from an equivalent credit note for self expenses.

831

(8 replies, posted in Translations)

The actual installer translations are yet to be added in to the official repo.
Added Now.

832

(5 replies, posted in Setup)

https://www.transifex.com/gnuacademy/frontaccounting-1/ -- FA 2.3.x
https://www.transifex.com/gnuacademy/frontaccounting24/  -- FA 2.4.x

Check out the codebase after the recent menu popups fixes in the FA GitMaster.

834

(3 replies, posted in Setup)

Since you are only drop shipping it, have a separate PHP Application or FA module made that reads from the FA tables and do it as a cron job for population of the new application/module's tables. The only real page for the application/module would be to choose the drop ship customer and provide reports. This way, you need not divulge the rates / prices of your real customer to their downlines.

835

(7 replies, posted in Wish List)

Other Chat applications that will need manual integration in a similar manner are:

* On SourceForge: PHPChat, PHPFreeChat.
* Fox21 PHPChat
* Make Your Own Chat Script in PHP - Tutorial

The actual value of TB_PREF is in the $db_connections[#]['tbpref'] array element in config_db.php's  that pertains to the company (#) logged in.

837

(18 replies, posted in Setup)

Whilst a onetime cleanup using a journal adjustment entry is in order, the real solution going forward will be to increase the precision in php.ini from default 14 to 17.

An interesting discussion on this topic is here:
https://stackoverflow.com/questions/145 … oint-issue.

Whilst at it, please fix the "PM Link" for the moderator login in the top horizontal menu.

@paul: highlighting the the two similar lines will expose trailing spaces in the one to be removed.

The way to do is listed in this post and it is upto the ingenuity of the deployer to do it as they deem fit.

841

(12 replies, posted in Fixed Assets)

@joe: is this a real solution?

842

(12 replies, posted in Reporting)

It most certainly does. See attachment.
Which version of FA are you using?
FA 2.4.7 has been released in June 2019 and several fixes to it has been made as well till date.
This is a very old (> 2 years) issue that has been fixed.

843

(6 replies, posted in Reporting)

The same construct is seen in

reporting/rep107.php
reporting/rep110.php
reporting/rep113.php
includes/ui/ui_view.inc

@joe: Do any of these reports or file show the same effect?

@joe: Maybe put in this fix after checking if PHP version >= 7.

The chr(32) is to specify Ascii instead of any other collation like utf-8, etc. that would occur if a mere space was put in place of it.

845

(6 replies, posted in Reporting)

@joe: what should change and where (earlier or later) - should this be committed?

Where is the Development Forum?
@joe: any secret forum....?

The inserted line in the proposed solution is:

$this->from = $parts[1];

There is no "else" in the current codebase nor thru from FA v2.2.1.
It is not there even in @FreeMan's  cloned repo as of 4 years ago.

Wonder which version of FA is being used.

Thanks @joe.

Whilst we are on this, we might as well optimise the sql in the last function in sales/includes/db/sales_order_db.inc with:

--- sales/includes/db/sales_order_db.inc    Tue Jan 14 05:30:15 2020
+++ sales/includes/db/sales_order_db.inc    Tue Jan 14 05:42:21 2020
@@ -632,11 +632,9 @@
 {
         $sql = "SELECT $field
             FROM ".TB_PREF."sales_order_details d
-            WHERE order_no =
-            (SELECT order_no FROM ".TB_PREF."sales_orders o
+            LEFT JOIN " .TB_PREF."sales_orders o on d.order_no=o.order_no
             WHERE debtor_no=" . db_escape($order->customer_id) . "
-            ORDER BY order_no DESC LIMIT 1)
-            ORDER BY d.id DESC LIMIT 1";        
+            ORDER BY d.id DESC LIMIT 1";
 
         $last_query=db_query($sql, "Could not retrieve last order detail");
         $row = db_fetch_row($last_query);

@joe: is this necessary?

https://github.com/apmuthu/FA24extensions/tree/master/Extensions/rep_cash_flow_statement