{% load i18n %}

<div class="col-md-3 left_col">
    <div class="left_col scroll-view">     
        <div class="navbar nav_title" style="border: 0;">
              <span href="#" class="site_title"><img src="/media/{{company_logo}}" style='height:50px;'>
                  <span style='font-size:14px;'  >
                        {% if user.company %}
                            {{user.company.name}}
                        {% else %}
                            {% trans '基础信息' %}
                        {% endif %}
                  </span>
              </span>
        </div>
        <div class="clearfix"></div>    
        <!-- sidebar menu -->
        <div id="sidebar-menu" class="main_menu_side hidden-print main_menu" style='margin-top:30px;'>


        {% ifequal user.groups.all.0.name '销售出库组' %}
            <div class="menu_section">
                <h3>{% trans '物流管理' %}</h3>
                <ul class="nav side-menu">
                  <li><a><i class="fa fa-list"></i> {% trans '进销存报表' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">  
                        <li><a class="l-a" href="/inventory/batch/gdn/">{% trans '销售出库' %}</a></li>   
                        <li><a class="l-a" href="/inventory/batch/gtn/">{% trans '成品转库' %}</a></li>
                        <li><a class="l-a" href="/inventory/batch/gwn/">{% trans '销售退库' %}</a></li> 
                        <li><a class="l-a" href="/inventory/stock/">{% trans '出入库列表' %}</a></li>  
                    </ul>
                  </li>
                  <li><a><i class="fa fa-paw"></i> {% trans '物流查询' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                        <li><a class="l-a" href="/inventory/html/label_query/">{% trans '标签查询' %}</a></li>                        
                    </ul>
                  </li>  
                </ul>
            </div>  
        {% else %}
            {% ifequal user.groups.all.0.name '成品入库组' %}
                <div class="menu_section">
                    <h3>{% trans '物流管理' %}</h3>
                    <ul class="nav side-menu">
                        <li><a><i class="fa fa-list"></i> {% trans '进销存报表' %} <span class="fa fa-chevron-down"></span></a>
                            <ul class="nav child_menu">  
                                <li><a class="l-a" href="/inventory/batch/grn/">{% trans '成品入库' %}</a></li>   
                                <li><a class="l-a" href="/inventory/batch/gtn/">{% trans '成品转库' %}</a></li>
                                <li><a class="l-a" href="/inventory/batch/gcn/">{% trans '标签退库' %}</a></li>
                                <li><a class="l-a" href="/inventory/stock/">{% trans '出入库列表' %}</a></li>  
                            </ul>
                        </li>
                        <li><a><i class="fa fa-paw"></i> {% trans '物流查询' %} <span class="fa fa-chevron-down"></span></a>
                            <ul class="nav child_menu">
                                <li><a class="l-a" href="/inventory/html/label_query/">{% trans '标签查询' %}</a></li>                        
                            </ul>
                        </li>  
                    </ul>
                </div>  
            {% else %}        
            <div class="menu_section">
                <h3>{% trans '基础信息' %}</h3>
                <ul class="nav side-menu">
                  <li><a><i class="fa fa-home"></i> {% trans '公司管理' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a class='l-a' href="/obj/list/user/">{% trans '用户帐号' %}</a></li>                      
                      <li><a class='l-a' href="/obj/list/prd_plant/">{% trans '工厂厂区' %}</a></li>
                      
                        <li><a class='l-a' href="/obj/list/store/">{% trans '仓库列表' %}</a></li> 
                      
                      <li><a class='l-a' href="/obj/list/sal_division/">{% trans '营销战区' %}</a></li>
                      <li><a class='l-a' href="/obj/list/sal_subdivision/">{% trans '营销分区' %}</a></li>    
                      <li><a class='l-a' href="/product/list/query/auth/">{% trans '稽察授权' %}</a></li>   
                      {% ifequal user.id 1 %}
                        <li><a class='l-a' href="/obj/list/companycfg/">{% trans '公司设置' %}</a></li> 
                      {% endifequal %}
                    </ul>
                  </li>
                  <li><a><i class="fa fa-edit"></i> {% trans '产品管理' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">                      
                       <li><a class="l-a" href="/obj/list/series/" >{% trans '产品系列' %}</a></li>
                        <li><a class="l-a" href="/obj/list/product/" >{% trans '产品名称' %}</a></li>
                        <li><a class="l-a" href="/obj/list/productprop/" >{% trans '产品属性' %}</a></li>
                    </ul>
                  </li>
                  <li><a><i class="fa fa-sitemap"></i> {% trans '经销商管理' %}  <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                      <li><a class="l-a" href="/obj/list/agent/">{% trans '经销商列表' %}</a></li>  
                      <li><a class="l-a" href="/company/list/register/">{% trans '终端店注册' %}</a></li>   
                      <li><a class='l-a' href="/company/list/agent/order/">{% trans '订单列表' %}</a></li>
                    </ul>
                  </li>  
                </ul>
            </div>
            <div class="menu_section">
                <h3>{% trans '物流管理' %}</h3>
                <ul class="nav side-menu">
                  <li><a><i class="fa fa-list"></i> {% trans '进销存报表' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                        {% if perms.company.stk_inbound %}
                            <li><a class="l-a" href="/inventory/batch/grn/">{% trans '成品入库' %}</a></li>   
                            <li><a class="l-a" href="/inventory/batch/gdn/">{% trans '销售出库' %}</a></li>
                            {% if request.user.company.level.sn < 1 %}
                                <li><a class="l-a" href="/inventory/batch/gtn/">{% trans '成品转库' %}</a></li>
                                <li><a class="l-a" href="/inventory/batch/gwn/">{% trans '销售退库' %}</a></li>                                
                            {% endif %}   

                            {% if request.user.company.level.sn < 1 %}
                                <li><a class="l-a" href="/inventory/batch/gcn/">{% trans '标签退库' %}</a></li>
                            {% else %}
                                <li><a class="l-a" href="/inventory/batch/gcn/">{% trans '入库退库' %}</a></li>
                            {% endif %}
                        {% endif %}

                        {% if perms.company.stk_delivery %}   
                            <li><a class="l-a" href="/inventory/stock/">{% trans '出入库列表' %}</a></li>
                            {% ifnotequal request.user.company.id 1 %}
                                <li><a class="l-a" href="/inventory/stock/agents/">{% trans '经销商现有库存' %}</a></li>                            
                                <li><a class="l-a" href="/inventory/agent/list/" > {% trans '经销商出入库查询' %}</a></li>
                            {% endifnotequal %}


                        {% endif %}
                    </ul>
                  </li>
                  <li><a><i class="fa fa-paw"></i> {% trans '物流查询' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                         <li><a class="l-a" href="/inventory/html/label_query/">{% trans '标签查询' %}</a></li>
                         {% ifequal request.user.company.id 1%}
                            {% if perms.company.sys_admin %}
                                <li><a class="l-a" href="/inventory/query/label_query/">{% trans '批量查询' %}</a></li>
                            {% endif %}
                         {% endifequal %}
                         {% if perms.company.stk_delivery %}                                                     
                            <li><a class="l-a" href="/inventory/stock/err/list/">{% trans '标签检查' %}</a></li>
                            <li><a class="l-a" href="/inventory/stock/err/product/">{% trans '品名检查' %}</a></li>                            
                        {% endif %}
                    </ul>
                  </li>
                  <li><a><i class="fa fa-wrench"></i> {% trans '物流工具' %} <span class="fa fa-chevron-down"></span></a>
                  <ul class="nav child_menu">
                        {% if not request.user.company.is_microboss %}
                            {% if not request.user.company.parent %}
                                {% if perms.company.sys_admin %}
                                    {% if request.user.company.is_manufacturing %}
                                        <li><a class="l-a"
                                                href="/inventory/html/label_replace/">{% trans '上传标签替换TXT' %}</a></li>
                                    {% endif %}
                                {% endif %}
                            {% endif %}
                        {% endif %}
                        {% if perms.company.sys_admin %}                            
                            <li><a class="l-a" href="/inventory/upload/inv/">{% trans '上传发货TXT文件' %}</a></li>                            
                        {% endif %}    
                        {% if perms.company.sys_admin %}
                            {% ifequal request.user.company.level_id 1 %}
                                <li><a class="l-a" href="/inventory/stock/transfer/">{% trans '经销商库存转移' %}</a></li>   
                            {% endifequal %}
                        {% endif %}    
                  </ul>
                  </li>
                    <li><a><i class="fa fa-book"></i> {% trans '领用核销' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                         <li><a class="l-a" href="/obj/list/recipient/">{% trans '业务员领用记录' %}</a></li>
                        <!--
                        <li><a class="l-a" href="#">{% trans '核销记录' %}</a></li>
                        -->
                        <li><a class="l-a" href="/sales/agents/writeoff/">{% trans '经销商核销列表' %}</a></li>

                    </ul>
                  </li>
                </ul>
            </div>
            <div class="menu_section">
                <h3>{% trans '营销管理' %}</h3>
                <ul class="nav side-menu">
                  <li><a><i class="fa fa-line-chart"></i> {% trans '销售报表' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">
                        {% ifequal request.user.company.id 1644 %}
                            <li><a class="l-a" href="/sales/agents/scan/" >{% trans '经销商扫码' %}</a></li>
                        {% endifequal %}    
                        <li><a class="l-a" href="/sales/query/month/" >{% trans '月度图表' %}</a></li>                    
                        <li><a class="l-a" href="/sales/query/date/" >{% trans '时间段图表' %}</a></li>   
                    </ul>
                  </li>                  
                  <li><a><i class="fa fa-qrcode"></i> {% trans '营销活动' %} <span class="fa fa-chevron-down"></span></a>
                    <ul class="nav child_menu">                        
                        <li><a class="l-a" href="/obj/list/award/" >{% trans '奖品设置' %}</a></li>   
                        <li><a class="l-a" href="/obj/list/activities/" >{% trans '活动设置' %}</a></li>  
                        <li><a class='l-a' href="/obj/list/consumerwinner/">{% trans '中奖记录' %}</a></li> 
                    </ul>
                  </li>  
                </ul>  
            </div> 
            {% endifequal %}
        {% endifequal %}

        </div>
        <!-- /sidebar menu -->


        <!-- /menu footer buttons -->
        <div class="sidebar-footer hidden-small">
              <a data-toggle="tooltip" data-placement="top" title="Settings">
                <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="{% trans '全屏显示' %}">
                <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="Lock">
                <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="{% trans '退出登录' %}"  href="/user/logout/">
                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
              </a>
        </div>
        <!-- /menu footer buttons -->

    </div>

</div>
