<?php
require "../commonincludefiles.php";
error_reporting(1);
$objCustomerInvoiceMgmt = new CustomerInvoiceMgmt();
$i = 0;
$condition = "";
$customer_id = Escape($_REQUEST['customer_id']);
if ($customer_id != "")
	$condition .= " and customer_id ='" . $customer_id . "' and status='DuePayment' ";
$rs = $objCustomerInvoiceMgmt->getInvoiceNosofcustomer($condition);
$total = dbRows($rs);
$InvoicenoData = array("count" => $total, "data" => array());
if (dbRows($rs) > 0) {

	while ($row = dbArray($rs)) {


		$temparray["invoice_no"] = $row["customerinvoice_no"];
		$temparray["dueamount"] = $row["dueamount"];

		$InvoicenoData["data"][$i] = $temparray;
		$i++;
	}
}
echo json_encode($InvoicenoData);
?>