fix(server): Revert the paid amount to bill transaction after editing bill payment amount

This commit is contained in:
Ahmed Bouhuolia
2024-02-05 18:50:34 +02:00
parent ba3ea93a2d
commit 7b5287ee80
6 changed files with 15 additions and 44 deletions

View File

@@ -61,7 +61,8 @@ export class EditPaymentReceive {
// Validate the payment receive existance.
const oldPaymentReceive = await PaymentReceive.query()
.withGraphFetched('entries')
.findById(paymentReceiveId);
.findById(paymentReceiveId)
.throwIfNotFound();
// Validates the payment existance.
this.validators.validatePaymentExistance(oldPaymentReceive);