I found that some of the exchange rate such as TWD(Taiwanese NT Dollar) is unavailable in ECB.  But when I change the source in config.php around line 287 to $dflt_xr_provider = 1; //YAHOO.  It will update.  I then tested on GOOGLE and BLOOMBERG.  The source Google is Ok but Bloomberg did not update.  Is the Bloomberg no longer available?

$xr_providers = array("ECB", "YAHOO", "GOOGLE", "BLOOMBERG");
$dflt_xr_provider = 0;

/Mark

This is the error in the log file after I clicked on the voided payment #:

[19-Jun-2016 22:22:28 Asia/Singapore] <b>DATABASE ERROR :</b> no debtor trans found for given params<br>sql that failed was : SELECT trans.*,ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,cust.name AS DebtorName, cust.address, cust.curr_code, cust.tax_id, com.memo_,bank_act,0_bank_accounts.bank_name, 0_bank_accounts.bank_account_name,
            0_bank_accounts.account_type AS BankTransType,
            0_bank_accounts.bank_curr_code,
            0_bank_trans.amount as bank_amount FROM 0_debtor_trans trans
                    LEFT JOIN 0_comments com ON trans.type=com.type AND trans.trans_no=com.id
                    LEFT JOIN 0_shippers ON 0_shippers.shipper_id=trans.ship_via,
                    0_debtors_master cust, 0_bank_trans, 0_bank_accounts WHERE trans.trans_no='3'
        AND trans.type='12'
        AND trans.debtor_no=cust.debtor_no AND 0_bank_trans.trans_no ='3'
            AND 0_bank_trans.type=12
            AND 0_bank_trans.amount != 0
            AND 0_bank_accounts.id=0_bank_trans.bank_act <br><br><br>



/Mark

The one that I encountered with the error message was version 2.3.22.  And I have made a clean installation of version 2.3.25. 

