EditCliente
extends ComercialContactController
in package
Controller to edit a single item from the Cliente model
Tags
Table of Contents
Constants
- MODEL_NAMESPACE = '\FacturaScripts\Dinamic\Model\\'
Properties
- $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.
- $hasData : bool
- Indicates if the main view has data or is empty.
- $multiRequestProtection : MultiRequestProtection
- $permissions : ControllerPermissions
- User permissions on this controller.
- $request : Request
- Request on which we can get data.
- $tabsPosition : string
- Tabs position in page: left, bottom.
- $title : string
- Title of the page.
- $uri : string
- Given uri, default is empty.
- $user : User|false
- User logged in.
- $views : array<string|int, BaseView>
- List of views displayed by the controller.
- $dataBase : DataBase
- It provides direct access to the database.
- $response : Response
- HTTP Response object.
Methods
- __construct() : mixed
- Starts all the objects and properties.
- addButton() : mixed
- addCustomView() : BaseView
- addExtension() : mixed
- getCurrentView() : BaseView
- getDeliveryNotesRisk() : string
- Returns the customer's risk on pending delivery notes.
- getImageUrl() : string
- getInvoicesRisk() : string
- Returns the customer's risk on unpaid invoices.
- getMainViewName() : string
- Returns the name assigned to the main view
- getModel() : mixed
- Pointer to the data model.
- getModelClassName() : string
- Returns the class name of the model to use in the editView.
- getOrdersRisk() : string
- Returns the customer's risk on pending orders.
- 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.
- listView() : ListView
- pipe() : mixed
- pipeFalse() : bool
- privateCore() : mixed
- Runs the controller's private logic.
- publicCore() : mixed
- Execute the public part of the controller.
- redirect() : mixed
- request() : Request
- run() : void
- setCurrentView() : void
- setSettings() : BaseView
- Set value for setting of a view
- setTabsPosition() : void
- Sets the tabs position, by default is set to 'left', also supported 'bottom', 'top' and 'left-bottom'.
- setTemplate() : bool
- Set the template to use for this controller.
- tab() : BaseView
- 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.
- addButtonPayInvoice() : void
- Adds button to pay invoices.
- addButtonPayReceipt() : void
- Adds button to pay receipts.
- addCommonViewFilters() : void
- addEditListView() : EditListView
- Adds a EditList type view to the controller.
- addEditView() : EditView
- Adds an Edit type view to the controller.
- addHtmlView() : mixed
- addListView() : ListView
- Adds a List type view 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.
- checkSubaccountLength() : void
- Check that the subaccount length is correct.
- checkViesAction() : bool
- createContactsView() : void
- Crea el panel de 'Direcciones y contactos' con el botón de Aplicar a documentos
- createCustomerListView() : void
- Add a Customer document List View.
- createDocumentView() : void
- createEmailsView() : void
- Add an Email Sent List View.
- createInvoiceView() : void
- createLineView() : void
- Add Product Lines from documents.
- createReceiptView() : void
- Add a receipt list view.
- createSubaccountsView() : void
- Add Subaccount List View.
- createSupplierListView() : void
- Add a Supplier document List View
- createViewDocFiles() : void
- createViews() : mixed
- Crea todas las vista de EditCliente y sus paneles
- datalistAction() : array<string|int, mixed>
- Run the datalist action.
- db() : DataBase
- deleteAction() : bool
- Action to delete data.
- editAction() : bool
- Runs the data edit action.
- execAfterAction() : mixed
- Run the controller after actions.
- execPreviousAction() : bool
- Run the actions that alter 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.
- groupDocumentAction() : bool
- Group selected documents.
- insertAction() : bool
- Runs data insert action.
- loadData() : mixed
- Load view data procedure
- loadExceptionVat() : void
- loadLanguageValues() : void
- Load the available language values from translator.
- lockInvoiceAction() : bool
- Locks selected invoices.
- payInvoiceAction() : bool
- Sets all receipts of selected invoices as paid.
- payReceiptAction() : bool
- Sets selected receipts as paid.
- requestGet() : array<string|int, mixed>
- Return array with parameters values
- response() : Response
- selectAction() : array<string|int, mixed>
- Run the select action.
- setCustomWidgetValues() : void
- Set custom configuration when load main data
- updateContact() : void
- updateDocsAddressAction() : bool
- Actualiza la dirección de envío del cliente a todos los documentos de venta pendientes con la misma dirección:
- updateNumDocs() : void
- Actualiza el número de adjuntos del documento.
- validateFormToken() : bool
- widgetLibrarySearchAction() : array<string|int, mixed>
- widgetLibraryUploadAction() : array<string|int, mixed>
- widgetSubcuentaSearchAction() : array<string|int, mixed>
- widgetVarianteSearchAction() : array<string|int, mixed>
- addFileAction() : bool
- deleteFileAction() : bool
- editFileAction() : bool
- loadDataDocFiles() : void
- unlinkFileAction() : bool
- validateFileActionToken() : bool
Constants
MODEL_NAMESPACE
public
mixed
MODEL_NAMESPACE
= '\FacturaScripts\Dinamic\Model\\'
Properties
$active
Indicates the active view.
public
string
$active
$codeModel
Model to use with select and autocomplete filters.
public
CodeModel
$codeModel
$empresa
Selected company.
public
Empresa
$empresa
$exportManager
Object to export data.
public
ExportManager
$exportManager
$hasData
Indicates if the main view has data or is empty.
public
bool
$hasData
= false
$multiRequestProtection
public
MultiRequestProtection
$multiRequestProtection
$permissions
User permissions on this controller.
public
ControllerPermissions
$permissions
$request
Request on which we can get data.
public
Request
$request
$tabsPosition
Tabs position in page: left, bottom.
public
string
$tabsPosition
$title
Title of the page.
public
string
$title
título de la página.
$uri
Given uri, default is empty.
public
string
$uri
$user
User logged in.
public
User|false
$user
= false
$views
List of views displayed by the controller.
public
array<string|int, BaseView>
$views
= []
$dataBase
It provides direct access to the database.
protected
DataBase
$dataBase
$response
HTTP Response object.
protected
Response
$response
Methods
__construct()
Starts all the objects and properties.
public
__construct(string $className[, string $uri = '' ]) : mixed
Parameters
- $className : string
- $uri : string = ''
addButton()
public
abstract addButton(string $viewName, array<string|int, mixed> $btnArray) : mixed
Parameters
- $viewName : string
- $btnArray : array<string|int, mixed>
addCustomView()
public
addCustomView(string $viewName, BaseView $view) : BaseView
Parameters
- $viewName : string
- $view : BaseView
Return values
BaseViewaddExtension()
public
static addExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getCurrentView()
public
getCurrentView() : BaseView
Return values
BaseViewgetDeliveryNotesRisk()
Returns the customer's risk on pending delivery notes.
public
getDeliveryNotesRisk() : string
Return values
stringgetImageUrl()
public
getImageUrl() : string
Return values
stringgetInvoicesRisk()
Returns the customer's risk on unpaid invoices.
public
getInvoicesRisk() : string
Return values
stringgetMainViewName()
Returns the name assigned to the main view
public
getMainViewName() : string
Return values
stringgetModel()
Pointer to the data model.
public
getModel() : mixed
getModelClassName()
Returns the class name of the model to use in the editView.
public
getModelClassName() : string
Return values
stringgetOrdersRisk()
Returns the customer's risk on pending orders.
public
getOrdersRisk() : string
Return values
stringgetPageData()
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
getTemplate()
Return the template to use for this controller.
public
getTemplate() : string|false
Return values
string|falsegetViewModelValue()
Return the value for a field in the model of the view.
public
getViewModelValue(string $viewName, string $fieldName) : mixed
Parameters
- $viewName : string
- $fieldName : string
listView()
public
listView(string $viewName) : ListView
Parameters
- $viewName : string
Return values
ListViewpipe()
public
pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed>
pipeFalse()
public
pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
- $name : string
- $arguments : array<string|int, mixed>
Return values
boolprivateCore()
Runs the controller's private logic.
public
privateCore(Response &$response, User $user, ControllerPermissions $permissions) : mixed
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
publicCore()
Execute the public part of the controller.
public
publicCore(Response &$response) : mixed
Parameters
- $response : Response
redirect()
public
abstract redirect(string $url[, int $delay = 0 ]) : mixed
Parameters
- $url : string
- $delay : int = 0
request()
public
request() : Request
Return values
Requestrun()
public
run() : void
setCurrentView()
public
setCurrentView(string $viewName) : void
Parameters
- $viewName : string
setSettings()
Set value for setting of a view
public
setSettings(string $viewName, string $property, mixed $value) : BaseView
Parameters
- $viewName : string
- $property : string
- $value : mixed
Return values
BaseViewsetTabsPosition()
Sets the tabs position, by default is set to 'left', also supported 'bottom', 'top' and 'left-bottom'.
public
setTabsPosition(string $position) : void
Parameters
- $position : string
setTemplate()
Set the template to use for this controller.
public
setTemplate(string|false $template) : bool
Parameters
- $template : string|false
Return values
booltab()
public
tab(string $viewName) : BaseView
Parameters
- $viewName : string
Return values
BaseViewurl()
Return the URL of the actual controller.
public
url() : string
Return values
stringaddButtonApproveDocument()
Adds buttons to approve documents.
protected
addButtonApproveDocument(string $viewName) : mixed
Parameters
- $viewName : string
addButtonGenerateAccountingInvoices()
Adds button to lock invoices.
protected
addButtonGenerateAccountingInvoices(string $viewName[, string|null $code = null ]) : void
Parameters
- $viewName : string
- $code : string|null = null
addButtonGroupDocument()
Adds button to group documents.
protected
addButtonGroupDocument(string $viewName) : void
Parameters
- $viewName : string
addButtonLockInvoice()
Adds button to lock invoices.
protected
addButtonLockInvoice(string $viewName) : void
Parameters
- $viewName : string
addButtonPayInvoice()
Adds button to pay invoices.
protected
addButtonPayInvoice(string $viewName) : void
Parameters
- $viewName : string
addButtonPayReceipt()
Adds button to pay receipts.
protected
addButtonPayReceipt(string $viewName) : void
Parameters
- $viewName : string
addCommonViewFilters()
protected
addCommonViewFilters(string $viewName, string $modelName) : void
Parameters
- $viewName : string
- $modelName : string
addEditListView()
Adds a EditList type view to the controller.
protected
addEditListView(string $viewName, string $modelName, string $viewTitle[, string $viewIcon = 'fa-solid fa-bars' ]) : EditListView
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fa-solid fa-bars'
Return values
EditListViewaddEditView()
Adds an Edit type view to the controller.
protected
addEditView(string $viewName, string $modelName, string $viewTitle[, string $viewIcon = 'fa-solid fa-edit' ]) : EditView
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fa-solid fa-edit'
Return values
EditViewaddHtmlView()
protected
abstract addHtmlView(string $viewName, string $fileName, string $modelName, string $viewTitle[, string $viewIcon = 'fa-brands fa-html5' ]) : mixed
Parameters
- $viewName : string
- $fileName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fa-brands fa-html5'
addListView()
Adds a List type view to the controller.
protected
addListView(string $viewName, string $modelName, string $viewTitle[, string $viewIcon = 'fa-solid fa-list' ]) : ListView
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fa-solid fa-list'
Return values
ListViewapproveDocumentAction()
Approves selected documents.
protected
approveDocumentAction(mixed $codes, TransformerDocument $model, bool $allowUpdate, DataBase $dataBase) : bool
Parameters
- $codes : mixed
- $model : TransformerDocument
- $allowUpdate : bool
- $dataBase : DataBase
Return values
boolautocompleteAction()
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
boolcheckSubaccountLength()
Check that the subaccount length is correct.
protected
checkSubaccountLength(string|null $code) : void
Parameters
- $code : string|null
checkViesAction()
protected
checkViesAction() : bool
Return values
boolcreateContactsView()
Crea el panel de 'Direcciones y contactos' con el botón de Aplicar a documentos
protected
createContactsView([string $viewName = 'EditDireccionContacto' ]) : void
Parameters
- $viewName : string = 'EditDireccionContacto'
createCustomerListView()
Add a Customer document List View.
protected
createCustomerListView(string $viewName, string $model, string $label) : void
Parameters
- $viewName : string
- $model : string
- $label : string
createDocumentView()
protected
createDocumentView(string $viewName, string $model, string $label) : void
Parameters
- $viewName : string
- $model : string
- $label : string
createEmailsView()
Add an Email Sent List View.
protected
createEmailsView([string $viewName = 'ListEmailSent' ]) : void
Parameters
- $viewName : string = 'ListEmailSent'
createInvoiceView()
protected
createInvoiceView(string $viewName) : void
Parameters
- $viewName : string
createLineView()
Add Product Lines from documents.
protected
createLineView(string $viewName, string $model[, string $label = 'products' ]) : void
Parameters
- $viewName : string
- $model : string
- $label : string = 'products'
createReceiptView()
Add a receipt list view.
protected
createReceiptView(string $viewName, string $model) : void
Parameters
- $viewName : string
- $model : string
createSubaccountsView()
Add Subaccount List View.
protected
createSubaccountsView([string $viewName = 'ListSubcuenta' ]) : void
Parameters
- $viewName : string = 'ListSubcuenta'
createSupplierListView()
Add a Supplier document List View
protected
createSupplierListView(string $viewName, string $model, string $label) : void
Parameters
- $viewName : string
- $model : string
- $label : string
createViewDocFiles()
protected
createViewDocFiles([string $viewName = 'docfiles' ][, string $template = 'Tab/DocFiles' ]) : void
Parameters
- $viewName : string = 'docfiles'
- $template : string = 'Tab/DocFiles'
createViews()
Crea todas las vista de EditCliente y sus paneles
protected
createViews() : mixed
datalistAction()
Run the datalist action.
protected
datalistAction() : array<string|int, mixed>
Returns a JSON string for the searched values.
Return values
array<string|int, mixed>db()
protected
db() : DataBase
Return values
DataBasedeleteAction()
Action to delete data.
protected
deleteAction() : bool
Return values
booleditAction()
Runs the data edit action.
protected
editAction() : bool
Return values
boolexecAfterAction()
Run the controller after actions.
protected
execAfterAction(string $action) : mixed
Parameters
- $action : string
execPreviousAction()
Run the actions that alter data before reading it.
protected
execPreviousAction(mixed $action) : bool
Parameters
- $action : mixed
Return values
boolexportAction()
protected
exportAction() : mixed
generateAccountingEntriesAction()
protected
generateAccountingEntriesAction(mixed $model, mixed $allowUpdate, mixed $dataBase) : bool
Parameters
- $model : mixed
- $allowUpdate : mixed
- $dataBase : mixed
Return values
boolgetAutocompleteValues()
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
stringgroupDocumentAction()
Group selected documents.
protected
groupDocumentAction(mixed $codes, TransformerDocument $model) : bool
Parameters
- $codes : mixed
- $model : TransformerDocument
Return values
boolinsertAction()
Runs data insert action.
protected
insertAction() : bool
Return values
boolloadData()
Load view data procedure
protected
loadData(string $viewName, BaseView $view) : mixed
Parameters
- $viewName : string
- $view : BaseView
loadExceptionVat()
protected
loadExceptionVat(string $viewName) : void
Parameters
- $viewName : string
loadLanguageValues()
Load the available language values from translator.
protected
loadLanguageValues(string $viewName) : void
Parameters
- $viewName : string
lockInvoiceAction()
Locks selected invoices.
protected
lockInvoiceAction(mixed $codes, TransformerDocument $model, bool $allowUpdate, DataBase $dataBase) : bool
Parameters
- $codes : mixed
- $model : TransformerDocument
- $allowUpdate : bool
- $dataBase : DataBase
Return values
boolpayInvoiceAction()
Sets all receipts of selected invoices as paid.
protected
payInvoiceAction(mixed $codes, TransformerDocument $model, bool $allowUpdate, DataBase $dataBase, string $nick) : bool
Parameters
- $codes : mixed
- $model : TransformerDocument
- $allowUpdate : bool
- $dataBase : DataBase
- $nick : string
Return values
boolpayReceiptAction()
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
boolrequestGet()
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>response()
protected
response() : Response
Return values
ResponseselectAction()
Run the select action.
protected
selectAction() : array<string|int, mixed>
Returns a JSON string for the searched values.
Return values
array<string|int, mixed>setCustomWidgetValues()
Set custom configuration when load main data
protected
setCustomWidgetValues(string $viewName) : void
Parameters
- $viewName : string
updateContact()
protected
updateContact(Cliente|Proveedor $subject) : void
Parameters
updateDocsAddressAction()
Actualiza la dirección de envío del cliente a todos los documentos de venta pendientes con la misma dirección:
protected
updateDocsAddressAction() : bool
Return values
boolupdateNumDocs()
Actualiza el número de adjuntos del documento.
protected
updateNumDocs() : void
validateFormToken()
protected
abstract validateFormToken() : bool
Return values
boolwidgetLibrarySearchAction()
protected
widgetLibrarySearchAction() : array<string|int, mixed>
Return values
array<string|int, mixed>widgetLibraryUploadAction()
protected
widgetLibraryUploadAction() : array<string|int, mixed>
Return values
array<string|int, mixed>widgetSubcuentaSearchAction()
protected
widgetSubcuentaSearchAction() : array<string|int, mixed>
Return values
array<string|int, mixed>widgetVarianteSearchAction()
protected
widgetVarianteSearchAction() : array<string|int, mixed>
Return values
array<string|int, mixed>addFileAction()
private
addFileAction() : bool
Return values
booldeleteFileAction()
private
deleteFileAction() : bool
Return values
booleditFileAction()
private
editFileAction() : bool
Return values
boolloadDataDocFiles()
private
loadDataDocFiles(BaseView $view, string $model, string $modelid) : void
Parameters
- $view : BaseView
- $model : string
- $modelid : string
unlinkFileAction()
private
unlinkFileAction() : bool
Return values
boolvalidateFileActionToken()
private
validateFileActionToken() : bool