<?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. //////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

// office
$CFG['globalEntity']['::DocumentSeries']['idOffice']['mandatory']=false;
$CFG['globalEntity']['::DocumentSeries']['idOffice']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['idOffice']['validation']= ['type'=>'int', 'minValue'=>'0'];
// code
$CFG['globalEntity']['::DocumentSeries']['code']['mandatory']=true;
$CFG['globalEntity']['::DocumentSeries']['code']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['code']['validation']= ['maxLength'=>100];
// number length
$CFG['globalEntity']['::DocumentSeries']['length']['mandatory']=false;
$CFG['globalEntity']['::DocumentSeries']['length']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['length']['validation']= ['type'=>'int', 'minValue'=>0, 'maxValue'=>99];
// start
$CFG['globalEntity']['::DocumentSeries']['start']['mandatory']=true;
$CFG['globalEntity']['::DocumentSeries']['start']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['start']['validation']= ['type'=>'digits', 'maxLength'=>20];
// end
$CFG['globalEntity']['::DocumentSeries']['end']['mandatory']=true;
$CFG['globalEntity']['::DocumentSeries']['end']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['end']['validation']= ['type'=>'digits', 'maxLength'=>20];
// nextNumber
$CFG['globalEntity']['::DocumentSeries']['nextNumber']['mandatory']=false;
$CFG['globalEntity']['::DocumentSeries']['nextNumber']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['nextNumber']['validation']= ['type'=>'digits', 'maxLength'=>20];
// status
$CFG['globalEntity']['::DocumentSeries']['status']['mandatory']=false;
$CFG['globalEntity']['::DocumentSeries']['status']['invisible']=false;
$CFG['globalEntity']['::DocumentSeries']['status']['validation']= ['list'=> ['WRK', 'END']];

// valid start date
$CFG['globalEntity']['::DocumentSeries']['validStartDate']['mandatory']=true;
$CFG['globalEntity']['::DocumentSeries']['validStartDate']['invisible']=false;

// valid end date
$CFG['globalEntity']['::DocumentSeries']['validEndDate']['mandatory']=true;
$CFG['globalEntity']['::DocumentSeries']['validEndDate']['invisible']=false;


// SPECIAL ----------------------------------------------------------------------------------------

// indicates how the original invoice is referenced on the reversed invoice rows: none, number, series+number, id
$CFG['globalEntity']['::DocumentSeries']['_special']['forceChronologicalUse'] = true;
