2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 10:58:59 +00:00

fix: setPaymentReferenceType patch for payments for versions >0.18 <0.20

This commit is contained in:
Mildred Ki'Lya 2024-01-19 23:23:03 +01:00
parent 27d67a33e5
commit dcbfa9f1c5

View File

@ -2,7 +2,10 @@ import { DatabaseManager } from '../database/manager';
async function execute(dm: DatabaseManager) {
await dm.db!.knex!('Payment')
.where({ referenceType: null })
.where({ referenceType: null, paymentType: 'Pay' })
.update({ referenceType: 'PurchaseInvoice' });
await dm.db!.knex!('Payment')
.where({ referenceType: null, paymentType: 'Receive' })
.update({ referenceType: 'SalesInvoice' });
}