Changeset 9478 for main/waeup.kofa/trunk/tools
- Timestamp:
- 30 Oct 2012, 20:19:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/tools/fix_import_file.py
r9362 r9478 110 110 'payment_date': 'date', 111 111 'validation_date': 'date', 112 'resp_approved_amount': 'amount', 113 'amount': 'amount', 114 'amount_auth': 'amount', 115 'surcharge': 'amount' 112 116 } 113 117 … … 236 240 value = cls.old_new_id_map.get(value, value) 237 241 if len(value) == 7: 238 return ' M' + value242 return 'B' + value 239 243 return value 240 244 … … 320 324 # If real names are given, let's see if a similar value 321 325 # in LGAS exist. 326 value = value.replace('_',' ') 322 327 value = LGAS_inverted_stripped.get(strip(lower), value) 323 328 return value … … 432 437 433 438 @classmethod 439 def amount(self, value, row): 440 """ Amounts must be integers 441 """ 442 try: 443 return float(value) 444 except: 445 return 446 447 @classmethod 434 448 def mode(self, value, row): 435 449 if value == "transfer_fulltime": … … 483 497 """ 484 498 if not value: 499 return 500 if len(value) < 5: 485 501 return 486 502 value = value.strip('#') … … 491 507 if value.startswith('234'): 492 508 value = '+' + value[:3] + '-' + value[3:] 509 elif value.startswith('+234'): 510 value = value[:4] + '-' + value[4:] 493 511 else: 494 512 value = '-%s' % phone … … 520 538 header = convert_fieldnames(reader.fieldnames) 521 539 writer.writerow(header) 522 if row.get('reg_state') == 'student_created':523 # We do not reimport student records which have never been accessed.524 continue540 #if row.get('reg_state') == 'student_created': 541 # # We do not reimport student records which have never been accessed. 542 # continue 525 543 if row.get('status') == 'started': 526 544 # We do not reimport started payments.
Note: See TracChangeset for help on using the changeset viewer.