Commit d89e3c4c authored by Luca Cristaldi's avatar Luca Cristaldi
Browse files

Merge branch 'membership-fee' into 'master'

Membership fee

See merge request !1
parents 5e486fc2 83d9a785
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4,7 +4,13 @@
#dev files
*.sqlite
*.conf
.eggs
__pycache__
*.egg-info

# pipenv
Pipfile
Pipfile.lock

#Stylesheets
stylesheets
+22 −3
Original line number Diff line number Diff line
from trytond.pool import Pool
from .association import *
from .account import *
from .member import *
from .membership import *
from .configuration import *
from .ir import *

__all__ = ['register']


def register():
    Pool.register(
        Member, Configuration, MemberSequence,
        Member,
        Configuration,
        MemberSequence,
        Membership,
        Period,
        Fee,
        Line,
        Move,
        GenerateFeeStart,
        Cron,
        PrintMembersBookStart,
        module='association', type_='model')

    Pool.register(
        PostFee,
        GenerateFee,
        MembersBookWizard,
        module='association', type_='wizard')

    Pool.register(
        MembersBookReport,
    module='association', type_='report')

account.py

0 → 100644
+11 −0
Original line number Diff line number Diff line
from trytond.pool import PoolMeta, Pool


__all__ = ['Move']

class Move(metaclass=PoolMeta):
    __name__ = 'account.move'

    @classmethod
    def _get_origin(cls):
        return super(Move, cls)._get_origin() + ['association.membership.fee']
 No newline at end of file
+74 −2
Original line number Diff line number Diff line
Association Module
##################
===========
Association
===========
------
Member
------
A member is defined by:
 * code: a sequential code, you can specify the format in the Configuration tab
 * Party: The party associated with this member
 * join_date: The date were the member joins the association
 * leave_date: The date were the member leaves the association
 * memberships: A list of Mebership Line

If you want easilly check if the member paied all his fees, you can use the "Fees" relate utility.

---------------
Membership Line
---------------
The membership line is used to specify the starting and ending date of the membership.
This so you can selecet a starting/ending date different from the member one.
If you leave the fields empty, it will use the join/leave date from the member.
A membership line is defined by:
 * membership: the membership the member enrolled
 * start_date: the strating date, if not specified use the join date from the member will be used
 * end_date: the ending date, if not specified the leave date from the member will be used

This is used by the "Create Fees" Wizard to filter wich period the user should be billed


----------
Membership
----------
A membership is a collection of Periods.
The list must contain Periods with no overlapping date.
A Membership is defined by:
 * name:            The name of the Membership
 * journal:         The Journal that will be used for posting accounting move
 * account_revenue: The account revenue that will be used for posting accounting move
 * periods:         A list of Periods

*******************
Print Member's Book
*******************
This wizard will print a Report of all the member that are not in the draft state.

------
Period
------
A periods define a date range and what the member should pay for the period
A period is defined by:
 * start_date:  the starting date of the period
 * end_date:    the ending date of the period
 * fee:         the amount that the member should pay for this period

---
Fee
---
A fee is associated to a Member and a Period.
Tryton will check if a Member have Fees with the same period,and will throw an error if you try to do so.
A feee is defined as:
 * member:  The Member associated with this fee
 * period:  The Period associated with this fee
 * move:    The move associated with this fee

The module will check if the move is reconciled and posted, if so the paid field will be checked.
You can post the move via the Post button/action, or manually.

******************
Create Fees Wizard
******************
The wizard will generate fee record based on the date.
This wizard is used by the cronjob that will trigger (by default) once every day.

exceptions.py

0 → 100644
+21 −0
Original line number Diff line number Diff line
from trytond.model.exceptions import ValidationError


class PeriodValidationError(ValidationError):
    pass


class PeriodDateOverlapError(PeriodValidationError):
    pass


class DateNotInPeriodError(PeriodValidationError):
    pass


class SequenceMissingError(ValidationError):
    pass


class MemberUnpaiedFeeError(ValidationError):
    pass
Loading