summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-08-28 11:47:00 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-08-28 11:47:00 +0700
commit4fcaaf9bc4e1e595e196437887dbe7c15acc5c41 (patch)
tree66ea0b9c9adafdcb501d067e233a759ef8a3ff71
parent9b0ce82de8518012198f526737403648f94d21c7 (diff)
(andri) fix informasi tambahan dan menambahkan button cek selengkapnya
-rw-r--r--indoteknik_custom/models/account_move.py45
1 files changed, 28 insertions, 17 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index b97edd0a..8e58ce6b 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -180,7 +180,7 @@ class AccountMove(models.Model):
('payment_state', 'not in', ['paid', 'in_payment', 'reversed']),
('invoice_date_due', 'in', target_dates),
('date_terima_tukar_faktur', '!=', False),
- ('partner_id', 'in' , [14709])
+ ('partner_id', 'in' , [94603])
], limit=5)
_logger.info(f"Invoices: {invoices}")
@@ -295,23 +295,34 @@ class AccountMove(models.Model):
overdue_amount = sum(overdue_invoices.mapped('amount_total'))
currency = invs[0].currency_id if invs else partner.company_id.currency_id
+ # tempo_link = 'https://www.indoteknik.com/my/tempo'
+ tempo_link = 'http://localhost:2100/my/tempo'
+
limit_info_html = f"""
- <p><b>Informasi Tambahan:</b></p>
- <ul style="font-size:12px; color:#333; line-height:1.4; padding-left:0; margin-left:0; list-style-position:inside;">
- <li>Kredit Limit Anda: {formatLang(self.env, blocking_limit, currency_obj=currency)}</li>
- <li>Status Detail Tempo: {partner.property_payment_term_id.name or 'Review'}</li>
- <li style="color:{'red' if (blocking_limit - outstanding_amount) < 0 else 'green'};">
- Sisa Kredit Limit: {formatLang(self.env, blocking_limit - outstanding_amount, currency_obj=currency)}
- </li>
- <li style="color:red;">
- Kredit Limit Terpakai: {formatLang(self.env, outstanding_amount, currency_obj=currency)}
- <span style="font-size:12px; color:#666;">({len(outstanding_invoices)} Transaksi)</span>
- </li>
- <li style="color:red;">
- Jatuh Tempo: {formatLang(self.env, overdue_amount, currency_obj=currency)}
- <span style="font-size:12px; color:#666;">({len(overdue_invoices)} Invoice)</span>
- </li>
- </ul>
+ <p><b>Informasi Tambahan:</b></p>
+ <ul style="font-size:12px; color:#333; line-height:1.4; margin:0; padding-left:0; list-style-position:inside;">
+ <li>Kredit Limit Anda: {formatLang(self.env, blocking_limit, currency_obj=currency)}</li>
+ <li>Status Detail Tempo: {partner.property_payment_term_id.name or 'Review'}</li>
+ <li style="color:{'red' if (blocking_limit - outstanding_amount) < 0 else 'green'};">
+ Sisa Kredit Limit: {formatLang(self.env, blocking_limit - outstanding_amount, currency_obj=currency)}
+ </li>
+ <li style="color:red;">
+ Kredit Limit Terpakai: {formatLang(self.env, outstanding_amount, currency_obj=currency)}
+ <span style="font-size:12px; color:#666;">({len(outstanding_invoices)} Transaksi)</span>
+ </li>
+ <li style="color:red;">
+ Jatuh Tempo: {formatLang(self.env, overdue_amount, currency_obj=currency)}
+ <span style="font-size:12px; color:#666;">({len(overdue_invoices)} Invoice)</span>
+ </li>
+ </ul>
+ <p style="margin-top:10px;">
+ <a href="{tempo_link or '#'}"
+ style="display:inline-block; padding:8px 16px;
+ background-color:#007bff; color:#fff; text-decoration:none;
+ border-radius:4px; font-size:12px;">
+ Cek Selengkapnya
+ </a>
+ </p>
"""
days_to_due_message = ""