<?php
/**
 * The edit voucher view file of kingdee 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      Tingting Dai <daitingting@xirangit.com>
 * @package     kingdee
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../../sys/common/view/datepicker.html.php';?>
<div id='mainTitle' class='clearfix'>
  <div class='btn-toolbar pull-left'>
    <?php if(!isonlybody()):?>
    <?php echo html::a('javascript:history.go(-1);', '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, "class='btn btn-back'");?>
    <div class="divider"></div>
    <?php endif;?>
    <div class="page-title">
      <span class="text"><?php echo $lang->voucher->edit;?></span>
    </div>
  </div>
</div>
<form id='ajaxForm' method='post' class='main-row'>
  <div class='main-col col-8'>
    <div class='panel'>
      <div class='panel-body'>
        <table class='table table-form table-details'>
          <thead>
            <tr class='text-center'>
              <th class='w-60px'><?php echo $lang->voucher->FEntryID;?></th>
              <th class='w-180px'><?php echo $lang->voucher->FExplanation;?></th>
              <th class='w-180px'><?php echo $lang->voucher->FAccountName;?></th>
              <th class='w-120px'><?php echo $lang->voucher->FDebit;?></th>
              <th class='w-120px'><?php echo $lang->voucher->FCredit;?></th>
              <th><?php echo $lang->voucher->FItem;?></th>
            </tr>
          </thead>
          <tbody>
            <?php foreach($voucher->details as $detail):?>
            <tr>
              <td><?php echo html::input("entryIDs[{$detail->id}]", $detail->entryID, "class='form-control'");?></td>
              <td><?php echo html::input("explanations[{$detail->id}]", $detail->explanation, "class='form-control'");?></td>
              <td><?php echo html::select("accounts[{$detail->id}]", $accounts, $detail->account, "class='form-control chosen'");?></td>
              <td><?php echo html::input("debits[{$detail->id}]", $detail->debit, "class='form-control'");?></td>
              <td><?php echo html::input("credits[{$detail->id}]", $detail->credit, "class='form-control'");?></td>
              <td><?php echo html::input("items[{$detail->id}]", $detail->item, "class='form-control'");?></td>
              <td><?php echo html::a('javascript:;', "<i class='icon icon-remove'></i>", "class='btn btn-sm btn-remove'");?></td>
            </tr>
            <?php endforeach;?>
          </tbody>
        </table>
      </div>
    </div>
    <?php echo $this->fetch('action', 'history', "objectType=voucher&objectID={$voucher->id}");?>
    <div class='main-actions'>
      <?php echo html::submitButton() . html::backButton();?>
    </div>
  </div>
  <div class='side-col col-4'>
    <div class='panel'>
      <div class='panel-heading'><strong><i class="icon icon-list-info"></i> <?php echo $lang->voucher->basicInfo;?></strong></div>
      <div class='panel-body'>
        <table class='table table-form'>
          <tr>
            <th class='w-80px'><?php echo $lang->voucher->FGroupID;?></th>
            <td><?php echo html::input('type', $voucher->type, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->voucher->FAttachments;?></th>
            <td><?php echo html::input('attachments', $voucher->attachments, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->voucher->status;?></th>
            <td><?php echo html::select('status', $lang->voucher->statusList, $voucher->status, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->voucher->date;?></th>
            <td><?php echo html::input('date', $voucher->date, "class='form-control form-date'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->voucher->FTransDate;?></th>
            <td><?php echo html::input('transDate', $voucher->transDate, "class='form-control form-date'");?></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</form>
<?php include '../../common/view/footer.html.php';?>
