Topic: Bug in purchasing/includes/db/invoice_db.inc

In file purchasing/includes/db/invoice_db.inc line 375:

    if (count($supp_trans->src_docs) == 1)
    {
        $invoice_no = key($supp_trans->src_docs);
        $invoice_alloc_balance = get_supp_trans_allocation_balance(ST_SUPPINVOICE, $supp_trans->src_docs);
        if ($invoice_alloc_balance > 0) 
        {     //the invoice is not already fully allocated 

This line actually give error:

$invoice_alloc_balance = get_supp_trans_allocation_balance(ST_SUPPINVOICE, $supp_trans->src_docs);

Because $supp_trans->src_docs is an array and it should be a string. I believe it should be:

$invoice_alloc_balance = get_supp_trans_allocation_balance(ST_SUPPINVOICE, $invoice_no);

Re: Bug in purchasing/includes/db/invoice_db.inc

Thanks for detecting this.
This has been fixed and committed to stable repo.

A fixed file can be downloaded here.

Joe