<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from edumin.dexignlab.com/xhtml/add-departments.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Nov 2020 13:56:15 GMT -->
<head>
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Rizwan </title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="<?php echo base_url();?>assets/images/favicon.png">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style.css">
    <!-- Pick date -->
   <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/pickadate/themes/default.css">
    <link rel="stylesheet" href="<?php echo base_url();?>assets/vendor/pickadate/themes/default.date.css">
     <link href="<?php echo base_url();?>assets/vendor/datatables/css/jquery.dataTables.min.css" rel="stylesheet">
    <!-- Custom Stylesheet -->
     

</head>

<body>

    <!--*******************
        Preloader start
    ********************-->
        <div id="preloader">
        <div class="sk-three-bounce">
            <div class="sk-child sk-bounce1"></div>
            <div class="sk-child sk-bounce2"></div>
            <div class="sk-child sk-bounce3"></div>
        </div>
    </div>
    <!--*******************
        Preloader end
    ********************-->

    <!--**********************************
        Main wrapper start
    ***********************************-->
    <div id="main-wrapper">

      <?php  $this->load->view('header'); ?>
        
        <!--**********************************
            Content body start
        ***********************************-->
        <div class="content-body">

            <!-- row -->
            <div class="container-fluid">
            
                <div class="row">
                 <div class="col-12">
                   <div class="card">
                           <div class="card-body">
                               
                                <?php if($this->session->flashdata('material_bom_danger')){ ?>
                                    <div class="alert alert-danger solid " style='text-align:center;'><?php echo $this->session->flashdata('material_bom_danger'); ?></div>
                                <?php } ?>
                                 <div id='material_bom_danger' class='alert alert-danger solid' style='display:none;margin-left: 33%;width: 30%;'></div>
                                <div class="table-responsive">
                                    <table id="example5" class="display" style="min-width: 845px">
                                        <thead>
                                            <tr>
                                                <th>Bill #</th>
                                                <th>SO #</th>
                                                <th>Party</th>
                                                <th>Amount</th>
                                                <th>Payment</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!empty($bill_get)){
                                            foreach($bill_get as $get_bill){    
                                            ?>
                                          <tr>
                                             <td><?php echo $get_bill['bill_no']; ?></td>
                                             <td><?php echo so_number_dc($get_bill['so_id']); ?></td>
                                             <td><?php $party = get_party_address($get_bill['so_id']); echo party_name($party); ?></td>
                                             <td><?php 
                                             $total = $get_bill['total_value']*95.5/100; 
                                             $pai_amount = bill_pay_amount($get_bill['so_id']);
                                             $total_amount  = $total-$pai_amount;
                            
                                             echo "Rs. ".number_format($total_amount,2);?></td>
                                             <td>
                                                <?php if($get_bill['status']==0){ ?>
                                                <span class="badge badge-warning">Not Recived</span>
                                                <?php } ?>
                                            </td>
                                             <td>
                                                <button data-toggle="modal" data-target=".bd-example-modal-lg" class="btn btn-success button" onclick="get_bill_data(<?php echo $get_bill['so_id']; ?>);">Receive Payment</button>
                                            </td>
                                          </tr>
                                          <?php }} ?>
                                        </tbody>
                                    </table>
                                </div>
                                
                            </div>
                            </div>
                            </div>
                        </div>
                    </div>                   
                </div>
            </div>
       
        <!--**********************************
            Content body end
        ***********************************-->
        <div class="modal fade bd-example-modal-lg" style="width: 100%;" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span>&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <div class="card-body" id="reciving_bill">
                
                        </div>
                    </div>
              </div>
          </div>
        </div>
    </div>
    <!--**********************************
        Main wrapper end
    ***********************************-->

    <!--**********************************
        Scripts
    ***********************************-->
    <!-- Required vendors -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script type='text/javascript'>
     function get_bill_data(id) { 
      var id =  id;
      $.ajax({
                type:'POST',
                url:'<?php echo base_url('Sales_order/add_bill_payment'); ?>',
                data:{id:id},
                dataType:'json',
                success:function(data){
                $('#reciving_bill').show().html(data.html);       
                },
                error:function(data){console.log(data.responseText);}
            });
        } 
    </script>   
       <?php  $this->load->view('footer'); ?>
</body>
<!-- Mirrored from edumin.dexignlab.com/xhtml/add-departments.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Nov 2020 13:56:15 GMT -->
</html> 