Skip to content

Commit

Permalink
fix: setPaymentReferenceType patch for payments for versions >0.18 <0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
mildred committed Jan 19, 2024
1 parent 27d67a3 commit dcbfa9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/patches/setPaymentReferenceType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
}

Expand Down

0 comments on commit dcbfa9f

Please sign in to comment.