diff --git a/backend/patches/setPaymentReferenceType.ts b/backend/patches/setPaymentReferenceType.ts index a141e201..70f57b01 100644 --- a/backend/patches/setPaymentReferenceType.ts +++ b/backend/patches/setPaymentReferenceType.ts @@ -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' }); }