<?php
include("../../classes/manager.class.php");
$m = new Manager();
$id = $_REQUEST['id'];
if ($id) {
    $filter = " WHERE customer_id = '$id'";
    $qry = Invoice::GetInvoiceList($filter);
    if($qry)
    {
        echo '<option></option>';
        foreach($qry AS $row){
            if($row->total_amount != $row->payment_due && $row->status == 'Pending'){
                echo '<option value="'.$row->id.'">'.$row->code.'</option>';
            }
        }
    }
}
?>