Merge pull request #1298 from nabinhait/hotfix
Accounts Receivable fix for partial payment in pos
This commit is contained in:
commit
5c6a2acff7
@ -78,15 +78,23 @@ class AccountsReceivableReport(object):
|
|||||||
if getdate(e.posting_date) <= report_date)
|
if getdate(e.posting_date) <= report_date)
|
||||||
|
|
||||||
def is_receivable(self, gle, future_vouchers):
|
def is_receivable(self, gle, future_vouchers):
|
||||||
return ((not gle.against_voucher) or (gle.against_voucher==gle.voucher_no) or
|
return (
|
||||||
((gle.against_voucher_type, gle.against_voucher) in future_vouchers))
|
# advance
|
||||||
|
(not gle.against_voucher) or
|
||||||
|
|
||||||
|
# sales invoice
|
||||||
|
(gle.against_voucher==gle.voucher_no and gle.debit > 0) or
|
||||||
|
|
||||||
|
# entries adjusted with future vouchers
|
||||||
|
((gle.against_voucher_type, gle.against_voucher) in future_vouchers)
|
||||||
|
)
|
||||||
|
|
||||||
def get_outstanding_amount(self, gle, report_date):
|
def get_outstanding_amount(self, gle, report_date):
|
||||||
payment_received = 0.0
|
payment_received = 0.0
|
||||||
for e in self.get_gl_entries_for(gle.account, gle.voucher_type, gle.voucher_no):
|
for e in self.get_gl_entries_for(gle.account, gle.voucher_type, gle.voucher_no):
|
||||||
if getdate(e.posting_date) <= report_date and e.name!=gle.name:
|
if getdate(e.posting_date) <= report_date and e.name!=gle.name:
|
||||||
payment_received += (flt(e.credit) - flt(e.debit))
|
payment_received += (flt(e.credit) - flt(e.debit))
|
||||||
|
|
||||||
return flt(gle.debit) - flt(gle.credit) - payment_received
|
return flt(gle.debit) - flt(gle.credit) - payment_received
|
||||||
|
|
||||||
def get_customer(self, account):
|
def get_customer(self, account):
|
||||||
@ -180,4 +188,4 @@ def get_ageing_data(age_as_on, entry_date, outstanding_amount):
|
|||||||
if index is None: index = 3
|
if index is None: index = 3
|
||||||
outstanding_range[index] = outstanding_amount
|
outstanding_range[index] = outstanding_amount
|
||||||
|
|
||||||
return [age] + outstanding_range
|
return [age] + outstanding_range
|
||||||
|
Loading…
x
Reference in New Issue
Block a user