Topic: Error on edit of a customer payment

Hi

I am getting this error when I am editing customer payment.

DATABASE ERROR : The debtor transaction record could not be inserted
error code : 1366
error message : Incorrect integer value: '' for column 'payment_terms' at row 1
sql that failed was : UPDATE 0_debtor_trans SET debtor_no='7' , branch_code='7', tran_date='2013-02-12', due_date='0000-00-00', reference='CPT000375', tpe='0', order_='0', ov_amount=182, ov_discount='0', ov_gst=0, ov_freight='0', ov_freight_tax=0, rate=1, ship_via='0', alloc=0, dimension_id='0', dimension2_id='0', payment_terms='' WHERE trans_no='416' AND type='12'

Re: Error on edit of a customer payment

Hello dvarsane,

Will you do me a favor and change line 107 in file /sales/includes/db/cust_trans_db.inc from

        payment_terms=".db_escape($payment_terms)."

to

        payment_terms=".db_escape($payment_terms, true)."

and see if it helps.

/Joe

Re: Error on edit of a customer payment

Hi Joe

Yep. That fixed the bug.

Thanks

Re: Error on edit of a customer payment

Thanks for finding this.

HG Repository updated.

For those interested it can be downloaded here and replaced on server.

Joe

Post's attachments

cust_trans_db.inc 14.8 kb, 1 downloads since 2013-03-11 

You don't have the permssions to download the attachments of this post.