
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet box grey-cascade">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-gift"></i>Do 24K Sale
                            </div>
                        </div>
                         
                        <div id="add_new_stock_item" class="modal fade" tabindex="-1" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                        <h4 class="modal-title">Add New Stock Item</h4>
                                    </div>
                                    <form id="add_stock_item_sale" class="form-horizontal" method="post">
                                        <div class="modal-body">
                                            <div id="response_msg_modal"></div>
                                            <div class="scroller" style="height:300px" data-always-visible="1" data-rail-visible1="1">
                                                <div class="row">
                                                    <div class="col-md-12">
                                                        <div class="form-body">
                                                            <div class="row form-group">
                                                                <label class="col-md-3 control-label pull-left">Item Type</label>
                                                                <div class="col-md-6">
                                                                    <label class="control-label pull-left">24K Sale</label>
                                                                    <input type="hidden" name="item_type" id="item_type" value="24K Sale" class="form-control"/>
                                                                </div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <label class="col-md-3 control-label pull-left">Item Category</label>
                                                                <div class="col-md-6">
                                                                    <select class="form-control select2me" name="stock_item_category" id="stock_item_category">
                                                                        <option value="">Please select a category</option>
                                                                        <option value="Add New Category">Add New Category</option>
                                                                        <?php
                                                                        $categories = $this->admin_db->get_stock_item_categories();
                                                                        foreach ($categories as $category) {
                                                                            $sel = '';
                                                                        ?>

                                                                        <option value="<?php echo $category['id']; ?>" <?php echo $sel; ?>><?php echo $category['category_name']; ?></option>

                                                                        <?php } ?>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div id="add_new_category" class="hidden">
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-3">Category Name</label>
                                                                    <div class="col-md-6">
                                                                        <input type="text" name="category_name" id="customer_name" placeholder="Type Here.." class="form-control"/>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label col-md-3">Category Description</label>
                                                                    <div class="col-md-6">
                                                                        <textarea name="description" id="description" class="form-control"></textarea>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <label class="col-md-3 control-label pull-left">Item Code</label>
                                                                <div class="col-md-6">
                                                                    <input type="text" name="item_code" id="item_code" placeholder="Type here.." class="form-control"/>
                                                                </div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <label class="col-md-3 control-label pull-left">Item Name</label>
                                                                <div class="col-md-6">
                                                                    <input type="text" name="item_name" id="item_name" placeholder="Type here.." class="form-control"/>
                                                                </div>
                                                            </div>
                                                            <div class="row form-group">
                                                                <label class="col-md-3 control-label pull-left">Item Description</label>
                                                                <div class="col-md-6">
                                                                    <textarea name="item_description" id="item_description" class="form-control"></textarea>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" data-dismiss="modal" class="btn default">Close</button>
                                            <button type="submit" class="btn green">Save changes</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        
                        <div class="portlet-body form">
                            <!-- BEGIN FORM-->
                            <form id="save_24k_do_sale" class="form-horizontal" method="POST" enctype="multipart/form-data">
                                <div class="alert alert-info"><strong>Info! </strong>Please Press add item button before submitting the invoice</div>
                                <div class="form-body">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">Date</label>
                                        <div class="col-md-3">
                                            <input class="form-control form-control-inline input-medium date-picker" size="16" type="text" data-date-format=dd-mm-yyyy name="invoice_date" value="<?php echo date('d-m-Y') ?>"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">Invoice Number</label>
                                        <div class="col-md-3">
                                            <input type="text" class="form-control input-medium" name="invoice_number"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">Sale Type</label>
                                        <div class="col-md-3">
                                            <select class="form-control input-medium" name="sale_type" id="sale_type">
                                                <option value="24K DXB Sale">24K DXB Sale</option>
                                                <option value="24K BOX Sale">24K BOX Sale</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">Customer Name</label>
                                        <div class="col-md-3">
                                            <select class="form-control input-medium select2me" data-placeholder="Select..." id="sales_add_24k_customer" name="select_customer">
                                                <option value="">Select Customer</option>
                                                <option value="Add New Customer">Add New Supplier</option>
                                                <?php
                                                    $customers = $this->admin_db->get_24k_customers_to_do_24k_sales();
                                                    foreach ($customers as $customer) {
                                                        $sel = '';
                                                ?>

                                                <option value="<?php echo $customer['id']; ?>" <?php echo $sel; ?> item_id="<?php echo $customer['contact_number']; ?>"><?php echo $customer['customer_name']; ?></option>

                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group hidden" id="div_hold_on_customer">
                                        <label class="control-label col-md-7" id="hold_on_customer_msg" style="color: red;"></label>
                                    </div>
                                    <div id="div_customer_details" class="hidden">
                                        <div class="form-group">
                                            <label class="control-label col-md-3">Mobile Number</label>
                                            <div class="col-md-3">
                                                <input class="form-control" size="16" type="text" id="txt_24k_cus_contact_num" disabled="disabled"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3">Telephone Number</label>
                                            <div class="col-md-3">
                                                <input class="form-control" size="16" type="text" id="txt_24k_cus_tel_num" disabled="disabled"/>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="add_new_customer" class="hidden">
                                        <div class="form-group">
                                            <label class="control-label col-md-3">Customer Name</label>
                                            <div class="col-md-3">
                                                <input type="text" name="customer_name" id="customer_name" placeholder="Type Here.." class="form-control"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3">Mobile Number</label>
                                            <div class="col-md-3">
                                                <input type="number" name="contact_num" id="contact_num" placeholder="Type Here.." class="form-control"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3">Telephone Number</label>
                                            <div class="col-md-3">
                                                <input type="number" name="tel_number" id="tel_number" placeholder="Type Here.." class="form-control"/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group" id="div_24k_rate">
                                        <label class="control-label col-md-3">24K Rates</label>
                                        <div class="col-md-3">
                                            <div class="control-label pull-left"><?php // echo 'Rs. '.number_format($k_rate,2,'.',','); ?></div>
                                            <input class="form-control" type="text" id="24k_sale_24k_rate" name="24k_rate" value="<?php echo $k_rate; ?>"/>
                                        </div>
                                    </div>                                    
                                    <!-- BEGIN GOLD BILLS PORTLET-->
                                    <div class="form-body" id="div_gold_sale">
                                        <div class="portlet-body">
                                            <div class="table-scrollable">    
                                                <table class="table table-striped table-bordered table-hover" id="">
                                                    <thead>
                                                        <tr>
                                                            <th style=""><strong>Item Name</strong></th>
                                                            <th style=""><strong>Description</strong></th>
                                                            <th style=""><strong>Sales in Grams (g) - 24K</strong></th>
                                                            <th style=""><strong>Amount</strong></th>
                                                            <th style="width: 3%"><strong></strong></th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="24k-sale-table-gold">

                                                    </tbody>
                                                    <tr>
                                                        <th>
                                                            <select class="form-control select2me" name="item_name_credit" id="item_name_credit">
                                                                <option value="">Please Select an Item</option>
                                                                <?php
                                                                    $items = $this->admin_db->get_all_24k_stock_items();                       
                                                                    foreach ($items as $item) {
                                                                ?>

                                                                <option value="<?php echo $item['item_code'].' - '.$item['item_name']; ?>" itemid="<?php echo $item['id']; ?>"><?php echo $item['item_code'].' - '.$item['item_name']; ?></option>

                                                            <?php } ?>
                                                            </select>
                                                        </th>
                                                        <th><input type="text" class="form-control" id="description_credit"></th>
                                                        <th>
                                                            <div class="input-group input-small">
                                                                <input type="number" maxlength="15" class="form-control input-small" id="24k_sales_grams_credit"/>
                                                                <span class="input-group-addon">
                                                                    g
                                                                </span>
                                                            </div>
                                                        </th>
                                                        <th style="text-align: right;">
                                                            <strong id="24k_item_amount_credit">Rs. 0.00</strong>
                                                        </th>
                                                        <th></th>
                                                    </tr>
                                                    <tr>
                                                        <th colspan="3"><strong>Total</strong></th>
                                                        <th style="text-align: right;"><strong id="debit_sum_credit">Rs. 0.00</strong></th>
                                                        <input type="hidden" name="total_gold_sale" value="" id="total_gold_sale" />
                                                        <input type="hidden" name="debit_sum_txt_credit" value="" id="debit_sum_txt_credit" />
                                                    </tr>
                                                </table>
                                            </div>
                                            <div id="error" style="display: none; color: red; text-align: right; font-weight: 500"></div>
                                            <div style="text-align: right;" id="append_button_gold">
                                                <a class="btn default btn-xs green" data-toggle="modal" href="#add_new_stock_item">
                                                <i class="fa fa-plus"></i> Add Stock Item </a>
                                                <a class="btn default btn-xs purple" id="append_24k_SalesItem">
                                                <i class="fa fa-edit"></i> Add Item </a>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- END GOLD BILLS PORTLET-->
                                    
                                    <div id="response_msg"></div>
                                
                                    <div class="invoice">
                                        <div class="row">
                                            <div class="col-xs-4"> </div>
                                            <div class="col-xs-8 invoice-block" align="right">
                                                <ul class="list-unstyled amounts" style="font-size: 20px">
                                                    <li>
                                                        <strong>Total:</strong><div id="grand-total">0.00</div>
                                                        <input type="hidden" name="total" value="" id="total" />
                                                    </li>
                                                    <li>
                                                        <strong>Discount:</strong>
                                                        <div class="input-group input-small">
                                                            <span class="input-group-addon">
                                                                Rs.
                                                            </span>
                                                            <input type="number" class="form-control input-small" name="discount" id="24k_sale_discount" />
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <strong>Grand Total:</strong><div id="grand_total">0.00</div>
                                                        <input type="hidden" name="grand_total" value="" id="txt_grand_total" />
                                                    </li>
                                                </ul>
                                                <br/>

                                                <button type="submit" class="btn btn-lg green hidden-print margin-bottom-5 hidden" id="do_sales_submit_btn">
                                                Submit Your Invoice <i class="fa fa-check"></i>
                                                </button>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div> 
            </div>
            <!-- END DASHBOARD STATS -->
        </div>
    </div>
    <!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
