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

        <!--<ol class="breadcrumb">
  <li><a href="#"> صيانه</a></li>
  <li><a href="clientController.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">


                {literal}
                <form class="form-horizontal nameToBeChecked" id="receipt_client_form" role="form" action="receiptController.php?do=update" method="post" >

                    {/literal}


                    <div class="form-group">
                        <label for="clientid" class="col-lg-2 control-label">العميل</label>
                        <div class="col-lg-4"><span id="spryselect1">
                                <select class="select2 wdt100" name="clientid" id="clientid">
                                    <option value="-1">اختر عميل</option>


                                    {foreach $allclient as $data }

                                    <option value="{$data->clientid}"  {if {$data->clientid} eq {$clientdebtchangeData->clientid}} selected  {/if} >{$data->clientname}</option>

                                    {/foreach}


                                </select>
                                <span class="selectInvalidMsg">*</span></span></div>
                    </div>

                    <!-- =================================================   -->
                    <div id="receptdiv">
                        <div class="form-group">

                            <label for="receiptid" class="col-lg-2 control-label">رقم الفاتوره</label>

                            <div class="col-lg-4">
                                {if {$clientdebtchangeData->reciptid} neq 0}
                                <select class="select2 wdt100" name="receiptid" id="receiptid">
                                    <option value="-1"> اختر فاتوره</option>
                                    {foreach $alldata as $data }

                                    <option value="{$data->id}" id="xy" {if {$data->id} eq {$clientdebtchangeData->reciptid}} selected  {/if} >{$data->receiptserial}</option>

                                    {/foreach}

                                </select>
                                {else}
                                <label class="col-lg-7 control-label" style="color:#FF0000"> لايوجد فواتير لهذا العميل</label>
                                {/if}
                            </div>
                        </div>

                    </div>
                    <!-- =================================================   -->


                    <div class="form-group">
                        <label for="totaldebt" class="col-lg-2 control-label"> اجمالى المديونيه</label>

                        <div class="col-lg-4">
                            <div class="input-group">

                                <input type="text" name="totaldebt" id="totaldebt" class="form-control" readonly value="{$clientdebtchangeData->clientdebtchangebefore}"/>
                                <span class="input-group-addon">{$currency}</span>
                            </div>
                        </div>
                    </div>

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



                    <div class="form-group">
                        <label for="payed" class="col-lg-2 control-label"> المدفوع</label>

                        <div class="col-lg-4">
                            <div class="input-group">

                                <input type="text" name="payed" id="payed" class="form-control numberinput" value="{$clientdebtchangeData->clientdebtchangeamount}"  required="required"/>
                                <span class="input-group-addon">{$currency}</span>
                            </div>
                        </div>
                    </div>

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

                    <div class="form-group">
                        <label for="payed" class="col-lg-2 control-label"> الدين بعد</label>

                        <div class="col-lg-4">
                            <div class="input-group">

                                <input type="text" name="debtafter" id="debtafter" class="form-control" readonly {if {$clientdebtchangeData->discount} eq 0 } value="{$clientdebtchangeData->clientdebtchangeafter}"{else} value="{$debtremain}"{/if}/>
                                       <span class="input-group-addon">{$currency}</span>

                            </div>
                            <label id="showdebt" style="color:#900; display:none"> هذا الرقم اكبر من الدين</label>
                        </div>
                    </div>

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



                    <div class="form-group">
                        <label for="payed" class="col-lg-2 control-label"> الخصم من الدين</label>

                        <div class="col-lg-4">
                            <div class="input-group">

                                <input type="text" name="discount" id="discount" class="form-control numberinput" value="{$clientdebtchangeData->discount}" />
                                <span class="input-group-addon">{$currency}</span>
                            </div>
                        </div>
                    </div>

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


                    <div class="form-group">
                        <label for="payed" class="col-lg-2 control-label"> الباقى</label>

                        <div class="col-lg-4">
                            <div class="input-group">

                                <input type="text" name="remain" id="remain" class="form-control" readonly {if {$clientdebtchangeData->discount} neq 0 } value="{$clientdebtchangeData->clientdebtchangeafter}"{else} value="{$debtremain}"{/if} />
                                       <span class="input-group-addon">{$currency}</span>
                            </div>
                            <label id="showremain" style="color:#900; display:none"> هذا الرقم اكبر من الدين</label>
                        </div>
                    </div>

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

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

                            <textarea  class="form-control" rows="3" name="textDetails" id="textDetails">{$clientdebtchangeData->comment}</textarea>

                        </div>
                    </div>

                    <!-- =================================================   -->
                    <input type="hidden" name="clientdebtchangeid" id="clientdebtchangeid" class="form-control" value="{$clientdebtchangeData->clientdebtchangeid}" />
                    <input type="hidden" name="finishingpayedid" id="finishingpayedid" class="form-control" value="{$clientdebtchangeData->finishingPayedId}" />
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit" class="btn btn-primary pull-left">حفظ الامر</button>
                        </div>
                    </div>




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




    </div>
</div>


<div class="clear"></div>
<!-- ======= .grid_12 - block end ======= -->

</section>
<!-- End of #container -->

</section>
<!-- End of #layout -->
<div class="clear"></div>
{literal}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue: "-1"});
</script>
{/literal}
