Subversion Repositories SmartDukaan

Rev

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

Rev 18449 Rev 19499
Line 126... Line 126...
126
		$url = $this->apihost.'pending-refunds/user/'.$userId;
126
		$url = $this->apihost.'pending-refunds/user/'.$userId;
127
		$pendingCashbacks = $this->make_request($url,null);
127
		$pendingCashbacks = $this->make_request($url,null);
128
		//Get credited cashbacks
128
		//Get credited cashbacks
129
		$url = $this->apihost.'refund/user/'.$userId;
129
		$url = $this->apihost.'refund/user/'.$userId;
130
		$creditedCashbacks = $this->make_request($url,null);
130
		$creditedCashbacks = $this->make_request($url,null);
-
 
131
		
-
 
132
		$totalcreditedcashback = 0;
-
 
133
		if(!empty($creditedCashbacks)){
-
 
134
			$totalcreditedcashback = $creditedCashbacks['credited'];
-
 
135
		}
131
 
136
		
132
		$creditKeyArray = array();
137
		$creditKeyArray = array();
133
		$creditValueArray = array();
138
		$creditValueArray = array();
134
		$total_credited_amount = 0;
139
		$total_credited_amount = 0;
135
		if(!empty($creditedCashbacks)){
140
		if(!empty($creditedCashbacks)){
136
			foreach ($creditedCashbacks['data'] as $key => $value) {
141
			foreach ($creditedCashbacks['data'] as $key => $value) {
Line 147... Line 152...
147
					$creditValueArray['fortbatchid'] = $value['batch'];
152
					$creditValueArray['fortbatchid'] = $value['batch'];
148
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
153
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
149
					// $creditKeyArray[date('Y-m-d',strtotime($value['timestamp']))] = $creditValueArray;
154
					// $creditKeyArray[date('Y-m-d',strtotime($value['timestamp']))] = $creditValueArray;
150
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
155
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
151
				}
156
				}
-
 
157
				elseif($value['type']== 'Refund'){
-
 
158
					$creditValueArray['amount'] = $value['userAmount'];
-
 
159
					$creditValueArray['type'] = $value['type'];
-
 
160
					$creditValueArray['fortbatchid'] = $value['batch'];
-
 
161
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
-
 
162
					$creditValueArray['description'] = $value['description'];
-
 
163
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
-
 
164
					
152
				
165
				}
-
 
166
				elseif($value['type']== 'Adjustment'){
-
 
167
					$creditValueArray['amount'] = $value['userAmount'];
-
 
168
					$creditValueArray['type'] = $value['type'];
-
 
169
					$creditValueArray['fortbatchid'] = $value['batch'];
-
 
170
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
-
 
171
					$creditValueArray['description'] = $value['description'];
-
 
172
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
-
 
173
				}
153
			}
174
			}
154
		}
175
		}
155
		$storemapping = Configure::read('storemapping');
176
		$storemapping = Configure::read('storemapping');
156
		$activestores = Configure::read('activestores');
177
		$activestores = Configure::read('activestores');
157
		//App related cashbacks
178
		//App related cashbacks
Line 295... Line 316...
295
		$url = $this->apihost.'pending-refunds/user/'.$userId;
316
		$url = $this->apihost.'pending-refunds/user/'.$userId;
296
		$pendingCashbacks = $this->make_request($url,null);
317
		$pendingCashbacks = $this->make_request($url,null);
297
		//Get credited cashbacks
318
		//Get credited cashbacks
298
		$url = $this->apihost.'refund/user/'.$userId;
319
		$url = $this->apihost.'refund/user/'.$userId;
299
		$creditedCashbacks = $this->make_request($url,null);
320
		$creditedCashbacks = $this->make_request($url,null);
-
 
321
		
-
 
322
		$totalcreditedcashback = 0;
-
 
323
		if(!empty($creditedCashbacks)){
-
 
324
			$totalcreditedcashback = $creditedCashbacks['credited'];
-
 
325
		}
300
 
326
		
301
		$creditKeyArray = array();
327
		$creditKeyArray = array();
302
		$creditValueArray = array();
328
		$creditValueArray = array();
303
		$total_credited_amount = 0;
329
		$total_credited_amount = 0;
304
		if(!empty($creditedCashbacks)){
330
		if(!empty($creditedCashbacks)){
305
			foreach ($creditedCashbacks['data'] as $key => $value) {
331
			foreach ($creditedCashbacks['data'] as $key => $value) {
Line 316... Line 342...
316
					$creditValueArray['fortbatchid'] = $value['batch'];
342
					$creditValueArray['fortbatchid'] = $value['batch'];
317
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
343
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
318
					// $creditKeyArray[date('Y-m-d',strtotime($value['timestamp']))] = $creditValueArray;
344
					// $creditKeyArray[date('Y-m-d',strtotime($value['timestamp']))] = $creditValueArray;
319
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
345
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
320
				}
346
				}
-
 
347
				elseif($value['type']== 'Refund'){
-
 
348
					$creditValueArray['amount'] = $value['userAmount'];
-
 
349
					$creditValueArray['type'] = $value['type'];
-
 
350
					$creditValueArray['fortbatchid'] = $value['batch'];
-
 
351
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
-
 
352
					$creditValueArray['description'] = $value['description'];
-
 
353
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
-
 
354
						
-
 
355
				}
-
 
356
				elseif($value['type']== 'Adjustment'){
-
 
357
					$creditValueArray['amount'] = $value['userAmount'];
-
 
358
					$creditValueArray['type'] = $value['type'];
-
 
359
					$creditValueArray['fortbatchid'] = $value['batch'];
-
 
360
					$creditValueArray['creditedDate'] = date('Y-m-d',strtotime($value['timestamp']));
-
 
361
					$creditValueArray['description'] = $value['description'];
-
 
362
					$creditKeyArray[date('Y-m-d',strtotime($value['timestamp'])).$value['type']] = $creditValueArray;
-
 
363
				}
321
				
364
				
322
			}
365
			}
323
		}
366
		}
324
 
367
 
325
		$storemapping = Configure::read('storemapping');
368
		$storemapping = Configure::read('storemapping');