FacturaScripts

ListAlbaranProveedor extends ListAlbaranProveedor
in package
Uses ExtensionsTrait

Class created by Core/Base/PluginManager

Tags
author

FacturaScripts [email protected]

Table of Contents

MODEL_NAMESPACE  = '\\FacturaScripts\\Dinamic\\Model\\'
$active  : string
Indicates the active view.
$codeModel  : CodeModel
Model to use with select and autocomplete filters.
$empresa  : Empresa
Selected company.
$exportManager  : ExportManager
Object to export data.
$multiRequestProtection  : MultiRequestProtection
$permissions  : ControllerPermissions
User permissions on this controller.
$request  : Request
Request on which we can get data.
$title  : string
Title of the page.
$uri  : string
Given uri, default is empty.
$user  : User|false
User logged in.
$views  : array<string|int, BaseView>|array<string|int, ListView>
List of views displayed by the controller.
$dataBase  : DataBase
It provides direct access to the database.
$extensions  : array<string|int, mixed>
Stores class extensions.
$response  : Response
HTTP Response object.
$className  : string
Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here)
$current  : string
Indicates current view, when drawing.
$template  : string|false
Name of the file for the template.
__call()  : mixed
Executes the first matched extension.
__construct()  : mixed
Initialize all objects and properties.
addButton()  : mixed
Adds a new button to the tab.
addCustomView()  : mixed
addExtension()  : mixed
getCurrentView()  : BaseView|ListView
getMainViewName()  : string
Returns the name assigned to the main view
getPageData()  : array<string|int, mixed>
Return the basic data for this page.
getSettings()  : mixed
Returns the configuration value for the indicated view.
getTemplate()  : string|false
Return the template to use for this controller.
getViewModelValue()  : mixed
Return the value for a field in the model of the view.
pipe()  : mixed
pipeFalse()  : bool
privateCore()  : mixed
Runs the controller's private logic.
publicCore()  : mixed
Execute the public part of the controller.
redirect()  : mixed
Redirect to an url or controller.
setCurrentView()  : mixed
setSettings()  : void
Set value for setting of a view
setTemplate()  : bool
Set the template to use for this controller.
toolBox()  : ToolBox
url()  : string
Return the URL of the actual controller.
addButtonApproveDocument()  : mixed
Adds buttons to approve documents.
addButtonGenerateAccountingInvoices()  : void
Adds button to lock invoices.
addButtonGroupDocument()  : void
Adds button to group documents.
addButtonLockInvoice()  : void
Adds button to lock invoices.
addButtonPayReceipt()  : void
Adds button to pay receipts.
addColor()  : mixed
Adds a new color option to the list.
addColorStatus()  : void
addCommonViewFilters()  : void
addFilterAutocomplete()  : mixed
Add an autocomplete type filter to the ListView.
addFilterCheckbox()  : mixed
Adds a boolean condition type filter to the ListView.
addFilterDatePicker()  : mixed
Adds a date type filter to the ListView.
addFilterNumber()  : mixed
Adds a numeric type filter to the ListView.
addFilterPeriod()  : mixed
Adds a period type filter to the ListView.
addFilterSelect()  : mixed
Add a select type filter to a ListView.
addFilterSelectWhere()  : mixed
Add a select where type filter to a ListView.
addOrderBy()  : mixed
Adds an order field to the ListView.
addSearchFields()  : mixed
Adds a list of fields to the search in the ListView.
addView()  : mixed
Creates and adds a ListView to the controller.
approveDocumentAction()  : bool
Approves selected documents.
autocompleteAction()  : array<string|int, mixed>
Run the autocomplete action.
checkOwnerData()  : bool
Returns true if the active user has permission to view the information of the active record in the informed model.
createViewLines()  : void
createViewPurchases()  : mixed
createViews()  : mixed
Inserts the views or tabs to display.
createViewsAlbaranes()  : mixed
createViewSales()  : mixed
deleteAction()  : bool
Action to delete data.
deleteFilterAction()  : mixed
Removes the selected page filter.
execAfterAction()  : mixed
Runs the controller actions after data read.
execPreviousAction()  : bool
Runs the actions that alter the data before reading it.
exportAction()  : mixed
generateAccountingEntriesAction()  : bool
getAutocompleteValues()  : array<string|int, mixed>
Return values from Widget Values for autocomplete action
getClassName()  : string
Return the name of the controller.
getOwnerFilter()  : array<string|int, DataBaseWhere>
Returns the where filter to apply to obtain the data created by the active user.
groupDocumentAction()  : bool
Group selected documents.
loadData()  : mixed
Loads the data to display.
lockInvoiceAction()  : bool
Locks selected invoices.
megaSearchAction()  : mixed
Returns a JSON response to MegaSearch.
payReceiptAction()  : bool
Sets selected receipts as paid.
requestGet()  : array<string|int, mixed>
Return array with parameters values
saveFilterAction()  : mixed
Saves filter values for active view and user.
selectAction()  : array<string|int, mixed>
Run the select action.
validateFormToken()  : bool
Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
checkPHPversion()  : mixed
megaSearchColumns()  : array<string|int, mixed>
Returns columns title for megaSearchAction function.
tableColToNumber()  : string

