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

This commit is contained in:
Mildred Ki'Lya
2024-01-19 23:40:19 +01:00
parent 27d67a33e5
commit dcbfa9f1c5
+4 -1
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' });
}