Topic: DATABASE ERROR : no debtor trans found for given params

New to this...

Invoiced a customer and promptly received payment.

Went to sales > Customer Payments, selected the customer, entered the relevant reference, allocated the amount, hit "Add Payment" and I am getting this error:

DATABASE ERROR : no debtor trans found for given params
sql that failed was : SELECT trans.*,ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,cust.name AS DebtorName, cust.address, cust.curr_code, cust.tax_id, com.memo_,bank_act,0_bank_accounts.bank_name, 0_bank_accounts.bank_account_name, 0_bank_accounts.account_type AS BankTransType, 0_bank_accounts.bank_curr_code, 0_bank_trans.amount as bank_amount FROM 0_debtor_trans trans LEFT JOIN 0_comments com ON trans.type=com.type AND trans.trans_no=com.id LEFT JOIN 0_shippers ON 0_shippers.shipper_id=trans.ship_via, 0_debtors_master cust, 0_bank_trans, 0_bank_accounts WHERE trans.trans_no='2' AND trans.type='12' AND trans.debtor_no=cust.debtor_no AND 0_bank_trans.trans_no ='2' AND 0_bank_trans.type=12 AND 0_bank_trans.amount != 0 AND 0_bank_accounts.id=0_bank_trans.bank_act

Went to phpmyadmin and looked in 0_debtor_trans, and I am seeing type = 13

It appears that the sql is looking for type = 12 which does not exist, my transaction shows type 13 and not 12

I am stumped - could anyone please let me know what to do and why the type shows 13 and not 12

Thanks / Frank

Re: DATABASE ERROR : no debtor trans found for given params

I may add to the post above that I am using

FA 2.3.18 - theme Dashboard

locally:

- Linux Mint 15
- PHP Version     5.4.9-4ubuntu2.3
- mysql Client API version     5.5.32

webserver:

- CentOS Linux
- Apache version    2.2.23
- PHP version    5.2.17
- MySQL version    5.0.96-community

Australian COA

Australian language pack

Can't figure out what may have gone wrong - any takers please?

Thanks / Frank

Re: DATABASE ERROR : no debtor trans found for given params

Type 13 is Delivery Note, which is not allocatable. Transaction type 12 is Customer Payment which can be allocated to sales invoice. I guess you have broken database for some reason, but I don't know how it happened.
Janusz

4 (edited by aquarius 11/05/2013 11:14:11 am)

Re: DATABASE ERROR : no debtor trans found for given params

Thanks Janusz

Sorry - late reply from my side (due to personal issues) but can report that I had made a booboo when entering the payment. Erroneously (and repeatedly) entered the full payment amount into the Bank Charges field - which makes the whole transaction zero. I am sorry but I am still trying to get to grips with FA.

Noticed my error, restored a backup of the DB and re-entered the payment. Works fine....

We live and we learn!

Cheers / Frank

Re: DATABASE ERROR : no debtor trans found for given params

A good trap on this might be to check if the bank charge is greater than the payment and flag the user for approval. An even better way might be allow a percentage threshold as system preference.