<div class="content-wrapper">
    <section class="content-header">
        <?=$this->partial('layout/breadcrumb')?>

        <h1 class="pull-right">
            <a href="<?=$this->url('accounts-receivable');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?=$this->translate('返回应收账款列表')?></a>
            <?=$this->HelpUrl('accountsReceivableLog')?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?=$this->translate('收款信息')?></h3>
                    </div>

                    <div class="box-body">
                        <div class="row">
                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('销售单号')?>：</b><?=$this->escapeHtml($this->receivableInfo->getSalesOrderSn());?>
                                </div>
                            </div>

                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('应收金额')?>：</b><?=$this->erpCurrencyFormat($this->receivableInfo->getReceivableAmount());?>
                                </div>
                            </div>

                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b class="text-green"><?=$this->translate('已收金额')?>：</b><?=$this->erpCurrencyFormat($this->receivableInfo->getFinishAmount());?>
                                </div>
                            </div>

                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b class="text-danger"><?=$this->translate('未收金额')?>：</b><?=$this->erpCurrencyFormat(($this->receivableInfo->getReceivableAmount() - $this->receivableInfo->getFinishAmount()));?>
                                </div>
                            </div>
                        </div>

                        <div class="box-header">
                            <h4 class="box-title"><?=$this->translate('收款记录')?></h4>
                        </div>
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th width="10%"><?=$this->translate('收款时间')?></th>
                                    <th width="10%"><?=$this->translate('收款金额')?></th>
                                    <th width="15%"><?=$this->translate('收款人')?></th>
                                    <th width="10%"><?=$this->translate('收款凭证')?></th>
                                    <th width="30%"><?=$this->translate('收款备注')?></th>
                                    <th width="10%"><?=$this->translate('操作人')?></th>
                                    <th width="15%"><?=$this->translate('操作时间')?></th>
                                </tr>
                                </thead>

                                <?php if($this->receivableLogList) foreach ($this->receivableLogList as $log) { ?>
                                    <tr>
                                        <td><?=date("Y-m-d", $log->getReceivableLogTime())?></td>
                                        <td><?=$this->erpCurrencyFormat($log->getReceivableLogAmount())?></td>
                                        <td><?=$this->escapeHtml($log->getReceivableLogUser())?></td>
                                        <td>
                                            <?php if($log->getReceivableFile()) { ?>
                                                <a href="<?=$this->basePath($log->getReceivableFile())?>" title="<?=$this->translate('点击查看')?>" target="_blank"><i class="fa fa-picture-o"></i></a>
                                            <?php } else echo $this->translate('无') ?>
                                        </td>
                                        <td><?=$this->escapeHtml($log->getReceivableInfo())?></td>
                                        <td><?=$this->escapeHtml($log->getOneAdmin()->getAdminName())?></td>
                                        <td><?=date("Y-m-d H:i:s", $log->getReceivableAddTime())?></td>
                                    </tr>
                                <?php } ?>
                            </table>
                        </div>

                    </div>

                </div>


            </div>
        </div>

    </section>

</div>