<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



{literal}
<script language="javascript" type="text/javascript">
    /*$(document).ready(function() {
     //window.print();
     printDiv();
     });*/
    function printDiv() {
        var divId = document.getElementById('printdiv');
        divId.setAttribute("className", "print_section print");
        divId.setAttribute("class", "print_section print");
        window.print();

        window.close();
    }
</script>
<style>
    @media print {
        table , p , .table-black { width:  700px ;  }
        .mydevl{width: 400px ; padding-right:  40px;}
        td ,th{
            border: 1px solid #000 !important;
        }
        .mytitle{
            margin-right:  50px;
        }
        .noprint{
            display: none;
        }
    }
    .hidden{
        display: none;
    }
</style>
{/literal}
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title class="mytitle">{$type}</title>
    </head>
    <body>
        {if count($loadData)>0}
        <table style="width: 90%; padding:0 10px;direction: rtl;" align="center" id="printdiv">
            <tr>
                <td style="border:0!important">
                    <div style="text-align: center;display: inline">
                        <h2>{$Programsettingdata->companyname}</h2>
                    </div>
                    <label style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none; border-radius: 5px;font-size: 20px"> {$type}</label>

                    <table width="100%" style="margin-top: 20px; border: 1px solid #ccc; border-radius: 5px;" class="table-black">
                        <tr>
                            <th {if {$Programsettingdata->print_amount} eq 1} hidden {/if} style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">رقم الاذن</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">تاريخ الاذن</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;"> من مخزن</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;"> الى مخزن</th>

                            <!--<th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">نوع الاذن</th>-->
                            <!--<th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">السيارة</th>-->
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">اسم المستخدم</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">تعليق</th>
                        </tr>
                        <tr>
                            <td {if {$Programsettingdata->print_amount} eq 1} hidden {/if} style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$loadData[0]->operationnum} </td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$loadData[0]->transferproductdate}</td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$loadData[0]->storefromName}</td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$loadData[0]->storetoName}</td>

                            <!--<td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{if $loadData[0]->storeidfrom == 1}صرف{elseif $loadData[0]->storeidto == 1}ارتجاع{else}تحويل بين المخازن{/if}</td>-->
                            <!--<td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$loadData[0]->driverName}</td>-->
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$username}</td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center">{$loadData[0]->maincomment}</td>
                        </tr>
                    </table>

                    <table width="100%" style="margin-top: 20px; border: 1px solid #ccc; border-radius: 5px;" class="table-black">
                        <tr>
                            <th>#</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">الباركود</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">اسم الصـــنف</th>
                            <th style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">الوحــــدة</th>
                            <th {if {$Programsettingdata->print_amount} eq 1} hidden {/if} style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">الكمـــية</th>
                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'}<th class="{if $usergroupdata->hideBillPrices == 1}hidden noprint{/if}" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">السعر</th>{/if}
                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'}<th class="{if $usergroupdata->hideBillPrices == 1}hidden noprint{/if}" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">الإجمالي</th>{/if}
                            <!-- <th class="commentsClass" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">تعليق</th> -->
                        </tr>
                        {assign var=totalPieces value=0}
                        {foreach $loadData as $data}
                        <tr style="font-size: 15px !important;">
                            <td>{$data@iteration}</td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">{$data->parcode}</td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">{$data->productName}/{$data->productCatName}</td>
                            <td style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">قطعة</td>
                            <td {if {$Programsettingdata->print_amount} eq 1} hidden {/if} style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">{assign var=totalPieces value=$totalPieces+$data->transferproductamount}{$data->transferproductamount}</td>
                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'} <td class="{if $usergroupdata->hideBillPrices == 1}hidden noprint{/if}" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">{assign var=totalOnePrice value=$totalOnePrice+($data->price/$data->transferproductamount)}{$data->price/$data->transferproductamount}</td>{/if}
                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'} <td class="{if $usergroupdata->hideBillPrices == 1}hidden noprint{/if}" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">{assign var=totalPrice value=$totalPrice+$data->price}{$data->price}</td>{/if}
                            <!-- <td class="commentsClass" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.01);border: 0 none;margin: 0;padding: 6px 10px;text-align: center;">{$data->comment}</td> -->
                        </tr>
                        {/foreach}
                        <tr {if {$Programsettingdata->print_amount} eq 1 && ( $loadData[0]->priceType == '' || $loadData[0]->priceType == 'hide')} hidden {/if} >
                            <th

                                colspan="4"
                                >الاجمالى </th>
                            <th {if {$Programsettingdata->print_amount} eq 1} hidden {/if} style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">{$totalPieces}</th>
                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'}<th class="{if $usergroupdata->hideBillPrices == 1}hidden noprint{/if}" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">{$totalOnePrice}</th>{/if}
                            {if $loadData[0]->priceType != '' && $loadData[0]->priceType != 'hide'}<th class="{if $usergroupdata->hideBillPrices == 1}hidden noprint{/if}" style="background: none repeat scroll 0 0 rgba(0, 0, 0, 0.09);border-bottom: 1px solid #cccccc;font-weight: bold;padding: 8px 10px;text-align: center;border: 0 none;">{$totalPrice}</th>{/if}
                            <!-- <th class="commentsClass"></th> -->
                        </tr>
                    </table>
                    <br />
                    <p>* استلمت البضاعة الموضحة عالية بعد المعاينة والقبول بصفة امانة وهذا اقرار مني ولا يعتبر هذا الاذن مسدد الا بعد تسليم الأصل</p><br />
                    <center>
                        <table width="100%" class="table-black mydevl">
                            <tr>
                                <td style="text-align:center"><strong>استلام العميل</strong></td>
                                <td style="text-align:center"><strong>استلام ال{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}</strong></td>
                            </tr>
                        </table>
                    </center>
                </td>
            </tr>
        </table>
        {/if}

        <div class="form-group noprint row" style="direction: rtl;">
            <div class="col-lg-offset-2 col-lg-4">
                <button type="button" onclick="MovementCommentsFunc();" id="MovementComments"  class="btn btn-success pull-right noprint" style="margin-right: 40%"></button>
                <button type="button" onclick="window.print();"  class="btn btn-success pull-right noprint">طباعة</button>
            </div>
        </div>

    </body>
</html>

{literal}
<script type="text/javascript" charset="utf-8" src="media/js/jquery.js"></script>
<script>
                    function MovementCommentsFunc(p) {
                        //current status,then toggle
                        var val = localStorage.getItem("MovementComments");
                        if (val === "hide") {//hidden, we show it
                            $('.commentsClass').removeClass('noprint');
                            $('#MovementComments').html('عدم طباعة التعليقات');
                            localStorage.setItem("MovementComments", "show");
                        } else {//we hide it
                            $('.commentsClass').addClass('noprint');
                            $('#MovementComments').html('طباعة التعليقات');
                            localStorage.setItem("MovementComments", "hide");
                        }
                    }

                    //apply initial value
                    var val = localStorage.getItem("MovementComments");
                    if (val === "show" || !val) {//hidden , we show it
                        localStorage.setItem("MovementComments", "show");
                        $('#MovementComments').html('عدم طباعة التعليقات');
                        $('.commentsClass').removeClass('noprint');
                    } else {//we hide it//or not set initially
                        localStorage.setItem("MovementComments", "hide");
                        $('#MovementComments').html('طباعة التعليقات');
                        $('.commentsClass').addClass('noprint');
                    }
                    window.print();

</script>
{/literal}