<?php include "header.php"; 
$gst_value = 3;

$statement_price = $pdo->prepare("SELECT tbl_prices.*,tbl_ids_purity.short_name
                    FROM `tbl_prices`
                    LEFT JOIN tbl_ids_purity ON tbl_ids_purity.id=tbl_prices.purity_id
                    WHERE tbl_prices.product_id=?");
$statement_price->execute(array(1));
$price_data = $statement_price->fetchAll(PDO::FETCH_ASSOC);
$price_totalData = $statement_price->rowCount(); 

?>

<style>
    thead{
        background: antiquewhite;
    }
    th{
        padding: 5px;
        text-align: center;
    }
    td{
        text-align: center;
    }
</style>

<div class="content-wrapper">
        


        <div class="col-lg-12 alerts">
            <div id="custom-alerts" style="display:none;">
                <div class="alert alert-dismissable">
                    <div class="custom-msg"></div>
                </div>
            </div>
            
            <?php if ($error)  { ?>
            <div class="alert alert-danger alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-ban"></i> Error</h4>
                <?= $error; ?>
            </div>
            <?php $error=0;} if ($warning) { ?>
            <div class="alert alert-warning alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-warning"></i> Warning</h4>
                <?= $warning; ?>
            </div>
            <?php  $warning=0;} if ($message) { ?>
            <div class="alert alert-success alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4>    <i class="icon fa fa-check"></i> Success</h4>
                <?= $message; ?>
            </div>
            <?php $message=0; } ?>
        </div>
        <div class="clearfix"></div>







<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;">
                <div class="box-body">
                    
                    
                    
                <div id="content-div">    
                    <div class="col-lg-12">

                        <form id="form_details" autocomplete="off">
                                                
                                                
                                                                 
                        <div class="row">
                            
                           
                            
                            
                            
                            <div class="col-md-8">
                                
                                
                                
                                
                    <div class="row">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label class="required" for="customer_id">Customers</label>                                   
                                    <select name="customer_id" class="form-control select2" style="width:100%" id="customer_id" required="required">
                                        <?php $statement = $pdo->prepare("SELECT * FROM `tbl_customers` where status=1");
                                            $statement->execute();
                                            $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                            foreach ($location_result as $result) { ?>
                                                <option value="<?=$result['id']?>" <?php if(isset($_GET['cus_id']) && $_GET['cus_id']==$result['id']){echo "selected";}?>><?=$result['customer_name']?> - <?=$result['mobile_no']?></option>
                                        <?php  }  ?>
                                    </select>
                                </div>
                                
                            </div>
                            
                            <div class="col-md-1" style="text-align: center;">
                                    <a href="modal/customers-create.php" data-toggle="ajax-modal" title="Add Customers" class="tip btn btn-success btn-xs" id="" style="margin-top: 23px; padding: 5px;"><i class="fa fa-plus-circle" aria-hidden="true" style="font-size:22px;"></i></a>
                            </div>
                            
                            
                            
                            
                            
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label class="required" for="created_user_id">Sales Man</label>                                   
                                    <select name="created_user_id" class="form-control select2" style="width:100%" id="created_user_id" required="required">
                                        <?php $statement = $pdo->prepare("SELECT * FROM `tbl_users` where status=1");
                                            $statement->execute();
                                            $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                            foreach ($location_result as $result) { ?>
                                                <option value="<?=$result['id']?>" <?php if($session_id==$result['id']){echo "selected";}?>><?=$result['name']?> - <?=$result['emp_code']?></option>
                                        <?php  }  ?>
                                    </select>
                                </div>
                            </div>
                            
                            
                            
                            <div class="col-md-3" hidden>
                                <div class="form-group">
                                    <label class="required" for="invoice_no">Estimation No</label>                                    
                                    <input type="invoice_no" name="invoice_no" value="" placeholder="Enter the Estimation No" class="form-control" id="invoice_no"  />
                                </div>
                            </div>
                            
                            <div class="col-md-2">
                                <div class="form-group">
                                    <label class="required" for="date">Date</label>                                    
                                    <input type="date" name="date" value="<?=date('Y-m-d')?>"  class="form-control" id="date"  required="required" />
                                </div>
                            </div>
                            
                            <div class="col-md-2" hidden>
                                <div class="form-group">
                                    <label class="required" for="sales_status">Sales Status</label>                                   
                                    <select name="sales_status" class="form-control select2" style="width:100%" id="sales_status" required="required">
                                        <option value="2" <?php if(isset($_GET['status']) && $_GET['status']=="Quotation"){ echo "selected"; } ?>>Quotation</option>
                                        <option value="1" <?php if(isset($_GET['status']) && $_GET['status']=="Sales"){ echo "selected"; } ?>>Sales</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="col-md-2">
                                <div class="form-group">
                                    <label class="required" for="location_id">Locations</label>                                   
                                    <select name="location_id" class="form-control select2" style="width:100%" id="location_id" required="required">
                                        <?php 
                                            $statement = $pdo->prepare("SELECT bb.* FROM `tbl_business_branch` bb WHERE bb.status=1 $branch_conditions");
                                            $statement->execute();
                                            $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                            foreach ($location_result as $result) { ?>
                                                <option value="<?=$result['id']?>"><?=$result['location_name']?></option>
                                        <?php  }  ?>
                                    </select>
                                </div>
                            </div>
                            
                            <!-- Hidden Input Field -->
                            <input type="hidden" name="payment_scheme_used" id="payment_scheme_used" value="0">
                            <input type="hidden" name="weight_scheme_used" id="weight_scheme_used" value="0">
                            <input type="hidden" name="advance_used" id="advance_used" value="0">
                            
                            <input type="hidden" name="payment_scheme_ids[]" id="payment_scheme_ids" value="">
                            <input type="hidden" name="weight_scheme_ids[]" id="weight_scheme_ids" value="">
                            <input type="hidden" name="advance_ids[]" id="advance_ids" value="">
                            
                    </div> 
                                
                                <!-- Old Gold Section Starts Here -->
                                <div class="col-md-12" style="margin: 10px; background: #9db6e3; padding: 16px; border-radius: 7px;">
                                <span id="old_gold_button" class="btn btn-warning btn-xs"><b style="font-family: system-ui;">Old Gold Section (Show/Hide)</b></span>&nbsp;&nbsp;&nbsp;
                                
                                <div id="old_gold_section" style="margin-top: 10px;">
                                    
                                    <table style="width: 100%;">
                                        <thead>
                                            <tr>
                                                <th style="width: 15%;">Product</th>
                                                <th style="width: 15%;">Purity</th>
                                                <th style="width: 10%;">Unit</th>
                                                <th style="width: 10%;">Type</th>
                                                <th style="width: 10%;">Weight</th>
                                                
                                                <th style="width: 10%;">Price</th>
                                                <th style="width: 10%;">Total</th>
                                                <th style="width: 10%;">Actions <span id="add_row_btn" class="btn btn-success btn-xs"><i class="fa fa-plus"></i></span></th>
                                            </tr>
                                        </thead>
                                        <tbody id="old_append_tbody">
                                            
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                                <!-- Old Gold Section Endsss Here -->
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <div class="form-group search-box">
                                    <label class="" for="search_products">Search Products</label>   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                       
                                    <input type="text" name="search_products" placeholder="Enter the Products" value=""  class="form-control" id="search_products"  />
                                    <div class="result" style="max-height: 200px; overflow-y: scroll;"></div>
                                </div>
                                
                                <table style="width: 100%;" >
                                    <thead>
                                        <tr>
                                            <th style="width: 10%">Product&nbsp;Name</th>
                                            <th style="width: 10%">Karat</th>
                                            <th style="width: 7%">Was(%)</th>
                                            <th style="width: 15%">Cross - Stone - Net</th>
                                            <th style="width: 10%">Rates</th>
                                            <th style="width: 8%">Product</th>
                                            <th style="width: 8%">Stone</th>
                                            <th style="width: 8%">Wastage</th>
                                            <th style="width: 10%">Total</th>
                                            <th style="width: 5%"><i class="fa fa-times"></i></th>
                                        </tr>
                                    </thead>
                                    <tbody id="product_tbody">
                                        
                                    </tbody>
                                </table>
                                
                                
                                
                                <!-- New Footer Calculation Starts Here -->
                                <div class="col-md-12">
                                    <div class="col-lg-12" style="background: aquamarine; padding-top: 10px; margin-top: 20px; padding-bottom: 10px; border-radius: 10px; box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;">
                                        <table style="width: 100%;">
                                            <tr>
                                                <th style="">Total Net Weight</th>
                                                <th style="">Scheme Wt</th>
                                                <th style="">Non-Scheme Wt</th>
                                                <th style="">Gold Rate</th>
                                                <th style="">Sch & Non</th>
                                                <th style="">Total</th>
                                                <th style="">Stone</th>
                                                <th style="">Wastage</th>
                                                <th style="">Grand Total</th>
                                            </tr>
                                            <tr>
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="hidden" name="f_purity_id[]" value="<?=$purity_id?>" id="f_purity_id_<?=$purity_id?>" class="form-control">
                                                        <input type="text" name="f_total_weight[]" id="f_total_weight_<?=$purity_id?>" class="form-control" readonly>
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                                
                                                
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="text" name="scheme_weight_<?=$purity_id?>" id="scheme_weight_<?=$purity_id?>" class="form-control" readonly>
                                                        <input type="hidden" name="scheme_gold_rate_<?=$purity_id?>" id="scheme_gold_rate_<?=$purity_id?>" value="" class="form-control">
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="text" name="non_scheme_weight_<?=$purity_id?>" id="non_scheme_weight_<?=$purity_id?>" class="form-control" readonly>
                                                        <input type="hidden" name="non_scheme_gold_rate_<?=$purity_id?>" id="non_scheme_gold_rate_<?=$purity_id?>" value="<?=$purity['amount']?>" class="form-control">
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                                
                                                
                                                
                                                
                                                <td style="" class="">
                                                    <table style="width: 100%;">
                                                        <?php
                                                        foreach($price_data as $purity){
                                                            $purity_id = $purity['id'];
                                                        ?>
                                                        
                                                            <tr>
                                                                <th><?=$purity['short_name']?></th>
                                                                <th>
                                                                    <?=number_format($purity['amount'], 2)?>
                                                                    <input type="hidden" name="gold_rate_<?=$purity_id?>" id="gold_rate_<?=$purity_id?>" value="<?=$purity['amount']?>" class="form-control">
                                                                </th>
                                                            </tr>
                                                        <?php } ?>
                                                    </table>
                                                </td>
                                                
                                                <td style="" class="">
                                                    <table style="width: 100%;">
                                                        <?php
                                                        foreach($price_data as $purity){
                                                            $purity_id = $purity['id'];
                                                        ?>
                                                        
                                                            <tr>
                                                                <td>
                                                                    <input type="text"  name="scheme_total_<?=$purity_id?>" id="scheme_total_<?=$purity_id?>" value="" style="padding: 0px 0px 0px 5px;" class="form-control" readonly>
                                                                </td>
                                                                <td>
                                                                    <input type="text" name="non_scheme_total_<?=$purity_id?>" id="non_scheme_total_<?=$purity_id?>" value="" style="padding: 0px 0px 0px 5px;" class="form-control" readonly>
                                                                </td>
                                                            </tr>
                                                        <?php } ?>
                                                    </table>
                                                </td>
                                                
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="text" name="f_gold_amount_<?=$purity_id?>" id="f_gold_amount_<?=$purity_id?>" class="form-control" readonly>
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="text" name="f_stone_<?=$purity_id?>" id="f_stone_<?=$purity_id?>" class="form-control" readonly>
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="text" name="f_wastage_<?=$purity_id?>" id="f_wastage_<?=$purity_id?>" class="form-control" readonly>
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                                <td style="" class="">
                                                    <?php
                                                    foreach($price_data as $purity){
                                                        $purity_id = $purity['id'];
                                                    ?>
                                                        <input type="text" name="f_grand_total_<?=$purity_id?>" id="f_grand_total_<?=$purity_id?>" class="form-control totals" readonly>
                                                    <?php } ?>
                                                </td>
                                                
                                                
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                                <!-- New Footer Calculation Endsss Here -->
                                
                            </div>
                            
                            
                            
                            
                            
                            
                            
                            
                            
                            <div class="col-md-4">
                                
                                
                                
        <!-- Hidden Values Starts Here -->         
        
                                <div class="col-md-12" hidden>
                                    <div class="form-group">
                                        <label class="required" for="total_amount">Total Amount</label>                                   
                                        <input type="text" name="total_amount" placeholder="Total Amount" value="0"  class="form-control" id="total_amount"  required="required" />
                                        <input type="text" name="gst_amount" placeholder="GST Amount" value="0"  class="form-control" id="gst_amount"  required="required" />
                                    </div>
                                </div>
                                <div class="col-md-6" style="margin-top: 10px;" hidden>
                                    <div class="form-group" style="">
                                        <label for="discount_type">Discount Type <span style="color: red">*</span></label>
                                        <select name="discount_type" id="discount_type" onchange="discountType()" class="form-control select22" style="width: 100%;">
                                            <option value="1">Percentage</option>
                                            <option value="2">Fixed Amount</option>
                                        </select>
                                    </div>
                                </div>
                                
                                
                                <div class="col-md-6" style="margin-top: 10px;" hidden>
                                    <div class="form-group">
                                        <label class="optional" for="discount">Discount <span id="discount_span"></span></label>                                   
                                         <input type="text" name="discount" placeholder="Discount" value="0"  oninput="calculateTotal()" class="form-control" id="discount"  />
                                    </div>
                                </div>
                                
                                <div class="col-md-12" hidden><b style="color: blue;">Discount (<i class="fa fa-inr"></i>) : <span id="discount_amount_span">0.00</span></b></div>
                                
                                <input type="hidden" name="discount_amount" id="discount_amount" value="" >
                                <input type="hidden" name="old_product_amount" id="old_product_amount" value="" >
                                
        <!-- Hidden Values Endsss Here -->
                                
                                
                                
                                
                                <!-- GST Starts Here -->
                                <div class="col-md-12">
                                    <div class="col-lg-12" style="background: #ebebe1; padding-top: 10px;margin-top: 20px;padding-bottom: 10px;border-radius: 15px;box-shadow: 2px 1px 2px 2px;">
                                        <div class="col-lg-6" style="padding-top: 10px;">
                                            <b>Total Items</b>
                                        </div>
                                        <div class="col-lg-6" style="padding-top: 10px;">
                                            <span id="total_product_items" style="font-weight: bold;">0</span>
                                        </div>
                                        <div class="col-lg-6" style="padding-top: 10px;">
                                            <b>Total</b>
                                        </div>
                                        <div class="col-lg-6" style="padding-top: 10px;">
                                            <i class="fa fa-inr"></i> <span id="total_product_amount" style="font-weight: bold;">0.00</span>
                                        </div>
                                        <div class="col-lg-6" style="padding-top: 15px;">
                                            <b>Select Tax (%)</b>
                                        </div>
                                        
                                        <div class="col-lg-6" style="padding-top: 15px;">
                                            <select name="gst_percentage"  class="form-control" id="tax" style="width: 100%;" onkeyup="calculate()" onchange="calculate()">
                                                <option value="0">0% GST</option>
                                            <?php $statement = $pdo->prepare("SELECT * FROM `tbl_gst` WHERE status=1 ORDER bY gst asc");
                                                $statement->execute();
                                                $resultss = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                                foreach ($resultss as $ress) { ?>
                                                    <option value="<?=$ress['gst']?>" <?= ($gst_value==$ress['gst']) ? "selected":"" ?>><?=$ress['name']?></option>
                                            <?php } ?>
                                            </select>
                                        </div>
                                        
                                        <div class="col-lg-6" style="padding-top: 10px;">
                                            <div class="form-group">
                                                <label class="" for="insurance_policy">Select Tax Type</label>
                                            </div>
                                         </div>
                                        
                                        <div class="col-lg-6" style="padding-top: 10px;">
                                            <div class="form-group">
                                                <select name="tax_type" id="tax_type" onkeyup="calculate()" style="width: 100%;" onchange="calculate()" required="required" class="form-control">
                                                    <option value="1" selected="selected">Exclusive</option>
                                                    <option value="2">Inclusive</option>
                                                </select>
                                            </div>
                                         </div>
                                        
                                         
                                        <div class="col-lg-6">
                                            <b>Select GST Type</b>
                                         </div>
                                        
                                        <div class="col-lg-6">
                                            <div class="form-group">
                                                <select name="gst_type" id="gst_type" onkeyup="calculate()" onchange="calculate()" required="required" class="form-control">
                                                    <option value="1" selected="selected">GST</option>
                                                    <option value="2">IGST</option>
                                                </select>
                                            </div>
                                        </div>
                                        
                                        
                                        <!-- GST HERE -->
                                        <div class="row" id="div-cgst">
                                                <div class="col-md-8" >
                                                            <div class="form-group" style="margin-bottom: 6px;">
                                                                <label for="code">Total CGST &nbsp; <span style="color: blue;font-weight: 900;font-size: 18px;" id='cgst_tax_per' name='cgst_tax_per'>0.00</span> % :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
                                                            </div>
                                                </div>
                                                <div class="col-md-4">
                                                        <div class="form-group" style="margin-bottom: 6px;">
                                                            <span style="color: blue;font-weight: 900;font-size: 18px;" id='cgst_tax_amount'>0.00</span>
                                                        </div>
                                                </div>
                                            </div>
                                            
                                            <div class="row" id="div-sgst">
                                                <div class="col-md-8" >
                                                            <div class="form-group" style="margin-bottom: 6px;">
                                                                <label for="code">Total SGST &nbsp; <span style="color: blue;font-weight: 900;font-size: 18px;" id='sgst_tax_per'>0.00</span> % :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
                                                            </div>
                                                </div>
                                                <div class="col-md-4">
                                                        <div class="form-group" style="margin-bottom: 6px;">
                                                            <span style="color: blue;font-weight: 900;font-size: 18px;" id='sgst_tax_amount'>0.00</span>
                                                        </div>
                                                </div>
                                            </div>
                                            
                                            <div class="row" id="div-sgst">
                                                <div class="col-md-8" >
                                                            <div class="form-group" style="margin-bottom: 6px;">
                                                                <label for="code">Total &nbsp; <span id='gst_type_span'></span> &nbsp; <span style="color: blue;font-weight: 900;font-size: 18px;" id='gst_tax_per' name='gst_tax_per'>0.00</span> % :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            </div>
                                                </div>
                                                <div class="col-md-4">
                                                        <div class="form-group" style="margin-bottom: 6px;">
                                                            <span style="color: blue;font-weight: 900;font-size: 18px;" id='total_tax'>0.00</span>
                                                        </div>
                                                </div>
                                            </div>
                                            
                                            
                                            <!-- Hidden GST Values Here -->
                                            <input type="hidden" name="gst_or_igst_amount" id="total_tax_input" value="">
                                            <input type="hidden" name="cgst_or_sgst_amount" id="cgst_tax_per_input" value="">
                                            <!-- Hidden GST Values Here -->
                                            
                                            
                                            <div class="row" id="" style="padding-top: 10px;">
                                                <div class="col-md-6" >
                                                        <div class="form-group">
                                                            <div class="form-group">
                                                                <label for="code">Total Amount After Tax:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            </div>
                                                        </div>
                                                </div>
                                                <div class="col-md-6">
                                                        <div class="form-group">
                                                            <input type="text" name="tax_after_total" id="tax_after_total" class="form-control" value="" required="required" style="width: 90%; background: #fd0a36;; color: white;font-weight: 600;font-size: 20px;" readonly>
                                                            <!--<span style="color: blue;font-weight: 900;font-size: 18px;" id='tax_after_total'>0.00</span> -->
                                                        </div>
                                                </div>
                                            </div>
                                        <!-- GST HERE -->
                                                     
                                    </div>
                                </div>
                                <!-- GST Endsss Here -->
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <div class="col-md-12" style="margin-top: 10px;">
                                    <b style="color: blue; font-size: 18px;">Old Product Amount (<i class="fa fa-inr"></i>) : <span id="old_product_amount_span">0.00</span></b>
                                </div>
                                
                                
                                
                                
                                
                                <!-- Scheme & Advance Starts Here -->
                                <div class="col-md-12">
                                    <div class="nav-tabs-custom" style="background-color: #3c8dbc;">
                                        <ul class="nav nav-tabs" style="padding: 1px 0px 1px 5px;">
                    						<li class="active"><a href="#tab_1" data-toggle="tab">Payment Scheme</a></li>
                    						<li class=""><a href="#tab_2" data-toggle="tab">Weight Scheme</a></li>
                    						<li><a href="#tab_3" data-toggle="tab">Advance</a></li>
                    					</ul>
                    					
                    					
					                    <div class="tab-content" style="background: beige; box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;">
					    
					    
					<div class="tab-pane active" id="tab_1">
							<section class="content" style="padding: 0px;">
							    <center><b>Payment Scheme Details</b></center>
							    <div id="payment_scheme_details"></div>
							</section>
					</div>
					
					<div class="tab-pane" id="tab_2">
							<section class="content" style="padding: 0px;">
							    <center><b>Weight Scheme Details</b></center>
							    <div id="weight_scheme_details"></div>
							</section>
					</div>
					
					<div class="tab-pane " id="tab_3">
							<section class="content" style="padding: 0px;">
							    <center><b>Advance Details</b></center>
							    <div id="advance_details"></div>
							</section>
					</div>
					
					</div>
					
                                    </div>
                                </div>
                                <!-- Scheme & Advance Endsss Here -->
                                
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="required" for="paid_amount">Paid Amount</label>                                   
                                        <input type="text" name="paid_amount" placeholder="" value=""  class="form-control" id="paid_amount"  required="required" readonly />
                                    </div>
                                </div>
                                
                                
                                
                                
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="required" for="grand_amount">Grand Amount</label>                                   
                                        <input type="text" name="grand_amount" placeholder="Grand Amount" value=""  class="form-control" id="grand_amount"  required="required" readonly />
                                    </div>
                                </div>
                                
                                
                                
                                
                                
                                
                                
                                
                            </div>
                            
                            
                           
                            
                            
                            
                        </div>
                        
                        
                        

                        <div class="form-group" style="text-align:center;">
                            <input type="submit"  id="submit" value="Add Sales" class="btn btn-success" />
                        </div>
                        
                        </form>

                    </div>
                    
                    
                        <div class="form-group" style="text-align:center;">
                            <span onclick="location.reload();" class="btn btn-primary" ><i class="fa fa-refresh"></i> Reset Form</span>
                            <a href="sales-list.php"><button class="btn btn-warning" ><i class="fa fa-chevron-left"></i> Back to List</button></a>
                        </div>
                </div>
                
                
<div class="container" id="loading-div" style="display: none; margin-top: 40px; margin-bottom: 40px;">
        <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center>
</div>
                    
                    
                    
                    
                    <div class="container" id="success-div" style="display: none; margin-top: 40px; margin-bottom: 40px;">
                        <center><b class="blinking" style="font-size:22px;">Sales Added Successfully...</b><br>
                            <img src="img/success.gif" style="width: 250px;">
                            <br><br>
                            <span onclick="location.reload();" class="btn btn-info"><i class="fa fa-refresh"></i> Reset Form</span>
                            &nbsp;&nbsp;
                            <a href="sales-list.php"><button class="btn btn-warning"><i class="fa fa-chevron-left"></i> Back to List</button></a>
                        </center>
                    </div>
                    
                    
                    <div class="container" id="quotation-success-div" style="display: none; margin-top: 40px; margin-bottom: 40px;">
                        <center><b class="blinking" style="font-size:22px;">Quotation Added Successfully...</b><br>
                            <img src="img/success.gif" style="width: 250px;">
                            <br><br>
                            <span onclick="location.reload();" class="btn btn-info"><i class="fa fa-refresh"></i> Reset Form</span>
                            &nbsp;&nbsp;
                            <a href="quotation-list.php"><button class="btn btn-warning"><i class="fa fa-chevron-left"></i> Back to Quotation's List</button></a>
                        </center>
                    </div>
                        
                        
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>

</br></br></br></br>

<?php include "footer.php"; ?>

<?php include "pos-assets.php"; ?>


