mirror of
				https://gitlab.crans.org/bde/nk20-scripts
				synced 2025-10-30 22:59:52 +01:00 
			
		
		
		
	Update the balance of the Kfet club
This commit is contained in:
		| @@ -185,6 +185,7 @@ class Command(ImportCommand): | ||||
|         n = cur.rowcount | ||||
|         pk_membership = 1 | ||||
|         pk_transaction = 1 | ||||
|         kfet_balance = 0 | ||||
|         for idx, row in enumerate(cur): | ||||
|             if save or idx % chunk_size == 0: | ||||
|                 self.update_line(idx, n, row["description"]) | ||||
| @@ -261,6 +262,7 @@ class Command(ImportCommand): | ||||
|                     } | ||||
|                     obj_dict0["amount"] = bde_dict["fee"] | ||||
|                     obj_dict["amount"] = kfet_dict["fee"] | ||||
|                     kfet_balance += kfet_dict["fee"] | ||||
|                     # BDE membership Transaction is inserted before the Kfet membershipTransaction | ||||
|                     pk_membership += 1 | ||||
|                     pk_transaction += 1 | ||||
| @@ -291,6 +293,14 @@ class Command(ImportCommand): | ||||
|             pk_transaction += 1 | ||||
|         bulk_mgr.done() | ||||
|  | ||||
|         # Update the balance of the BDE and the Kfet club | ||||
|         note_bde = NoteClub.objects.get(pk=5) | ||||
|         note_kfet = NoteClub.objects.get(pk=6) | ||||
|         note_bde.balance -= kfet_balance | ||||
|         note_kfet.balance += kfet_balance | ||||
|         note_bde.save() | ||||
|         note_kfet.save() | ||||
|  | ||||
|     @timed | ||||
|     def set_roles(self): | ||||
|         bulk_mgr = BulkCreateManager(chunk_size=10000) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user