How Credit Note Processing and Vehicle Sale Reversals Work
Source: invoice.rb:451-479, invoice.rb:537-546, invoices_controller.rb:2827-2828
- When processing a credit containing a vehicle sale, the vehicle's customer is reset to the company's internal_customer
- Date_of_sale and value_of_sale are cleared, sale_status returns to for_sale
- For credits, product quantity_on_hand is increased (stock is returned) instead of decreased
- TillPayments reversal credits cannot exceed the original invoice total
- Credit invoices recalculate the customer's credit_account balance; branch accounts are also updated if the customer has a branch_link
- TillPayments credit conversion forces cash_or_account to "C" and auto-generates a note with the original invoice reference
Support scenarios
- "I processed a credit note for a vehicle sale and the vehicle went back to for-sale" -> this is expected; the credit reversal undoes the sale and returns the vehicle to inventory
- "The credit total can't be more than the original invoice" -> this is a TillPayments reversal credit, which is capped at the original amount
- "The customer's account balance changed after the credit" -> credits recalculate the customer's credit account; this is the expected behaviour