Topic: How to clear "current credit" in the direct invoice screen?
In the direct invoice screen for a certain debtor a negative "current credit appears", but there are no outstanding payments. How can I reset this amount to zero?
thnx
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Accounts Receivable → How to clear "current credit" in the direct invoice screen?
In the direct invoice screen for a certain debtor a negative "current credit appears", but there are no outstanding payments. How can I reset this amount to zero?
thnx
Remember that the credit limit is not included in the information.
You can look at the function for duing this calculation in file /sales/includes/db/sales_order_db.inc, function
function get_customer_to_order($customer_id)
This is about line 457.
/Joe
Lines 457-458 of sales/includes/db/sales_order_db.inc:
cust.credit_limit - Sum(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2,
-1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit
The ov_discount field is being added - is that right - should it not be subtracted?
@apmuthu
I am not in office at present. Please make a test on the training Co. Make a direct invoice on a customer with some discount percent.
Also try a payment with a discount. Look into the table 0_debtor_trans and see if it is negative or positive. I cannot recall right now.
Joe
@apmuthu
Yes it is correct. The ov_discount should be added in these cases. When the customer payments are done, they should include the ov_discount.
/Joe
If so, is the ov_discount being stored as a negative value in the table? In related vein, will the discount percentages be stored in the negative as well while being entered positive in the form?
No, it is stored as positive.
Example customer payment:
Customer pays 100. Discount is 10.
debtor_trans table.
ov_amount 100
ov_discount 10
Gl posting:
Bank debit 100
AR. Credit. 110
Discount debit 10
Joe
FrontAccounting forum → Accounts Receivable → How to clear "current credit" in the direct invoice screen?
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.