<?php
/**
 * The config file of order module of ZDOO.
 *
 * @copyright   Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     order
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
$config->order->newItemsCount     = 5;
$config->order->printItems        = 8;

$config->order->excel = new stdclass();
$config->order->excel->fields       = array('orderNo', 'trader', 'createdBy', 'createdDate', 'finishedDate', 'money', 'status', 'settlement', 'desc');
$config->order->excel->detailFields = array('product', 'model', 'unit', 'amount', 'price', 'totalPrice');
$config->order->excel->numberFields = array('money', 'amount', 'price', 'totalPrice');
$config->order->excel->customWidth  = array('orderNo' => 20, 'contract' => 20, 'trader' => 15, 'money' => 10, 'finishedDate' => 10, 'createdBy' => 10, 'createdDate' => 10, 'status' => 10, 'settlement' => 10, 'desc' => 15, 'product' => 20, 'model' => 15, 'unit' => 10, 'amount' => 10, 'price' => 10, 'totalPrice' => 10);

$config->order->require = new stdclass();
$config->order->require->create           = 'trader, finishedDate'; 
$config->order->require->edit             = 'trader, finishedDate';
$config->order->require->createProduct    = 'trader'; 
$config->order->require->activate         = 'assignedTo';
$config->order->require->assign           = 'assignedTo, status';
$config->order->require->assignToPurchase = 'assignedTo';
$config->order->require->finish           = 'finishedDate';

$config->order->editor = new stdclass();
$config->order->editor->assignto = array('id' => 'comment', 'tools' => 'simple');
$config->order->editor->cancel   = array('id' => 'comment', 'tools' => 'simple');
$config->order->editor->activate = array('id' => 'comment', 'tools' => 'simple');
$config->order->editor->finish   = array('id' => 'comment', 'tools' => 'simple');

$config->order->print = new stdClass();
$config->order->print->maxLines  = 16;

$config->order->orderNo = new stdclass();
$config->order->orderNo->tables['sale']           = TABLE_PSI_ORDER;
$config->order->orderNo->tables['saleRefund']     = TABLE_PSI_ORDER;
$config->order->orderNo->tables['purchase']       = TABLE_PSI_ORDER;
$config->order->orderNo->tables['purchaseRefund'] = TABLE_PSI_ORDER;
$config->order->orderNo->tables['in']             = TABLE_BATCH;
$config->order->orderNo->tables['out']            = TABLE_BATCH;

$config->order->orderNo->fields[TABLE_PSI_ORDER] = 'orderNo';
$config->order->orderNo->fields[TABLE_BATCH]     = 'batchNo';

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

$config->order->search['fields']['orderNo']      = $lang->order->orderNo->common;
$config->order->search['fields']['trader']       = $lang->order->trader;
$config->order->search['fields']['contract']     = $lang->order->contract;
$config->order->search['fields']['money']        = $lang->order->money;
$config->order->search['fields']['taxed']        = $lang->order->taxed;
$config->order->search['fields']['settlement']   = $lang->order->settlement;
$config->order->search['fields']['desc']         = $lang->order->desc;
$config->order->search['fields']['createdBy']    = $lang->order->createdBy;
$config->order->search['fields']['createdDate']  = $lang->order->createdDate;
$config->order->search['fields']['editedBy']     = $lang->order->editedBy;
$config->order->search['fields']['editedDate']   = $lang->order->editedDate;
$config->order->search['fields']['assignedTo']   = $lang->order->assignedTo;
$config->order->search['fields']['assignedBy']   = $lang->order->assignedBy;
$config->order->search['fields']['assignedDate'] = $lang->order->assignedDate;
$config->order->search['fields']['finishedDate'] = $lang->order->finishedDate;
$config->order->search['fields']['status']       = $lang->order->status;
$config->order->search['fields']['id']           = $lang->order->id;

$config->order->search['params']['orderNo']      = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->order->search['params']['trader']       = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->order->search['params']['contract']     = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->order->search['params']['money']        = array('operator' => '=',       'control' => 'input',  'values' => '');
$config->order->search['params']['taxed']        = array('operator' => '=',       'control' => 'select', 'values' => array('' => '') + $lang->order->taxedList);
$config->order->search['params']['settlement']   = array('operator' => '=',       'control' => 'select', 'values' => $lang->order->settlementList);
$config->order->search['params']['desc']         = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->order->search['params']['createdBy']    = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->order->search['params']['createdDate']  = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->order->search['params']['editedBy']     = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->order->search['params']['editedDate']   = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->order->search['params']['assignedTo']   = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->order->search['params']['assignedBy']   = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->order->search['params']['assignedDate'] = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->order->search['params']['finishedDate'] = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->order->search['params']['status']       = array('operator' => '=',       'control' => 'select', 'values' => $lang->order->statusList);
$config->order->search['params']['id']           = array('operator' => '=',       'control' => 'input',  'values' => '');
