Commit 23464452 by Owo Sugiana

Perubahan invoice profile

1 parent c0a653d2
0.1 4-11-2021 0.1 29-11-2021
------------- --------------
- Kali pertama - Kali pertama
...@@ -19,27 +19,29 @@ from bpd_sultra.structure import ( ...@@ -19,27 +19,29 @@ from bpd_sultra.structure import (
from bpd_sultra.pbb import WebClient as BaseWebClient from bpd_sultra.pbb import WebClient as BaseWebClient
NUM_FIELDS = [ PROFILE_FIELDS = [
('JML_POKOK', 'Pok'), ('NOP', 'NOP', False),
('JML_DENDA', 'Den')] ('THN_PAJAK', 'Tahun', False),
('NAMA_WP', 'Nama', False),
STR_FIELDS = ['ALAMAT_WP', 'KELURAHAN_WP'] ('KELURAHAN_WP', 'Kelurahan', False),
('ALAMAT_WP', 'Alamat', False),
('JML_POKOK', 'Pokok', True),
('JML_DENDA', 'Denda', True)]
def profile2name(resp): def profile2name(resp):
invoice_id = 'NOP {} Tahun {}'.format(resp['NOP'], resp['THN_PAJAK']) msg = []
msg = [invoice_id, resp['NAMA_WP']] for field, label, is_num in PROFILE_FIELDS:
for field, label in NUM_FIELDS: val = resp[field]
s = resp[field] if is_num:
if s: if not val:
msg.append(f'{label} {s}') val = '0'
for field in STR_FIELDS: elif val:
s = resp[field] val = val.replace(':', ' ').replace('_', ' ')
if s: else:
if field == 'ALAMAT_OP': val = '-'
s = s.replace(':', ' ') msg.append(f'{label}_{val}')
msg.append(s) return '_'.join(msg)
return ', '.join(msg)
class WebClient(BaseWebClient): class WebClient(BaseWebClient):
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!