Skip to content

Commit

Permalink
fixes aps bill amount
Browse files Browse the repository at this point in the history
  • Loading branch information
andobolocco committed Jun 19, 2020
1 parent 20f94f9 commit 666ffcc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/documentTypes/apsBill.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ module.exports = {
const [, city, state, zip_code] = matchedCityStateZip;

// bill amount
const bill_amount = keyValues[keys[stringSimilarity.findBestMatch(
'Total amount due:',
let bill_amount = keyValues[keys[stringSimilarity.findBestMatch(
'Total amount due',
keys,
).bestMatchIndex]];
if (!bill_amount || !bill_amount.length) {
bill_amount = keyValues[keys[stringSimilarity.findBestMatch(
'Total amount due:',
keys,
).bestMatchIndex]];
}

// bill date
let bill_date = keyValues[keys[stringSimilarity.findBestMatch(
'Payment due date',
keys,
).bestMatchIndex]];

if (!bill_date || !bill_date.length) {
bill_date = keyValues[keys[stringSimilarity.findBestMatch(
'Payment due date:',
Expand Down

0 comments on commit 666ffcc

Please sign in to comment.