OrderCreditNoteFormTrait
Partial credit note form.
A table of rows of the source invoice with a numeric "return" field limited to the remaining
amount. There is no cap logic here: both the preview and the issuing go only through the Api
(api/eshop/order/credit-note-preview, api/eshop/order/credit-note) and the server enforces
the cap under a lock anyway. max in HTML is a convenience, not a safeguard.
Rows with a zero remainder are shown grayed out, not hidden, so it is visible why they cannot be selected (otherwise the admin would look for where the item went).
There is no voucher in the form: a fixed discount is dissolved proportionally and automatically, so the admin cannot get it wrong.
Table of Contents
Methods
- createComponentCreditNoteForm() : Form
- processCreditNote() : bool
- Issues the credit note through the Api; redirects on success, returns false (with a flash) otherwise.
Methods
createComponentCreditNoteForm()
protected
createComponentCreditNoteForm() : Form
Return values
FormprocessCreditNote()
Issues the credit note through the Api; redirects on success, returns false (with a flash) otherwise.
private
processCreditNote(ArrayHash<string|int, mixed> $values) : bool
Parameters
- $values : ArrayHash<string|int, mixed>