<?php
$config->receivable->require = new stdclass();
$config->receivable->require->create  = 'type,trader,deserved';
$config->receivable->require->edit    = 'type';
$config->receivable->require->receive = 'depositor,money,handlers,date';

$config->receivable->editor = new stdclass();
$config->receivable->editor->create = array('id' => 'desc', 'tools' => 'simple');
$config->receivable->editor->edit   = array('id' => 'desc', 'tools' => 'simple');

$config->receivable->floatFields = 'deserved,actual,balance'; 

$config->receivable->list = new stdclass();
$config->receivable->list->exportFields = 'id, origin, trader, contract, order, batch, deserved, actual, balance, desc, createdBy, createdDate, editedBy, editedDate';

$config->receivable->excel = new stdclass();
$config->receivable->excel->numberFields = array('id', 'deserved', 'actual', 'balance');
$config->receivable->excel->customWidth  = array('id' => 5, 'origin' => 15, 'trader' => 30, 'contract' => 40, 'order' => 20, 'batch' => 20,
    'deserved' => 10, 'actual' => 10, 'balance' => 10, 'createdBy' => 10, 'createdDate' => 10, 'editedBy' => 10, 'editedDate' => 10);

global $lang, $app;
$config->receivable->search['module'] = 'receivable';

$config->receivable->search['fields']['t1.trader']   = $lang->receivable->trader;
$config->receivable->search['fields']['t1.contract'] = $lang->receivable->contract;
$config->receivable->search['fields']['t1.order']    = $lang->receivable->order;
$config->receivable->search['fields']['t1.batch']    = $lang->receivable->batch;
$config->receivable->search['fields']['origin']      = $lang->receivable->origin;
$config->receivable->search['fields']['deserved']    = $lang->receivable->deserved;
$config->receivable->search['fields']['actual']      = $lang->receivable->actual;
$config->receivable->search['fields']['balance']     = $lang->receivable->balance;
$config->receivable->search['fields']['desc']        = $lang->receivable->desc;
$config->receivable->search['fields']['createdBy']   = $lang->receivable->createdBy;
$config->receivable->search['fields']['createdDate'] = $lang->receivable->createdDate;
$config->receivable->search['fields']['editedBy']    = $lang->receivable->editedBy;
$config->receivable->search['fields']['editedDate']  = $lang->receivable->editedDate;
$config->receivable->search['fields']['id']          = $lang->receivable->id;

$config->receivable->search['params']['t1.trader']   = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->receivable->search['params']['t1.contract'] = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->receivable->search['params']['t1.order']    = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->receivable->search['params']['t1.batch']    = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->receivable->search['params']['origin']      = array('operator' => '=',       'control' => 'select', 'values' => array('' => '') + $lang->receivable->originList);
$config->receivable->search['params']['deserved']    = array('operator' => '=',       'control' => 'input',  'values' => '');
$config->receivable->search['params']['actual']      = array('operator' => '=',       'control' => 'input',  'values' => '');
$config->receivable->search['params']['balance']     = array('operator' => '=',       'control' => 'input',  'values' => '');
$config->receivable->search['params']['desc']        = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->receivable->search['params']['createdBy']   = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->receivable->search['params']['createdDate'] = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->receivable->search['params']['editedBy']    = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->receivable->search['params']['editedDate']  = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->receivable->search['params']['id']          = array('operator' => '=',       'control' => 'input',  'values' => '');
