|
@ -21,7 +21,8 @@ class LoanIssueLine(models.Model): |
|
|
line.amount = line.face_value * line.quantity |
|
|
line.amount = line.face_value * line.quantity |
|
|
|
|
|
|
|
|
name = fields.Char( |
|
|
name = fields.Char( |
|
|
String="Name" |
|
|
|
|
|
|
|
|
String="Name", |
|
|
|
|
|
readonly=True, |
|
|
) |
|
|
) |
|
|
reference = fields.Char( |
|
|
reference = fields.Char( |
|
|
string="Reference", |
|
|
string="Reference", |
|
@ -112,8 +113,13 @@ class LoanIssueLine(models.Model): |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|
def action_validate(self): |
|
|
def action_validate(self): |
|
|
|
|
|
sequence_id = self.env.ref( |
|
|
|
|
|
"easy_my_coop_loan.sequence_loan_issue_line", |
|
|
|
|
|
False |
|
|
|
|
|
) |
|
|
for line in self: |
|
|
for line in self: |
|
|
line.write({"state": "subscribed"}) |
|
|
|
|
|
|
|
|
loan_line_num = sequence_id.next_by_id() |
|
|
|
|
|
line.write({"name": loan_line_num, "state": "subscribed"}) |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|
def action_request_payment(self): |
|
|
def action_request_payment(self): |
|
@ -202,7 +208,7 @@ class LoanIssueLine(models.Model): |
|
|
days = self.get_number_of_days(line.payment_date.year) |
|
|
days = self.get_number_of_days(line.payment_date.year) |
|
|
interim_amount = line.amount * rate * (diff_days / days) |
|
|
interim_amount = line.amount * rate * (diff_days / days) |
|
|
|
|
|
|
|
|
due_date = start_date + relativedelta(years=+loan_term) |
|
|
|
|
|
|
|
|
due_date = start_date + relativedelta(years=loan_term) |
|
|
|
|
|
|
|
|
for year in range(1, loan_term + 1): |
|
|
for year in range(1, loan_term + 1): |
|
|
interest = accrued_amount * rate |
|
|
interest = accrued_amount * rate |
|
|