<?php
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Url;
use home\modules\receivable\models\Plan;
use home\modules\contract\models\Contract;
use home\models\Attachment;
use common\models\User;

/* @var $this \yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \home\modules\project\models\Project */

$this->title = '回款详情';
?>

<!--container-->
<div class="container manage-project fix">
  <?= $this->render('@home/views/site/_left-menu') ?>

    <!--manage-left -->
    <div class="manage-right">
        <div class="tab-column tab-manage">
            <div class="tab-right">
                <button type="button" title="新增回款" data-url='<?= Url::to([$this->context->id . '/create']) ?>' data-title='新增回款' data-width="560" data-height="360" class="btn btn-default btn-task open-dialog">
                    <i class="icon-plus"></i>
                </button>
            </div>
            <p class="caption">回款详情</p>
        </div>
        <div class="task-title">
            <p class="lefttitle"><span>回款编号：</span><?= isset($model['rece_no'])?$model['rece_no']:'' ?>&nbsp;&nbsp; 
                <span>合同名称：</span><?= isset($contract->name)?$contract->name:'' ?> &nbsp;
                <span>转账方式：</span><?= isset($model->method->name)?$model->method->name:'' ?>
            </p>
        </div>
        <div class="mgt10">
            <table class="table task-table taskdetail-table">
                <tr>
                    <td width="20%" class="table-blue">合同名称</td>  
                    <td colspan="3">
                        <a target="_blank" href="<?= isset($contract->name) ? Url::to(['/contract/contract/detail', 'id' => $contract->contract_id]): 'javascript:;' ?>">
                            <?= isset($contract->name)?$contract->name:'' ?>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td width="20%" class="table-blue">客户名称</td>  
                    <td width="30%">
                        <a target="_blank" href="<?= isset($contract->customer)?Url::to(['/customer/customer/detail', 'id' => $contract->customer['customer_id']]):'javascript:;' ?>">
                            <?= isset($contract->customer)?$contract->customer['name']:'' ?>
                        </a>
                    </td>
                    <td width="20%" class="table-blue">项目名称</td>
                    <td width="30%">
                        <a target="_blank" href="<?= isset($contract->project)?Url::to(['/project/project/detail', 'id' => $contract->project['project_id']]):'javascript:;' ?>">
                            <?= isset($contract->project)?$contract->project['name']:'' ?>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td width="20%" class="table-blue">回款编号</td>  
                    <td width="30%"><?= $model->rece_no ?></td>
                    <td width="20%" class="table-blue">回款金额</td>
                    <td width="30%"><?= $model->rece_money ?></td>
                </tr>
                <tr>
                    <td width="20%" class="table-blue">回款开户行</td>  
                    <td width="30%"><?= $model->rece_bank ?></td>
                    <td width="20%" class="table-blue">回款账号</td>
                    <td width="30%"><?= $model->rece_account ?></td>
                </tr>
                <tr>
                    <td width="20%" class="table-blue">收款银行</td>  
                    <td width="30%"><?= isset($model->bank->name)?$model->bank->name:'' ?></td>
                    <td width="20%" class="table-blue">收款账号</td>
                    <td width="30%"><?= $model->receiving_account ?></td>
                </tr>
                <tr>
                    <td width="20%" class="table-blue">到款日期</td>  
                    <td width="30%"><?= date('Y-m-d', $model->to_date) ?></td>
                    <td width="20%" class="table-blue">回款登记人</td>
                    <td width="30%"><?= User::findById($model->user_id)->realname ?></td>
                </tr>
                <tr>
                    <td width="20%" class="table-blue">备注</td>  
                    <td colspan="3"><?= $model->remark ?></td>
                </tr>
            </table>
        </div>
    <!--manage-right--> 
</div>
<!--container-->
</div>