<?php
$config->invoice = new stdclass();
$config->invoice->require = new stdclass();
$config->invoice->require->create    = 'company,customer,money,invoiceTitle,taxNumber,saleType';
$config->invoice->require->edit      = 'company,money,invoiceTitle,taxNumber,saleType';
$config->invoice->require->drawn     = 'sn';
$config->invoice->require->express   = 'contact,address,express,waybill,sendway,sendAccount,subject,content';

$config->invoice->colorList['wait']     = 'yellow';
$config->invoice->colorList['normal']   = 'green';
$config->invoice->colorList['canceled'] = 'red';
$config->invoice->colorList['red']      = 'red';

$config->invoice->fields = array('invoiceTitle', 'taxNumber', 'registedAddress', 'phone', 'bankName', 'bankAccount');

$config->invoice->excel = new stdclass();
$config->invoice->excel->fields       = array('company', 'drawnDate', 'customer', 'type', 'sn', 'status', 'money', 'returnMoney', 'returnDetails', 'item', 'desc');
$config->invoice->excel->numberFields = array('money', 'returnMoney');
$config->invoice->excel->customWidth  = array('company' => 30, 'drawnDate' => 10, 'customer' => 30, 'type' => 20, 'sn' => 20, 'status' => 10, 'money' => 10, 'returnMoney' => 10, 'returnDetails' => 30, 'item' => 20, 'desc' => 30);

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

$config->invoice->search['fields']['sn']              = $lang->invoice->sn;
$config->invoice->search['fields']['customer']        = $lang->invoice->customer;
$config->invoice->search['fields']['company']         = $lang->invoice->company;
$config->invoice->search['fields']['contract']        = $lang->invoice->contract;
$config->invoice->search['fields']['contact']         = $lang->invoice->contact;
$config->invoice->search['fields']['address']         = $lang->invoice->address;
$config->invoice->search['fields']['money']           = $lang->invoice->money;
$config->invoice->search['fields']['type']            = $lang->invoice->type;
$config->invoice->search['fields']['taxRate']         = $lang->invoice->taxRate;
$config->invoice->search['fields']['invoiceTitle']    = $lang->invoice->invoiceTitle;
$config->invoice->search['fields']['taxNumber']       = $lang->invoice->taxNumber;
$config->invoice->search['fields']['registedAddress'] = $lang->invoice->registedAddress;
$config->invoice->search['fields']['phone']           = $lang->invoice->phone;
$config->invoice->search['fields']['bankName']        = $lang->invoice->bankName;
$config->invoice->search['fields']['bankAccount']     = $lang->invoice->bankAccount;
$config->invoice->search['fields']['express']         = $lang->invoice->express;
$config->invoice->search['fields']['waybill']         = $lang->invoice->waybill;
$config->invoice->search['fields']['sendway']         = $lang->invoice->sendway;
$config->invoice->search['fields']['sendAccount']     = $lang->invoice->sendAccount;
$config->invoice->search['fields']['status']          = $lang->invoice->status;
$config->invoice->search['fields']['createdBy']       = $lang->invoice->createdBy;
$config->invoice->search['fields']['createdDate']     = $lang->invoice->createdDate;
$config->invoice->search['fields']['receivedBy']      = $lang->invoice->receivedBy;
$config->invoice->search['fields']['receivedDate']    = $lang->invoice->receivedDate;
$config->invoice->search['fields']['checkedBy']       = $lang->invoice->checkedBy;
$config->invoice->search['fields']['checkedDate']     = $lang->invoice->checkedDate;
$config->invoice->search['fields']['drawnBy']         = $lang->invoice->drawnBy;
$config->invoice->search['fields']['drawnDate']       = $lang->invoice->drawnDate;
$config->invoice->search['fields']['expressedBy']     = $lang->invoice->expressedBy;
$config->invoice->search['fields']['expressedDate']   = $lang->invoice->expressedDate;
$config->invoice->search['fields']['taxRefundedBy']   = $lang->invoice->taxRefundedBy;
$config->invoice->search['fields']['taxRefundedDate'] = $lang->invoice->taxRefundedDate;
$config->invoice->search['fields']['id']              = $lang->invoice->id;

$config->invoice->search['params']['sn']              = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['customer']        = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->invoice->search['params']['company']         = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->invoice->search['params']['contract']        = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->invoice->search['params']['contact']         = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->invoice->search['params']['address']         = array('operator' => '=',       'control' => 'select', 'values' => 'set in control');
$config->invoice->search['params']['money']           = array('operator' => '>=',      'control' => 'input',  'values' => '');
$config->invoice->search['params']['type']            = array('operator' => '=',       'control' => 'select', 'values' => $lang->invoice->typeList);
$config->invoice->search['params']['taxRate']         = array('operator' => '=',       'control' => 'input',  'values' => '');
$config->invoice->search['params']['invoiceTitle']    = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['taxNumber']       = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['registedAddress'] = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['phone']           = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['bankName']        = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['bankAccount']     = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['express']         = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['waybill']         = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['sendway']         = array('operator' => '=',       'control' => 'input',  'values' => $lang->invoice->sendwayList);
$config->invoice->search['params']['sendAccount']     = array('operator' => 'include', 'control' => 'input',  'values' => '');
$config->invoice->search['params']['status']          = array('operator' => '=',       'control' => 'select', 'values' => $lang->invoice->statusList);
$config->invoice->search['params']['createdBy']       = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->invoice->search['params']['createdDate']     = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->invoice->search['params']['receivedBy']      = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->invoice->search['params']['receivedDate']    = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->invoice->search['params']['checkedBy']       = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->invoice->search['params']['checkedDate']     = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->invoice->search['params']['drawnBy']         = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->invoice->search['params']['drawnDate']       = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->invoice->search['params']['expressedBy']     = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->invoice->search['params']['expressedDate']   = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->invoice->search['params']['taxRefundedBy']   = array('operator' => '=',       'control' => 'select', 'values' => 'users');
$config->invoice->search['params']['taxRefundedDate'] = array('operator' => '>=',      'control' => 'input',  'values' => '', 'class' => 'date'); 
$config->invoice->search['params']['id']              = array('operator' => '=',       'control' => 'input',  'values' => '');
