Changeset 7626
- Timestamp:
- 10 Feb 2012, 20:26:34 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py
r7623 r7626 561 561 elif 'reg_number' in row.keys() and row['reg_number']: 562 562 reg_number = row['reg_number'] 563 #import pdb; pdb.set_trace()564 563 cat = queryUtility(ICatalog, name='students_catalog') 565 564 results = list( … … 586 585 if payments is None: 587 586 return None 588 if row['p_id'].startswith('p'): 589 entry = payments.get(row['p_id']) 587 # We can use the hash symbol at the end of p_id in import files 588 # to avoid annoying automatic number transformation 589 # by Excel or Calc 590 p_id = row['p_id'].strip('#') 591 if p_id.startswith('p'): 592 entry = payments.get(p_id) 590 593 else: 591 594 # For data migration from old SRP 592 entry = payments.get('p' + row['p_id'][6:])595 entry = payments.get('p' + p_id[6:]) 593 596 return entry 594 597 595 598 def addEntry(self, obj, row, site): 596 599 parent = self.getParent(row, site) 597 if not row['p_id'].startswith('p'): 600 p_id = row['p_id'].strip('#') 601 if not p_id.startswith('p'): 598 602 # For data migration from old SRP 599 obj.p_id = 'p' + row['p_id'][6:]603 obj.p_id = 'p' + p_id[6:] 600 604 parent[obj.p_id] = obj 601 605 else: 602 parent[ row['p_id']] = obj606 parent[p_id] = obj 603 607 return 604 608 … … 610 614 row, self.factory_name) 611 615 # We have to check p_id. 612 if row['p_id'].startswith('p'): 613 if not len(row['p_id']) == 14: 616 p_id = row['p_id'].strip('#') 617 if p_id.startswith('p'): 618 if not len(p_id) == 14: 614 619 errs.append(('p_id','invalid length')) 615 620 return errs, inv_errs, conv_dict 616 621 else: 617 if not len( row['p_id']) == 19:622 if not len(p_id) == 19: 618 623 errs.append(('p_id','invalid length')) 619 624 return errs, inv_errs, conv_dict -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_payment_data.csv
r7623 r7626 1 1 p_state,p_category,r_pay_reference,r_desc,p_id,reg_number,session_id,r_amount_approved,p_item,amount_auth,r_card_num,r_code,creation_date,type,surcharge_1 2 paid,schoolfee,GTB|WEB|FUT|26-11-2010|002295,Approved Successful,3816951290797973744 ,1,2010,19500,BTECHBDT,19500,0942,00,2010/11/26 19:59:33.744 GMT+1,online,02 paid,schoolfee,GTB|WEB|FUT|26-11-2010|002295,Approved Successful,3816951290797973744#,1,2010,19500,BTECHBDT,19500,0942,00,2010/11/26 19:59:33.744 GMT+1,online,0 3 3 unpaid,schoolfee,GTB|WEB|FUT|25-11-2010|,Transaction status unconfirmed,3816951290712593757,2,2010,0,BTECHBDT,19500,0942,Z0,2010/11/25 20:16:33.757 GMT+1,online,0 4 4 paid,schoolfee,UBA|WEB|FUT|15-02-2010|000517,Approved Successful,p1266236341955,3,2009,19500,BTECHBDT,19500,0615,00,2010/02/15 13:19:01.955 GMT+1,online,0 -
main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
r7624 r7626 361 361 'Y': 'No previous verdict', 362 362 'X': 'New 300 level student', 363 'Z': 'Successful student (provisional)' 363 'Z': 'Successful student (provisional)', 364 364 'A1': 'First Class', 365 365 'A2': 'Second Class Upper',
Note: See TracChangeset for help on using the changeset viewer.