mirror of
https://github.com/frappe/books.git
synced 2024-11-12 16:36:27 +00:00
fix: paymentType formula for return
This commit is contained in:
parent
74fcbe6dfd
commit
8c46a93b13
@ -505,13 +505,21 @@ export class Payment extends Transactional {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const partyDoc = (await this.loadAndGetLink('party')) as Party;
|
const partyDoc = (await this.loadAndGetLink('party')) as Party;
|
||||||
|
const outstanding = partyDoc.outstandingAmount as Money;
|
||||||
|
|
||||||
|
if (outstanding.isNegative()) {
|
||||||
|
if (this.referenceType === ModelNameEnum.SalesInvoice) {
|
||||||
|
return 'Pay';
|
||||||
|
}
|
||||||
|
return 'Receive';
|
||||||
|
}
|
||||||
|
|
||||||
if (partyDoc.role === 'Supplier') {
|
if (partyDoc.role === 'Supplier') {
|
||||||
return 'Pay';
|
return 'Pay';
|
||||||
} else if (partyDoc.role === 'Customer') {
|
} else if (partyDoc.role === 'Customer') {
|
||||||
return 'Receive';
|
return 'Receive';
|
||||||
}
|
}
|
||||||
|
|
||||||
const outstanding = partyDoc.outstandingAmount as Money;
|
|
||||||
if (outstanding?.isZero() ?? true) {
|
if (outstanding?.isZero() ?? true) {
|
||||||
return this.paymentType;
|
return this.paymentType;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user