<?php
/**
 * The config file of purchasecontract module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Dongdong Jia <jiadongdong@easycorp.ltd>
 * @package     contract 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
$config->purchasecontract->require = new stdclass();
$config->purchasecontract->require->create  = 'customer, name';
$config->purchasecontract->require->edit    = 'customer, name';
$config->purchasecontract->require->receive = 'amount, depositor, returnedDate';

global $lang, $app;
$app->loadLang('purchasecontract', 'crm');
$config->purchasecontract->search['module'] = 'purchasecontract';

$config->purchasecontract->search['fields']['name']          = $lang->purchasecontract->name;
$config->purchasecontract->search['fields']['code']          = $lang->purchasecontract->code;
$config->purchasecontract->search['fields']['amount']        = $lang->purchasecontract->amount;
$config->purchasecontract->search['fields']['signedDate']    = $lang->purchasecontract->signedDate;
$config->purchasecontract->search['fields']['status']        = $lang->purchasecontract->status;
$config->purchasecontract->search['fields']['begin']         = $lang->purchasecontract->begin;
$config->purchasecontract->search['fields']['end']           = $lang->purchasecontract->end;
$config->purchasecontract->search['fields']['createdBy']     = $lang->purchasecontract->createdBy;
$config->purchasecontract->search['fields']['createdDate']   = $lang->purchasecontract->createdDate;
$config->purchasecontract->search['fields']['return']        = $lang->purchasecontract->return;
$config->purchasecontract->search['fields']['returnedBy']    = $lang->purchasecontract->returnedBy;
$config->purchasecontract->search['fields']['returnedDate']  = $lang->purchasecontract->returnedDate;
$config->purchasecontract->search['fields']['id']            = $lang->purchasecontract->id;

$config->purchasecontract->search['params']['name']          = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->purchasecontract->search['params']['code']          = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->purchasecontract->search['params']['amount']        = array('operator' => '>=', 'control' => 'input',  'values' => '');
$config->purchasecontract->search['params']['signedDate']    = array('operator' => '>=', 'control' => 'input',  'values' => '', 'class' => 'date');
$config->purchasecontract->search['params']['status']        = array('operator' => '=',  'control' => 'select', 'values' => $lang->purchasecontract->statusList);
$config->purchasecontract->search['params']['begin']         = array('operator' => '>=', 'control' => 'input',  'values' => '', 'class' => 'date');
$config->purchasecontract->search['params']['end']           = array('operator' => '>=', 'control' => 'input',  'values' => '', 'class' => 'date');
$config->purchasecontract->search['params']['createdBy']     = array('operator' => '=',  'control' => 'select', 'values' => 'users');
$config->purchasecontract->search['params']['createdDate']   = array('operator' => '>=', 'control' => 'input',  'values' => '', 'class' => 'date');
$config->purchasecontract->search['params']['return']        = array('operator' => '=',  'control' => 'select', 'values' => $lang->purchasecontract->returnList);
$config->purchasecontract->search['params']['returnedBy']    = array('operator' => '=',  'control' => 'select', 'values' => 'users');
$config->purchasecontract->search['params']['returnedDate']  = array('operator' => '>=', 'control' => 'input',  'values' => '', 'class' => 'date');
$config->purchasecontract->search['params']['id']            = array('operator' => '=',  'control' => 'input',  'values' => '');

$config->purchasecontract->list = new stdclass();
$config->purchasecontract->list->exportFields = '
  id, customer, name, code, amount, currency, begin, end,
  return, status, contact, signedBy, signedDate,
  returnedBy, returnedDate, finishedBy, finishedDate,
  canceledBy, canceledDate, createdBy, createdDate, editedBy, editedDate,
  contactedBy, contactedDate, nextDate, items, files';
