Both Google and Bloomberg Exchange rates work with the new fix attached herewith.
2,301 12/12/2017 06:35:22 pm
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
2,302 12/12/2017 05:14:24 pm
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
No need to bother with the number_format statement. The Bloomberg fix uses another part of the page which does not have any locale formatting. I have changed it a bit and re-uploaded it. If you were the first to download it then download it again.
2,303 12/12/2017 04:06:33 am
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
It appears that both php-curl and the FA function url_get_contents() fail for BLOOMBERG exchange rate provider now that they insist on https:// and also have a second colon in the url, the parsing of the url causes some problems.
The attached fix also overcomes the locale based thousands separator in the rate, mitigated by acquiring another string from the file that has no separators.
2,304 12/11/2017 11:45:49 pm
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
YAHOO has blocked all access to FA's means of exchange rate acquisition.
Checkout:
http://download.finance.yahoo.com/d/quotes.csv?s=USDIDR=X&f=sl1d1t1ba&e=.csv
The widget js that does the job is at:
https://widget-yahoo.ofx.com/resources/1500309750700/js/app.js
The new page to look at is:
https://widget-yahoo.ofx.com/
and this sports the separator with locale as well.
ECB is still available with no separators:
http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
Google is also still available with no separators:
http://finance.google.com/finance/converter?a=1&from=OMR&to=IDR
Bloomberg is available for select currency sets with a separator:
https://www.bloomberg.com/quote/USDIDR:CUR
2,305 12/11/2017 11:32:18 pm
Re: Whats happened with Recurrent invoices? (24 replies, posted in Accounts Receivable)
Try this now:
function calculate_next($myrow)
{
if ($myrow["last_sent"] == '0000-00-00')
$next = sql2date($myrow["begin"]);
else
$next = sql2date($myrow["last_sent"]);
if ($myrow['days'] == -1 && $myrow['monthly'] > 0) {
// ignore months when days = -1
$next = begin_month($next); // to later become last day of previous month
$myrow['days']=0;
}
$next = add_months($next, $myrow['monthly']);
$next = add_days($next, $myrow['days']);
return add_days($next,-1);
}
2,306 12/11/2017 11:20:14 pm
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
Also we need to check if locale specific separators will have their say as well.
2,307 12/11/2017 11:11:39 pm
Re: Customer reference (1 replies, posted in Accounts Receivable)
Whilst a Supplier's Reference is mandatory for all Purchase Forms (Payment Terms absent), the Customer Reference is available as an option for input in all Sales Forms (Sales Quotation, Order, Delivery and Invoice) where the Payment Terms (mandatory) is "Non Cash".
See attached screenshot.
More info in the Wiki.
2,308 12/11/2017 03:28:53 pm
Re: Whats happened with Recurrent invoices? (24 replies, posted in Accounts Receivable)
From the wiki:
A days value of -1 together with a month value would be the last day in the previous month.
Hence we need a month value as well to get the period.
The function that can now be tried is:
function calculate_next($myrow)
{
if ($myrow["last_sent"] == '0000-00-00')
$next = sql2date($myrow["begin"]);
else
$next = sql2date($myrow["last_sent"]);
if ($myrow['days'] == -1 && $myrow['monthly'] > 0) {
// ignore months when days = -1
$next = add_days(begin_month($next), -1); // last day of previous month
$myrow['days']=0;
}
$next = add_months($next, $myrow['monthly']);
$next = add_days($next, $myrow['days']);
return add_days($next,-1);
}
2,309 12/11/2017 03:03:03 pm
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
Try to replace line 318 of /includes/current_user.inc:
$num = number_format($number, $dec, $dsep, $tsep);
with
$num = number_format(floatval(trim($number)), $dec, $dsep, $tsep);
PHP's loose typing has been trampled upon in later versions like 7.0+ and hence type casting may be needed.
This may happen when some whitespace creeps into $number.
2,310 12/10/2017 07:01:53 pm
Re: Whats happened with Recurrent invoices? (24 replies, posted in Accounts Receivable)
For 30 days it appears okay so we do not need to change that portion.
For -1, the invoice needs to be raised on the last day of the month for the period from the last day of the previous month to the day before the last day of the current month.
The new function replacement should be:
function calculate_next($myrow)
{
if ($myrow["last_sent"] == '0000-00-00')
$next = sql2date($myrow["begin"]);
else
$next = sql2date($myrow["last_sent"]);
if ($myrow['days'] == -1) {
// ignore months when days = -1
$next = add_days($next, 2); // <-- changed line
$next = end_month($next);
return $next;
} else {
$next = add_months($next, $myrow['monthly']);
$next = add_days($next, $myrow['days']);
return add_days($next,-1);
}
}
2,311 12/10/2017 03:32:12 am
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
These incremental changes are to assist those who installed from a release. Just overwrite the corresponding files harmlessly with these files and you have "upgraded".
The CHANGELOG.txt file in it will provide all the necessary info on what has changed.
If you download from my repo, you will get the list of changes separately that have not been accepted yet by the devs. The files in the FA24Mods folder can be used to overwrite their counterparts in the core before install.
2,312 12/10/2017 01:18:38 am
Re: FA2.4.2 error getting exchange rate from Google (55 replies, posted in Report Bugs here)
@poncho1234: hope you are using the FA 2.4.3+ bleeding edge code and not just the release.
2,313 12/10/2017 01:16:01 am
Re: Whats happened with Recurrent invoices? (24 replies, posted in Accounts Receivable)
If we put in 1 month, then it will be a calendar month. If we put in 30 days, it will be just so using the add_month() function.
The -1 functionality works okay for the first invoice and is 1 day earlier for the rest.
Try to change the 3rd line above:
$next = add_days($next, 1);
to:
$next = add_days($next, 2);
and provide feedback for the "-1" cases.
2,314 12/09/2017 05:23:05 pm
Re: Whats happened with Recurrent invoices? (24 replies, posted in Accounts Receivable)
Month is a calendar month and not 30 days.
Months and days can be used together like 1 month and 7 days.
The functions "add_months" and "add_days" are defined in includes/date_functions.inc.
The functions "days_in_month" and "end_month" are also defined therein.
We can use the native PHP function cal_days_in_month(CAL_GREGORIAN,10,2005); to get the days in a month / end of month. This function has been available since PHP 4.1+. The "-1" can be implemented using these functions.
Lines 79-81 of the function calculate_next():
$next = add_months($next, $myrow['monthly']);
$next = add_days($next, $myrow['days']);
return add_days($next,-1);
can be altered to make for the "-1" functionality of last day of the month as:
if ($myrow['days'] == -1) {
// ignore months when days = -1
$next = add_days($next, 1);
$next = end_month($next);
return $next;
} else {
$next = add_months($next, $myrow['monthly']);
$next = add_days($next, $myrow['days']);
return add_days($next,-1);
}
Please test and provide feedback for inclusion into the core.
2,315 12/09/2017 05:08:31 pm
Re: how to remove table border lines in Sales Invoice print report (2 replies, posted in Reporting)
Logo can now be disabled in the company setup page.
2,316 12/09/2017 02:11:48 pm
Re: Project Management Extension (24 replies, posted in Modules Add-on's)
Windows / DOS line endings are chr(13).chr(10) or "\r\n" whilst Unix line endings are just chr(10) or "\n". In frontaccounting, we can run the following on Unix to convert them wholesale (assuming the webroot to be /var/www/frontac):
cd /var/www/frontac
find ./ -type f \
-name "*.php" \
-o -name "*.css" \
-o -name "*.js" \
-o -name "*.txt" \
-o -name "*.inc" \
-o -name "*.sql" \
| xargs dos2unix
2,317 12/09/2017 06:44:29 am
Re: Inventory Valuation Report showing 0 (zero) on Unit Cost (16 replies, posted in Items and Inventory)
The default value of the precision parameter in php.ini on a 32 bit system is 14 even when absent. In some installs it comes preset at 17. All float values that are a result of a fraction that has recurring decimals ad infinitum will generally truncate off at ini_get('precision')-3 decimals, to make up for a:
1. sign,
2. single integer to the left of the decimal point and
3. the decimal point itself.
Hence the line 356 of includes/current_user.inc:
if ($len > $dec)
should be:
if ($len > $dec && $len < ini_get('precision')-3)
@joe: can commit both fixes (decimals and report sql)
2,318 12/09/2017 04:17:17 am
Re: Inventory Valuation Report showing 0 (zero) on Unit Cost (16 replies, posted in Items and Inventory)
The sql in the function getAverageCost() defined in the file reporting/rep301.php (Inventory Valuation Report) is like:
SELECT move.*, IF(ISNULL(supplier.supplier_id), debtor.debtor_no, supplier.supplier_id) person_id
FROM 1_stock_moves move
LEFT JOIN 1_supp_trans credit ON credit.trans_no=move.trans_no AND credit.type=move.type
LEFT JOIN 1_grn_batch grn ON grn.id=move.trans_no AND 25=move.type
LEFT JOIN 1_suppliers supplier ON IFNULL(grn.supplier_id, credit.supplier_id)=supplier.supplier_id
LEFT JOIN 1_debtor_trans cust_trans ON cust_trans.trans_no=move.trans_no AND cust_trans.type=move.type
LEFT JOIN 1_debtors_master debtor ON cust_trans.debtor_no=debtor.debtor_no
WHERE stock_id=102
AND move.tran_date < '2017-11-27'
AND standard_cost > 0.001
AND qty <> 0
AND move.type <> 16 -- ST_LOCTRANSFER
ORDER BY tran_date;
This means that when the purchase invoice is made on 2017-11-27, the sql above computes the average cost to just before the said date and not including it. If a subsequent date is used for the query, then all is well (save for the irrational value at times not obeying the decimal limit).
@joe: must we correct line 65 in it:
AND move.tran_date < '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND move.type <> ".ST_LOCTRANSFER;
to be
AND move.tran_date <= '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND move.type <> ".ST_LOCTRANSFER;
so that it takes into consideration all transaction up until the end of the day and not to just before the date?
The decimals issue can be corrected by appropriately formatting the return value at the end of the said function or where it it used in line 211 in the report although line 229 uses it without assignment when $details is present. The culprit is line 357 in includes/current_user.inc for irrational numbers with large number of decimal places when the value of $dec becomes 14. It is best hard coded to 2.
2,319 12/09/2017 02:48:36 am
Re: Order on Hold (1 replies, posted in Wish List)
@joe: An inactive flag?
2,320 12/09/2017 02:47:00 am
Re: Project Management Extension (24 replies, posted in Modules Add-on's)
Added Kanban to the list of extensions in my FA24extensions repo.
@notrinos: replace CRLF with LF (Unix line endings) in the 2 jquery files in your js folder and you may want to update your README.md to this one.
@itronics: can add it to the official pkg repo.
2,321 12/09/2017 02:14:13 am
Re: edit quote options (4 replies, posted in FA Modifications)
Listed in the Pending Issues post.
In the meanwhile, export a quote and import it as a new one after modifying it or after importing it.
2,322 12/09/2017 02:09:24 am
Re: Repeating line items block inside single invoice page (4 replies, posted in FA Modifications)
Stands corrected:
Line 146 in reporting/rep107.php:
$result = get_customer_trans_details(ST_SALESINVOICE, $row['trans_no']);
gets the line items from the function (defined in sales/includes/db/cust_trans_details_db.inc) used above like:
SELECT line.*,
line.unit_price+line.unit_tax AS FullUnitPrice,
line.description AS StockDescription,
item.units, item.mb_flag
FROM 1_debtor_trans_details line,1_stock_master item
WHERE (
(debtor_trans_no=1) -- 1st Transaction in Demo Co
AND debtor_trans_type=10 -- ST_SALESINVOICE
AND item.stock_id=line.stock_id
)
ORDER BY id
This result having the invoice's line items are cycled through from lines 148 to 181 in reporting/rep107.php.
2,323 12/07/2017 09:28:44 am
Re: Repeating line items block inside single invoice page (4 replies, posted in FA Modifications)
Lines 344 onwards in reporting/rep107.php cycle through the line items which is what you need to put into some javascripted set of tabs.
2,324 12/07/2017 09:11:25 am
Re: How can i integrate frontaccounting with AdminLTE? (6 replies, posted in Setup)
The image links can have a title attribute for their "a" tag.
2,325 12/07/2017 12:02:26 am
Re: Whats happened with Recurrent invoices? (24 replies, posted in Accounts Receivable)
It works okay in 2.4.3+.
The last significant changes to the file sales/create_recurrent_invoices.php that introduced the functions "calculate_from" and "calculate_next" were done between Apr and July 2015 and they compute correctly as per the wiki.
Attached are the screenshots of the Recurrent Sales Invoice Request Form, it's execution and the resultant Invoice generated.
Where in it do you face a problem?