Commit da1846f7cb2e53620b6a1871b5a0949a8adfe315

Authored by Adhidarma Hadiwinoto
1 parent 4f1375b5dc
Exists in master

Perbaikan deteksi keyval pada calculateBaseBillAmount

Showing 2 changed files with 8 additions and 3 deletions Inline Diff

1 "use strict"; 1 "use strict";
2 2
3 const regexLooperReplace = require('tektrans-lib/regex-looper/replace'); 3 const regexLooperReplace = require('tektrans-lib/regex-looper/replace');
4 const rcFromMsg = require('komodo-sdk/rc-from-msg'); 4 const rcFromMsg = require('komodo-sdk/rc-from-msg');
5 const organicRc = require('./rc'); 5 const organicRc = require('./rc');
6 6
7 function isInquiryResponseMessage(msg) { 7 function isInquiryResponseMessage(msg) {
8 return (msg || '').indexOf('CEK TAGIHAN') >= 0; 8 return (msg || '').indexOf('CEK TAGIHAN') >= 0;
9 } 9 }
10 10
11 function isPaymentResponseMessage(msg) { 11 function isPaymentResponseMessage(msg) {
12 return (msg || '').indexOf('BAYAR TAGIHAN') >= 0; 12 return (msg || '').indexOf('BAYAR TAGIHAN') >= 0;
13 } 13 }
14 14
15 function isPostpaidResponseMessage(msg) { 15 function isPostpaidResponseMessage(msg) {
16 return isInquiryResponseMessage(msg) || isPaymentResponseMessage(msg); 16 return isInquiryResponseMessage(msg) || isPaymentResponseMessage(msg);
17 } 17 }
18 18
19 function getRcFromMessage(msg, customRc) { 19 function getRcFromMessage(msg, customRc) {
20 let rc; 20 let rc;
21 if (customRc && Array.isArray(customRc) && customRc.length) { 21 if (customRc && Array.isArray(customRc) && customRc.length) {
22 rc = rcFromMsg(msg, customRc); 22 rc = rcFromMsg(msg, customRc);
23 } 23 }
24 24
25 if (!rc) { 25 if (!rc) {
26 rc = rcFromMsg(msg, organicRc); 26 rc = rcFromMsg(msg, organicRc);
27 } 27 }
28 28
29 return rc; 29 return rc;
30 } 30 }
31 31
32 function getPriceFromMessage(msg, rule) { 32 function getPriceFromMessage(msg, rule) {
33 if (typeof msg !== 'string') { 33 if (typeof msg !== 'string') {
34 return; 34 return;
35 } 35 }
36 36
37 if (process.env.DEBUG_IRS && !rule) { 37 if (process.env.DEBUG_IRS && !rule) {
38 console.log('** IRS.getPriceFromMessage no rule'); // eslint-disable-line no-console 38 console.log('** IRS.getPriceFromMessage no rule'); // eslint-disable-line no-console
39 } 39 }
40 40
41 if (process.env.DEBUG_IRS && rule) { 41 if (process.env.DEBUG_IRS && rule) {
42 console.log('** IRS.getPriceFromMessage rule: ' + JSON.stringify(rule, null, 2)); // eslint-disable-line no-console 42 console.log('** IRS.getPriceFromMessage rule: ' + JSON.stringify(rule, null, 2)); // eslint-disable-line no-console
43 } 43 }
44 44
45 //const pattern = (rule && typeof rule.pattern === 'string') ? rule.pattern : "Harga: ([\\d\\.]+?) "; 45 //const pattern = (rule && typeof rule.pattern === 'string') ? rule.pattern : "Harga: ([\\d\\.]+?) ";
46 const pattern = (rule && typeof rule.pattern === 'string') ? rule.pattern : "\\d+\\s+-\\s+([\\d,\\.]+)\\s+="; 46 const pattern = (rule && typeof rule.pattern === 'string') ? rule.pattern : "\\d+\\s+-\\s+([\\d,\\.]+)\\s+=";
47 const match_idx = (rule && typeof rule.match_idx === 'number') ? rule.match_idx : 1; 47 const match_idx = (rule && typeof rule.match_idx === 'number') ? rule.match_idx : 1;
48 48
49 const re = new RegExp(pattern); 49 const re = new RegExp(pattern);
50 const matches = msg.match(re); 50 const matches = msg.match(re);
51 if (process.env.DEBUG_IRS) { 51 if (process.env.DEBUG_IRS) {
52 console.log('** IRS.getPriceFromMessage msg: "' + msg + '" active_pattern: "' + pattern + '" active_match_idx: ' + match_idx); // eslint-disable-line no-console 52 console.log('** IRS.getPriceFromMessage msg: "' + msg + '" active_pattern: "' + pattern + '" active_match_idx: ' + match_idx); // eslint-disable-line no-console
53 console.log('** IRS.getPriceFromMessage matches:\n' + JSON.stringify(matches)); // eslint-disable-line no-console 53 console.log('** IRS.getPriceFromMessage matches:\n' + JSON.stringify(matches)); // eslint-disable-line no-console
54 } 54 }
55 55
56 if (matches && matches[match_idx]) { 56 if (matches && matches[match_idx]) {
57 const result = Number(matches[match_idx].replace(/\./g, '')); 57 const result = Number(matches[match_idx].replace(/\./g, ''));
58 if (process.env.DEBUG_IRS) { 58 if (process.env.DEBUG_IRS) {
59 console.log('** IRS.getPriceFromMessage SUPPLIER-PRICE: ' + result); // eslint-disable-line no-console 59 console.log('** IRS.getPriceFromMessage SUPPLIER-PRICE: ' + result); // eslint-disable-line no-console
60 } 60 }
61 return result; 61 return result;
62 } 62 }
63 } 63 }
64 64
65 function extractFromMessage(msg, rule) { 65 function extractFromMessage(msg, rule) {
66 if (typeof msg !== 'string') { return; } 66 if (typeof msg !== 'string') { return; }
67 67
68 if (!rule) { return; } 68 if (!rule) { return; }
69 69
70 if (typeof rule !== 'object') { 70 if (typeof rule !== 'object') {
71 return; 71 return;
72 } 72 }
73 73
74 rule.match_idx = Number(rule.match_idx); 74 rule.match_idx = Number(rule.match_idx);
75 75
76 if (!rule.match_idx) { 76 if (!rule.match_idx) {
77 rule.match_idx = 1; 77 rule.match_idx = 1;
78 } 78 }
79 79
80 const re = new RegExp(rule.pattern); 80 const re = new RegExp(rule.pattern);
81 const matches = msg.match(re); 81 const matches = msg.match(re);
82 if (matches && matches[rule.match_idx] && typeof matches[rule.match_idx] === 'string') { 82 if (matches && matches[rule.match_idx] && typeof matches[rule.match_idx] === 'string') {
83 return matches[rule.match_idx]; 83 return matches[rule.match_idx];
84 } 84 }
85 } 85 }
86 86
87 function getSnFromMessage(msg, rule) { 87 function getSnFromMessage(msg, rule) {
88 if (!rule) { 88 if (!rule) {
89 rule = { 89 rule = {
90 pattern: "[: ]S/*N:\\s*(.+?)\\s", 90 pattern: "[: ]S/*N:\\s*(.+?)\\s",
91 match_idx: 1 91 match_idx: 1
92 } 92 }
93 } 93 }
94 94
95 let sn = extractFromMessage(msg, rule); 95 let sn = extractFromMessage(msg, rule);
96 if (!sn || typeof sn !== 'string') { return; } 96 if (!sn || typeof sn !== 'string') { return; }
97 97
98 return sn.toUpperCase().replace(/[^a-zA-Z0-9:,/]/g, '-').replace(/-+/g, '-').replace(/-*\/-*/g, '/').replace(/^-+/, '').replace(/-+$/, ''); 98 return sn.toUpperCase().replace(/[^a-zA-Z0-9:,/]/g, '-').replace(/-+/g, '-').replace(/-*\/-*/g, '/').replace(/^-+/, '').replace(/-+$/, '');
99 } 99 }
100 100
101 function getBalanceFromMessage(msg, rule) { 101 function getBalanceFromMessage(msg, rule) {
102 if (!rule) { 102 if (!rule) {
103 rule = { 103 rule = {
104 pattern: "Saldo: .+? = ([\\d\\.]+) ", 104 pattern: "Saldo: .+? = ([\\d\\.]+) ",
105 match_idx: 1 105 match_idx: 1
106 } 106 }
107 } 107 }
108 108
109 let result = extractFromMessage(msg, rule); 109 let result = extractFromMessage(msg, rule);
110 if (!result || typeof result !== 'string') { return; } 110 if (!result || typeof result !== 'string') { return; }
111 111
112 return Number(result.replace(/\./g, '')); 112 return Number(result.replace(/\./g, ''));
113 } 113 }
114 114
115 function getDetailFromMessage(msg, rule, replacementRules) { 115 function getDetailFromMessage(msg, rule, replacementRules) {
116 if (!rule) { 116 if (!rule) {
117 rule = { 117 rule = {
118 pattern: " Detail:\\s*(.+?)\\s+Sisa [Ss]aldo", 118 pattern: " Detail:\\s*(.+?)\\s+Sisa [Ss]aldo",
119 match_idx: 1, 119 match_idx: 1,
120 } 120 }
121 } 121 }
122 122
123 return ( 123 return (
124 regexLooperReplace(extractFromMessage(msg, rule), replacementRules) || '' 124 regexLooperReplace(extractFromMessage(msg, rule), replacementRules) || ''
125 ).trim() || null; 125 ).trim() || null;
126 } 126 }
127 127
128 function splitPostpaidDetail(str) { 128 function splitPostpaidDetail(str) {
129 const retval = (str || '') 129 const retval = (str || '')
130 .split('/') 130 .split('/')
131 .map((item) => { 131 .map((item) => {
132 let [keyword, value] = item.split(':'); 132 let [keyword, value] = item.split(':');
133 keyword = (keyword || '').trim() 133 keyword = (keyword || '').trim()
134 134
135 if (keyword === 'N') keyword = 'SN'; 135 if (keyword === 'N') keyword = 'SN';
136 136
137 return { 137 return {
138 keyword, 138 keyword,
139 value: (value || '').trim(), 139 value: (value || '').trim(),
140 }; 140 };
141 }) 141 })
142 .filter((item) => item.keyword.length && item.value.length); 142 .filter((item) => item.keyword.length && item.value.length);
143 return retval; 143 return retval;
144 } 144 }
145 145
146 function calculateBaseBillAmountAuto(detailSplitted, customKeywords, productKeyval) { 146 function calculateBaseBillAmountAuto(detailSplitted, customKeywords, productKeyval) {
147 const tagihanAsliKeyvalKeywords = ((productKeyval && productKeyval.KEYWORD_TAGASLI) || '') 147 const tagihanAsliKeyvalKeywords = (productKeyval && productKeyval.KEYWORD_TAGASLI) ? productKeyval.KEYWORD_TAGASLI.split(/ *, */)
148 .split(/ *, */); 148 : null;
149 149
150 const keywords = (tagihanAsliKeyvalKeywords && Array.isArray(tagihanAsliKeyvalKeywords) && tagihanAsliKeyvalKeywords.length && tagihanAsliKeyvalKeywords) 150 const keywords = (tagihanAsliKeyvalKeywords && Array.isArray(tagihanAsliKeyvalKeywords) && tagihanAsliKeyvalKeywords.length && tagihanAsliKeyvalKeywords)
151 || customKeywords 151 || customKeywords
152 || ['TAGIHANASLI', 'TAGIHAN', 'DENDA', 'RPPREMI', 'BIAYA']; 152 || ['TAGIHANASLI', 'TAGIHAN', 'DENDA', 'RPPREMI', 'BIAYA'];
153 153
154 let retval = 0; 154 let retval = 0;
155 let detailCount = (detailSplitted || []).length; 155 let detailCount = (detailSplitted || []).length;
156 156
157 for (let i = 0; i < detailCount; i += 1) { 157 for (let i = 0; i < detailCount; i += 1) {
158 const item = detailSplitted[i]; 158 const item = detailSplitted[i];
159 if (keywords.indexOf(item.keyword.toUpperCase()) >= 0) { 159 if (keywords.indexOf(item.keyword.toUpperCase()) >= 0) {
160 const value = (item.value || '').trim().replace(/^rp */i, '').replace(/\./g, ''); 160 const value = (item.value || '').trim().replace(/^rp */i, '').replace(/\./g, '');
161 retval += Number(value) || 0; 161 retval += Number(value) || 0;
162 } 162 }
163 } 163 }
164 164
165 return retval; 165 return retval;
166 } 166 }
167 167
168 function calculateBaseBillAmount(detailSplitted, customKeywords, productKeyval, billCount) { 168 function calculateBaseBillAmount(detailSplitted, customKeywords, productKeyval, billCount) {
169 if ( 169 if (
170 !productKeyval 170 !productKeyval
171 || !Array.isArray(productKeyval) 171 || !Array.isArray(productKeyval)
172 || !productKeyval.KEYWORD_TOTALTAG 172 || !productKeyval.KEYWORD_TOTALTAG
173 || !productKeyval.KEYWORD_ADMINFEE 173 || !productKeyval.KEYWORD_ADMINFEE
174 ) { 174 ) {
175 return calculateBaseBillAmountAuto(detailSplitted, customKeywords, productKeyval, billCount); 175 return calculateBaseBillAmountAuto(detailSplitted, customKeywords, productKeyval, billCount);
176 } 176 }
177 177
178 const billCountOrDefault = billCount || 1; 178 const billCountOrDefault = billCount || 1;
179 179
180 const totalTagihanKeyword = productKeyval.KEYWORD_TOTALTAG; 180 const totalTagihanKeyword = productKeyval.KEYWORD_TOTALTAG;
181 if (!totalTagihanKeyword) return 0; 181 if (!totalTagihanKeyword) return 0;
182 182
183 const totalTagihanItem = detailSplitted.find((item) => (item.keyword || '').toUpperCase() === totalTagihanKeyword); 183 const totalTagihanItem = detailSplitted.find((item) => (item.keyword || '').toUpperCase() === totalTagihanKeyword);
184 const totalTagihanValue = Number((totalTagihanItem.value || '').trim().replace(/^rp */i, '').replace(/\./g, '')); 184 const totalTagihanValue = Number((totalTagihanItem.value || '').trim().replace(/^rp */i, '').replace(/\./g, ''));
185 if (!totalTagihanValue) return 0; 185 if (!totalTagihanValue) return 0;
186 186
187 const defaultAdminFee = Number(productKeyval.ADMINFEE || ''); 187 const defaultAdminFee = Number(productKeyval.ADMINFEE || '');
188 188
189 const adminFeeKeyword = productKeyval.KEYWORD_ADMINFEE; 189 const adminFeeKeyword = productKeyval.KEYWORD_ADMINFEE;
190 if (!adminFeeKeyword && defaultAdminFee) return totalTagihanValue - (defaultAdminFee * billCountOrDefault); 190 if (!adminFeeKeyword && defaultAdminFee) return totalTagihanValue - (defaultAdminFee * billCountOrDefault);
191 if (!adminFeeKeyword) return 0; 191 if (!adminFeeKeyword) return 0;
192 192
193 const adminFeeItem = detailSplitted.find((item) => (item.keyword || '').toUpperCase() === adminFeeKeyword); 193 const adminFeeItem = detailSplitted.find((item) => (item.keyword || '').toUpperCase() === adminFeeKeyword);
194 const adminFeeValue = Number((adminFeeItem.value || '').trim().replace(/^rp */i, '').replace(/\./g, '')); 194 const adminFeeValue = Number((adminFeeItem.value || '').trim().replace(/^rp */i, '').replace(/\./g, ''));
195 if (!adminFeeValue) return 0; 195 if (!adminFeeValue) return 0;
196 196
197 return totalTagihanValue - (adminFeeValue * billCountOrDefault); 197 return totalTagihanValue - (adminFeeValue * billCountOrDefault);
198 } 198 }
199 199
200 200
201 function getBillCount(msg) { 201 function getBillCount(msg) {
202 const matches = (msg || '').match(/JMLBLN:(\d+)BLN/); 202 const matches = (msg || '').match(/JMLBLN:(\d+)BLN/);
203 return (matches && Number(matches[1])) || null; 203 return (matches && Number(matches[1])) || null;
204 } 204 }
205 205
206 exports.getRcFromMessage = getRcFromMessage; 206 exports.getRcFromMessage = getRcFromMessage;
207 exports.getPriceFromMessage = getPriceFromMessage; 207 exports.getPriceFromMessage = getPriceFromMessage;
208 exports.getSnFromMessage = getSnFromMessage; 208 exports.getSnFromMessage = getSnFromMessage;
209 exports.getBalanceFromMessage = getBalanceFromMessage; 209 exports.getBalanceFromMessage = getBalanceFromMessage;
210 exports.isInquiryResponseMessage = isInquiryResponseMessage; 210 exports.isInquiryResponseMessage = isInquiryResponseMessage;
211 exports.isPaymentResponseMessage = isPaymentResponseMessage; 211 exports.isPaymentResponseMessage = isPaymentResponseMessage;
212 exports.isPostpaidResponseMessage = isPostpaidResponseMessage; 212 exports.isPostpaidResponseMessage = isPostpaidResponseMessage;
213 exports.getDetailFromMessage = getDetailFromMessage; 213 exports.getDetailFromMessage = getDetailFromMessage;
214 exports.splitPostpaidDetail = splitPostpaidDetail; 214 exports.splitPostpaidDetail = splitPostpaidDetail;
215 exports.calculateBaseBillAmount = calculateBaseBillAmount; 215 exports.calculateBaseBillAmount = calculateBaseBillAmount;
216 exports.getBillCount = getBillCount; 216 exports.getBillCount = getBillCount;
217 217
1 /* eslint-disable no-console */
1 /* global describe it */ 2 /* global describe it */
2 3
3 //process.env.KOMODO_SDK_DEBUG_RC_FROM_MSG = 'YES'; 4 //process.env.KOMODO_SDK_DEBUG_RC_FROM_MSG = 'YES';
4 5
5 const should = require('should'); 6 const should = require('should');
6 const irs = require('../index'); 7 const irs = require('../index');
7 8
8 describe('#irs', function() { 9 describe('#irs', function() {
9 describe('#getRcFromMessage', function() { 10 describe('#getRcFromMessage', function() {
10 it('should return correct rc', function() { 11 it('should return correct rc', function() {
11 irs.getRcFromMessage('Request IBP25 ke 085736328877 under proses..').should.equal('68'); 12 irs.getRcFromMessage('Request IBP25 ke 085736328877 under proses..').should.equal('68');
12 irs.getRcFromMessage('Transaksi HX5 ke 081809903333 GAGAL. Mohon periksa kembali No tujuan sebelum di ulang. Saldo: Rp 26.857.538').should.equal('40'); 13 irs.getRcFromMessage('Transaksi HX5 ke 081809903333 GAGAL. Mohon periksa kembali No tujuan sebelum di ulang. Saldo: Rp 26.857.538').should.equal('40');
13 irs.getRcFromMessage('REFF#11538167 Trx IBP25.085736328877 BERHASIL,Harga: 24.475 SN: 503133415264594 Sisa Saldo: 1.169.227 - 24.475 = 1.144.752 @5/3/2018 1:34:13 PM').should.equal('00'); 14 irs.getRcFromMessage('REFF#11538167 Trx IBP25.085736328877 BERHASIL,Harga: 24.475 SN: 503133415264594 Sisa Saldo: 1.169.227 - 24.475 = 1.144.752 @5/3/2018 1:34:13 PM').should.equal('00');
14 15
15 irs.getRcFromMessage('REFF#1238 CEK TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail: NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041 Sisa Saldo: 180.318 - 0 = 180.318 @29/12/2017 9:48:16').should.equal('00', 'postpaid inquiry success'); 16 irs.getRcFromMessage('REFF#1238 CEK TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail: NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041 Sisa Saldo: 180.318 - 0 = 180.318 @29/12/2017 9:48:16').should.equal('00', 'postpaid inquiry success');
16 irs.getRcFromMessage('REFF#1239 BAYAR TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail:S/N:0BNS25G5043265250358/NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLNPERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALBAYAR:19041 Sisa Saldo: 180.318 - 17.741 = 162.577 @29/12/2017 9:48:41').should.equal('00', 'postpaid payment success'); 17 irs.getRcFromMessage('REFF#1239 BAYAR TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail:S/N:0BNS25G5043265250358/NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLNPERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALBAYAR:19041 Sisa Saldo: 180.318 - 17.741 = 162.577 @29/12/2017 9:48:41').should.equal('00', 'postpaid payment success');
17 18
18 irs.getRcFromMessage('Maaf Produk sedang gangguan').should.equal('90'); 19 irs.getRcFromMessage('Maaf Produk sedang gangguan').should.equal('90');
19 }); 20 });
20 }); 21 });
21 22
22 describe('#getPriceFromMessage', function() { 23 describe('#getPriceFromMessage', function() {
23 describe('#generic', function() { 24 describe('#generic', function() {
24 it('should return correct price', function() { 25 it('should return correct price', function() {
25 irs.getPriceFromMessage('REFF#11538167 Trx IBP25.085736328877 BERHASIL,Harga: 24.475 SN: 503133415264594 Sisa Saldo: 1.169.227 - 24.475 = 1.144.752 @5/3/2018 1:34:13 PM').should.equal(24475); 26 irs.getPriceFromMessage('REFF#11538167 Trx IBP25.085736328877 BERHASIL,Harga: 24.475 SN: 503133415264594 Sisa Saldo: 1.169.227 - 24.475 = 1.144.752 @5/3/2018 1:34:13 PM').should.equal(24475);
26 }); 27 });
27 28
28 it('should handle postpaid response', () => { 29 it('should handle postpaid response', () => {
29 irs.getPriceFromMessage('REFF#1238 CEK TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail: NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041 Sisa Saldo: 180.318 - 0 = 180.318 @29/12/2017 9:48:16').should.equal(0, 'postpaid inquiry succces'); 30 irs.getPriceFromMessage('REFF#1238 CEK TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail: NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041 Sisa Saldo: 180.318 - 0 = 180.318 @29/12/2017 9:48:16').should.equal(0, 'postpaid inquiry succces');
30 irs.getPriceFromMessage('REFF#1239 BAYAR TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail:S/N:0BNS25G5043265250358/NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLNPERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALBAYAR:19041 Sisa Saldo: 180.318 - 17.741 = 162.577 @29/12/2017 9:48:41').should.equal(17741, 'postpaid payment success'); 31 irs.getPriceFromMessage('REFF#1239 BAYAR TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail:S/N:0BNS25G5043265250358/NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLNPERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALBAYAR:19041 Sisa Saldo: 180.318 - 17.741 = 162.577 @29/12/2017 9:48:41').should.equal(17741, 'postpaid payment success');
31 irs.getPriceFromMessage('REFF#562126 BAYAR TAGIHAN PLN25 SUKSES IDPEL:172000147469 Detail:S/N: 0BNS25G5008509025529/NAMA:MASJID-NURUL-IMAN/DAYA:900/TARIF:S2/JMLBLN:1BLN/PERIODE:201912/METERKINI:19627/METERLALU:19428/TAGIHAN:79340/ADM:2500/DENDA:0/TOTALBAYAR:81840 Sisa Saldo: 1.000.000 - 79.540 = 920.460 @2019/12/20 19:49:21').should.equal(79540); 32 irs.getPriceFromMessage('REFF#562126 BAYAR TAGIHAN PLN25 SUKSES IDPEL:172000147469 Detail:S/N: 0BNS25G5008509025529/NAMA:MASJID-NURUL-IMAN/DAYA:900/TARIF:S2/JMLBLN:1BLN/PERIODE:201912/METERKINI:19627/METERLALU:19428/TAGIHAN:79340/ADM:2500/DENDA:0/TOTALBAYAR:81840 Sisa Saldo: 1.000.000 - 79.540 = 920.460 @2019/12/20 19:49:21').should.equal(79540);
32 }) 33 })
33 34
34 it('should handle missing price', function() { 35 it('should handle missing price', function() {
35 should.not.exist(irs.getPriceFromMessage('REFF#11538167 Trx IBP25.085736328877 BERHASIL, SN: 503133415264594 @5/3/2018 1:34:13 PM')); 36 should.not.exist(irs.getPriceFromMessage('REFF#11538167 Trx IBP25.085736328877 BERHASIL, SN: 503133415264594 @5/3/2018 1:34:13 PM'));
36 }); 37 });
37 }); 38 });
38 39
39 describe('#eflashtron', function() { 40 describe('#eflashtron', function() {
40 it('should return correct price', function() { 41 it('should return correct price', function() {
41 irs.getPriceFromMessage('Trx HT5.08989355280 BERHASIL. SN: 0608211002164754102. Sisa Saldo: 536.581 - 5.265 = 531.316 @08/06/2019 21:10:03 Komplen max. H+7').should.equal(5265); 42 irs.getPriceFromMessage('Trx HT5.08989355280 BERHASIL. SN: 0608211002164754102. Sisa Saldo: 536.581 - 5.265 = 531.316 @08/06/2019 21:10:03 Komplen max. H+7').should.equal(5265);
42 }); 43 });
43 }); 44 });
44 45
45 describe('#some suppliers', () => { 46 describe('#some suppliers', () => {
46 it('should return correct price', () => { 47 it('should return correct price', () => {
47 irs.getPriceFromMessage('Trx S10 085212341234 BERHASIL, Harga: 5.285 SN: 41002553325946 Saldo: 2.284.011 - 5.285 = 2.278.726 @24/06/2018 18:38:06') 48 irs.getPriceFromMessage('Trx S10 085212341234 BERHASIL, Harga: 5.285 SN: 41002553325946 Saldo: 2.284.011 - 5.285 = 2.278.726 @24/06/2018 18:38:06')
48 .should.equal(5285, 'tajir price'); 49 .should.equal(5285, 'tajir price');
49 }); 50 });
50 }); 51 });
51 52
52 describe('#custom', () => { 53 describe('#custom', () => {
53 it('should return correct price', () => { 54 it('should return correct price', () => {
54 const msg = 'HX5 No.087781522208 Berhasil SN:99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105'; 55 const msg = 'HX5 No.087781522208 Berhasil SN:99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105';
55 const rule = { 56 const rule = {
56 pattern: 'Saldo Anda (?:[\\d\\.]+) - Rp ([\\d\\.]+)', 57 pattern: 'Saldo Anda (?:[\\d\\.]+) - Rp ([\\d\\.]+)',
57 match_idx: 1, 58 match_idx: 1,
58 } 59 }
59 irs.getPriceFromMessage(msg, rule).should.equal(5525); 60 irs.getPriceFromMessage(msg, rule).should.equal(5525);
60 should.not.exists(irs.getPriceFromMessage('kosong', rule)); 61 should.not.exists(irs.getPriceFromMessage('kosong', rule));
61 }); 62 });
62 }) 63 })
63 }); 64 });
64 65
65 describe('#getBalanceFromMessage', () => { 66 describe('#getBalanceFromMessage', () => {
66 67
67 describe('#some suppliers', () => { 68 describe('#some suppliers', () => {
68 it('should return correct price', () => { 69 it('should return correct price', () => {
69 irs.getBalanceFromMessage('Trx S10 085212341234 BERHASIL, Harga: 5.285 SN: 41002553325946 Saldo: 2.284.011 - 5.285 = 2.278.726 @24/06/2018 18:38:06') 70 irs.getBalanceFromMessage('Trx S10 085212341234 BERHASIL, Harga: 5.285 SN: 41002553325946 Saldo: 2.284.011 - 5.285 = 2.278.726 @24/06/2018 18:38:06')
70 .should.equal(2278726, 'tajir balance'); 71 .should.equal(2278726, 'tajir balance');
71 }); 72 });
72 }); 73 });
73 74
74 75
75 describe('#custom', () => { 76 describe('#custom', () => {
76 it('should return correct price', () => { 77 it('should return correct price', () => {
77 const msg = 'HX5 No.087781522208 Berhasil SN:99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105'; 78 const msg = 'HX5 No.087781522208 Berhasil SN:99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105';
78 const rule = { 79 const rule = {
79 pattern: 'Saldo Anda (?:[\\d\\.]+) - Rp (?:[\\d\\.]+) = Rp ([\\d\\.]+)', 80 pattern: 'Saldo Anda (?:[\\d\\.]+) - Rp (?:[\\d\\.]+) = Rp ([\\d\\.]+)',
80 match_idx: 1, 81 match_idx: 1,
81 } 82 }
82 irs.getBalanceFromMessage(msg, rule).should.equal(490105); 83 irs.getBalanceFromMessage(msg, rule).should.equal(490105);
83 should.not.exists(irs.getBalanceFromMessage('kosong', rule)); 84 should.not.exists(irs.getBalanceFromMessage('kosong', rule));
84 }); 85 });
85 }) 86 })
86 }); 87 });
87 88
88 describe('#getSnFromMessage', () => { 89 describe('#getSnFromMessage', () => {
89 it('should return correct result', () => { 90 it('should return correct result', () => {
90 irs.getSnFromMessage('HX5 No.087781522208 Berhasil SN: 99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105').should.equal('99971113094584', 'SN: 99971113094584'); 91 irs.getSnFromMessage('HX5 No.087781522208 Berhasil SN: 99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105').should.equal('99971113094584', 'SN: 99971113094584');
91 irs.getSnFromMessage('HX5 No.087781522208 Berhasil SN:99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105').should.equal('99971113094584', 'SN:99971113094584'); 92 irs.getSnFromMessage('HX5 No.087781522208 Berhasil SN:99971113094584 Tgl 2019-13-11 12:31:47.Saldo Anda 495.630 - Rp 5.525 = Rp 490.105').should.equal('99971113094584', 'SN:99971113094584');
92 irs.getSnFromMessage('REFF#22955367 BAYAR TAGIHAN PLN25 SUKSES IDPEL:173300992349 Detail:S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560 Sisa Saldo: 40.653.798 - 140.960 = 40.512.838 @2019/11/28 11:44:36') 93 irs.getSnFromMessage('REFF#22955367 BAYAR TAGIHAN PLN25 SUKSES IDPEL:173300992349 Detail:S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560 Sisa Saldo: 40.653.798 - 140.960 = 40.512.838 @2019/11/28 11:44:36')
93 .should.equal('0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560', 'kiosbayar postpaid payment'); 94 .should.equal('0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560', 'kiosbayar postpaid payment');
94 }); 95 });
95 }); 96 });
96 97
97 describe('#getDetailFromMessage', () => { 98 describe('#getDetailFromMessage', () => {
98 it('should return correct result', () => { 99 it('should return correct result', () => {
99 irs.getDetailFromMessage('REFF#1238 CEK TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail: NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041 Sisa Saldo: 180.318 - 0 = 180.318 @29/12/2017 9:48:16') 100 irs.getDetailFromMessage('REFF#1238 CEK TAGIHAN PLN16 SUKSES IDPEL:538710624871 Detail: NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041 Sisa Saldo: 180.318 - 0 = 180.318 @29/12/2017 9:48:16')
100 .should.equal('NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041', 'postpaid inquiry success'); 101 .should.equal('NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041', 'postpaid inquiry success');
101 102
102 irs.getDetailFromMessage('REFF#22955367 BAYAR TAGIHAN PLN25 SUKSES IDPEL:173300992349 Detail:S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560 Sisa Saldo: 40.653.798 - 140.960 = 40.512.838 @2019/11/28 11:44:36') 103 irs.getDetailFromMessage('REFF#22955367 BAYAR TAGIHAN PLN25 SUKSES IDPEL:173300992349 Detail:S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560 Sisa Saldo: 40.653.798 - 140.960 = 40.512.838 @2019/11/28 11:44:36')
103 .should.equal('S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560', 'kiosbayar postpaid payment'); 104 .should.equal('S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560', 'kiosbayar postpaid payment');
104 105
105 irs.getDetailFromMessage('REFF#561744 CEK TAGIHAN PLN25 SUKSES IDPEL:172000147469 Detail: NAMA:MASJID-NURUL-IMAN/DAYA:900/TARIF:S2/JMLBLN:1BLN/PERIODE:201912/METERKINI:19627/METERLALU:19428/TAGIHAN:79340/ADM:2500/DENDA:0/TOTALTAGIHAN:81840 Sisa Saldo: 1.000.000 - 0 = 1.000.000 @2019/12/20 19:41:21') 106 irs.getDetailFromMessage('REFF#561744 CEK TAGIHAN PLN25 SUKSES IDPEL:172000147469 Detail: NAMA:MASJID-NURUL-IMAN/DAYA:900/TARIF:S2/JMLBLN:1BLN/PERIODE:201912/METERKINI:19627/METERLALU:19428/TAGIHAN:79340/ADM:2500/DENDA:0/TOTALTAGIHAN:81840 Sisa Saldo: 1.000.000 - 0 = 1.000.000 @2019/12/20 19:41:21')
106 .should.equal('NAMA:MASJID-NURUL-IMAN/DAYA:900/TARIF:S2/JMLBLN:1BLN/PERIODE:201912/METERKINI:19627/METERLALU:19428/TAGIHAN:79340/ADM:2500/DENDA:0/TOTALTAGIHAN:81840'); 107 .should.equal('NAMA:MASJID-NURUL-IMAN/DAYA:900/TARIF:S2/JMLBLN:1BLN/PERIODE:201912/METERKINI:19627/METERLALU:19428/TAGIHAN:79340/ADM:2500/DENDA:0/TOTALTAGIHAN:81840');
107 }); 108 });
108 109
109 it('should return correct result with custom pattern', () => { 110 it('should return correct result with custom pattern', () => {
110 irs.getDetailFromMessage( 111 irs.getDetailFromMessage(
111 'Cek Tagihan PLN SUKSES ke 520550410074, REFID: 520550410074/MASJID.. KATEGORI:S2/900 , PERIODE:092020, JUMLAH:1, TOTAL TAGIHAN : 72.010', 112 'Cek Tagihan PLN SUKSES ke 520550410074, REFID: 520550410074/MASJID.. KATEGORI:S2/900 , PERIODE:092020, JUMLAH:1, TOTAL TAGIHAN : 72.010',
112 { 113 {
113 pattern: '(REFID: .*)$', 114 pattern: '(REFID: .*)$',
114 match_idx: 1, 115 match_idx: 1,
115 }, 116 },
116 [ 117 [
117 { 118 {
118 pattern: ' *\\.\\.+ *', 119 pattern: ' *\\.\\.+ *',
119 replacement: '/', 120 replacement: '/',
120 flags: 'g', 121 flags: 'g',
121 }, 122 },
122 { 123 {
123 pattern: ' *, *', 124 pattern: ' *, *',
124 replacement: '/', 125 replacement: '/',
125 flags: 'g', 126 flags: 'g',
126 }, 127 },
127 { 128 {
128 pattern: ' *: *', 129 pattern: ' *: *',
129 replacement: ':', 130 replacement: ':',
130 flags: 'g', 131 flags: 'g',
131 }, 132 },
132 { 133 {
133 pattern: 'TOTAL TAGIHAN*', 134 pattern: 'TOTAL TAGIHAN*',
134 replacement: 'TOTALTAGIHAN', 135 replacement: 'TOTALTAGIHAN',
135 }, 136 },
136 ] 137 ]
137 ) 138 )
138 .should.equal('REFID:520550410074/MASJID/KATEGORI:S2/900/PERIODE:092020/JUMLAH:1/TOTALTAGIHAN:72.010', 'TAJIRA PLN POSTPAID'); 139 .should.equal('REFID:520550410074/MASJID/KATEGORI:S2/900/PERIODE:092020/JUMLAH:1/TOTALTAGIHAN:72.010', 'TAJIRA PLN POSTPAID');
139 }); 140 });
140 }); 141 });
141 142
142 describe('#splitPostpaidDetail', () => { 143 describe('#splitPostpaidDetail', () => {
143 it('should return correct result - inquiry', () => { 144 it('should return correct result - inquiry', () => {
144 const detail = 'NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041'; 145 const detail = 'NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041';
145 const splitted = irs.splitPostpaidDetail(detail); 146 const splitted = irs.splitPostpaidDetail(detail);
146 147
147 splitted.should.ok(); 148 splitted.should.ok();
148 splitted.find((item) => item.keyword === 'NAMA').value.should.equal('MUSHOLLA-NURUL-KHOIR'); 149 splitted.find((item) => item.keyword === 'NAMA').value.should.equal('MUSHOLLA-NURUL-KHOIR');
149 splitted.find((item) => item.keyword === 'TAGIHAN').value.should.equal('14441'); 150 splitted.find((item) => item.keyword === 'TAGIHAN').value.should.equal('14441');
150 splitted.find((item) => item.keyword === 'DENDA').value.should.equal('3000'); 151 splitted.find((item) => item.keyword === 'DENDA').value.should.equal('3000');
151 }); 152 });
152 153
153 it('should return correct result - pay', () => { 154 it('should return correct result - pay', () => {
154 const detail = 'S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560'; 155 const detail = 'S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560';
155 const splitted = irs.splitPostpaidDetail(detail); 156 const splitted = irs.splitPostpaidDetail(detail);
156 157
157 splitted.should.ok(); 158 splitted.should.ok();
158 splitted.find((item) => item.keyword === 'SN').value.should.equal('0BNS25G5082152526173'); 159 splitted.find((item) => item.keyword === 'SN').value.should.equal('0BNS25G5082152526173');
159 splitted.find((item) => item.keyword === 'NAMA').value.should.equal('DONAR-HARHAP'); 160 splitted.find((item) => item.keyword === 'NAMA').value.should.equal('DONAR-HARHAP');
160 splitted.find((item) => item.keyword === 'TAGIHAN').value.should.equal('131560'); 161 splitted.find((item) => item.keyword === 'TAGIHAN').value.should.equal('131560');
161 splitted.find((item) => item.keyword === 'DENDA').value.should.equal('9000'); 162 splitted.find((item) => item.keyword === 'DENDA').value.should.equal('9000');
162 }); 163 });
163 }); 164 });
164 165
165 describe('#calculateBaseBillAmount', () => { 166 describe('#calculateBaseBillAmount', () => {
166 it('should return correct value - inquiry', () => { 167 it('should return correct value - inquiry', () => {
167 const detail = 'NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041'; 168 const detail = 'NAMA:MUSHOLLA-NURUL-KHOIR/DAYA:450/TARIF:S2/JMLBLN:1BLN/PERIODE:201712/METERKINI:18984/METERLALU:18932/TAGIHAN:14441/ADM:1600/DENDA:3000/TOTALTAGIHAN:19041';
168 const splitted = irs.splitPostpaidDetail(detail); 169 const splitted = irs.splitPostpaidDetail(detail);
169 170
170 irs.calculateBaseBillAmount(splitted).should.equal(17441); 171 irs.calculateBaseBillAmount(splitted).should.equal(17441);
171 172
172 }) 173 })
173 174
174 it('should return correct value - payment', () => { 175 it('should return correct value - payment', () => {
175 const detail = 'S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560'; 176 const detail = 'S/N: 0BNS25G5082152526173/NAMA:DONAR-HARHAP/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201910,201911/METERKINI:5508/METERLALU:5508/TAGIHAN:131560/ADM:5000/DENDA:9000/TOTALBAYAR:145560';
176 const splitted = irs.splitPostpaidDetail(detail); 177 const splitted = irs.splitPostpaidDetail(detail);
178
179 // console.log('--- DEBUG');
180 // console.log(splitted);
181 // console.log('---');
177 182
178 irs.calculateBaseBillAmount(splitted).should.equal(140560); 183 irs.calculateBaseBillAmount(splitted).should.equal(140560, '#2CBDCEB8');
179 184
180 }) 185 })
181 }); 186 });
182 187
183 describe('#getBillCount', () => { 188 describe('#getBillCount', () => {
184 it('should return correct value', () => { 189 it('should return correct value', () => {
185 irs.getBillCount('0BNS25G5087744307740/NAMA:SUYATMAN/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201911,201912/METERKINI:3606/METERLALU:3564/TAGIHAN:117260/ADM:5000/DENDA:9000/TOTALBAYAR:131260').should.equal(2); 190 irs.getBillCount('0BNS25G5087744307740/NAMA:SUYATMAN/DAYA:900/TARIF:R1M/JMLBLN:2BLN/PERIODE:201911,201912/METERKINI:3606/METERLALU:3564/TAGIHAN:117260/ADM:5000/DENDA:9000/TOTALBAYAR:131260').should.equal(2);
186 should.not.exists(irs.getBillCount('0BNS25G5087744307740/NAMA:SUYATMAN/DAYA:900/TARIF:R1M/JMLBLN:BLN/PERIODE:201911,201912/METERKINI:3606/METERLALU:3564/TAGIHAN:117260/ADM:5000/DENDA:9000/TOTALBAYAR:131260')); 191 should.not.exists(irs.getBillCount('0BNS25G5087744307740/NAMA:SUYATMAN/DAYA:900/TARIF:R1M/JMLBLN:BLN/PERIODE:201911,201912/METERKINI:3606/METERLALU:3564/TAGIHAN:117260/ADM:5000/DENDA:9000/TOTALBAYAR:131260'));
187 should.not.exists(irs.getBillCount('')); 192 should.not.exists(irs.getBillCount(''));
188 should.not.exists(irs.getBillCount()); 193 should.not.exists(irs.getBillCount());
189 }); 194 });
190 }); 195 });
191 }); 196 });