[7419] | 1 | ## $Id: interfaces.py 8072 2012-04-09 07:53:53Z henrik $
|
---|
[6923] | 2 | ##
|
---|
[7419] | 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
|
---|
| 4 | ## This program is free software; you can redistribute it and/or modify
|
---|
| 5 | ## it under the terms of the GNU General Public License as published by
|
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or
|
---|
| 7 | ## (at your option) any later version.
|
---|
| 8 | ##
|
---|
| 9 | ## This program is distributed in the hope that it will be useful,
|
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 12 | ## GNU General Public License for more details.
|
---|
| 13 | ##
|
---|
| 14 | ## You should have received a copy of the GNU General Public License
|
---|
| 15 | ## along with this program; if not, write to the Free Software
|
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 17 | ##
|
---|
[7695] | 18 |
|
---|
| 19 | import zope.i18nmessageid
|
---|
[6923] | 20 | from zope import schema
|
---|
[8072] | 21 | from waeup.kofa.interfaces import (SimpleKofaVocabulary,
|
---|
[7505] | 22 | ISessionConfiguration, academic_sessions_vocab)
|
---|
[8072] | 23 | from waeup.custom.utils.lgas import LGAS
|
---|
[6923] | 24 |
|
---|
[7695] | 25 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.custom')
|
---|
| 26 |
|
---|
[8072] | 27 | lgas_vocab = SimpleKofaVocabulary(
|
---|
| 28 | *sorted([(x[1],x[0]) for x in LGAS]))
|
---|
| 29 |
|
---|
[7021] | 30 | # It's recommended to replicate all fields from the base package here.
|
---|
| 31 | class ISessionConfiguration(ISessionConfiguration):
|
---|
[6923] | 32 | """A session configuration object.
|
---|
| 33 | """
|
---|
| 34 |
|
---|
[7880] | 35 | # Base fees, do not remove.
|
---|
| 36 |
|
---|
[7928] | 37 | school_fee_base = schema.Float(
|
---|
[7695] | 38 | title = _(u'School Fee (ignored)'),
|
---|
[7928] | 39 | default = 0.0,
|
---|
[7880] | 40 | required = False,
|
---|
[6923] | 41 | )
|
---|
| 42 |
|
---|
[7928] | 43 | surcharge_1 = schema.Float(
|
---|
[7880] | 44 | title = _(u'Surcharge Portal Provider'),
|
---|
[7928] | 45 | default = 0.0,
|
---|
[7880] | 46 | required = False,
|
---|
[6923] | 47 | )
|
---|
| 48 |
|
---|
[7928] | 49 | surcharge_2 = schema.Float(
|
---|
[7695] | 50 | title = _(u'Surcharge Interswitch'),
|
---|
[7928] | 51 | default = 0.0,
|
---|
[7880] | 52 | required = False,
|
---|
[6923] | 53 | )
|
---|
| 54 |
|
---|
[7928] | 55 | surcharge_3 = schema.Float(
|
---|
[7695] | 56 | title = _(u'Surcharge 3'),
|
---|
[7928] | 57 | default = 0.0,
|
---|
[7880] | 58 | required = False,
|
---|
[6923] | 59 | )
|
---|
| 60 |
|
---|
[7928] | 61 | clearance_fee = schema.Float(
|
---|
[7695] | 62 | title = _(u'Clearance Fee'),
|
---|
[7928] | 63 | default = 0.0,
|
---|
[7880] | 64 | required = False,
|
---|
[6923] | 65 | )
|
---|
| 66 |
|
---|
[7928] | 67 | booking_fee = schema.Float(
|
---|
[7695] | 68 | title = _(u'Booking Fee'),
|
---|
[7928] | 69 | default = 0.0,
|
---|
[7880] | 70 | required = False,
|
---|
[6923] | 71 | )
|
---|
| 72 |
|
---|
[7928] | 73 | acceptance_fee = schema.Float(
|
---|
[7880] | 74 | title = _(u'Acceptance Fee'),
|
---|
[7928] | 75 | default = 0.0,
|
---|
[7880] | 76 | required = False,
|
---|
| 77 | )
|
---|
| 78 |
|
---|
| 79 | # Additional fees in waeup.custom
|
---|
| 80 |
|
---|
[7928] | 81 | maint_fee = schema.Float(
|
---|
[7695] | 82 | title = _(u'Maintenance Fee'),
|
---|
[7928] | 83 | default = 0.0,
|
---|
[7880] | 84 | required = False,
|
---|
[6950] | 85 | )
|
---|
| 86 |
|
---|
[7928] | 87 | gown = schema.Float(
|
---|
[7695] | 88 | title = _(u'Gown Fee'),
|
---|
[7928] | 89 | default = 0.0,
|
---|
[7880] | 90 | required = False,
|
---|
[7021] | 91 | )
|
---|
| 92 |
|
---|
[7928] | 93 | transfer = schema.Float(
|
---|
[7695] | 94 | title = _(u'Transfer Fee'),
|
---|
[7928] | 95 | default = 0.0,
|
---|
[7880] | 96 | required = False,
|
---|
[7021] | 97 | )
|
---|
| 98 |
|
---|
[6923] | 99 | def getSessionString():
|
---|
| 100 | """Returns the session string from the vocabulary.
|
---|
| 101 | """
|
---|
| 102 |
|
---|
| 103 |
|
---|
| 104 | class ISessionConfigurationAdd(ISessionConfiguration):
|
---|
| 105 | """A session configuration object in add mode.
|
---|
| 106 | """
|
---|
| 107 |
|
---|
| 108 | academic_session = schema.Choice(
|
---|
[7695] | 109 | title = _(u'Academic Session'),
|
---|
[6923] | 110 | source = academic_sessions_vocab,
|
---|
| 111 | default = None,
|
---|
| 112 | required = True,
|
---|
| 113 | readonly = False,
|
---|
| 114 | )
|
---|
| 115 |
|
---|
| 116 | ISessionConfigurationAdd['academic_session'].order = ISessionConfiguration[
|
---|
| 117 | 'academic_session'].order |
---|