~camptocamp/banking-addons/bank-statement-reconcile-7.0-add-cancel-line-lep

« back to all changes in this revision

Viewing changes to account_statement_base_import/parser/parser.py

  • Committer: Virgil Dupras
  • Date: 2013-05-03 19:57:26 UTC
  • mto: This revision was merged to the branch mainline in revision 94.
  • Revision ID: virgil.dupras@savoirfairelinux.com-20130503195726-wxzulfrltjl7bgfp
[ENH] Began extracting the commission-handling feature from account_statement_base_import.

The extracted commission part is not functional, but the base_import module still works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        self.result_row_list = None
50
50
        # The file buffer on which to work on
51
51
        self.filebuffer = None
52
 
        # Concatenate here the global commission taken by the bank/office
53
 
        # for this statement.
54
 
        self.commission_global_amount = None
55
52
 
56
53
    @classmethod
57
54
    def parser_for(cls, parser_name):
110
107
        """
111
108
        Implement a method in your parser to make some last changes on the result of parsing
112
109
        the datas, like converting dates, computing commission, ...
113
 
        Work on self.result_row_list and put the commission global amount if any
114
 
        in the self.commission_global_amount one.
115
110
        """
116
111
        return NotImplementedError
117
112
 
133
128
        """
134
129
        return NotImplementedError
135
130
 
136
 
    def get_st_line_commision(self, *args, **kwargs):
137
 
        """
138
 
        This is called by the importation method to create the commission line in
139
 
        the bank statement. We will always create one line for the commission in the
140
 
        bank statement, but it could be computated from a value of each line, or given
141
 
        in a single line for the whole file.
142
 
            return: float of the whole commission (self.commission_global_amount)
143
 
        """
144
 
        return self.commission_global_amount
145
 
 
146
131
    def parse(self, filebuffer, *args, **kwargs):
147
132
        """
148
133
        This will be the method that will be called by wizard, button and so