<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    .mHead{
        color: #002bff !important;
        font-weight: bold !important;
    }
</style>


<style>

    @media (min-width: 768px){
        .form-horizontal .form-group {
            margin-right: -10px;
            margin-left:-10px;
        }

        .m10{
            margin: 10px
        }
        h4{
            font-size: 17px;
            font-weight: bold;
            color: #000000;
            margin: 10px 0 15px;
            font-family: sans-serif;
        }
        hr {
            margin: 20px ;
            border: 0;
            border-top: 2px solid #d7d7d7;

        }
        .card{
            box-shadow: 0 4px 16px rgba(0,0,0,.12);
            padding: 10px;
            margin: 40px 0;
            border-radius: 5px
        }

    }
    .wdt230{
        width:230px
    }
    .billtable thead>tr>th {
        color: #eeecda;
        background-color: #0081a8;
    }
    .add i{
        font-size: 20px;
        color: #607D8B;
    }
    .wdt50{
        width:50px
    }
    .mt-10{
        margin-top: 10px
    }
    .data-search{
        margin: 10px 15px 0;
    }
    .btn-dark {
        color: #fff;
        background-color: #636262;
        border-color: #646464;
    }
    .data-search .form-control{
        border-radius:3px
    }

</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير الموردين بالنوع</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير الموردين بالنوع
                <!--<a href="{$youtubes[274]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>-->
            </div>
            <div class="panel-body">
                <form class="searchForm form-inline hidden-print" action="typesupplierReportController.php" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>




                    <div class="form-group">
                        <label class="sr-only" style="margin-left: 13px;">نوع المورد</label>
                        <select class="select2 wdt300"  name="typesupplierId" id="typesupplierId" required>
                            <option value="-1">اختر نوع الموردين</option>

                            {foreach $TypeSupplierData as $single}

                            <option value="{$single->typeId}">{$single->typeName} </option>

                            {/foreach}

                        </select>
                        <div class="clientError" style="display:none;"></div>
                    </div>
                    <button type="submit" class="searchBtn btn btn-primary">بحث</button>
                    <!--<button type="button" class="searchBtn btn btn-primary">بحث</button>-->

                    <div class="dateStartError" style="display:none;"></div>
                    <div class="dateEndError" style="display:none;"></div>

                </form>
            </div>

            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading mHead">{if $message}{$message} {else}"لايوجد" {/if}</div>
                <div class="panel-body">
                    <hr/>
                    <table class="table table-black dataTableClass" id="supplier">
                        <thead>
                        <tr>
                            <th  class="hidden-print">
                                <label>
                                    <input type="checkbox" name="checkAll" id="checkAll"/>
                                </label>
                            </th>
                            <th>الرقم التسلسلي</th>
                            <th>اسم المورد</th>
                            <!-- <th>المديونية</th> -->
                            <th>ليه</th>
                            <th>عليه</th>
                        </tr>
                        </thead>
                        <tbody>
{assign var="totalDebit" value=0}
{assign var="totalCredit" value=0}
                        {foreach $allData as $data}
                        <tr>
                            <td class="hidden-print">
                                <label>
                                    <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$data->supplierid}" />
                                </label>
                            </td>
                            <td>{$data->supplierid}</td>
                            <td>{$data->suppliername}</td>
                            {if $data->suppliercurrentDebt < 0}
                            {assign var="totalCredit" value=$totalCredit+$data->suppliercurrentDebt}
                            <td>0</td>
                            <td>{$data->suppliercurrentDebt}</td>
                            {else}
                            {assign var="totalDebit" value= $totalDebit+$data->suppliercurrentDebt}
                            <td>{$data->suppliercurrentDebt}</td>
                            <td>0</td>
                            {/if}
                        </tr>
                        {/foreach}
                        </tbody>
                        <tfoot>
                            <tr>
                                <th colspan="3">الإجمالي</th>
                                <th>{$totalDebit}</th>
                                <th>{$totalCredit}</th>
                            </tr>
                        </tfoot>
                    </table>

                    <div class="col-lg-offset-8 col-lg-4">
                        <div class="well well-sm well-2sm">
                            <h4 class="text-center">الصافي {$totalDebit-$totalCredit}</h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>


