{if $shape == 0}



{assign var=debtorByNature value=$lastDebtVal}
{assign var=cerditorByNature value=$lastCreditVal}
{assign var=lastid value=0}
{foreach $allDailyEntery as $dailyEntery}
{if $dailyEntery->id !=""}
{assign var=lastid value=$dailyEntery->id}

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




    {else}

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



    {/if}

    <td class="solidgrayleft solidgrayright">{$dailyEntery->dDateTime}</td>
    <td class="solidgrayleft solidgrayright">{$dailyEntery->entryComment}</td>
    <td class="solidgrayleft solidgrayright">{$dailyEntery->dComment}</td>
    <td class="solidgrayleft solidgrayright"><a href="dailyentry.php?id={$dailyEntery->id}" target="_blank" style="color:blue;"><u>{$dailyEntery->id}</u></a></td>




    {if $dailyEntery->type eq 0}
    <td class="solidgrayleft solidgrayright">{$dailyEntery->value}</td>
    <td class="solidgrayleft solidgrayright"></td>
    <td class="solidgrayleft solidgrayright">{$dailyEntery->accountstreeName}</td>

    {assign var=debtorByNature value=$debtorByNature + $dailyEntery->value}
    {assign var=cerditorByNature value=$cerditorByNature - $dailyEntery->value}
    {else}
    <td class="solidgrayleft solidgrayright"></td>
    <td class="solidgrayleft solidgrayright">{$dailyEntery->value}</td>
    <td class="solidgrayleft solidgrayright">{$dailyEntery->accountstreeName}</td>
    {assign var=debtorByNature value=$debtorByNature - $dailyEntery->value}
    {assign var=cerditorByNature value=$cerditorByNature + $dailyEntery->value}
    {/if}
    <td class="solidgrayleft">{if $entry->itemtype == "0"||$entry->itemtype == "3"}{$debtorByNature}{else}{$cerditorByNature}{/if}</td>

</tr>
{/foreach}








{else if $shape == 1}






{assign var=debtorTotal value=0}
{assign var=cerditorTotal value=0}
{assign var=lastid value=0}
{for $foo = 0 to $realCount step=2}
{if $allDailyEntery[$foo]->accountstreeName =="" && $allDailyEntery[$foo+1]->accountstreeName ==""}
{else}
<tr>
    {if $allDailyEntery[$foo]->id > 0 && $allDailyEntery[$foo]->id > $lastid}    {assign var=lastid value=$allDailyEntery[$foo]->id}    {/if}
    {if $allDailyEntery[$foo+1]->id > 0 && $allDailyEntery[$foo+1]->id > $lastid}  {assign var=lastid value=$allDailyEntery[$foo+1]->id}  {/if}

    <td class="solidgrayright">{$allDailyEntery[$foo]->value}</td>
    <th>{if $allDailyEntery[$foo]->accountstreeName != ""}<span class="toaccountstylesmall">الى حــ/ </span>{/if}{$allDailyEntery[$foo]->accountstreeName}</th>
    <td >{$allDailyEntery[$foo]->dDateTime}</td>
    <td class="solidgrayleft"><a href="dailyentry.php?id={$allDailyEntery[$foo]->id}" target="_blank" style="color:blue;"><u>{$allDailyEntery[$foo]->id}</u></a></td>
    <td class="solidgrayright">{$allDailyEntery[$foo+1]->value}</td>
    <th>{if $allDailyEntery[$foo+1]->accountstreeName != ""}<span class="fromaccountstylesmall">من حــ/ </span>{/if}{$allDailyEntery[$foo+1]->accountstreeName}</th>
    <td>{$allDailyEntery[$foo+1]->dDateTime}</td>
    <td class="solidgrayleft"><a href="dailyentry.php?id={$allDailyEntery[$foo+1]->id}" target="_blank" style="color:blue;"><u>{$allDailyEntery[$foo+1]->id}</u></a></td>
</tr>
{assign var=debtorTotal value=$debtorTotal + $allDailyEntery[$foo]->value}
{assign var=cerditorTotal value=$cerditorTotal + $allDailyEntery[$foo+1]->value}
{/if}
{/for}
{if $cerditorTotal-$debtorTotal != 0}
<tr class="netRow">
    <td class="solidgrayright">{if $cerditorTotal-$debtorTotal>0}<span class="dangerstyle netRight">{$cerditorTotal-$debtorTotal}</span>{/if}</td>
    <th colspan="2">{if $cerditorTotal-$debtorTotal>0}<span class="dangerstyle">رصيد دائن</span>{/if}</th>
    <td class="solidgrayleft"></td>
    <td class="solidgrayright">{if $debtorTotal-$cerditorTotal>0}<span class="dangerstyle netLeft">{$debtorTotal-$cerditorTotal}</span>{/if}</td>
    <th colspan="2">{if $debtorTotal-$cerditorTotal>0}<span class="dangerstyle">رصيد مدين</span>{/if}</th>
    <td class="solidgrayleft"></td>
</tr>
{/if}
<tr class="mytotal mytotalRow">
    <td class="solidgrayright totalRight">{if $cerditorTotal-$debtorTotal>0}{$cerditorTotal}{else}{$debtorTotal}{/if}</td>
    <th colspan="2"></th>
    <td class="solidgrayleft"></td>
    <td class="solidgrayright totalLeft">{if $cerditorTotal-$debtorTotal>0}{$cerditorTotal}{else}{$debtorTotal}{/if}</td>
    <th colspan="2"></th>
    <td class="solidgrayleft"></td>

</tr>




{/if}

{if count($allDailyEntery)>0}
<tr class="showMore showMoreStyle" data-lid="{$lastid}" {if $shape == 0}data-last-debt="{$debtorByNature}" data-last-credit="{$cerditorByNature}" {/if}><td colspan="8"> عـــرض المزيـــد</td></tr>
{/if}