|
@ -26,18 +26,24 @@ class LoanIssueLine(models.Model): |
|
|
} |
|
|
} |
|
|
return move_line |
|
|
return move_line |
|
|
|
|
|
|
|
|
|
|
|
@api.model |
|
|
|
|
|
def create_move(self, line, date, journal): |
|
|
|
|
|
return self.env["account.move"].create({ |
|
|
|
|
|
"ref": line.reference, |
|
|
|
|
|
"date": date.today(), |
|
|
|
|
|
"journal_id": journal.id, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|
def create_waiting_payment_moves(self): |
|
|
|
|
|
move_obj = self.env["account.move"] |
|
|
|
|
|
|
|
|
def create_waiting_payment_move(self): |
|
|
move_line_obj = self.env["account.move.line"] |
|
|
move_line_obj = self.env["account.move.line"] |
|
|
for line in self: |
|
|
for line in self: |
|
|
company = line.company_id |
|
|
company = line.company_id |
|
|
move_vals = { |
|
|
|
|
|
"ref": line.reference, |
|
|
|
|
|
"date": date.today(), |
|
|
|
|
|
"journal_id": company.awaiting_loan_payment_journal.id, |
|
|
|
|
|
} |
|
|
|
|
|
move = move_obj.create(move_vals) |
|
|
|
|
|
|
|
|
move = self.create_move( |
|
|
|
|
|
line, |
|
|
|
|
|
date.today(), |
|
|
|
|
|
company.awaiting_loan_payment_journal.id, |
|
|
|
|
|
) |
|
|
loan_vals = line.get_loan_move_line(move.id) |
|
|
loan_vals = line.get_loan_move_line(move.id) |
|
|
loaner_vals = line.get_loan_move_line(move.id) |
|
|
loaner_vals = line.get_loan_move_line(move.id) |
|
|
|
|
|
|
|
@ -50,9 +56,29 @@ class LoanIssueLine(models.Model): |
|
|
move_line_obj.create([loan_vals, loaner_vals]) |
|
|
move_line_obj.create([loan_vals, loaner_vals]) |
|
|
line.awaiting_move_id = move |
|
|
line.awaiting_move_id = move |
|
|
|
|
|
|
|
|
|
|
|
@api.multi |
|
|
|
|
|
def create_loan_fy_move(self): |
|
|
|
|
|
# this function generate the move for the loan |
|
|
|
|
|
# to reimburse for the current fiscal year |
|
|
|
|
|
for line in self: |
|
|
|
|
|
company = line.company_id |
|
|
|
|
|
move = self.create_move( |
|
|
|
|
|
line, |
|
|
|
|
|
line, |
|
|
|
|
|
company.awaiting_loan_payment_journal.id, |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
@api.multi |
|
|
|
|
|
def create_interest_payment_move(self): |
|
|
|
|
|
print() |
|
|
|
|
|
|
|
|
|
|
|
@api.multi |
|
|
|
|
|
def create_loan_reimbursement_move(self): |
|
|
|
|
|
print() |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|
def action_request_payment(self): |
|
|
def action_request_payment(self): |
|
|
self.create_waiting_payment_moves() |
|
|
|
|
|
|
|
|
self.create_waiting_payment_move() |
|
|
super(LoanIssueLine, self).action_request_payment() |
|
|
super(LoanIssueLine, self).action_request_payment() |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|