<style>
    th,td{
        border: 1px solid #ddd !important;
    }
</style>
<div class="row">
    <div class="container">
        <!--show-------------------------------------------------------------------------------------------->
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"><strong> الميزانية العمومية </strong></h3>
                <a href="{$youtubes[224]->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">
                <div>
                    <table class="table table-black">
                        <thead>
                            <tr class="">
                                <th style="text-align: center;" class="color-black">الكود </th>
                                <th style="text-align: center;" class="color-black">البند </th>
                                <th style="text-align: center;" class="color-black">القيمة </th>
                            </tr>
                        </thead>
                        <tbody>


                            {assign var=totalFixedAssets value=0}
                            {assign var=totalCurrentAssets value=0}
                            {assign var=totalOwnerEquity value=0}
                            {assign var=totalnonCurrentLiabilities value=0}
                            {assign var=totalCurrentLiabilities value=0}


                            {assign var=totalAssets value=0}
                            {assign var=totalLiabilities value=0}

                            <!--- fixedAssets ---------------------------------------------->
                            {assign var=i value=0}
                            {foreach $fixedAssets as $item}
                            <tr {if $i==0}class="bg-black"{/if}>
                                <td>{$item->layingOrder}</td>
                                <td>
                                    {for $foo = 0 to $item->notes step=1}
                                    &emsp;
                                    {/for}
                                    {$item->customName}
                                </td>
                                <td>
                                    {if $item->theValue != 0}
                                    {$item->theValue}
                                    {assign var=totalFixedAssets value=$totalFixedAssets+$item->theValue}

                                    {/if}
                                </td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}

                            <tr style="background-color: #c1e4ff;">
                                <td></td>
                                <td>
                                    <b>اجمالى الاصول الغير متداولة</b>
                                </td>
                                <td>
                                    <b>{$totalFixedAssets}</b>
                                </td>
                            </tr>


                            <!--- currentAssets ---------------------------------------------->
                            {assign var=i value=0}
                            {foreach $currentAssets as $item}
                            {if $item->id !=381 && $item->id !=63}<!-- وسيط المشتريات و سلف العاملين    لا تدخل فى حساباتنا -->
                            <tr {if $i==0}class="bg-black"{/if}>
                                <td>{$item->layingOrder}</td>
                                <td>
                                    {for $foo = 0 to $item->notes step=1}
                                    &emsp;
                                    {/for}
                                    {$item->customName}
                                </td>
                                <td>
                                    {if $item->theValue != 0}
                                    {$item->theValue}
                                    {assign var=totalCurrentAssets value=$totalCurrentAssets+$item->theValue}

                                    {/if}
                                </td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/if}
                            {/foreach}

                            <tr style="background-color: #c1e4ff;">
                                <td></td>
                                <td>
                                    <b>اجمالى الاصول الغير متداولة</b>
                                </td>
                                <td>
                                    <b>{$totalCurrentAssets}</b>
                                </td>
                            </tr>
                            <tr style="background-color: #7bbff3;">
                                <td></td>
                                <td>
                                    <b>اجمالى الاصول </b>
                                </td>
                                <td>
                                    <b>
                                        {assign var=totalAssets value=$totalFixedAssets + $totalCurrentAssets}
                                        {$totalAssets}</b>
                                </td>
                            </tr>








                            <!----------------------------------------------------->
                            {assign var=i value=0}
                            {foreach $ownerequity as $item}
                            <tr {if $i==0}class="bg-black"{/if}>
                                <td>{$item->layingOrder}</td>
                                <td>
                                    {for $foo = 0 to $item->notes step=1}
                                    &emsp;
                                    {/for}
                                    {if $item->notes == 1}<b>{$item->customName}</b> {else} {$item->customName} {/if}

                                </td>
                                <td>
                                    {if $item->theValue != 0}
                                    {$item->theValue}
                                    {assign var=totalOwnerEquity value=$totalOwnerEquity + $item->theValue}
                                    {/if}
                                </td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}
                            <tr style="background-color: #c1e4ff;">
                                <td></td>
                                <td>
                                    <b>اجمالى حقوق الملكية </b>
                                </td>
                                <td>
                                    <b>{$totalOwnerEquity}</b>
                                </td>
                            </tr>
                            <!----------------------------------------------------->
                            {assign var=i value=0}
                            {foreach $nonCurrentLiabilities as $item}
                            <tr {if $i==0}class="bg-black"{/if}>
                                <td>{$item->layingOrder}</td>
                                <td>
                                    {for $foo = 0 to $item->notes step=1}
                                    &emsp;
                                    {/for}
                                    {if $item->notes == 1}<b>{$item->customName}</b> {else} {$item->customName} {/if}

                                </td>
                                <td>
                                    {if $item->theValue != 0}
                                    {$item->theValue}
                                    {assign var=totalnonCurrentLiabilities value=$totalnonCurrentLiabilities + $item->theValue}
                                    {/if}
                                </td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}
                            <tr style="background-color: #c1e4ff;">
                                <td></td>
                                <td>
                                    <b>اجمالى الالتزامات الغير متداولة </b>
                                </td>
                                <td>
                                    <b>{$totalnonCurrentLiabilities}</b>
                                </td>
                            </tr>
                            <!----------------------------------------------------->
                            {assign var=i value=0}
                            {foreach $currentLiabilities as $item}
                            {if $item->id != 95}<!-- تأمين شراء بضاعه       ليست فى حساباتنا  -->
                            <tr {if $i==0}class="bg-black"{/if}>
                                <td>{$item->layingOrder}</td>
                                <td>
                                    {for $foo = 0 to $item->notes step=1}
                                    &emsp;
                                    {/for}
                                    {if $item->notes == 1}<b>{$item->customName}</b> {else} {$item->customName} {/if}

                                </td>
                                <td>
                                    {if $item->theValue != 0}
                                    {$item->theValue}
                                    {assign var=totalCurrentLiabilities value=$totalCurrentLiabilities + $item->theValue}
                                    {/if}
                                </td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/if}
                            {/foreach}
                            <tr style="background-color: #c1e4ff;">
                                <td></td>
                                <td>
                                    <b>اجمالى الالتزامات المتداولة </b>
                                </td>
                                <td>
                                    <b>{$totalCurrentLiabilities}</b>
                                </td>
                            </tr>

                            <tr style="background-color: #7bbff3;">
                                <td></td>
                                <td>
                                    <b>اجمالى الالتزامات </b>
                                </td>
                                <td>
                                    <b>
                                        {assign var=totalLiabilities value=$totalOwnerEquity + $totalnonCurrentLiabilities + $totalCurrentLiabilities}
                                        {$totalLiabilities}</b>
                                </td>
                            </tr>




                        </tbody>
                    </table>
                    <br/>
                    <div class="col-lg-offset-16 col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center">{$gainLossMsg}</h4>
                        </div>
                    </div>
                </div>
                </br>
            </div>
        </div>
    </div>
</div>