<!--- = editor
        ******************************************************************************************* -->
<script type="text/javascript" src="{$path}/js/custombill.js"></script>


<!-- here will start the bill html tags-->



<section id="container" class="container_12">
    <!--- = bill
           ********************************************************************************* -->   


    <!-- all custom js method here --------->
    <script type="text/javascript">

        //here the varables in supplier method
        var supplierpagename = 'purchasebillAjaxController.php';
        var supplierid = 1;
        var productpricepagename = 'purchasebillAjaxController.php';
        //type determine if the bill is buy or return
        // 0 for buy , 1 for return
        var billtype = 0;

    </script>
    <!-- end custom js ----------- --------->



    <!-- === here the drop down list that fill the product list === -->
    <div id="addrowcreated" style="display:none">       
        {foreach $rawmaterialData as $rawmaterial}

        <option value="{$rawmaterial->rawmaterialid}">{$rawmaterial->rawmaterialname} </option>

        {/foreach}
    </div>
    <!-- === end of drop down list === -->





    <!-- ====================================================== .grid_12 - block begin ======= -->
    <form action="purchasebillController.php?do=add" method="post" id="billform">

        <!-- ====================================================== .breadCrumb ======= -->
        <section class="grid_12">
            <div class="box aw_mb10">
                <div class="title">

                    <div class="layout"> 

                        here will be breadCrumb

                    </div>
                </div>
            </div>
        </section>
        <!-- ====================================================== -->					
        {literal}
        <style>
            .aw_lb{
                float:right;
            }
            .clear{
                clear: both;
            }
            .aw_label{
                width: 75px;
                float: right;
                margin: 3px 5px 3px 0px;
            }
            .aw_width {
                width: 100%;
                float: right;
                text-align: right;
                padding: 5px 0;
            }
            .aw_lb{
                margin-right: 0px !important;
            }
            .sizew190 {
                width: 190px!important;
            }
            .dataTables_filter label input {
                border: 1px solid #ccc;
                border-radius: 2px;
                -webkit-border-radius: 2px;
                -moz-border-radius: 2px;
                outline: none;
                padding: 2px 4px;
            }
            .aw_left {
                float: left;
            }
            .aw_w2 {
                width: 35%;
            }
            .aw_rllb {
                margin-right: 0px !important;
                float: right;
            }
            .dataTables_filter label {
                margin-right: 10px;
            }
            .aw_right {
                float: right;
            }
            .aw_w1 {
                width: 35%;
            }
            .aw_m1 {
                max-width: 350px;
                width: 195px;
            }
            .container_12{
                width:100% !important;
            }
            .aw_ras {
                float: right;
                margin: 5px 30px 0 0;
            }
        </style>
        {/literal}				

        <section class="grid_12">
            <div class="box aw_mb10">
                <div class="title">
                    <div class="layout">الفاتورة</div>
                </div>						
                <div class="inside">
                    <div class="aw_width dataTables_filter" id="datatable_2_filter">

                        <div class="aw_right aw_w1">
                            <label>
                                <div class="aw_label">اسم المورد :  </div>
                                <span id="spryselect1">
                                    <select id="supplier" name="supplier" data-placeholder="اختر" class="chzn-select aw_m1" tabindex="1">
                                        <option value="-1"></option>

                                        <option value="1"> على كامل الحسينى محمد</option>
                                        <option value="1">محمد</option>
                                        <option value="1">محمد</option>
                                        <option value="1">محمد</option>
                                        <option value="1">محمد</option>



                                    </select>
                                    <span class="selectInvalidMsg">اختر مورد</span></span>
                            </label>



                            <label class="aw_rllb">
                                <div class="aw_label">رصيد الدين : </div>
                                <div id="debt" class="aw_ras">
                                    اختر مورد
                                </div>
                                <input name="hidden_debt" id="hidden_debt" type="hidden" value="1500" />
                                <span class="aw_ras"><a id="editdebt" style="display:none;" href="#">تعديل</a></span>
                            </label>

                        </div> 


                        <label class="aw_lb"><div class="aw_label">رقم الفاتورة :  </div>
                            <input name="bns" id="bns" class="sizew100" type="text" tabindex="3" />
                        </label>


                        <div class="aw_left aw_w2">

                            <div class="clear"></div>

                            <label class="aw_lb"><div class="aw_label">التاريخ :  </div>
                                <span id="sprytextfield1">
                                    <input name="bn" type="text" class="datepicker sizew190" id="data" tabindex="4" />
                                    <span class="textfieldRequiredMsg">ادخل التاريخ</span></span>
                            </label>

                            <div class="clear"></div>

                            <label class="aw_lb">

                                <div class="aw_label">المخزن : </div>
                                <span id="spryselect2">
                                    <select name="storerawmaterialid" data-placeholder="اختر" class="chzn-select aw_m1" tabindex="5">
                                        <option value="-1"></option>

                                        <option value="1">مخزن واحد </option>
                                        <option value="1">مخزن واحد </option>
                                        <option value="1">مخزن واحد </option>
                                        <option value="1">مخزن واحد </option>
                                        <option value="1">مخزن واحد </option>


                                    </select>
                                    <span class="selectInvalidMsg">اختر مخزن</span></span>
                            </label>


                            <div class="clear"></div>


                        </div> 

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

        <!-- ====================================================== .grid_12 - block begin ======= -->
        <section class="grid_12">
            <div class="box">
                <div class="title">
                    <div class="layout">مكونات الفاتورة</div>
                </div>		

                <div class="inside">

                    <table id="containerpros" border="1" class="aw_fatora">
                        <tr class="aw">
                            <td colspan="6" class="noborder aw_wa10">
                                <div class="aw_maa555"><a name="addpro" id="addpro" class="button">إضافة عنصر</a></div>
                            </td>

                        <tr class="aw_bg1f86c2">
                            <td class="aw_proname">اسم المنتج</td>
                            <td class="aw_proprice">السعر</td>
                            <td class="aw_pronum">العدد</td>
                            <td class="aw_prodis">الخصم</td>
                            <td class="aw_prototal">الإجمالي</td>
                            <td class="aw_prodel aw_none">&nbsp;<input name="hidden_itr" id="hidden_itr" type="hidden" value="0" /></td>
                        </tr>
                        <!-- ------------------------------------------------------------------->
                        <tr class="aw_td">
                            <td>
                                <div id="productdiv1" class="aw_width aw_mt5">

                                    <select id="product1" name="product1" data-placeholder="اختر" class="chzn-select aw_m1 chosenproduct" tabindex="12">
                                        <option value="-1"></option>

                                        <option value="1">منتج معين  </option>
                                        <option value="1">منتج معين  </option>
                                        <option value="1">منتج معين  </option>
                                        <option value="1">منتج معين  </option>


                                    </select>
                                </div>					
                            </td>
                            <td>
                                <div id="propricechange1">
                                    <input name="proprice1" id="proprice1" value="15" class="getprototal aw_m aw_mt aw_pp numberclic enteraction" type="text" tabindex="13" />
                                </div>
                            </td>
                            <td><input name="pronum1" id="pronum1" value="1" class="getprototal aw_m aw_mt aw_pp numberclic enteraction" type="text" tabindex="14" /></td>
                            <td><input name="prodis1" id="prodis1" value="0" class="getprototal aw_m aw_mt aw_in numberonly enteraction" type="text" tabindex="15" /></td>
                            <td class="aw_totalprice"><div id="prototal1" class="aw_mt">0</div>
                                <input name="hidden_prototal1" id="hidden_prototal1" type="hidden" value="0" /></td>
                            <td class="aw_none"><p class="aw_mf"><a id="remove1" class="removeproduct"><img alt="" src="{$path}/images/close.png" /></p></a></td>
                        </tr>
                        <!-- -------------------------------------------------------------------------->


                        </tr>

                    </table>

                    <table class="aw_table30">
                        <tr class="aw_ddd">
                            <td class="aw_tdnoborder fulltotal">الإجمالي العام</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gentotal">0</div><span class="aw_right">&nbsp; ج &nbsp;</span>
                                <input type="hidden" name="purchasebilltotalbeforediscount" id="purchasebilltotalbeforediscount" value="0"/>
                            </td>
                        </tr>

                        <tr class="aw_fff">
                            <td class="aw_tdnoborder">الخصم</td>
                            <td class="aw_tdnoborder"><input name="gendis" id="gendis" value="0" class="aw_m aw_mt aw_pd aw_in numberclic" type="text" tabindex="116" /></td>
                        </tr>

                        <tr>
                            <td class="aw_tdnoborder" colspan="2"><hr /></td>
                        </tr>

                        <tr class="aw_ddd">
                            <td class="aw_tdnoborder">الصافي</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gen2total">0</div><span class="aw_right">&nbsp; ج &nbsp;</span>
                                <input type="hidden" name="purchasebilltotalafterdiscount" id="purchasebilltotalafterdiscount" value="0"/>
                            </td>
                        </tr>

                        <tr class="aw_fff">
                            <td class="aw_tdnoborder">المدفوع</td>
                            <td class="aw_tdnoborder"><input name="genpay" id="genpay"  class="aw_m aw_mt aw_pd numberclic" type="text" tabindex="117" /></td>
                        </tr>

                        <tr>
                            <td class="aw_tdnoborder" colspan="2"><hr /></td>
                        </tr>

                        <tr class="aw_ddd">
                            <td class="aw_tdnoborder">الباقي</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gen3total">0</div><span class="aw_right">&nbsp; ج &nbsp;</span></td>
                        </tr>

                        <tr class="aw_eee">
                            <td class="aw_tdnoborder">الدين</td>
                            <td class="aw_tdnoborder"><div class="aw_tright" id="gen4total">0</div><span class="aw_right">&nbsp; ج &nbsp;</span>
                                <input type="hidden" name="rawmaterialssupplierdebtafter" id="rawmaterialssupplierdebtafter" value="0"/>
                            </td>
                        </tr>

                    </table>


                    <!--Form footer begin-->
                    <section class="box_footer">
                        <div class="grid-12-12">
                            <input type="reset" class="left button red" value="الغاء" />
                            <input type="submit" class="left button green" tabindex="118" id="billsure" value="اضافة" /> 

                            <div class="clear"></div>	

                        </div>
                </div>


        </section>

        <!--Form footer end-->

        <div class="clear"></div>


        </div>	
</section>			

</form>
<div class="clear"></div>
</section>


{literal}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {isRequired: false, invalidValue: "-1"});
</script>
{/literal}