1 (edited by seend 11/23/2015 08:21:31 pm)

Topic: Sales Quotation/Order/Invoice leading to blank page

Hi,

Have done a new install recently and tried to create a sales transaction. When click on sales invoice, quotation etc leads to a blank white page.

I have deactivated all extensions I had installed and also reverted back to the default theme, but still getting the same errors.

Am using FrontAccounting 2.3.24.

Any ideas how to investigate this / fix it?

any help much appreciated.

Update:

Looking through the error log file, I am getting this error only when click on any of the: Sales Quotation, Direct INvoice etc.

23-Nov-2015 21:09:16] <b>DATABASE ERROR :</b> The customer details could not be retrieved<br>error code : 1064<br>error message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2, -1, 1)
            * (trans' at line 8<br>sql that failed was : SELECT 0_debtors_master.name, 0_debtors_master.curr_code, 0_payment_terms.terms,
        0_debtors_master.credit_limit, 0_credit_status.dissallow_invoices, 0_credit_status.reason_description,

        Sum(IFNULL(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2, -1, 1)
            * (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount),0),0)) AS Balance,
        Sum(IF ((TO_DAYS('2015-11-23') - TO_DAYS(IF (trans.type=10, trans.due_date, trans.tran_date))) > 0,IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2, -1, 1)
            * (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount),0),0)) AS Due,
        Sum(IF ((TO_DAYS('2015-11-23') - TO_DAYS(IF (trans.type=10, trans.due_date, trans.tran_date))) > ,IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2, -1, 1)
            * (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount),0),0)) AS Overdue1,
        Sum(IF ((TO_DAYS('2015-11-23') - TO_DAYS(IF (trans.type=10, trans.due_date, trans.tran_date))) > 0,IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2, -1, 1)
            * (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount),0),0)) AS Overdue2

        FROM 0_debtors_master
             LEFT JOIN 0_debtor_trans trans ON
             trans.tran_date <= '2015-11-23' AND 0_debtors_master.debtor_no = trans.debtor_no AND trans.type <> 13
,
             0_payment_terms,
             0_credit_status

        WHERE
             0_debtors_master.payment_terms = 0_payment_terms.terms_indicator
             AND 0_debtors_master.credit_status = 0_credit_status.id
             AND 0_debtors_master.debtor_no = '' GROUP BY
              0_debtors_master.name,
              0_payment_terms.terms,
              0_payment_terms.days_before_due,
              0_payment_terms.day_in_following_month,
              0_debtors_master.credit_limit,
              0_credit_status.dissallow_invoices,
              0_credit_status.reason_description<br><br><br>

2 (edited by apmuthu 11/26/2015 05:02:42 pm)

Re: Sales Quotation/Order/Invoice leading to blank page

File: sales/includes/db/customers_db.inc
Function: get_customer_details()
The mandatory parameter must be a valid $customer_id.
If invalid, it causes an error in line the sql construction portion on line 100:

             AND ".TB_PREF."debtors_master.debtor_no = ".db_escape($customer_id)." ";

You tried to create a quotation without having created atleast 1 customer.

@seend: Try to use the FA 2.3.24+ snapshot and see if the error persists. It might also be that you are using a newer version of PHP that uses the STRICT option which may be disabled in PHP 5.6 but is compiled hardcoded in PHP 5.7 onwards.

@joe: An error should be output when no customer exists if a Document Form depends on it. I thought it was so now.

Re: Sales Quotation/Order/Invoice leading to blank page

@apmuthu
Yes the error should be enabled. If there are no customers and/or branches in the system, there should be an error reported before you can proceed. Will have a look.
@seend
In the meantime, please set the $go_debug variable first in the file config.php to 1 or 2, to trap any errors.

Joe