SellerPickerTrait
Seller picker for the invoice, pattern of {@see \App\UI\Admin\System\Presenters\Traits\Pickers\UserPickerTrait}.
fieldMap fills the denormalized seller snapshot in the form from the first contact and the
first bank account of the picked seller (address, registration number, VAT id, bank). The
snapshot stays editable. The modal targets :Admin:Invoicer:Seller.
TODO: let the user pick a specific (non-primary) contact or account via dependent selects.
Table of Contents
Properties
Methods
- sellerPicker() : PickerConfig
- loadSeller() : Seller|null
- Loads the seller with contacts, accounts and tax status history for the server-side prefill of the invoice snapshot.
- resolveSellerLabel() : string|null
- sellerLabel() : string
- sellerPrefillData() : array<string, string>
-
suggestSellers()
: array<int, array{id: int, label: string, data: array
}>
Properties
$sellerManager
public
SellerManager
$sellerManager
Attributes
- #[Inject]
Methods
sellerPicker()
protected
sellerPicker(string $formName, string $targetField[, string|null $submitButton = null ]) : PickerConfig
Parameters
- $formName : string
-
name of the form with the hidden field
- $targetField : string
-
name of the hidden control (sellerId)
- $submitButton : string|null = null
Return values
PickerConfigloadSeller()
Loads the seller with contacts, accounts and tax status history for the server-side prefill of the invoice snapshot.
private
loadSeller(int $id) : Seller|null
Parameters
- $id : int
Return values
Seller|nullresolveSellerLabel()
private
resolveSellerLabel(int $id) : string|null
Parameters
- $id : int
Return values
string|nullsellerLabel()
private
sellerLabel(Seller $seller) : string
Parameters
- $seller : Seller
Return values
stringsellerPrefillData()
private
sellerPrefillData(Seller $seller) : array<string, string>
Parameters
- $seller : Seller
Return values
array<string, string>suggestSellers()
private
suggestSellers(string $query) : array<int, array{id: int, label: string, data: array}>
Parameters
- $query : string