mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-30 16:35:35 -04:00 
			
		
		
		
	Saves redeemed hour value properly if previous edited transaction is saved again.
This commit is contained in:
		
							parent
							
								
									f95f2d2b2c
								
							
						
					
					
						commit
						a48fb518f7
					
				| @ -1018,8 +1018,36 @@ $(function() { | |||||||
| 					sold_to = $("[name='sold_to']").val();				 | 					sold_to = $("[name='sold_to']").val();				 | ||||||
| 				}	 | 				}	 | ||||||
| 				 | 				 | ||||||
|  | 				// data structure for volunteer benefits history
 | ||||||
|  | 				var volunteer_benefits_history = []; | ||||||
|  | 				var redeemed = { | ||||||
|  | 				 | ||||||
|  | 				 | ||||||
|  | 											};				 | ||||||
|  | 				 | ||||||
| 				// Volunteer History query
 | 				// Volunteer History query
 | ||||||
| 				$.post("json/transaction.php",{ volunteer_history_select: 1, contact_id: sold_to }, function(data) { | 				$.post("json/transaction.php",{ volunteer_history_select: 1, contact_id: sold_to }, function(data) { | ||||||
|  | 					if (data === "First Volunteer History") { | ||||||
|  | 						volunteer_benefits_history.push(redeemed); | ||||||
|  | 						 | ||||||
|  | 						/* | ||||||
|  | 						$.post("json/transaction.php",{ history_update: 1,  | ||||||
|  | 																	transaction_id: transaction_id,  | ||||||
|  | 																	history: transaction_history }); | ||||||
|  | 						*/					 | ||||||
|  | 					 | ||||||
|  | 					} else { // update redeemed hours
 | ||||||
|  | 						 | ||||||
|  | 						/* | ||||||
|  | 						transaction_history = $.parseJSON(data); | ||||||
|  | 						transaction_history.push(current_transaction); | ||||||
|  | 						$.post("json/transaction.php",{ history_update: 1,  | ||||||
|  | 																		transaction_id: transaction_id,  | ||||||
|  | 																		history: transaction_history, | ||||||
|  | 																		more_than_one: 1 }); | ||||||
|  | 						*/						 | ||||||
|  | 						 | ||||||
|  | 					} // update redeemed hours
 | ||||||
| 					 | 					 | ||||||
| 				}); | 				}); | ||||||
| 	 | 	 | ||||||
| @ -1055,7 +1083,7 @@ $(function() { | |||||||
| 										transaction_type: $("#transaction_type").val(), | 										transaction_type: $("#transaction_type").val(), | ||||||
| 										original_price: $("#original_price").text(), | 										original_price: $("#original_price").text(), | ||||||
| 										amount: $("#amount").val(), | 										amount: $("#amount").val(), | ||||||
| 										redeemed_hours: $("#redeemable_hours").val(), | 										redeemed_hours: $("#redeemable_hours").val() || $("#volunteer_hours").text(), | ||||||
| 										description: $("#description").val(),  | 										description: $("#description").val(),  | ||||||
| 										sold_to: sold_to, | 										sold_to: sold_to, | ||||||
| 										sold_by: $("[name='sold_by']").val(), | 										sold_by: $("[name='sold_by']").val(), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user