Payment Validation and Error Handling

Understanding payment form validation and error messages.

Overpayment Prevention

You cannot record a payment larger than the remaining balance:

  • Form validates payment amount
  • If amount exceeds remaining balance: Error shown
  • Modal remains open for correction
  • Adjust amount to valid value

Example:

  • Invoice total: 1000 kr
  • Already paid: 0 kr
  • Remaining: 1000 kr
  • If you try to record 1500 kr: Error!

Required Fields

When recording a payment:

  • Amount: Required, must be greater than 0
  • Payment date: Required, defaults to today
  • Payment method: Required, must select one

Payment Method Default

The payment method field:

  • Defaults to "Bankgiro" (first option)
  • You can change to any other method
  • Must have a method selected to save

Validation Messages

If validation fails:

  • Error message displayed in modal
  • Form remains open
  • Fix the issue and try again
  • No payment is recorded until valid

Canceling Payment Recording

If you change your mind:

  • Click Cancel button
  • Click X in top right
  • Click outside the modal (backdrop)
  • No payment is recorded
  • Modal closes

For Paid Invoices

Invoices already marked as paid:

  • Record Payment button hidden
  • Cannot add more payments
  • Payment history still visible
  • To add payment: Must first unmark as paid (if needed)