From 2e04304945dcaf580ba26ff6c6b23c2ada5bc853 Mon Sep 17 00:00:00 2001 From: Andres Bolocco Date: Mon, 22 Jun 2020 16:10:30 -0300 Subject: [PATCH] srp bill_amount extraction fix --- lib/documentTypes/srpBill.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/documentTypes/srpBill.js b/lib/documentTypes/srpBill.js index ce04825..a197e37 100644 --- a/lib/documentTypes/srpBill.js +++ b/lib/documentTypes/srpBill.js @@ -56,7 +56,10 @@ module.exports = { const [city, state, zip_code] = cityStateZipCodeLine; // bill amount - const bill_amount = keyValues['This Month\'s Charges']; + let bill_amount = keyValues['PLEASE PAY']; + if(!bill_amount || !bill_amount.length) { + bill_amount = keyValues['This Month\'s Charges']; + } // bill date const bill_date = rawText.slice(-15).find((line) => line.match(/^\w+ \d+, \d+$/g));