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

        <h1 class="pull-right">
            <a href="<?php echo $this->url('accounts-receivable');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回应收账款列表'); ?></a>
            <?php echo $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"><?php echo $this->translate('收款信息'); ?></h3>
                    </div>

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

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

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

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

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

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

                    </div>

                </div>


            </div>
        </div>

    </section>

</div>