

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">ادارة الفواتير</a></li>
            <li><a href="ReturnSellBillReportsController.php?do=show">فواتير المبيعات والمرودودات</a></li>
            <li class="active">تفاصيل فاتورة مبيعات ومردودات</li>
        </ol>
        <h3>{$billnameAddData->name}</h3>
        <hr/>

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

            <div class="row">
                <div class="col-lg-8">
                    <div class="form-group">
                        <label class="col-lg-2 control-label">رقم الفاتورة</label>
                        <div class="col-lg-4">
                            <p class="form-control-static">
                                {$sellbillandruternData->sellbillid}
                            </p>
                        </div>
                    </div><!-- end of form-group-->


                    <div class="form-group" {if {$billsettingsData[5]->billsettingsvalue} eq 0} style="display:block" {else} style="display:none" {/if} >
                        <label class="col-lg-2 control-label">تاريخ الفاتورة</label>
                        <div class="col-lg-4">
                            <p class="form-control-static">
                                {$sellbillandruternData->sellbilldate}
                            </p>
                        </div>
                    </div><!-- end of form-group-->


                    <div class="form-group" >
                        <label class="col-lg-2 control-label">اسم العميل المؤقت</label>
                        <div class="col-lg-4">
                            <p class="form-control-static">
                                {$sellbillandruternData->tempclientName}
                            </p>
                        </div>
                    </div><!-- end of form-group-->


                </div><!-- end of bill no-->


                <div class="col-lg-4">
                    <div class="form-group mg-bt5" {if {$billsettingsData[1]->billsettingsvalue} eq 0}  {else} style="display:none" {/if}>
                        <label class="col-lg-4 control-label">اسم العميل</label>
                        <div class="col-lg-8">
                            <p class="form-control-static">

                                {$sellbillandruternData->sellbillclientname}

                            </p>
                        </div>
                    </div><!-- end of form-group-->



                    <div class="form-group mg-bt5" {if {$billsettingsData[1]->billsettingsvalue} eq 0}  {else} style="display:none" {/if}>
                        <label class="col-lg-4 control-label">رصيد الدين</label>
                        <div class="col-lg-8">
                            <p class="form-control-static">
                                {$sellbillandruternData->sellbilltotaldeptbefor}
                            </p>
                        </div>
                    </div><!-- end of form-group-->



                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label">نوع السعر</label>
                        <div class="col-lg-8">
                            <p class="form-control-static">
                                {if {$ruternbilldetailData[0]->pricetype} eq 1}
                                تجزئة
                                {elseif {$ruternbilldetailData[0]->pricetype} eq 0}
                                جملة
                                {elseif {$ruternbilldetailData[0]->pricetype} eq 2}
                                نصف جملة
                                {/if}
                            </p>
                        </div>
                    </div><!-- end of form-group-->


                    <hr class="mg-bt5 mg-tp5"/>
                    <div class="form-group mg-bt5" {if {$billsettingsData[2]->billsettingsvalue} eq 0}  {else} style="display:none" {/if}>
                        <label class="col-lg-4 control-label">المخزن</label>
                        <div class="col-lg-8">
                            <p class="form-control-static">
                                {$sellbillandruternData->storeName}
                            </p>
                        </div>
                    </div><!-- end of form-group-->


                    <div class="form-group mg-bt5" {if {$billsettingsData[3]->billsettingsvalue} eq 0} style="display:block" {else} style="display:none" {/if}>
                        <label class="col-lg-4 control-label">اسم {if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}</label>
                        <div class="col-lg-8">
                            <p class="form-control-static">
                                {$sellbillandruternData->employeename}
                            </p>
                        </div>
                    </div><!-- end of form-group-->
                </div><!-- end of client info-->

            </div><!-- end of frist row-->
            <!-- hidden ===============================-->
            <input name="printingpapersize" id="printingpapersize" type="hidden" value="{$Programsettingdata->printingpapersize}" />
            <input type="hidden" name="billnameid" id="billnameid" value="{$billnameid}"/>
            <input type="hidden" name="settingreturn" id="settingreturn" value="{$billsettingsData[0]->billsettingsvalue}"/>
            <input type="hidden" name="settingclient" id="settingclient" value="{$billsettingsData[1]->billsettingsvalue}"/>
            <input type="hidden" name="settingstore" id="settingstore" value="{$billsettingsData[2]->billsettingsvalue}"/>
            <input type="hidden" name="settingseller" id="settingseller" value="{$billsettingsData[3]->billsettingsvalue}"/>
            <input type="hidden" name="settingparcode" id="settingparcode" value="{$billsettingsData[4]->billsettingsvalue}"/>
            <input type="hidden" name="settingdate" id="settingdate" value="{$billsettingsData[5]->billsettingsvalue}"/>
            <input type="hidden" name="settingnewproduct" id="settingnewproduct" value="{$billsettingsData[6]->billsettingsvalue}"/>
            <input type="hidden" name="settingcomment" id="settingcomment" value="{$billsettingsData[7]->billsettingsvalue}"/>
            <input type="hidden" name="settingdiscount" id="settingdiscount" value="{$billsettingsData[8]->billsettingsvalue}"/>
            <input type="hidden" name="settingQuantitiyFocus" id="settingQuantitiyFocus" value="{$billsettingsData[9]->billsettingsvalue}"/>
            <input type="hidden" name="settingUnit" id="settingUnit" value="{$billsettingsData[10]->billsettingsvalue}"/>



            <!-- end of hidden ===============================-->


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

            <div class="row">
                <div class="row">
                    <hr/>
                    <div class="col-lg-6">
                        <h4>المبيعات</h4>
                    </div>

                </div><!-- end of title row-->

                <div class="table-responsive">
                    <table class="table billtable table-bordered table-black" id="containerpros">
                        <thead>
                            <tr>
                                <th {if {$billsettingsData[4]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt120">الباركود</th>

                                <th class="wdt120">اسم المنتج</th>

                                <th {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt240">ملاحظات</th>

                                <th {if {$billsettingsData[10]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt100n">الوحدة</th>



                                <th class="wdt100n">العدد</th>
                                <th class="wdt100n">السعر</th>

                                <th {if {$billsettingsData[8]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt100n">الخصم</th>
                                <th class="wdt100n"> الاجمالى</th>


                            </tr>
                        </thead>
                        <tbody>

                            {foreach $sellbilldetailData as $sellbilldetail}
                            <tr>

                                <td {if {$billsettingsData[4]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <div id="productparcode1" >
                                        <p class="form-control-static">
                                            {$sellbilldetail->parcode}
                                        </p>
                                    </div>
                                </td>

                                <td>
                                    <div id="productdiv1">
                                        <p class="form-control-static">
                                            {$sellbilldetail->productName}/{$sellbilldetail->productCatName}
                                        </p>
                                    </div>
                                </td>


                                <td {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>
                                    <p class="form-control-static">
                                        {$sellbilldetail->note}
                                    </p>
                                </td>


                                <td {if {$billsettingsData[10]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <div id="productunitdiv1">
                                        <p class="form-control-static">

                                            {$sellbilldetail->unitName}
                                        </p>
                                    </div>
                                </td>



                                <td>
                                    <p class="form-control-static">
                                        {$sellbilldetail->sellbilldetailquantity}
                                    </p>
                                </td>

                                <td>
                                    <div id="propricechange1">
                                        <p class="form-control-static">
                                            {$sellbilldetail->sellbilldetailprice}
                                        </p>
                                    </div>
                                </td>


                                <td {if {$billsettingsData[8]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <p class="form-control-static">
                                        {$sellbilldetail->discountvalue}
                                    </p>
                                </td>


                                <td>
                                    <p class="form-control-static">
                                        {$sellbilldetail->sellbilldetailtotalprice}
                                    </p>
                                </td>





                            </tr>

                            {/foreach}
                        </tbody>
                    </table>
                </div>
                <button type="button" class="btn btn-primary pull-left ft-nor"> اجمالى المبيعات <span class="badge wht-clo"><div id="sellbilltotal">{$sellbillandruternData->sellbillprice}</div></span>
            </div>
            <!-- end of second row-->






            <div class="row" {if {$billsettingsData[0]->billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}>
                <div class="row">
                    <hr/>
                    <div class="col-lg-6">
                        <h4>مردودات المبيعات</h4>
                    </div>

                </div><!-- end of title row-->
                <div class="table-responsive">
                    <table class="table billtable table-bordered table-black" id="containerReturn" {if {$billsettingsData[0]->
                        billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}>
                        <thead>
                            <tr>
                                <th class="wdt120" {if {$billsettingsData[4]->billsettingsvalue} eq 0}  {else} style="display:none !important"{/if}>الباركود</th>
                                <th class="wdt120">اسم المنتج</th>
                                <th class="wdt240" {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>ملاحظات</th>
                                <th class="wdt100n">الوحدة</th>

                                <th class="wdt100n">العدد</th>
                                <th class="wdt100n">السعر</th>
                                <th class="wdt100n" {if {$billsettingsData[8]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الخصم</th>
                                <th class="wdt100n">الاجمالى</th>


                            </tr>
                        </thead>
                        <tbody>

                            {foreach $ruternbilldetailData as $ruternbilldetail}
                            <tr>
                                <td {if {$billsettingsData[4]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                    <div id="returnproductparcode1">
                                        <p class="form-control-static">
                                            {$ruternbilldetail->parcode}
                                        </p>
                                    </div>
                                </td>

                                <td>
                                    <div id="returnproductdiv1">
                                        <p class="form-control-static">
                                            {$ruternbilldetail->productName}/{$ruternbilldetail->productCatName}
                                        </p>

                                    </div>
                                </td>


                                <td {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <p class="form-control-static">
                                        {$ruternbilldetail->note}
                                    </p>
                                </td>


                                <td>
                                    <div id="returnproductunitdiv1">
                                        <p class="form-control-static">
                                            {$ruternbilldetail->unitName}
                                        </p>
                                    </div>
                                </td>



                                <td>
                                    <p class="form-control-static">
                                        {$ruternbilldetail->sellbilldetailquantity}
                                    </p>
                                </td>


                                <td>
                                    <div id="returnpropricechange1">
                                        <p class="form-control-static">
                                            {$ruternbilldetail->sellbilldetailprice}
                                        </p>
                                    </div>
                                </td>


                                <td {if {$billsettingsData[8]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <p class="form-control-static">
                                        {$ruternbilldetail->discountvalue}
                                    </p>
                                </td>


                                <td>
                                    <p class="form-control-static" id="reurnprototal1"> {$ruternbilldetail->sellbilldetailtotalprice}</p>

                                </td>



                            </tr>

                            {/foreach}
                        </tbody>
                    </table>
                </div>
                <button type="button" class="btn btn-primary pull-left ft-nor" {if {$billsettingsData[0]->billsettingsvalue} eq 0}  {else} style="display:none !important"  {/if}> اجمالى  مردودات المبيعات<span class="badge wht-clo" id="returnsellbilltotal">{$sellbillandruternData->returnsellbillprice}</span>

                </button>
            </div>

            <!-- end of third row-->





            <div class="row">

                <div class="col-lg-3">
                    <hr/>


                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">عدد القطع المباعة</label>
                        <div class="col-lg-7">
                            <p class="form-control-static" id="totalQty">
                                {if {$sellbillandruternData->sellQuantity} <= 0}
                                {$sellQuantity}
                                {else}
                                {$sellbillandruternData->sellQuantity}
                                {/if}
                            </p>

                        </div>
                    </div><!-- end of form-group-->


                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">عدد القطع المرتجعة</label>
                        <div class="col-lg-7">
                            <p class="form-control-static" id="returnTotalQty">
                                {if {$sellbillandruternData->returnsellQuantity} <= 0}
                                {$returnQuantity}
                                {else}
                                {$sellbillandruternData->returnsellQuantity}
                                {/if}

                            </p>

                        </div>
                    </div><!-- end of form-group-->



                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">الاجمالى العام</label>
                        <div class="col-lg-7">
                            <p class="form-control-static" id="gentotal">{$sellbillandruternData->sellbilltotalbill}</p>

                        </div>
                    </div><!-- end of form-group-->

                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">نوع الخصم</label>
                        <div class="col-lg-7">
                            <p class="form-control-static">
                                {if {$sellbillandruternData->sellbilldiscounttype} eq 1}
                                مباشر
                                {else}
                                بنسبة
                                {/if}
                            </p>
                        </div>
                    </div><!-- end of form-group-->

                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">قيمة الخصم</label>
                        <div class="col-lg-7">
                            <p class="form-control-static">
                                {$sellbillandruternData->sellbilldiscount}
                            </p>
                        </div>
                    </div><!-- end of form-group-->

                    <hr class="mg-tp5 mg-bt5"/>
                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">الصافى</label>
                        <div class="col-lg-7">
                            <p class="form-control-static" id="gen2total">{$sellbillandruternData->sellbillaftertotalbill} </p>

                        </div>
                    </div><!-- end of form-group-->

                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 control-label">المدفوع</label>
                        <div class="col-lg-7">
                            <p class="form-control-static">
                                {$sellbillandruternData->sellbilltotalpayed}
                            </p>
                        </div>
                    </div><!-- end of form-group-->


                    <hr class="mg-tp5 mg-bt5"/>
                    <div class="form-group mg-bt5 bg-yel">
                        <label class="col-lg-5 control-label">المتبقى</label>
                        <div class="col-lg-7">
                            <p class="form-control-static" id="gen3total">{$sellbillandruternData->sellbillfinalbill} </p>
                        </div>
                    </div><!-- end of form-group-->

                    <div class="form-group mg-bt5" {if {$billsettingsData[1]->billsettingsvalue} eq 0} style="display:block" {else} style="display:none !important" {/if}>
                        <label class="col-lg-5 control-label">باقى الدين</label>
                        <div class="col-lg-7">
                            <p class="form-control-static" id="gen4total">{$sellbillandruternData->sellbilltotaldeptafter} </p>

                        </div>
                    </div><!-- end of form-group-->
                </div><!-- end of totals center-->
            </div><!-- end of fourth row-->


            <div class="row hidden-print">
                <!--                <button type="submit"  class="btn btn-primary">رجوع</button>-->
                {*if {$Programsettingdata->printingpapersize} eq 0*}
                <!--<button type="button" onClick="print_Custom('mycustomheader');" class="btn btn-info">طباعة</button>-->
                {*/if*}
                {*if {$Programsettingdata->printingpapersize} eq 1*}
                <a target="_new" href="sellbillprintController.php?do=returnandselshowDetail&id={$sellbillandruternData->sellbillid}">
                    <button type="button" class="btn btn-info">طباعه ايصال</button></a>
                {*/if*}
            </div><!-- end of fifth row-->



        </form>
    </div><!-- end of container-->
</div><!-- end of main row-->






