172
172
# Record every line in the bank statement and compute the global commission
173
173
# based on the commission_amount column
174
175
for line in result_row_list:
175
176
parser_vals = parser.get_st_line_vals(line)
176
177
values = self.prepare_statetement_lines_vals(
177
178
cr, uid, parser_vals, account_payable,
178
179
account_receivable, statement_id, context)
179
180
# we finally create the line in system
180
statement_line_obj.create(cr, uid, values, context=context)
181
statement_store.append((0, 0, values))
181
182
# Build and create the global commission line for the whole statement
182
comm_vals = self.prepare_global_commission_line_vals(
183
cr, uid, parser, result_row_list, prof, statement_id, context)
183
statement_obj.write(cr, uid, [statement_id],
184
{'line_ids': statement_store}, context=context)
185
comm_vals = self.prepare_global_commission_line_vals(cr, uid, parser, result_row_list,
186
prof, statement_id, context)
185
188
statement_line_obj.create(cr, uid, comm_vals, context=context)