|
|
@ -81,6 +81,30 @@ class LoanInterestLine(models.Model): |
|
|
|
line.write({"loan_reimbursment_move": move.id, |
|
|
|
"state": "scheduled"}) |
|
|
|
|
|
|
|
@api.multi |
|
|
|
def generate_interest_move_lines_fy(self, date): |
|
|
|
|
|
|
|
for line in self: |
|
|
|
if not self.loan_due_fy_move: |
|
|
|
company = line.company_id |
|
|
|
move = line.create_move(date) |
|
|
|
|
|
|
|
deb_vals = line.get_move_line(move, line.partner_id) |
|
|
|
cred_vals = line.get_move_line(move, line.partner_id) |
|
|
|
|
|
|
|
deb_vals["debit"] = line.due_loan_amount |
|
|
|
deb_vals["date"] = date |
|
|
|
deb_vals["account_id"] = company.debt_long_term_account.id |
|
|
|
|
|
|
|
cred_vals["credit"] = line.due_loan_amount |
|
|
|
cred_vals["date"] = date |
|
|
|
cred_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|
|
|
|
|
|
self.env["account.move.line"].create([deb_vals, cred_vals]) |
|
|
|
|
|
|
|
line.write({"loan_due_fy_move": move.id, |
|
|
|
"state": "due_fy"}) |
|
|
|
|
|
|
|
@api.multi |
|
|
|
def generate_loan_due_fy(self, date): |
|
|
|
|
|
|
|