|
1 | | -# -*- coding: utf-8 -*- |
2 | 1 | # Copyright 2015 Alessandro Camilli (<http://www.openforce.it>) |
3 | 2 | # Copyright 2018 Lorenzo Battistini - Agile Business Group |
4 | 3 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
@@ -96,20 +95,20 @@ def generate_wt_moves(self): |
96 | 95 | p_date_maturity = False |
97 | 96 | payment_lines = wt_st.withholding_tax_id.payment_term.compute( |
98 | 97 | amount_wt, |
99 | | - rec_line_statement.date or False) |
| 98 | + rec_line_payment.date or False) |
100 | 99 | if payment_lines and payment_lines[0]: |
101 | 100 | p_date_maturity = payment_lines[0][0][0] |
102 | 101 | wt_move_vals = { |
103 | 102 | 'statement_id': wt_st.id, |
104 | | - 'date': rec_line_statement.date, |
| 103 | + 'date': rec_line_payment.date, |
105 | 104 | 'partner_id': rec_line_statement.partner_id.id, |
106 | 105 | 'reconcile_partial_id': self.id, |
107 | 106 | 'payment_line_id': rec_line_payment.id, |
108 | 107 | 'credit_debit_line_id': rec_line_statement.id, |
109 | 108 | 'withholding_tax_id': wt_st.withholding_tax_id.id, |
110 | 109 | 'account_move_id': rec_line_payment.move_id.id or False, |
111 | 110 | 'date_maturity': |
112 | | - p_date_maturity or rec_line_statement.date_maturity, |
| 111 | + p_date_maturity or rec_line_payment.date_maturity, |
113 | 112 | 'amount': amount_wt |
114 | 113 | } |
115 | 114 | wt_move_vals = self._prepare_wt_move(wt_move_vals) |
|
0 commit comments