docparse-supplier-nge
Version:
process ngrid electric utility bill data for use in the docparse system
23 lines (22 loc) • 668 B
JavaScript
/**
* First extract the total other cost value printed on the bill. Then iterate
* over all line item other charges and make sure they add up to the printed
* total
*/
var getOtherCostsText = require('./getOtherCostsText');
var processCostOtherText = require('./processCostOtherText');
var inspect = require('eyespect').inspector();
module.exports = function(text, callback) {
var otherCostsText = getOtherCostsText(text);
if (!otherCostsText) {
var no_output = {
total: '0',
costs: []
};
return callback(null, no_output);
}
var total_num;
var total_string;
var costs = [];
processCostOtherText(otherCostsText, callback);
};