diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-09-15 14:05:29 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-09-15 14:05:29 +0700 |
| commit | c9435b15e1e4f72d4b98fb9ba3719748da5c6953 (patch) | |
| tree | 5164c5c648525c046a9c407f0a72b4d35ac7c916 /vit_efaktur/wizard | |
| parent | 8f3d096dbae18bacd95796d03b17d4d94a806c85 (diff) | |
fix different dpp from header with line
Diffstat (limited to 'vit_efaktur/wizard')
| -rwxr-xr-x | vit_efaktur/wizard/pk.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vit_efaktur/wizard/pk.py b/vit_efaktur/wizard/pk.py index 752af61..1bb591b 100755 --- a/vit_efaktur/wizard/pk.py +++ b/vit_efaktur/wizard/pk.py @@ -230,12 +230,21 @@ class efaktur_pk_wizard(models.TransientModel): # d = inv['invoice_date'].split("-") # invoice_date = "%s/%s/%s" %(d[2],d[1],d[0]) + invno = inv['name'] invoice_date = inv['invoice_date'].strftime("%d/%m/%Y") npwp = partner_id.npwp.replace(".","").replace("-","") faktur = inv['efaktur_id'][1].replace(".","").replace("-","") + sum_dpp_line = 0 + for line in inv['invoice_line_ids']: + if not line['product_id']: + continue + sum_dpp_line += round(line['price_subtotal']) + + print ("Invoice No ", invno) print ("Tax ", inv['amount_tax']) - print ("DPP ", inv['amount_untaxed']) + # print ("DPP ", inv['amount_untaxed']) + print("DPP ", sum_dpp_line) print ("Tax Round ", round(inv['amount_tax'])) print ("DPP Round ", round(inv['amount_untaxed'])) |