I created a direct invoice and enter the customer payment transaction for this invoice.  Then I void this payment transaction. I went back to list Customer Transactions, and click on the number (#) of this voided payment transaction:

1.  On version 2.3.22:  I got the error as mentioned in my previous post.
2.  On version 2.3.25:  I got a new browser windows totally blank. (If there is no issue, I would expect to see the transaction and with the void note below)

I found the "!" in the file "cust_trans_db.inc" causing this issue as mentioned in my previous post.

I hope that this can be duplicated by other users and it can be rectified.  Otherwise, either a blank screen or error message made it look a little unappealing although I did not see this error caused other issues to the other transactions.

Thank you.

/Mark

It works.  Thanks!

/Mark

I found a problem with error message after I voided a customer payment.  This problem has been encountered by other users:

Ref: https://frontaccounting.com/punbb/viewtopic.php?id=4892

When attempt to open a voided customer payment by clicking on the Customer Payment #, the following error message appeared:

DATABASE ERROR : no debtor trans found for given params
sql that failed was : SELECT trans.*,ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,cust.name AS DebtorName, cust.address, cust.curr_code, cust.tax_id, com.memo_,bank_act,0_bank_accounts.bank_name, 0_bank_accounts.bank_account_name, 0_bank_accounts.account_type AS BankTransType, 0_bank_accounts.bank_curr_code, 0_bank_trans.amount as bank_amount FROM 0_debtor_trans trans LEFT JOIN 0_comments com ON trans.type=com.type AND trans.trans_no=com.id LEFT JOIN 0_shippers ON 0_shippers.shipper_id=trans.ship_via, 0_debtors_master cust, 0_bank_trans, 0_bank_accounts WHERE trans.trans_no='22' AND trans.type='12' AND trans.debtor_no=cust.debtor_no AND 0_bank_trans.trans_no ='22' AND 0_bank_trans.type=12 AND 0_bank_trans.amount != 0 AND 0_bank_accounts.id=0_bank_trans.bank_act

I managed to find a line in  sales/includes/db/cust_trans_db.inc that somehow caused the database error.

    if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
        // it's a payment so also get the bank account
        $sql .= " AND ".TB_PREF."bank_trans.trans_no =".db_escape($trans_id)."
            AND ".TB_PREF."bank_trans.type=$trans_type
            AND ".TB_PREF."bank_trans.amount != 0  <<== the "!=" is causing the issue
            AND ".TB_PREF."bank_accounts.id=".TB_PREF."bank_trans.bank_act ";

As stated above, this != 0 is causing the problem.  If I remove "!", then the voided payment will appear normal.  But the normal customer payment will have the same error.

Due to my limited php knowledge, I am not able to fix it. 

I hope this can be fixed as soon as possible or it looks ugly when the user click on the transaction.

Thanks!

/Mark

It was version 2.3.22.   I upgraded to 2.3.25 and I did the same test and it just showed a blank screen. (not sure your 2.3.25"+" contains what patches).

The COA I'm using is Singapore 4 digit.

I will re-Post this over there.

I found a problem with error message after I voided a customer payment.  This problem has been encountered by other users:

Ref: https://frontaccounting.com/punbb/viewtopic.php?id=4892

When attempt to open a voided customer payment by clicking on the Customer Payment #, the following error message appeared:

DATABASE ERROR : no debtor trans found for given params
sql that failed was : SELECT trans.*,ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,cust.name AS DebtorName, cust.address, cust.curr_code, cust.tax_id, com.memo_,bank_act,0_bank_accounts.bank_name, 0_bank_accounts.bank_account_name, 0_bank_accounts.account_type AS BankTransType, 0_bank_accounts.bank_curr_code, 0_bank_trans.amount as bank_amount FROM 0_debtor_trans trans LEFT JOIN 0_comments com ON trans.type=com.type AND trans.trans_no=com.id LEFT JOIN 0_shippers ON 0_shippers.shipper_id=trans.ship_via, 0_debtors_master cust, 0_bank_trans, 0_bank_accounts WHERE trans.trans_no='22' AND trans.type='12' AND trans.debtor_no=cust.debtor_no AND 0_bank_trans.trans_no ='22' AND 0_bank_trans.type=12 AND 0_bank_trans.amount != 0 AND 0_bank_accounts.id=0_bank_trans.bank_act

I managed to find a line in  sales/includes/db/cust_trans_db.inc that somehow caused the database error.

    if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {
        // it's a payment so also get the bank account
        $sql .= " AND ".TB_PREF."bank_trans.trans_no =".db_escape($trans_id)."
            AND ".TB_PREF."bank_trans.type=$trans_type
            AND ".TB_PREF."bank_trans.amount != 0  <<== the "!=" is causing the issue
            AND ".TB_PREF."bank_accounts.id=".TB_PREF."bank_trans.bank_act ";

As stated above, this != 0 is causing the problem.  If I remove "!", then the voided payment will appear normal.  But the normal customer payment will have the same error.

Due to my limited php knowledge, I am not able to fix it. 

I hope this can be fixed as soon as possible or it looks ugly when the user click on the transaction.

Thanks!

/Mark

Hi Joe, AP Muthu,

Sorry for the late reply as I have been out of town and got sick...

Thanks for update.  I will try it out.

/Mark

Under the "Items and Inventory", when an item is selected, there are number of tabs "Sales Pricing", "Purchasing Pricing", "Standard Cost"...etc which will appear black and users can enter the pricing details by clicking on the tab.

I found a access control issue.  If I set the User Access control to disallow the user on "Sales Prices Edition" under Sales Configuration, the user will not see the Sales Pricing (or grey out depending on the config.php setting) under "Items and Inventory" section.  However, if user goes to "Items" and select an item, he still can access the pricing and change the pricing details here by clicking on the "Sales Pricing" tab.  The access to this tab should be denied if the "Sales Prices Edition" is disallowed.

How can this problem be rectified?

Thank you

/Mark

I wanted to increase the font size and I entered

$rep->Font(+2)

And once I removed this, the invoice printed properly.

Hi APMuthu,

Thanks.  I have found the problem.   A font type was added in rep107.php some time back and it caused the issue with the Chinese fonts.  I have removed this line and the Invoice with non-home currency can be printed now.  Sorry for causing the alarm....

By the way, may I know how do I increase the font size or make the font italic in rep107.php?  Will this rep->Font(+2) work?  Or what should the correct line to add?

Thanks.

/Mark

Hi,

I have made changes to the respective files and mysql structure to UTF8 so as to cater for Chinese characters entry and output as required by our users.  And I have successfully made it work.  But I discovered an issue when printing Invoice.  And this issue only happened on printing Invoice but not on other documents such as SO, PO, DO when the home currency and the Invoice currency are different.

Here were what I did to make the system works with Chinese characters:

-   Downloaded the font files: chinese_simplified_cid0, unzipped and place them in reporting/fonts directory
-   Updated the reporting/includes/class.pdf.inc
                    case "ar_EG" :     $fontname = "ae_tholoth";     break;
                    case "zh_CN" :     $fontname = "gbsn00lp";     break;
                    case "zh_TW" :     $fontname = "chinese_traditional_cid0";     break;
                    default :          $fontname = "chinese_simplified_cid0";    break;
-   Updated the encoding in lang\installed_languages.inc with UTF8
        $installed_languages = array (
        0 =>
        array (
        'code' => 'C',
        'name' => 'English',
        'encoding' => 'utf-8',
-   Changed the character set to UTF8.

With this, the system with English Interface allows of Chinese Characters input and print.  We did not encounter any problem when printing PO, SO, Delivery Note with the Chinese Items, Customer names, addresses...etc.  However, we have a problem with Invoice when the home and invoice currencies are different and I will get an error "TCPDF error: Unsupported font type:" when printing the Invoice.   When I change the currency to match with the invoice currency, then it has no problem of printing.

Would someone advise how to solve the problem. 

Thank you.

/Mark

Hi @itronics,

The GL you mentioned:  does it mean that  the AP and AR which are not in home currency will be revaluated too besides the foreign currencies bank account?

Dear Anoop,

I have the needs and I am interested to have your source code.  Many thanks to send the source code to my email at mgatech.mark@gmail.com.

/Mark

Hi Joe,

Below the dotted line is the topic I extracted from https://frontaccounting.com/punbb/viewtopic.php?id=2076.  The original post was posted back in 2011. 

I would like to ask if the proposed changes (highlighted in blue below) have been implemented to the FA versions say, 2.3.19 or onwards?  That is, FA revaluate the non-home currency AP, AR and the non-home currency bank accounts.

Thank you.


/Mark

.......................................................................
Re: Currency Revaluations - Supplier/Customer balancesI have redirected a similar discussion we have had here.

https://frontaccounting.com/punbb/viewtopic.php?id=2057

I will try to explain how we eventually can solve it in FA. Please correct me if something seems wrong in my explanation.

We save the rate on the debtor_trans and supp_trans and we save the currency on the customer/supplier.

A revaluation could run with the following formula:

SUM all currency customers not fully allocated records with the rate of the record date and SUM all currency customers not fully allocated records with todays rate. The differences are booked on AR account and Exchange Variation Account.

SUM all currency suppliers not fully allocated records with the rate of the record date and SUM all currency suppliers not fully allocated records with todays rate. The differences are booked on AP account and Exchange Variation Account.

Well while we are doing that shouldn't we now replace all the rates on the records with todays rate? Otherwise we can't do this revaluation more times, right?

Can anybody see any side-effects with this?

/Joe

Thanks APMuthu for the valuable info....

/Mark

Hi there,

I am trying to figure out more about the functions of FA.

I have 2 questions:

1.   I saw a lot of predefined functions in FA include directories.  Is there a summary or documentation that describe these functions and that I could refer to learn more about these functions.

2.   Also, I saw functions that carry variables (see below) such as 'charge', 'discount', 'amount', 'ref', 'memo_' ...etc.  Would someone please advise where can I find these variables and their definitions?  They seem to me are the names of the database table Name but I'm not sure...

Thanks..


==============================
    amount_row(_("Bank Charge:"), 'charge');

    start_table(TABLESTYLE, "width=60%");

    label_row(_("Customer prompt payment discount :"), $display_discount_percent);
    amount_row(_("Amount of Discount:"), 'discount');

    amount_row(_("Amount:"), 'amount', null, '', $cust_currency);
    textarea_row(_("Memo:"), 'memo_', null, 22, 4);

Hi AP Muthu,

Sorry for the late reply.... and sure I'm happy to provide the change I made.

Actually it is just a small change to this file:  sales/customer_invoice.php:

At around line 400,  I commented this line:

ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");

and replaced it with these 2 lines:

label_cells(_("Inv No:"), $_SESSION['Items']->reference, "class='tableheader2'");
hidden('ref', $_SESSION['Items']->reference);

That's all I did and now the Invoice number cannot be changed by user.

I'm not sure this is the best way to do but it achieved what I need.

Thanks very much.
It works for me!

Thanks APmuthu.   I need some help in getting the variable of the field. 

Based on this line:

ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'"); //Invoice Number assigned but editable

I thought the value is $_SESSION['Items']->reference.  But I struggled to figure out what should be the correct variable/value to assign to the field but I failed to make it work.  (I can't put $ref = $_SESSION['Items']->reference;)

I would appreciate it if you could advise how to assign that and it will help if you could give me some examples.

Thank you.

I have posted this under another post but there is no reply so I transferred the topic to here....

There is a need to implement a control of the invoice number and we have to make the invoice number non-editable by the user when they enter a Direct Invoice or Invoice against a delivery.  We used the Form Setup to assign the first number and let the Invoice number incremental run automatically.

Currently, the Invoice screen will show the Invoice Number assigned by the Form Setup and the field allows user to edit.   This is because of the lines below in sales\customer_invoice.php:

if ($_SESSION['Items']->trans_no == 0) {
    ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'"); //Invoice Number assigned but editable
} else {
    label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}



To make it non-editable, I have replaced the line ref_cells to label_cells as follows:

if ($_SESSION['Items']->trans_no == 0) {
    label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");  //Invoice Number assigned and now not editable
} else {
    label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}

With this change, now the Invoice number is assigned (by Form Setups) and not editable.  However, when I process the Invoice, the error "You must enter a reference." shows.  I know I missed out something but I don't know what else to change.  The Invoice Number showed is not assigned to the variable which in turn update the reference in the database tables.  This variable is empty.

Would you please advise what other codes I have to change so that the assigned Invoice number is picked up and update the reference in the Tables?

Thank you.

Mark

Hi Joe/AP Muthu,

Is it possible to add a link on the screen (say Company Setup) and allow users to select the file (Header.pdf or Header2.pdf)  and upload the files to the company/X/reporting/forms/ directory?     We host FA in a server but we do not want the users to access to the FA directory.

If so, would you please advise the codes to add?

Thanks a lot.

Regards,
Mark

@APMuthu, @Joe,

The scripts work correctly.  I managed to get it done now instead of next week.  Below are 2 screen shots, before and after the new scripts.  Thanks guys.

http://www.mgatech-sg.com/images/Purchase-CreditNote-Before.jpg
http://www.mgatech-sg.com/images/Purchase-CreditNote-After.jpg

/Mark

49

(2 replies, posted in Setup)

Thanks Joe...

/Mark

Hi,

How can I attach the screen shot directly on this post?

/Mark