<?php
	require "../commonincludefiles.php";
   	$objlms_custinvoicereceiptMgmt= new lms_custinvoicereceiptMgmt();
	$i=0;
	$order_field=" receipt_no ";
	$order_type=" ASC ";
	$where=" and r.isdeleted=0 ";
	$rs = $objlms_custinvoicereceiptMgmt->getAllRecords_customer($limit,$start,$where,$order_field,$order_type);
	$total = dbRows($rs);
	$ReceiptData = array("count" => $total, "data" => array());
	if(dbRows($rs) > 0){
		
		while($row = dbArray($rs)){
			
			$temparray["receipt_id"]  	= $row["receipt_id"];
			$temparray["receipt_no"]  	= $row["receipt_no"];
			$temparray["receipt_date"]  = $row["receipt_date"];
			$temparray["customer_id"]  	= $row["customer_id"];
			$temparray["customer_name"]  	= $row["customer_orgname"];
			$temparray["invoice_no"]  	= $row["invoice_no"];
			$temparray["amount"]  		= $row["amount"];
			$temparray["payment_mode"]  = $row["payment_mode"];
			if($temparray["payment_mode"] == '1')
				$temparray["pmode"]='Cheque';
			else
				$temparray["pmode"]='Cash';
				
			$temparray["chequeno"]  	= $row["chequeno"];
			$temparray["bankname"]  	= $row["bankname"];
			$temparray["branchname"]  	= $row["branchname"];
			$temparray["chk_date"]  	= $row["chk_date"];
			$temparray["remark"]  		= $row["remark"];
			
			
			
			$ReceiptData["data"][$i] = $temparray;   
			$i++;
		}
	}
	echo json_encode($ReceiptData);	
?>