I am testing account_voucher_payment (in order to pay multiple invoices with 
one payment/receipt) ... i processed two invoices for same customer (invoice # 
1 = 38.25, invoice # 2 = 30.75), than in voucher entries 
(account_voucher_payment) i captured new bank receipt, receipt had two lines, 
linking to the invoice number, so the system picked up the amounts 
automatically ... clicked on create and all seems fine ,,, when i go to the 
invoice to see what is the status, it says 'Done', however i noticed that the 
residual amount is absolutely crazy (invoice # 1 residual amount = -61.50 and 
invoice # 2 residual amount = -76.50) ... first of all it shouldn't be in 
negative .... 

on the payment tab of the invoice # 1, there are three lines (2 lines for 
payment (i.e. 38.25 & 30.75 and 1 line for debtor i.e. 30.75,,,,,, and invoice 
number 2 have debtor line = 38.25)

if i do calculations manually to reach to the residual amount of invoice # 1, 
residual amount of -61.50 can be calculated like this: -61.50 = ((- 38.25) + 
(-30.75) + (-30.75)) + (38.25)

out of interest, residual is a function field, function which returns the 
residual is as below:

    def _amount_residual(self, cr, uid, ids, name, args, context=None):
        res = {}
        data_inv = self.browse(cr, uid, ids)
        for inv in data_inv:
            paid_amt = 0.0
            to_pay = inv.amount_total
            for lines in inv.move_lines:
                if lines.amount_currency and lines.currency_id:
                    paid_amt += lines.amount_currency
                else:
                    paid_amt += lines.credit + lines.debit
            res[inv.id] = round(to_pay - 
abs(paid_amt),int(config['price_accuracy']))
        return res

is it a problem with residual on invoice or is it a problem with 
account_voucher_payment (likely the second one)
i am on version 5.0.3 (ubuntu 9.10) ....


any help?

Thanks, Khalid




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=50504#50504

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to