<?php

///////////////////////////////////////////////////////////////////////////////////////////////////
// Define each field of the current Entity - for each field you can set the following keys: ///////
// 'mandatory', 'invisible' and 'validation'. Use the '_special' field key code to allow adding ///
// extra validations that are not checked automatically. //////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////


// alias
$CFG['globalEntity']['::Corporate']['alias']['mandatory']=true;
$CFG['globalEntity']['::Corporate']['alias']['invisible']=false;
$CFG['globalEntity']['::Corporate']['alias']['validation']= ['maxLength'=>150, 'case'=>'upper'];
// company
$CFG['globalEntity']['::Corporate']['company']['mandatory']=false; // it is manually checked that is set inside the Entity
$CFG['globalEntity']['::Corporate']['company']['invisible']=false;
$CFG['globalEntity']['::Corporate']['company']['unique']=true;
$CFG['globalEntity']['::Corporate']['company']['validation']= ['maxLength'=>170, 'case'=>'upper'];
// companyPrefix
$CFG['globalEntity']['::Corporate']['companyPrefix']['mandatory']=false; // it is manually checked that is set inside the Entity
$CFG['globalEntity']['::Corporate']['companyPrefix']['invisible']=false;
$CFG['globalEntity']['::Corporate']['companyPrefix']['validation']= ['maxLength'=>20];
// companySuffix
$CFG['globalEntity']['::Corporate']['companySuffix']['mandatory']=false; // it is manually checked that is set inside the Entity
$CFG['globalEntity']['::Corporate']['companySuffix']['invisible']=false;
$CFG['globalEntity']['::Corporate']['companySuffix']['validation']= ['maxLength'=>20];
// status
$CFG['globalEntity']['::Corporate']['status']['mandatory']=true;
$CFG['globalEntity']['::Corporate']['status']['invisible']=false;
$CFG['globalEntity']['::Corporate']['status']['validation']= ['maxLength'=>50, 'list'=>$CFG['generalData']['corporateStatuses']];
// type
$CFG['globalEntity']['::Corporate']['type']['mandatory']=true;
$CFG['globalEntity']['::Corporate']['type']['invisible']=false;
$CFG['globalEntity']['::Corporate']['type']['validation']= ['list'=> ['CC', 'SA']];
// segment
$CFG['globalEntity']['::Corporate']['idSegment']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idSegment']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idSegment']['validation']= ['type'=>'int', 'minValue'=>0];
// trust
$CFG['globalEntity']['::Corporate']['idTrust']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idTrust']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idTrust']['validation']= ['type'=>'int', 'minValue'=>0];
// fiscalCode
$CFG['globalEntity']['::Corporate']['fiscalCode']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['fiscalCode']['invisible']=false;
$CFG['globalEntity']['::Corporate']['fiscalCode']['unique']=true;
$CFG['globalEntity']['::Corporate']['fiscalCode']['validation']= ['maxLength'=>100];
$CFG['globalEntity']['::Corporate']['fiscalCode']['notUniqueValue']='-';
// regNo
$CFG['globalEntity']['::Corporate']['regNo']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['regNo']['invisible']=false;
$CFG['globalEntity']['::Corporate']['regNo']['unique']=true;
$CFG['globalEntity']['::Corporate']['regNo']['validation']= ['maxLength'=>100];
$CFG['globalEntity']['::Corporate']['regNo']['notUniqueValue']='-';
// registryAddress
$CFG['globalEntity']['::Corporate']['registryAddress']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['registryAddress']['invisible']=false;
$CFG['globalEntity']['::Corporate']['registryAddress']['validation']= ['maxLength'=>250];
// vatRegistered
$CFG['globalEntity']['::Corporate']['vatRegistered']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['vatRegistered']['invisible']=false;
$CFG['globalEntity']['::Corporate']['vatRegistered']['validation']= ['maxLength'=>1];
// vatCertificateNumber
$CFG['globalEntity']['::Corporate']['vatCertificateNumber']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['vatCertificateNumber']['invisible']=false;
$CFG['globalEntity']['::Corporate']['vatCertificateNumber']['validation']= ['maxLength'=>50];
$CFG['globalEntity']['::Corporate']['vatCertificateNumber']['mandatoryWhenVatRegistered']=false; // this is the correct config not the one above - it should be mandatory only when vatRegistered = true
// incomeTaxPayer
$CFG['globalEntity']['::Corporate']['incomeTaxPayer']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['incomeTaxPayer']['invisible']=false;
$CFG['globalEntity']['::Corporate']['incomeTaxPayer']['validation']= ['type' => 'int', 'minValue' => 0, 'maxValue' => 1];
// liablePerson
$CFG['globalEntity']['::Corporate']['liablePerson']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['liablePerson']['invisible']=true;
$CFG['globalEntity']['::Corporate']['liablePerson']['validation']= ['maxLength'=>200];
// telephone
$CFG['globalEntity']['::Corporate']['telephone']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['telephone']['invisible']=false;
$CFG['globalEntity']['::Corporate']['telephone']['validation']= ['maxLength'=>50];
// fax
$CFG['globalEntity']['::Corporate']['fax']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['fax']['invisible']=false;
$CFG['globalEntity']['::Corporate']['fax']['validation']= ['maxLength'=>50];
// email
$CFG['globalEntity']['::Corporate']['email']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['email']['invisible']=false;
$CFG['globalEntity']['::Corporate']['email']['validation']= ['maxLength'=>150, 'type'=>'email'];
// website
$CFG['globalEntity']['::Corporate']['website']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['website']['invisible']=false;
$CFG['globalEntity']['::Corporate']['website']['validation']= ['maxLength'=>250, 'type'=>'url'];
// comments
$CFG['globalEntity']['::Corporate']['comments']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['comments']['invisible']=false;
// remarks
$CFG['globalEntity']['::Corporate']['remarks']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['remarks']['invisible']=false;
// idAccountManager
$CFG['globalEntity']['::Corporate']['idAccountManager']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idAccountManager']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idAccountManager']['validation']= ['type'=>'int', 'minValue'=>0];
// idCollectionResponsible
$CFG['globalEntity']['::Corporate']['idCollectionResponsible']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idCollectionResponsible']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idCollectionResponsible']['validation']= ['type'=>'int', 'minValue'=>0];
// idInvoiceResponsible
$CFG['globalEntity']['::Corporate']['idInvoiceResponsible']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idInvoiceResponsible']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idInvoiceResponsible']['validation']= ['type'=>'int', 'minValue'=>0];
// client activity domain category
$CFG['globalEntity']['::Corporate']['idDomainCategory']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idDomainCategory']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idDomainCategory']['validation']= ['type'=>'int'];
// client activity domain
$CFG['globalEntity']['::Corporate']['idDomain']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idDomain']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idDomain']['validation']= ['type'=>'int'];

