Subversion Repositories SmartDukaan

Rev

Rev 19892 | Rev 20132 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19892 Rev 19929
Line 1522... Line 1522...
1522
		$this->set(compact('usersName','outstandingPayments','usersMap'));
1522
		$this->set(compact('usersName','outstandingPayments','usersMap'));
1523
		if($type=='credit'){
1523
		if($type=='credit'){
1524
			$this->render('admin_outstandingcredits');
1524
			$this->render('admin_outstandingcredits');
1525
		}
1525
		}
1526
	}
1526
	}
-
 
1527
	
-
 
1528
	public function admin_marksettlement(){
-
 
1529
		if(empty($this->request->data['repayment_date']) || empty($this->request->data['amount'])){
-
 
1530
			$message = "Please fill a valid date or amount for the settlement";
-
 
1531
		}
-
 
1532
		elseif ($this->request->data['amount']<=0){
-
 
1533
			$message = "Please check the amount that you filled earlier";
-
 
1534
		}else{
-
 
1535
			$payload = $this->request->data;
-
 
1536
			$url = Configure::read('saholicapihost').'counter!markOutstandingPaymentsAsSettled?settlement='.json_encode($payload,JSON_NUMERIC_CHECK);
-
 
1537
			$response = $this->make_request($url,json_encode($payload,JSON_NUMERIC_CHECK));
-
 
1538
			$message = $response['response'][key($response['response'])];
-
 
1539
		}
-
 
1540
		$this->set(compact('message'));
-
 
1541
	}
1527
}
1542
}
1528
1543