Commit 23464452 by Owo Sugiana

Perubahan invoice profile

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