summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-07-13 08:57:29 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-07-13 08:57:29 +0000
commit94ff2a962740492614b5f1f09e690ef8dd0b2874 (patch)
tree52c231ad754c966f3517f08c4a03ad43fd2e155e /indoteknik_custom/models/account_move.py
parentb496b7907c60d8b262ddba42e55dd8485f718fce (diff)
parent5556e2b56a010c78bb79718679d0a0b5b3f780c3 (diff)
Merged in hotfix/revisi-due-extension (pull request #51)
Hotfix/revisi due extension
Diffstat (limited to 'indoteknik_custom/models/account_move.py')
-rw-r--r--indoteknik_custom/models/account_move.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index c2e93632..99439915 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -13,6 +13,8 @@ class AccountMove(models.Model):
resi_tukar_faktur = fields.Char(string='Resi Faktur')
date_terima_tukar_faktur = fields.Date(string='Terima Faktur')
shipper_faktur_id = fields.Many2one('delivery.carrier', string='Shipper Faktur')
+ due_extension = fields.Integer(string='Due Extension', default=0)
+ new_due_date = fields.Date(string='New Due')
def unlink(self):
res = super(AccountMove, self).unlink()
@@ -70,6 +72,8 @@ class AccountMove(models.Model):
invoice_day_to_due = 0
if invoice.payment_state not in ['paid', 'in_payment', 'reversed'] and invoice.invoice_date_due:
invoice_day_to_due = invoice.invoice_date_due - date.today()
+ if invoice.new_due_date:
+ invoice_day_to_due = invoice.new_due_date - date.today()
invoice_day_to_due = invoice_day_to_due.days
invoice.invoice_day_to_due = invoice_day_to_due