CoolCMS API

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

processCreditNote()

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>
Return values
bool
On this page

Search results