2
0
mirror of https://github.com/frappe/books.git synced 2024-11-13 00:46:28 +00:00

Update outstanding of Invoice after payment submit

This commit is contained in:
Faris Ansari 2018-10-26 02:27:09 +05:30
parent cc28e0ee45
commit edd9f35756

View File

@ -17,6 +17,11 @@ module.exports = class PaymentServer extends BaseDocument {
async afterSubmit() { async afterSubmit() {
await this.getPosting().post(); await this.getPosting().post();
for (let row of this.for) {
if (row.referenceType === 'Invoice') {
await frappe.db.setValue('Invoice', row.referenceName, 'outstandingAmount', 0.0);
}
}
} }
async afterRevert() { async afterRevert() {