mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[DOC] Comment the whole code of the bank statement improvement modules suite.
(lp:c2c-financial-addons/6.1 rev 24.1.24)
This commit is contained in:
@@ -31,10 +31,10 @@ except:
|
||||
raise Exception(_('Please install python lib xlrd'))
|
||||
|
||||
class TransactionIDFileParser(FileParser):
|
||||
"""TransactionID parser that use a define format in csv or xls to import
|
||||
bank statement."""
|
||||
|
||||
|
||||
"""
|
||||
TransactionID parser that use a define format in csv or xls to import
|
||||
bank statement.
|
||||
"""
|
||||
|
||||
def __init__(self, parse_name, ftype='csv'):
|
||||
convertion_dict = {
|
||||
@@ -46,16 +46,19 @@ class TransactionIDFileParser(FileParser):
|
||||
}
|
||||
# Order of cols does not matter but first row of the file has to be header
|
||||
keys_to_validate = ['transaction_id', 'label', 'date', 'amount', 'commission_amount']
|
||||
|
||||
|
||||
super(TransactionIDFileParser,self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, convertion_dict=convertion_dict)
|
||||
|
||||
@classmethod
|
||||
def parser_for(cls, parser_name):
|
||||
"""
|
||||
Used by the new_bank_statement_parser class factory. Return true if
|
||||
the providen name is generic_csvxls_transaction
|
||||
"""
|
||||
return parser_name == 'generic_csvxls_transaction'
|
||||
|
||||
def get_st_line_vals(self, line, *args, **kwargs):
|
||||
"""This method must return a dict of vals that can be passed to create
|
||||
"""T
|
||||
his method must return a dict of vals that can be passed to create
|
||||
method of statement line in order to record it. It is the responsibility
|
||||
of every parser to give this dict of vals, so each one can implement his
|
||||
own way of recording the lines.
|
||||
@@ -84,7 +87,9 @@ class TransactionIDFileParser(FileParser):
|
||||
}
|
||||
|
||||
def _post(self, *args, **kwargs):
|
||||
"""Compute the commission from value of each line"""
|
||||
"""
|
||||
Compute the commission from value of each line
|
||||
"""
|
||||
res = super(GenericFileParser, self)._post(*args, **kwargs)
|
||||
val = 0.0
|
||||
for row in self.result_row_list:
|
||||
|
||||
Reference in New Issue
Block a user