1 (edited by notrinos 11/27/2020 03:01:54 pm)

Topic: Error: no supplier trans found for given params

This commit has made the error on Payment to Supplier process
Function get_supp_trans() at line 407 of allocation_cart.inc will fire the error when allocation table has a purchase order

Phuong

Re: Error: no supplier trans found for given params

@notrinos,  if you found solution for the bug. Update here. @joe will fix the bug.

Subscription service based on FA
HRM CRM POS batch Themes

3 (edited by notrinos 11/28/2020 01:00:35 pm)

Re: Error: no supplier trans found for given params

Acctually I already made my own solution for the problem by replace line 406 of allocation_cart.inc with this code:

elseif ($_SESSION['alloc']->person_type == PT_SUPPLIER && $_SESSION['alloc']->allocs[$counter]->type != ST_PURCHORDER)

But it will damage the solution of @itronics
A better solution in my opinion is to add a function called get_po() to po_db.inc like this

function get_po($order_no) {
    $sql = "SELECT * FROM ".TB_PREF."purch_orders WHERE order_no = ".db_escape($order_no);
    $result = db_query($sql);

    return db_fetch($result);
}

Then add a check for purchase orders in the allocation table by replace line 407 of allocation_cart.inc by this code:

if ($_SESSION['alloc']->allocs[$counter]->type == ST_PURCHORDER)
                $trans = get_po($_SESSION['alloc']->allocs[$counter]->type_no);
            else
                $trans = get_supp_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);
Phuong

Re: Error: no supplier trans found for given params

Thanks @notrinos.

I will fix this later today.

Joe

Re: Error: no supplier trans found for given params

Committed to stable 2.4.8 repo.

Fixed files can be fetched here and here.

/Joe