$CFG['globalEntity']['::Corporate']['statusComments']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['statusComments']['invisible']=false;
$CFG['globalEntity']['::Corporate']['statusComments']['validation']= ['type'=>'string'];

$CFG['globalEntity']['::Corporate']['accountingNumber']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['accountingNumber']['invisible']=false;
$CFG['globalEntity']['::Corporate']['accountingNumber']['unique']=true;
$CFG['globalEntity']['::Corporate']['accountingNumber']['validation']=['maxLength'=>50];

// euid (European Unique Identifier)
$CFG['globalEntity']['::Corporate']['euid']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['euid']['invisible']=true;
$CFG['globalEntity']['::Corporate']['euid']['unique']=true;
$CFG['globalEntity']['::Corporate']['euid']['validation']= ['maxLength'=>30];

// creditLimitAlertLimit
$CFG['globalEntity']['::Corporate']['creditLimitAlertLimit']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitAlertLimit']['invisible']=false;
$CFG['globalEntity']['::Corporate']['creditLimitAlertLimit']['validation']= ['type'=>'float', 'minValue'=>0];
// creditLimitBlockLimit
$CFG['globalEntity']['::Corporate']['creditLimitBlockLimit']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitBlockLimit']['invisible']=false;
$CFG['globalEntity']['::Corporate']['creditLimitBlockLimit']['validation']= ['type'=>'float', 'minValue'=>0];
// creditLimitIdSendingUser
$CFG['globalEntity']['::Corporate']['creditLimitIdSendingUser']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdSendingUser']['invisible']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdSendingUser']['validation']= ['type'=>'int', 'minValue'=>0];
// creditLimitIdContactPersons
$CFG['globalEntity']['::Corporate']['creditLimitIdContactPersons']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdContactPersons']['invisible']=false;
// creditLimitIdUsersBcc
$CFG['globalEntity']['::Corporate']['creditLimitIdUsersBcc']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdUsersBcc']['invisible']=false;
// creditLimitIdEmailTemplate_alert
$CFG['globalEntity']['::Corporate']['creditLimitIdEmailTemplateAlert']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdEmailTemplateAlert']['invisible']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdEmailTemplateAlert']['validation']= ['type'=>'int', 'minValue'=>0];
// creditLimitIdEmailTemplate_block
$CFG['globalEntity']['::Corporate']['creditLimitIdEmailTemplateBlock']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdEmailTemplateBlock']['invisible']=false;
$CFG['globalEntity']['::Corporate']['creditLimitIdEmailTemplateBlock']['validation']= ['type'=>'int', 'minValue'=>0];

// idGdsProfile
$CFG['globalEntity']['::Corporate']['idGdsProfileTemplate']['mandatory']=false;
$CFG['globalEntity']['::Corporate']['idGdsProfileTemplate']['invisible']=false;
$CFG['globalEntity']['::Corporate']['idGdsProfileTemplate']['validation']= ['type'=>'int', 'minValue'=>0];


// SPECIAL CONFIGS ////////////////////////////////////////////////////////////////////////////////

// OTHERS -----------------------------------------------------------------------------------------

// extra validation on company name - the field indicates if the company name is mandatory in a certain alphabet: can be 'standard', 'local', 'both' or '' (no extra validations)
$CFG['globalEntity']['::Corporate']['_special']['company']['mandatoryByAlphabet']='';
