File: /www/wwwroot/oa.sanjiangapp.com/app/cash/trade/view/create.html.php
<?php
/**
* The create view file of trade 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 Xiying Guan <guanxiying@xirangit.com>
* @package trade
* @version $Id$
* @link http://www.zdoo.com
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('modeType', $type);?>
<?php js::set('mainCurrency', $config->setting->mainCurrency);?>
<div class='panel'>
<div class='panel-heading'>
<strong><?php echo $lang->trade->{$type};?></strong>
</div>
<div class='panel-body'>
<form method='post' id='tradeForm'>
<table class='table table-form w-p60'>
<tr>
<th class='w-100px'><?php echo $lang->trade->depositor;?></th>
<td><?php echo html::select('depositor', $depositorList, '', "class='form-control chosen'");?></td>
</tr>
<?php if(count($productCategories) >= 2):?>
<tr>
<th><?php echo $lang->product->category;?></th>
<td><?php echo html::select('productCategory', array('') + $productCategories, '', "class='form-control chosen'");?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->trade->product;?></th>
<td><?php echo html::select('product', array('') + $productList, '', "class='form-control chosen'");?></td>
</tr>
<?php if($type == 'in'):?>
<tr class='income'>
<th><?php echo $lang->trade->category;?></th>
<td>
<div class='input-group categoryBox'>
<?php echo html::select('category', array('') + (array) $categories, '', "class='form-control chosen'");?>
<div class='input-group-btn'>
<?php echo html::a($this->createLink('tree', 'browse', "type=$type"), "<i class='icon icon-config'></i>", "class='btn' title={$lang->trade->manageCategory} target='_blank'");?>
</div>
<div class='input-group-btn'>
<?php echo html::commonButton('<i class="icon icon-refresh"></i>', 'btn', "title={$lang->refresh} onclick='ajaxGetCategories()'");?>
</div>
</div>
</td>
</tr>
<?php endif;?>
<?php if($type == 'out'):?>
<tr class='expense'>
<th><?php echo $lang->trade->category;?></th>
<td>
<div class='input-group categoryBox'>
<?php echo html::select('category', array('') + (array) $categories, '', "class='form-control chosen'");?>
<div class='input-group-btn'>
<?php echo html::a($this->createLink('tree', 'browse', "type=$type"), "<i class='icon icon-config'></i>", "class='btn' title={$lang->trade->manageCategory} target='_blank'");?>
</div>
<div class='input-group-btn'>
<?php echo html::commonButton('<i class="icon icon-refresh"></i>', 'btn', "title={$lang->refresh} onclick='ajaxGetCategories()'");?>
</div>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->trade->outType;?></th>
<td><?php echo html::checkbox('objectType', $lang->trade->objectTypeList);?></td>
</tr>
<tr class='customerTR hide'>
<th><?php echo $lang->trade->traderList['in'];?></th>
<td>
<?php echo html::select('customer', array('') + $customerList, '', "class='form-control chosen' onchange='getOrder(this.value)' data-no_results_text='" . $lang->searchMore . "'");?>
</td>
</tr>
<tr class='allCustomerTR hide'>
<th><?php echo $lang->trade->traderList['in'];?></th>
<td>
<?php echo html::select('allCustomer', array('') + $customerList, '', "class='form-control chosen' onchange='getContract(this.value, \"sale\", \".contractTD\")' data-no_results_text='" . $lang->searchMore . "'");?>
</td>
</tr>
<tr class='traderTR'>
<th><?php echo $lang->trade->traderList['out'];?></th>
<td>
<?php $traderList = array('') + $traderList;?>
<?php $hasCreatePriv = commonModel::hasPriv('provider', 'create');?>
<?php $traderClass = (count($traderList) > 1 or !$hasCreatePriv) ? '' : 'hide';?>
<?php $traderNameClass = (count($traderList) > 1) ? 'hide' : '';?>
<div class='input-group'>
<?php echo html::select('trader', $traderList, '', "class='form-control chosen {$traderClass}' onchange='getContract(this.value, \"purchase\", \".purchasecontractTD\")' data-no_results_text='" . $lang->searchMore . "'");?>
<?php if($hasCreatePriv):?>
<?php echo html::input('traderName', '', "class='form-control $traderNameClass'");?>
<div class='input-group-addon'><?php echo html::checkbox('createTrader', array(1 => $lang->trade->newTrader), count($traderList) > 1 ? '' : 1);?></div>
<?php endif;?>
</div>
</td>
</tr>
<tr class='customer-depositor hide'>
<th><?php echo $lang->customer->depositor;?></th>
<td><?php echo html::input('customerDepositor', '', "class='form-control' disabled='disabled'");?></td>
</tr>
<tr class='traderTR'>
<th><?php echo $lang->trade->purchaseContract;?></th>
<td class='purchasecontractTD'><?php echo html::select('purchaseContract', array(''), '', "class='form-control chosen'");?></td>
</tr>
<tr class='hide'>
<th><?php echo $lang->trade->order;?></th>
<td class='orderTD'><select name='order' id='order' class='form-control'></select></td>
</tr>
<tr class='hide'>
<th><?php echo $lang->trade->saleContract;?></th>
<td class='contractTD'><select name='contract' id='contract' class='form-control'></select></td>
</tr>
<?php endif;?>
<?php if($type == 'in'):?>
<tr>
<th><?php echo $lang->trade->traderList['in'];?></th>
<td>
<?php echo html::select('trader', array('') + $customerList, '', "class='form-control chosen' onchange='getContract(this.value, \"sale\", \".contractTD\")' data-no_results_text='" . $lang->searchMore . "'");?>
</td>
</tr>
<tr class='customer-depositor hide'>
<th><?php echo $lang->customer->depositor;?></th>
<td><?php echo html::input('customerDepositor', '', "class='form-control' disabled='disabled'");?></td>
</tr>
<tr>
<th><?php echo $lang->trade->contract;?></th>
<td class='contractTD'><select name='contract' id='contract' class='form-control'></select></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->trade->money;?></th>
<td>
<div class='input-group'>
<?php echo html::input('money', '', "class='form-control'");?>
<span class='input-group-addon '><?php echo $lang->trade->currency;?></span>
<?php echo html::select('currencyLabel', $lang->currencyList, '', "class='form-control' disabled");?>
<?php echo html::hidden('currency');?>
<span class='input-group-addon exchangeRate'><?php echo $lang->trade->exchangeRate;?></span>
<?php echo html::input('exchangeRate', 1, "class='form-control exchangeRate'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->trade->dept;?></th>
<td><?php echo html::select('dept', $deptList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->trade->handlers;?></th>
<td><?php echo html::select('handlers[]', $users, '', "class='form-control chosen' multiple");?></td>
</tr>
<tr>
<th><?php echo $lang->trade->date;?></th>
<td><?php echo html::input('date', date('Y-m-d'), "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->trade->desc;?></th>
<td><?php echo html::textarea('desc','', "class='form-control' rows='3'");?></td>
</tr>
<?php if(commonModel::hasPriv('file', 'upload')):?>
<tr>
<th><?php echo $lang->trade->uploadFile;?></th>
<td><?php echo $this->fetch('file', 'buildForm');?></td>
</tr>
<?php endif;?>
<tr>
<th></th>
<td class='form-actions'>
<?php echo html::submitButton() . html::backButton();?>
<div id='duplicateError' class='hide'></div>
</td>
</tr>
</table>
</form>
</div>
</div>
<div class='errorMessage hide'>
<div class='alert alert-danger alert-dismissable'>
<button aria-hidden='true' data-dismiss='alert' class='close' type='button'>×</button>
<button type='button' class='btn btn-default' id='continueSubmit'><?php echo $lang->continueSave;?></button>
</div>
</div>
<script>
<?php helper::import('../js/searchcustomer.js');?>
</script>
<?php include '../../common/view/footer.html.php';?>