<meta charset="UTF-8">
<style>
    .solidgraytop{
        border-top-style:solid;
        border-top-color:#000;
    }
    .solidgrayleft{
        border-left:solid;
        border-left-width:3px;
        border-color: #000;
    }
    .solidgrayright{
        border-right-style:solid;
        border-right-color:#000;
    }
    .solidgraybottom{
        border-top-style:solid;
        border-top-color:#000;
    }
    .hidetop{
        border-top:hidden !important;
    }
    .fromaccountstyle{
        font-weight:bold;
        font-size:17px;
        color:blue;
    }
    .toaccountstyle
    {
        font-weight:bold;
        font-size:17px;
        color:purple;
    }
    .mytotal{
        background-color:#000;
        font-weight:bold;
    }
    .nodata{
        background-color: #72B4EC;
        color: white;
        border-radius: 13px;
        margin: 14px;
        font-size: 24px;
        text-align: center;
        padding: 5px;
    }
    .table {
        font-family: arail;
        direction: rtl;
        border-collapse: collapse;
    }
    .table th{
        border-top:3px solid #000;
        border-right:3px solid #000;
        border-left:3px solid #000;
        padding: 5px 3px;
        background: #333;
        color: #fff;
    }
    .table td{
        text-align: right;
        padding-right: 3px;

    }

    .xno ,.xrq, .xmdn ,.xdan{
        width:5% !important;
    }
    .xdate {
        wudth:8%;
    }
    .xacc {
        min-width: 20%;
    }
    .xbyn {
        min-width: 42% !important;
    }
    .xbyq {
        min-width: 10% !important;
    }
    .bold {
        font-size: 14px;
    }
    @media print {
        @page {
            margin: 0px !important;
        }
    }

</style>

<center>
    <img src="{$path}/images/upload/{$Programsettingdata->logo}" width="150px" height="100px" />



    <div style="clear:both"></div>
    <br/>
    <br/>
    {foreach $relatedArr as $related}
    <div class="row" style=" background: #ccc; padding: 20px; font-weight: 600; margin-bottom: 10px; border-radius: 20px; ">
        <div class="form-group col-lg-2">
            <label class="sr-only">  رقم القيد المجمع</label>
            <label>{$allDailyEntery{$related}[0]->related}</label>
        </div>
        <div class="form-group col-lg-2">
            <label class="sr-only">تاريخ القيد المجمع</label>
            <label>{$allDailyEntery{$related}[0]->thedate}</label>
        </div>
        <div class="form-group col-lg-8">
            <label class="sr-only">بيان القيد المجمع</label>
            <label>{$allDailyEntery{$related}[0]->entryComment}</label>
        </div>

    </div>
    <table class="table table-black" width="100%">
        <thead>
            <tr class="mytotal">
                <th class="solidgrayright">#</th>
                <th class="solidgrayright" style="width:50px;">رقم القيد</th>
                <th>مدين</th>
                <th>دائن</th>
                <th>الحساب</th>
                <th class="solidgrayleft">البيان</th>
            </tr>
        </thead>
        <tbody>
            {assign var=i value=1}
            {assign var=debtorTotal value=0}
            {assign var=creditorTotal value=0}
            {foreach $allDailyEntery{$related} as $dailyEntery}
            {if $dailyEntery->id !=""}

            <!--عكس القيد-->
            {if $dailyEntery->reverseofid != 0 && $dailyEntery->reverseofid != -10}
            <tr class="solidgraytop" style="background-color: #FCE4EC">
                {else}
            <tr class="solidgraytop">
                {/if}

                <td class="solidgrayleft solidgrayright">{$i}</td>
                {assign var=i value=$i+1}
                <td class="solidgrayleft solidgrayright" style="text-align:center;">{$dailyEntery->id}</td>
                {else}

                <!--عكس القيد-->
                {if $dailyEntery->reverseofid > 0}
            <tr style="background-color: #FCE4EC">
                {else}
            <tr>
                {/if}

                <td class="hidetop solidgrayleft solidgrayright"></td>
                <td class="hidetop solidgrayleft solidgrayright"></td>
                {/if}



                {if $dailyEntery->type eq 0}
                <td>{$dailyEntery->value}</td>
                <td></td>
                <td> <span class="fromaccountstyle">من حــ/ </span> {$dailyEntery->accountstreeName}</td>
                <td {if $dailyEntery->id !=""}class="solidgrayleft solidgrayright"{else}class="hidetop solidgrayleft solidgrayright"{/if}>{$dailyEntery->dComment}</td>
                {assign var=debtorTotal value=$debtorTotal+ $dailyEntery->value}
                {else}
                <td></td>
                <td>{$dailyEntery->value}</td>
                <td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="toaccountstyle">الى حــ/ </span>{$dailyEntery->accountstreeName}</td>
                <td {if $dailyEntery->id !=""}class="solidgrayleft solidgrayright"{else}class="hidetop solidgrayleft solidgrayright"{/if}>{$dailyEntery->dComment}</td>
                {assign var=creditorTotal value=$creditorTotal+ $dailyEntery->value}
                {/if}



            </tr>
            {/foreach}
            <tr style="border-top:3px solid #000;"> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td>  </tr>
            <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
            <tr class="bold">
                <td colspan="3" style="text-align: center"><b>المحاسب</b></td>
                <td colspan="2" style="text-align: center"><b>المراجع</b></td>
                <td colspan="1" style="text-align: right;padding-left: 50px;"><b>المدير</b></td>
            </tr>

        </tbody>
    </table>
    {/foreach}

    {literal}
    <script>
        print_Custom('mycustomheader');
    </script>
    {/literal}
</center>