
<style>
    .myresult
    {
        -webkit-print-color-adjust: exact;
    }
    @media print{
        tr > .myborder{
            border: 1px solid black !important;

        }

        .myborder
        {
            color: solid #000 !important;


        }
        .hidden{
            display: none;
        }
    }

</style>


<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">المخازن</a></li>
            <li><a href="otherstoremovementController.php?do=show">التحويل بين المخازن</a></li>
            <li class="active">عرض تفاصيل تحويل</li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">عرض تفاصيل التحويل</h3>
            </div>
            <div class="panel-body">


                <form class="form-horizontal" role="form" action="otherstoremovementController.php?do=show" method="post">


                    <!--                    <div class="form-group">
                                            <label class="col-lg-2 control-label">رقم السيريال</label>
                                            <div class="col-lg-4">
                                                <label>
                                                {$perationdata->oprationnumber}
                                                </label>
                                            </div>
                                        </div>-->
                    <div class="form-group" style="text-align: center">
                        <h2>{$Programsettingdata->companyname}</h2>
                    </div>

                    <div class="info">

                        <table class="table table-info">

                            <tr>
                                {if $Programsettingdata->clientserial eq 1}
                                <td>
                                    <h5> رقم الايصال</h5>
                                </td>
                                <td>
                                    {$perationdata['operationnum']}
                                </td>
                                {/if}

                                <td>
                                    <h5>تاريخ التحويل</h5>

                                </td>
                                <td> {$perationdata['transferproductdate']}</td>
                            </tr>

                            <!-- <tr>
                                <td>تاريخ التحويل</td>
                                <td> {$perationdata['transferproductdate']}</td>
                            </tr> -->
                            <tr>
                                <td>
                                    <h5>اسم المستخدم </h5></td>
                                <td> {$loadData[0]->employeename}</td>
                                <td>
                                    <h5> التاريخ</h5></td>
                                <td> {$loadData[0]->transferproductdate}</td>
                            </tr>
                            <tr>
                                <td>
                                    <h5> من </h5></td>
                                <td> {$loadData[0]->storefromName}</td>
                                <td>
                                    <h5>الى
                                    </h5>
                                </td>
                                <td>{$loadData[0]->storetoName}</td>
                            </tr>
                            <tr>
                                <td>
                                    <h5> تعليق </h5></td>
                                <td> {$loadData[0]->maincomment}</td>
                                <td>
                                    <h5>
                                    </h5>
                                </td>
                                <td></td>
                            </tr>

                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'}
                            <tr>
                                <td>  <h5>سعر</h5></td>
                                <td>
                                    {if $loadData[0]->priceType == "productBuyPrice"}
                                    الشراء
                                    {else if $loadData[0]->priceType == "productSellAllPrice"}
                                    جملة
                                    {else if $loadData[0]->priceType == "productSellHalfPrice"}
                                    نص جملة
                                    {else if $loadData[0]->priceType == "productSellUnitPrice"}
                                    قطاعى
                                    {/if}
                                </td>
                            </tr>
                            {/if}
                        </table>


                        <!--                    <div class="form-group noprint">
                                                <label class="col-lg-2 control-label">التعليق</label>
                                                <div class="col-lg-4">
                                                    <label>
                                                    {$perationdata->comment}
                                                    </label>
                                                </div>
                                            </div>-->



                        <!-- =================================================   -->

                        <div class="form-group">
                            <!-- end of title row-->
                            <div class="table-responsive">
                                <table class="table billtable table-bordered table-black" id="containerpros">
                                    <thead>
                                        <tr>
                                            <!--                                        <th class="wdt200 myborder">من </th>
                                                                                    <th class="wdt200 myborder">الى</th>-->
                                            <th class="wdt200 myborder">اسم المنتج</th>

                                            <th class="myborder">الكمية المحولة</th>
                                            <th class="myborder {if $usergroupdata->hideBillPrices == 1}hidden{/if}" {if $loadData[0]->priceType == '' || $loadData[0]->priceType == 'hide'} style="display:none" {/if}>السعر</th>
                                            <th class="myborder {if $usergroupdata->hideBillPrices == 1}hidden{/if}" {if $loadData[0]->priceType == '' || $loadData[0]->priceType == 'hide'} style="display:none" {/if}>الإجمالي</th>
                                            <!--<th class="myborder">التاريخ</th>-->
                                            <th class="myborder">تعليق</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {assign var=x value=0}
                                        {assign var=y value=0}
                                        {assign var=dailyentryids value=""}
                                        {foreach $loadData as $myloadData}
                                        <!--                                    {*if {$myloadData->conditions} eq 1*}

                                                                            <tr class="danger">-->
                                        <tr>
                                            <!--                                        <td class="myborder">
                                                                                        {$myloadData->storefromName}
                                                                                    </td>

                                                                                    <td class="myborder">

                                                                                        {$myloadData->storetoName}

                                                                                    </td>-->
                                            <td  class="myborder">
                                                {$myloadData->productName} / {$myloadData->productCatName}
                                            </td>
                                            <td class="myborder">
                                                {$myloadData->transferproductamount}
                                                {assign var=x value=$x+$myloadData->transferproductamount}
                                            </td>
                                            <td class="myborder {if $usergroupdata->hideBillPrices == 1}hidden{/if}" {if $loadData[0]->priceType == '' || $loadData[0]->priceType == 'hide'} style="display:none"{/if}>
                                                {$myloadData->price/$myloadData->transferproductamount}
                                            </td>
                                            <td class="myborder {if $usergroupdata->hideBillPrices == 1}hidden{/if}" {if $loadData[0]->priceType == '' || $loadData[0]->priceType == 'hide'} style="display:none"{/if}>
                                                {$myloadData->price}
                                                {assign var=y value=$y+$myloadData->price}
                                            </td>
                                            <td class="myborder">
                                                {$myloadData->comment}
                                            </td>

                                            <!--                                        <td class="myborder">
                                                                                        {$myloadData->transferproductdate}
                                                                                    </td>-->



                                        </tr>
                                        {assign var=dailyentryids value="`$dailyentryids`,`$myloadData->dailyentryid`"}
                                        {/foreach}
                                        {assign var=dailyentryids value=$dailyentryids|ltrim:','}
                                    </tbody>
                                </table>

                                <br>
                                <button type="button" style="background-color: #428bca;color:black!important; border:1px solid black !important;{if $loadData[0]->priceType == '' || $loadData[0]->priceType == 'hide'};display:none{/if}" class="btn btn-primary pull-left ft-nor {if $usergroupdata->hideBillPrices == 1}hidden{/if}">
                                    اجمالى السعر <span class="badge wht-clo">
                                        <div id="totalQuantityMove" style="color:black!important;">{$y}</div>
                                    </span>
                                </button>
                                <button type="button" style="background-color: #428bca;color:black!important; border:1px solid black !important;margin-left:3px;" class="btn btn-primary pull-left ft-nor">
                                    اجمالى الكمية المحولة <span class="badge wht-clo">
                                        <div id="totalQuantityMove" style="color:black!important;">{$x}</div>
                                    </span>
                                </button>


                            </div>
                        </div>

                        <!--<hr style="height:2px !important; color:#000 " />-->

                    </div>

                    <div class="form-group noprint">
                        <div class="col-lg-offset-2 col-lg-4">
                            <!--  ----  -->
                            {if count($loadData) > 0 && {$loadData[0]->conditions} eq 0}



                            <!--  ----  -->
                            {if $loadData[0]->recieveType == 1}
                            {if $loadData[0]->recieveUserid != 0}
                            <label style="width:25%">استلم<br/><strong>{$loadData[0]->recieveUserName}</strong></label>
                            {else}
                            {if $userData->storeSupervisor == 1 &&  $loadData[0]->storeidto|in_array:$userData->storeSupervisorStores}<a href="storemovementController.php?do=recieveAllproducts&operationnum={$loadData[0]->operationnum}" type="button" class="btn btn-default btn-primary" style="color: white">استلام المشرف</a>{else}<!--غير مسموح-->{/if}
                            <a href="storemovementController.php?do=tempdelete2&operationnum={$loadData[0]->operationnum}" type="button" class="btn btn-default btn-danger" style="color: white">ايقاف</a>
                            {/if}
                            {/if}





                            <button type="button" onclick="print_Custom('mycustomheader');"  class="btn btn-success noprint">طباعة</button>

                            <a href="dailyentry.php?id={$dailyentryids}" target="_blank" type="button" class="hidden-print noprint btn btn-primary" style="color: white">قيد اليومية</a>
                            {/if}
                            <!--  ----  -->

                            <button type="submit"  class="btn btn-primary noprint"> رجوع</button>

                        </div>
                    </div>




                </form>
            </div>
        </div>

        <!------------------------old data-------------------------------------->
        {if !empty($oldperationdata)}
        <div class="panel panel-default panel-m noprint" >
            <div class="panel-heading">
                <h3 class="panel-title">عرض تفاصيل التحويل القديم</h3>
            </div>
            <div class="panel-body">


                <form class="form-horizontal" role="form" action="otherstoremovementController.php?do=show" method="post">


                    <div class="form-group">
                        <label class="col-lg-2 control-label">رقم السيريال</label>
                        <div class="col-lg-4">
                            {$oldperationdata->oprationnumber}
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-lg-2 control-label">التعليق</label>
                        <div class="col-lg-4">

                            {$oldperationdata->comment}

                        </div>
                    </div>


                    <div class="form-group"  >
                        <label class="col-lg-2 control-label">تاريخ التحويل</label>
                        <div class="col-lg-4">
                            {$oldperationdata->oprationdata}
                        </div>
                    </div>

                    <!-- =================================================   -->

                    <div class="form-group">
                        <!-- end of title row-->
                        <div class="table-responsive">
                            <table class="table billtable table-bordered table-black" id="containerpros">
                                <thead>
                                    <tr>
                                        <th class="wdt200">من </th>
                                        <th class="wdt200">الى</th>
                                        <th class="wdt200">اسم المنتج</th>

                                        <th >الكمية المحولة</th>
                                        <th>التاريخ</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {foreach $oldloadData as $myloadData}

                                    <tr>

                                        <td>
                                            {$myloadData->storefromName}
                                        </td>

                                        <td>

                                            {$myloadData->storetoName}

                                        </td>
                                        <td>
                                            {$myloadData->productName} / {$myloadData->productCatName}
                                        </td>
                                        <td>
                                            {$myloadData->transferproductamount}
                                        </td>

                                        <td>
                                            {$myloadData->transferproductdate}
                                        </td>



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

                    <hr style="height:2px !important; color:#000 " />




            </div>
        </div>
        {/if}


    </div>
</div>

