Topic: supplier payment

I am getting this error when making supplier payment after upgrading from version 2.3.18 to 2.3.19. After coming out of the payment page I went to supplier transaction page and found that payment has actually been posted. I tried another payment on my test database and had the same error on the payment page but the payment went through.

DATABASE ERROR :
At file C:\Frontaccounting\purchasing\includes\db\suppalloc_db.inc:25:
A supplier allocation could not be added to the database
error code : 1292
error message : Incorrect date value: '' for column 'date_alloc' at row 1
sql that failed was : INSERT INTO 0_supp_allocations ( amt, date_alloc, trans_type_from, trans_no_from, trans_no_to, trans_type_to) VALUES ('100', '', '22', '791', '861', '20')

Re: supplier payment

Have tried using the same procedure on using version 2.3.18 and it works fine. the update in suppalloc_db.inc in version 2.3.19  has some bug.

3 (edited by apmuthu 11/21/2013 06:00:39 pm)

Re: supplier payment

Function Lines 14 to 26 in purchasing/includes/db/suppalloc_db.inc are called in files includes/ui/allocation_cart.inc (lines 203-205) and purchasing/includes/db/invoice_db.inc (lines 357-358) and are:

function add_supp_allocation($amount, $trans_type_from, $trans_no_from,
    $trans_type_to, $trans_no_to, $date_)
{
    $date = date2sql($date_);
    $sql = "INSERT INTO ".TB_PREF."supp_allocations (
        amt, date_alloc,
        trans_type_from, trans_no_from, trans_no_to, trans_type_to)
        VALUES (".db_escape($amount).", '$date', "
        .db_escape($trans_type_from).", ".db_escape($trans_no_from).", "
        .db_escape($trans_no_to).", ".db_escape($trans_type_to).")";

    db_query($sql, "A supplier allocation could not be added to the database");
}

Somewhere the date2sql() function seems to fail or the $date_ variable does not have any value and no default is available.

Re: supplier payment

Hi

Thanks for looking at this issue. Is debugged version of file suppalloc_db.inc downloadable?

Re: supplier payment

Yes it is fixed in the HG Repo and the consolidated list of files have been uploaded in the Release Posting.

https://frontaccounting.com/punbb/viewtopic.php?pid=18494#p18494

Re: supplier payment

Thanks