<?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 the //////
// adding of some extra validations that are not checked automatically. ///////////////////////////
// (Eg: $CFG['globalEntity'][__Entity__]['_special']['oneContact']=true) //////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

// alias
$CFG['globalEntity']['::Supplier']['alias']['mandatory']=true;
$CFG['globalEntity']['::Supplier']['alias']['invisible']=false;
$CFG['globalEntity']['::Supplier']['alias']['validation']= ['maxLength'=>100, 'case'=>'upper'];
// company
$CFG['globalEntity']['::Supplier']['company']['mandatory']=true;
$CFG['globalEntity']['::Supplier']['company']['invisible']=false;
$CFG['globalEntity']['::Supplier']['company']['unique']=true;
$CFG['globalEntity']['::Supplier']['company']['validation']= ['maxLength'=>170, 'case'=>'upper'];
// companyPrefix
$CFG['globalEntity']['::Supplier']['companyPrefix']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['companyPrefix']['invisible']=false;
$CFG['globalEntity']['::Supplier']['companyPrefix']['validation']= ['maxLength'=>20];
// companySuffix
$CFG['globalEntity']['::Supplier']['companySuffix']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['companySuffix']['invisible']=false;
$CFG['globalEntity']['::Supplier']['companySuffix']['validation']= ['maxLength'=>20];
// trust
$CFG['globalEntity']['::Supplier']['idTrust']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['idTrust']['invisible']=false;
$CFG['globalEntity']['::Supplier']['idTrust']['validation']= ['type'=>'int', 'minValue'=>0];

// category
$CFG['globalEntity']['::Supplier']['category']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['category']['invisible']=false;
// address
$CFG['globalEntity']['::Supplier']['address']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['address']['invisible']=false;
// deliveryAddress
$CFG['globalEntity']['::Supplier']['deliveryAddress']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['deliveryAddress']['invisible']=false;
// zipCode
$CFG['globalEntity']['::Supplier']['zipCode']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['zipCode']['invisible']=false;
$CFG['globalEntity']['::Supplier']['zipCode']['validation']= ['maxLength'=>50];
// countryCode
$CFG['globalEntity']['::Supplier']['countryCode']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['countryCode']['invisible']=false;
$CFG['globalEntity']['::Supplier']['countryCode']['validation']= ['maxLength'=>2];
// cityId
$CFG['globalEntity']['::Supplier']['cityId']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['cityId']['invisible']=false;
$CFG['globalEntity']['::Supplier']['cityId']['validation']= ['type'=>'int', 'minValue'=>0];
// regNo
$CFG['globalEntity']['::Supplier']['regNo']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['regNo']['invisible']=false;
$CFG['globalEntity']['::Supplier']['regNo']['unique']=true;
$CFG['globalEntity']['::Supplier']['regNo']['validation']= ['maxLength'=>100];
// fiscalCode
$CFG['globalEntity']['::Supplier']['fiscalCode']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['fiscalCode']['invisible']=false;
$CFG['globalEntity']['::Supplier']['fiscalCode']['unique']=true;
$CFG['globalEntity']['::Supplier']['fiscalCode']['validation']= ['maxLength'=>100];
// vatRegistered
$CFG['globalEntity']['::Supplier']['vatRegistered']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['vatRegistered']['invisible']=true;
$CFG['globalEntity']['::Supplier']['vatRegistered']['validation']= ['maxLength'=>1];
// vatCertificateNumber
$CFG['globalEntity']['::Supplier']['vatCertificateNumber']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['vatCertificateNumber']['invisible']=true;
$CFG['globalEntity']['::Supplier']['vatCertificateNumber']['validation']= ['maxLength'=>50];
$CFG['globalEntity']['::Supplier']['vatCertificateNumber']['mandatoryWhenVatRegistered']=false; // this is the correct config not the one above - it should be mandatory only when vatRegistered = true

// income tax payer
$CFG['globalEntity']['::Supplier']['incomeTaxPayer']['mandatory'] = false;
$CFG['globalEntity']['::Supplier']['incomeTaxPayer']['invisible'] = true;
$CFG['globalEntity']['::Supplier']['incomeTaxPayer']['validation'] = ['type'=>'int', 'minValue' => 0, 'maxValue' => 1];

// paymentPossibilities
$CFG['globalEntity']['::Supplier']['paymentPossibilities']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['paymentPossibilities']['invisible']=false;
// telephone
$CFG['globalEntity']['::Supplier']['telephone']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['telephone']['invisible']=false;
$CFG['globalEntity']['::Supplier']['telephone']['validation']= ['maxLength'=>50];
// fax
$CFG['globalEntity']['::Supplier']['fax']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['fax']['invisible']=false;
$CFG['globalEntity']['::Supplier']['fax']['validation']= ['maxLength'=>50];
// email
$CFG['globalEntity']['::Supplier']['email']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['email']['invisible']=false;
$CFG['globalEntity']['::Supplier']['email']['validation']= ['maxLength'=>100, 'type'=>'email'];
// website
$CFG['globalEntity']['::Supplier']['website']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['website']['invisible']=false;
$CFG['globalEntity']['::Supplier']['website']['validation']= ['maxLength'=>250, 'type'=>'url'];
// bankAccounts
$CFG['globalEntity']['::Supplier']['bankAccounts']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['bankAccounts']['invisible']=false;
$CFG['globalEntity']['::Supplier']['bankAccounts']['validation']=[];

// comments
$CFG['globalEntity']['::Supplier']['comments']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['comments']['invisible']=false;
// remarks
$CFG['globalEntity']['::Supplier']['remarks']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['remarks']['invisible']=false;

// Accounting number
$CFG['globalEntity']['::Supplier']['accountingNumber']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['accountingNumber']['invisible']=false;
$CFG['globalEntity']['::Supplier']['accountingNumber']['unique']=true;
$CFG['globalEntity']['::Supplier']['accountingNumber']['validation']=['maxLength'=>50];

//////////////////////////////////////////////////////////////////////

// codes: iata
$CFG['globalEntity']['::Supplier']['_special']['code']['iata']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['_special']['code']['iata']['validation']= ['type'=>'alnum', 'case'=>'upper', 'maxLength'=>2];

// codes: tktCode
$CFG['globalEntity']['::Supplier']['_special']['code']['tktCode']['mandatory']=false;
$CFG['globalEntity']['::Supplier']['_special']['code']['tktCode']['validation']= ['type'=>'int', 'maxLength'=>3];

// address
$CFG['globalEntity']['::Supplier']['_special']['addressDetailsActive'] = false;
$CFG['globalEntity']['::Supplier']['_special']['addressDeliveryDetailsActive'] = false;
