|
@ -26,7 +26,7 @@ class LoanInterestLine(models.Model): |
|
|
move_line = { |
|
|
move_line = { |
|
|
"date_maturity": self.due_date, |
|
|
"date_maturity": self.due_date, |
|
|
"date": self.due_date, |
|
|
"date": self.due_date, |
|
|
"move_id": move_id, |
|
|
|
|
|
|
|
|
"move_id": move_id.id, |
|
|
} |
|
|
} |
|
|
if partner: |
|
|
if partner: |
|
|
move_line["partner_id"] = partner.id |
|
|
move_line["partner_id"] = partner.id |
|
@ -41,7 +41,7 @@ class LoanInterestLine(models.Model): |
|
|
due_date = self.due_date |
|
|
due_date = self.due_date |
|
|
|
|
|
|
|
|
return self.env["account.move"].create({ |
|
|
return self.env["account.move"].create({ |
|
|
"ref": self.loan_issue_id.reference, |
|
|
|
|
|
|
|
|
"ref": self.name, |
|
|
"date": due_date, |
|
|
"date": due_date, |
|
|
"journal_id": self.company_id.loan_journal.id, |
|
|
"journal_id": self.company_id.loan_journal.id, |
|
|
}) |
|
|
}) |
|
@ -54,8 +54,8 @@ class LoanInterestLine(models.Model): |
|
|
company = line.company_id |
|
|
company = line.company_id |
|
|
move = line.create_move() |
|
|
move = line.create_move() |
|
|
|
|
|
|
|
|
debit_vals = line.get_move_line(line.partner_id) |
|
|
|
|
|
loaner_vals = line.get_move_line(line.partner_id) |
|
|
|
|
|
|
|
|
debit_vals = line.get_move_line(move, line.partner_id) |
|
|
|
|
|
loaner_vals = line.get_move_line(move, line.partner_id) |
|
|
|
|
|
|
|
|
debit_vals["debit"] = line.interest |
|
|
debit_vals["debit"] = line.interest |
|
|
debit_vals["account_id"] = company.interest_account.id |
|
|
debit_vals["account_id"] = company.interest_account.id |
|
@ -71,7 +71,7 @@ class LoanInterestLine(models.Model): |
|
|
vals_list = [debit_vals, loaner_vals] |
|
|
vals_list = [debit_vals, loaner_vals] |
|
|
|
|
|
|
|
|
if line.taxes_amount > 0: |
|
|
if line.taxes_amount > 0: |
|
|
tax_vals = self.get_move_line() |
|
|
|
|
|
|
|
|
tax_vals = self.get_move_line(move) |
|
|
tax_vals["credit"] = line.taxes_amount |
|
|
tax_vals["credit"] = line.taxes_amount |
|
|
tax_vals["account_id"] = company.tax_account.id |
|
|
tax_vals["account_id"] = company.tax_account.id |
|
|
vals_list.append(tax_vals) |
|
|
vals_list.append(tax_vals) |
|
@ -89,15 +89,15 @@ class LoanInterestLine(models.Model): |
|
|
company = line.company_id |
|
|
company = line.company_id |
|
|
move = line.create_move(date) |
|
|
move = line.create_move(date) |
|
|
|
|
|
|
|
|
deb_vals = line.get_move_line(line.partner_id) |
|
|
|
|
|
cred_vals = line.get_move_line(line.partner_id) |
|
|
|
|
|
|
|
|
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["debit"] = line.due_loan_amount |
|
|
deb_vals["date"] = date |
|
|
deb_vals["date"] = date |
|
|
deb_vals["account_id"] = company.debt_long_term_account.id |
|
|
deb_vals["account_id"] = company.debt_long_term_account.id |
|
|
|
|
|
|
|
|
cred_vals["credit"] = line.due_loan_amount |
|
|
cred_vals["credit"] = line.due_loan_amount |
|
|
cred_vals["credit"] = date |
|
|
|
|
|
|
|
|
cred_vals["date"] = date |
|
|
cred_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|
cred_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|
|
|
|
|
|
|
self.env["account.move.line"].create([deb_vals, cred_vals]) |
|
|
self.env["account.move.line"].create([deb_vals, cred_vals]) |
|
@ -113,8 +113,8 @@ class LoanInterestLine(models.Model): |
|
|
company = line.company_id |
|
|
company = line.company_id |
|
|
move = line.create_move(fields.Date.today()) |
|
|
move = line.create_move(fields.Date.today()) |
|
|
|
|
|
|
|
|
debit_vals = line.get_move_line(line) |
|
|
|
|
|
credit_vals = line.get_move_line(line.partner_id) |
|
|
|
|
|
|
|
|
debit_vals = line.get_move_line(move, line) |
|
|
|
|
|
credit_vals = line.get_move_line(move, line.partner_id) |
|
|
|
|
|
|
|
|
debit_vals["debit"] = line.due_loan_amount |
|
|
debit_vals["debit"] = line.due_loan_amount |
|
|
debit_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|
debit_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|