Topic: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

I just upgraded to 2.4.4 from 2.4.1 and it no longer shows sales invoices if they were for free i.e. 0.00

We create service invoices for 0.00 when work was guaranteed all the time and can no longer see the clients complete  work history.  The invoices can no longer be seen all types and I just noticed the delivery notes are missing as well.

Thank you

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

I didn't know it changed, but to show them,

sales/includes/db/cust_trans_db.inc
function get_sql_for_customer_inquiry

Change line 351 to:

    // exclude voided transactions :
            ." AND ISNULL(v.date_)"
        // exclude self-balancing (journal) transactions:

      ." AND (trans.type = " . ST_SALESINVOICE . "
            OR (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount) != 0)";

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

@joe: Please verify and include if okay. Why was this done in the first place - was it the remnant of some debug coding? Or must there be a flag to suppress zero entries?

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

You  guys are awesome and that did work.

Just to let you know it still doesn't show the delivery notes in the 0.00 amount.

Thanks again, you guys are always the greatest

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

@joe: should a flag be used or should it simulate the old functionality with the inclusion of the said code?

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

Yes, maybe a company flag. Will have a look.

Joe

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

This has been solved by including a checkbox in the Customer Transactions 'Zero values'. Marking this will show the voided and zero valued records.

Will be committed in a while.

/Joe

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

@joe commit this to github as well.

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

It is automatically mirrored to /FrontaccountingErp/FA.

Joe

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

Yes, unfortunately it shows voided invoices now Wished this could be removed and if you click the option to edit a voided it will throw a SQL error.

DATABASE ERROR : document version retreival
error code : 1064
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 ')' at line 2
sql that failed was : SELECT trans_no, version FROM 2_debtor_trans WHERE type='13' AND ()

Re: 2.4.4 no Longer Displays 0.00 Sales Invoices in customer_inquiry.php

This happens when there are no transactions in function get_customer_trans_version() in sales/includes/db/cust_trans_db.inc. The construct at lines 37-43:

    $sql= 'SELECT trans_no, version FROM '.TB_PREF. 'debtor_trans
            WHERE type='.db_escape($type).' AND (';

    foreach ($trans_no as $key=>$trans)
        $trans_no[$key] =     'trans_no='.db_escape($trans_no[$key]);

    $sql .= implode(' OR ', $trans_no) . ')';

can be modified to be

    $sql= 'SELECT trans_no, version FROM '.TB_PREF. 'debtor_trans
            WHERE type='.db_escape($type).' AND trans_no IN ('.implode(',', db_escape($trans_no)).')';