Ignore:
Timestamp:
12 Jan 2013, 06:34:26 (12 years ago)
Author:
Henrik Bettermann
Message:

Roll back some of the changes made yesterday. We do not need a new payment category and pay_item_id.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9867 r9868  
    15231523    @action(_('Create ticket'), style='primary')
    15241524    def createTicket(self, **data):
    1525         balance_item = data.get('balance_item', None)
     1525        p_category = data['p_category']
    15261526        balance_session = data.get('balance_session', None)
    15271527        balance_level = data.get('balance_level', None)
     
    15301530        students_utils = getUtility(IStudentsUtils)
    15311531        error, payment = students_utils.setBalanceDetails(
    1532             balance_item, student, balance_session,
     1532            p_category, student, balance_session,
    15331533            balance_level, balance_amount)
    15341534        if error is not None:
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9864 r9868  
    4343    DICT_NAME = 'PREVIOUS_PAYMENT_CATEGORIES'
    4444
    45 class BalancePaymentItemSource(ContextualDictSourceFactoryBase):
     45class BalancePaymentCategorySource(ContextualDictSourceFactoryBase):
    4646    """A source that delivers all selectable items of balance payments.
    4747    """
    4848    #: name of dict to deliver from kofa utils.
    49     DICT_NAME = 'BALANCE_PAYMENT_ITEMS'
     49    DICT_NAME = 'BALANCE_PAYMENT_CATEGORIES'
    5050
    5151# VerdictSource can't be placed into the vocabularies module because it
     
    770770    """
    771771
    772     balance_item = schema.Choice(
     772    p_category = schema.Choice(
    773773        title = _(u'Payment Category'),
    774774        default = u'schoolfee',
    775775        required = True,
    776         source = BalancePaymentItemSource(),
     776        source = BalancePaymentCategorySource(),
    777777        )
    778778
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9865 r9868  
    23962396        # Previous session payment form is provided
    23972397        self.assertEqual(self.student.current_session, 2004)
    2398         self.browser.getControl(name="form.balance_item").value = ['schoolfee']
     2398        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    23992399        self.browser.getControl(name="form.balance_session").value = ['2004']
    24002400        self.browser.getControl(name="form.balance_level").value = ['300']
     
    24122412        self.assertEqual(self.student['payments'][value].p_session, 2004)
    24132413        self.assertEqual(self.student['payments'][value].p_level, 300)
    2414         self.assertEqual(self.student['payments'][value].p_item, u'School Fee')
    2415         self.assertEqual(self.student['payments'][value].p_category, 'balance')
     2414        self.assertEqual(self.student['payments'][value].p_item, u'Balance')
     2415        self.assertEqual(self.student['payments'][value].p_category, 'schoolfee')
    24162416
    24172417    def test_postgraduate_student_payments(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r9864 r9868  
    421421        return None, payment
    422422
    423     def setBalanceDetails(self, balance_item, student,
     423    def setBalanceDetails(self, category, student,
    424424            balance_session, balance_level, balance_amount):
    425425        """Create Payment object and set the payment data of a student for.
    426426
    427427        """
    428         p_item = getUtility(IKofaUtils).BALANCE_PAYMENT_ITEMS[balance_item]
    429         p_item = unicode(p_item)
     428        p_item = u'Balance'
    430429        p_session = balance_session
    431430        p_level = balance_level
     
    447446        timestamp = ("%d" % int(time()*10000))[1:]
    448447        payment.p_id = "p%s" % timestamp
    449         payment.p_category = 'balance'
     448        payment.p_category = category
    450449        payment.p_item = p_item
    451450        payment.p_session = p_session
Note: See TracChangeset for help on using the changeset viewer.