<style>
    .content {
        margin-top: 0;
    }
</style>
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            <?=$this->translate('首页')?>
            <small><?=$this->translate('信息概览')?></small>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-aqua"><i class="fa fa-square-o"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text"><?=$this->translate('商品')?></span>
                        <span class="info-box-number"><?=$this->goodsCount?></span>
                        <span class="info-box-more"><small></small></span>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-red"><i class="ion ion-ios-cart-outline"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text"><?=$this->translate('采购')?></span>
                        <span class="info-box-number"><?=$this->erpCurrencyFormat($this->purchaseAmount)?></span>
                        <span class="info-box-more"><small></small></span>
                    </div>
                </div>
            </div>
            <div class="clearfix visible-sm-block"></div>

            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-green"><i class="ion ion-ios-briefcase-outline"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text"><?=$this->translate('销售')?></span>
                        <span class="info-box-number"><?=$this->erpCurrencyFormat($this->salesAmount)?></span>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-yellow"><i class="ion ion-ios-people-outline"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text"><?=$this->translate('客户')?></span>
                        <span class="info-box-number"><?=$this->customerCount?></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">

            <div class="col-md-6">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?=$this->translate('采购订单')?></h3>
                    </div>

                    <div class="box-body">
                        <div class="table-responsive">
                            <table class="table no-margin">
                                <thead>
                                <tr>
                                    <th><?=$this->translate('订单号')?></th>
                                    <th><?=$this->translate('订单金额')?></th>
                                    <th><?=$this->translate('订单状态')?></th>
                                    <th><?=$this->translate('供应商')?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if($this->purchaseOrder) { foreach ($this->purchaseOrder as $orderValue) { ?>
                                <tr>
                                    <td><a href="<?= $this->url('p-order', ['action'=>'view', 'id' => $orderValue->getPOrderId()]); ?>"><?=$this->escapeHtml($orderValue->getPorderSn())?></a></td>
                                    <td><?=$this->erpCurrencyFormat($orderValue->getPOrderAmount());?></td>
                                    <td><?=$this->PurchaseHelper()->orderState($orderValue->getPOrderState(), 2)?></td>
                                    <td><?=$this->escapeHtml($orderValue->getOneSupplier()->getSupplierName())?></td>
                                </tr>
                                <?php } } ?>
                                </tbody>
                            </table>
                        </div>

                    </div>

                    <div class="box-footer clearfix">
                        <a href="<?=$this->url('p-order', ['action'=> 'add']);?>" class="btn btn-sm btn-info btn-flat pull-left"><?=$this->translate('添加采购订单')?></a>
                        <a href="<?=$this->url('p-order');?>" class="btn btn-sm btn-default btn-flat pull-right"><?=$this->translate('查看采购订单')?></a>
                    </div>

                </div>
            </div>

            <div class="col-md-6">
                <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="table-responsive">
                            <table class="table no-margin">
                                <thead>
                                <tr>
                                    <th><?=$this->translate('订单号')?></th>
                                    <th><?=$this->translate('订单金额')?></th>
                                    <th><?=$this->translate('订单状态')?></th>
                                    <th><?=$this->translate('客户')?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if($this->salesOrder) { foreach ($this->salesOrder as $orderValue) { ?>
                                <tr>
                                    <td><a href="<?= $this->url('sales-order', ['action'=>'view', 'id'=>$orderValue->getSalesOrderId()]); ?>"><?=$this->escapeHtml($orderValue->getSalesOrderSn())?></a></td>
                                    <td><?=$this->erpCurrencyFormat($orderValue->getSalesOrderAmount());?></td>
                                    <td><?=$this->salesHelper()->salesOrderState($orderValue->getSalesOrderState(), 2)?></td>
                                    <td><?=$this->escapeHtml($orderValue->getOneCustomer()->getCustomerName())?></td>
                                </tr>
                                <?php } } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <div class="box-footer clearfix">
                        <a href="<?=$this->url('sales-order', ['action'=> 'add']);?>" class="btn btn-sm btn-info btn-flat pull-left"><?=$this->translate('添加销售订单')?></a>
                        <a href="<?=$this->url('sales-order');?>" class="btn btn-sm btn-default btn-flat pull-right"><?=$this->translate('查看销售订单')?></a>
                    </div>

                </div>
            </div>

        </div>

    </section>

</div>