Constants

MODEL_NAMESPACE

public mixed MODEL_NAMESPACE = '\\FacturaScripts\\Dinamic\\Model\\'

Properties

$request

Request on which we can get data.

public Request $request

$title

Title of the page.

public string $title

título de la página.

$uri

Given uri, default is empty.

public string $uri

$extensions

Stores class extensions.

protected static array<string|int, mixed> $extensions = []

$response

HTTP Response object.

protected Response $response

$className

Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here)

private string $className

CLASS

$current

Indicates current view, when drawing.

private string $current

$template

Name of the file for the template.

private string|false $template

nombre_archivo.html.twig

Methods

__call()

Executes the first matched extension.

public __call(string $name[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed> = []
Tags
throws
BadMethodCallException
Return values
mixed

__construct()

Initialize all objects and properties.

public __construct(string $className[, string $uri = '' ]) : mixed
Parameters
$className : string
$uri : string = ''
Return values
mixed

addButton()

Adds a new button to the tab.

public addButton(string $viewName, array<string|int, mixed> $btnArray) : mixed
Parameters
$viewName : string
$btnArray : array<string|int, mixed>
Return values
mixed

addExtension()

public static addExtension(mixed $extension) : mixed
Parameters
$extension : mixed
Return values
mixed

getMainViewName()

Returns the name assigned to the main view

public getMainViewName() : string
Return values
string

getPageData()

Return the basic data for this page.

public getPageData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSettings()

Returns the configuration value for the indicated view.

public getSettings(string $viewName, string $property) : mixed
Parameters
$viewName : string
$property : string
Return values
mixed

getTemplate()

Return the template to use for this controller.

public getTemplate() : string|false
Return values
string|false

getViewModelValue()

Return the value for a field in the model of the view.

public getViewModelValue(string $viewName, string $fieldName) : mixed
Parameters
$viewName : string
$fieldName : string
Return values
mixed

pipe()

public pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
mixed

pipeFalse()

public pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
bool

publicCore()

Execute the public part of the controller.

public publicCore(Response &$response) : mixed
Parameters
$response : Response
Return values
mixed

redirect()

Redirect to an url or controller.

public redirect(string $url, int $delay) : mixed
Parameters
$url : string
$delay : int
Return values
mixed

setCurrentView()

public setCurrentView(string $viewName) : mixed
Parameters
$viewName : string
Return values
mixed

setSettings()

Set value for setting of a view

public setSettings(string $viewName, string $property, mixed $value) : void
Parameters
$viewName : string
$property : string
$value : mixed
Return values
void

setTemplate()

Set the template to use for this controller.

public setTemplate(string|false $template) : bool
Parameters
$template : string|false
Return values
bool

url()

Return the URL of the actual controller.

public url() : string
Return values
string

addButtonApproveDocument()

Adds buttons to approve documents.

protected addButtonApproveDocument(string $viewName) : mixed
Parameters
$viewName : string
Return values
mixed

addButtonGenerateAccountingInvoices()

Adds button to lock invoices.

protected addButtonGenerateAccountingInvoices(string $viewName[, string|null $code = null ]) : void
Parameters
$viewName : string
$code : string|null = null
Return values
void

addButtonGroupDocument()

Adds button to group documents.

protected addButtonGroupDocument(string $viewName) : void
Parameters
$viewName : string
Return values
void

addButtonLockInvoice()

Adds button to lock invoices.

protected addButtonLockInvoice(string $viewName) : void
Parameters
$viewName : string
Return values
void

addButtonPayReceipt()

Adds button to pay receipts.

protected addButtonPayReceipt(string $viewName) : void
Parameters
$viewName : string
Return values
void

addColor()

Adds a new color option to the list.

protected addColor(string $viewName, string $fieldName, mixed $value, string $color[, string $title = '' ]) : mixed
Parameters
$viewName : string
$fieldName : string
$value : mixed
$color : string
$title : string = ''
Return values
mixed

addColorStatus()

protected addColorStatus(string $viewName, string $modelName) : void
Parameters
$viewName : string
$modelName : string
Return values
void

addCommonViewFilters()

protected addCommonViewFilters(string $viewName, string $modelName) : void
Parameters
$viewName : string
$modelName : string
Return values
void

addFilterAutocomplete()

Add an autocomplete type filter to the ListView.

protected addFilterAutocomplete(string $viewName, string $key, string $label, string $field, string $table[, string $fieldcode = '' ][, string $fieldtitle = '' ][, array<string|int, mixed> $where = [] ]) : mixed
Parameters
$viewName : string
$key : string

(Filter identifier)

$label : string

(Human reader description)

$field : string

(Field of the model to apply filter)

$table : string

(Table to search)

$fieldcode : string = ''

(Primary column of the table to search and match)

$fieldtitle : string = ''

(Column to show name or description)

$where : array<string|int, mixed> = []

(Extra where conditions)

Return values
mixed

addFilterCheckbox()

Adds a boolean condition type filter to the ListView.

protected addFilterCheckbox(string $viewName, string $key[, string $label = '' ][, string $field = '' ][, string $operation = '=' ][, mixed $matchValue = true ][, array<string|int, DataBaseWhere$default = [] ]) : mixed
Parameters
$viewName : string
$key : string

(Filter identifier)

$label : string = ''

(Human reader description)

$field : string = ''

(Field of the model to apply filter)

$operation : string = '='

(operation to perform with match value)

$matchValue : mixed = true

(Value to match)

$default : array<string|int, DataBaseWhere> = []

(where to apply when filter is empty)

Return values
mixed

addFilterDatePicker()

Adds a date type filter to the ListView.

protected addFilterDatePicker(string $viewName, string $key[, string $label = '' ][, string $field = '' ][, string $operation = '>=' ]) : mixed
Parameters
$viewName : string
$key : string

(Filter identifier)

$label : string = ''

(Human reader description)

$field : string = ''

(Field of the table to apply filter)

$operation : string = '>='

(Operation to perform)

Return values
mixed

addFilterNumber()

Adds a numeric type filter to the ListView.

protected addFilterNumber(string $viewName, string $key[, string $label = '' ][, string $field = '' ][, string $operation = '>=' ]) : mixed
Parameters
$viewName : string
$key : string

(Filter identifier)

$label : string = ''

(Human reader description)

$field : string = ''

(Field of the table to apply filter)

$operation : string = '>='

(Operation to perform)

Return values
mixed

addFilterPeriod()

Adds a period type filter to the ListView.

protected addFilterPeriod(string $viewName, string $key, string $label, string $field) : mixed

(period + start date + end date)

Parameters
$viewName : string
$key : string

(Filter identifier)

$label : string

(Human reader description)

$field : string

(Field of the table to apply filter)

Return values
mixed

addFilterSelect()

Add a select type filter to a ListView.

protected addFilterSelect(string $viewName, string $key, string $label, string $field[, array<string|int, mixed> $values = [] ]) : mixed
Parameters
$viewName : string
$key : string

(Filter identifier)

$label : string

(Human reader description)

$field : string

(Field of the table to apply filter)

$values : array<string|int, mixed> = []

(Values to show)

Return values
mixed

addFilterSelectWhere()

Add a select where type filter to a ListView.

protected addFilterSelectWhere(string $viewName, string $key, array<string|int, mixed> $values[, string $label = '' ]) : mixed
Parameters
$viewName : string
$key : string

(Filter identifier)

$values : array<string|int, mixed>

(Values to show)

$label : string = ''

(Human reader description)

Example of values: [ ['label' => 'Only active', 'where' => [ new DataBaseWhere('suspended', 'FALSE') ]] ['label' => 'Only suspended', 'where' => [ new DataBaseWhere('suspended', 'TRUE') ]] ['label' => 'All records', 'where' => []], ]

Return values
mixed

addOrderBy()

Adds an order field to the ListView.

protected addOrderBy(string $viewName, array<string|int, mixed> $fields[, string $label = '' ], int $default) : mixed
Parameters
$viewName : string
$fields : array<string|int, mixed>
$label : string = ''
$default : int

(0 = None, 1 = ASC, 2 = DESC)

Return values
mixed

addSearchFields()

Adds a list of fields to the search in the ListView.

protected addSearchFields(string $viewName, array<string|int, mixed> $fields) : mixed

To use integer columns, use CAST(columnName AS CHAR(50)).

Parameters
$viewName : string
$fields : array<string|int, mixed>
Return values
mixed

addView()

Creates and adds a ListView to the controller.

protected addView(string $viewName, string $modelName[, string $viewTitle = '' ][, string $icon = 'fas fa-search' ]) : mixed
Parameters
$viewName : string
$modelName : string
$viewTitle : string = ''
$icon : string = 'fas fa-search'
Return values
mixed

autocompleteAction()

Run the autocomplete action.

protected autocompleteAction() : array<string|int, mixed>

Returns a JSON string for the searched values.

Return values
array<string|int, mixed>

checkOwnerData()

Returns true if the active user has permission to view the information of the active record in the informed model.

protected checkOwnerData(ModelClass $model) : bool
Parameters
$model : ModelClass
Return values
bool

createViewLines()

protected createViewLines(string $viewName, string $modelName) : void
Parameters
$viewName : string
$modelName : string
Return values
void

createViewPurchases()

protected createViewPurchases(string $viewName, string $modelName, string $label) : mixed
Parameters
$viewName : string
$modelName : string
$label : string
Return values
mixed

createViews()

Inserts the views or tabs to display.

protected abstract createViews() : mixed
Return values
mixed

createViewsAlbaranes()

protected createViewsAlbaranes([string $viewName = 'ListAlbaranProveedor' ]) : mixed
Parameters
$viewName : string = 'ListAlbaranProveedor'
Return values
mixed

createViewSales()

protected createViewSales(string $viewName, string $modelName, string $label) : mixed
Parameters
$viewName : string
$modelName : string
$label : string
Return values
mixed

deleteAction()

Action to delete data.

protected deleteAction() : bool
Return values
bool

deleteFilterAction()

Removes the selected page filter.

protected deleteFilterAction() : mixed
Return values
mixed

execAfterAction()

Runs the controller actions after data read.

protected execAfterAction(string $action) : mixed
Parameters
$action : string
Return values
mixed

execPreviousAction()

Runs the actions that alter the data before reading it.

protected execPreviousAction(string $action) : bool
Parameters
$action : string
Return values
bool

exportAction()

protected exportAction() : mixed
Return values
mixed

generateAccountingEntriesAction()

protected generateAccountingEntriesAction(mixed $model, mixed $allowUpdate, mixed $dataBase) : bool
Parameters
$model : mixed
$allowUpdate : mixed
$dataBase : mixed
Return values
bool

getAutocompleteValues()

Return values from Widget Values for autocomplete action

protected getAutocompleteValues(string $viewName, string $fieldName) : array<string|int, mixed>
Parameters
$viewName : string
$fieldName : string
Return values
array<string|int, mixed>

getClassName()

Return the name of the controller.

protected getClassName() : string
Return values
string

loadData()

Loads the data to display.

protected abstract loadData(string $viewName, BaseView $view) : mixed
Parameters
$viewName : string
$view : BaseView
Return values
mixed

megaSearchAction()

Returns a JSON response to MegaSearch.

protected megaSearchAction() : mixed
Return values
mixed

payReceiptAction()

Sets selected receipts as paid.

protected payReceiptAction(mixed $codes, Receipt $model, bool $allowUpdate, DataBase $dataBase, string $nick) : bool
Parameters
$codes : mixed
$model : Receipt
$allowUpdate : bool
$dataBase : DataBase
$nick : string
Return values
bool

requestGet()

Return array with parameters values

protected requestGet(array<string|int, mixed> $keys) : array<string|int, mixed>
Parameters
$keys : array<string|int, mixed>
Return values
array<string|int, mixed>

saveFilterAction()

Saves filter values for active view and user.

protected saveFilterAction() : mixed
Return values
mixed

selectAction()

Run the select action.

protected selectAction() : array<string|int, mixed>

Returns a JSON string for the searched values.

Return values
array<string|int, mixed>

validateFormToken()

Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated

protected validateFormToken() : bool
Return values
bool

checkPHPversion()

private checkPHPversion(float $min) : mixed
Parameters
$min : float
Return values
mixed

megaSearchColumns()

Returns columns title for megaSearchAction function.

private megaSearchColumns(ListView $view) : array<string|int, mixed>
Parameters
$view : ListView
Return values
array<string|int, mixed>

tableColToNumber()

private tableColToNumber(string $name) : string
Parameters
$name : string
Return values
string

Search results