fix: broken type check in stock ageing report
This commit is contained in:
		
							parent
							
								
									b7436a04c3
								
							
						
					
					
						commit
						36ff0748bf
					
				| @ -49,7 +49,7 @@ def get_average_age(fifo_queue, to_date): | |||||||
| 	for batch in fifo_queue: | 	for batch in fifo_queue: | ||||||
| 		batch_age = date_diff(to_date, batch[1]) | 		batch_age = date_diff(to_date, batch[1]) | ||||||
| 
 | 
 | ||||||
| 		if type(batch[0]) in ['int', 'float']: | 		if isinstance(batch[0], (int, float)): | ||||||
| 			age_qty += batch_age * batch[0] | 			age_qty += batch_age * batch[0] | ||||||
| 			total_qty += batch[0] | 			total_qty += batch[0] | ||||||
| 		else: | 		else: | ||||||
| @ -302,4 +302,4 @@ def add_column(range_columns, label, fieldname, fieldtype='Float', width=140): | |||||||
| 		fieldname=fieldname, | 		fieldname=fieldname, | ||||||
| 		fieldtype=fieldtype, | 		fieldtype=fieldtype, | ||||||
| 		width=width | 		width=width | ||||||
| 	)) | 	)) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user