docparse-supplier-nge
Version:
process ngrid electric utility bill data for use in the docparse system
12 lines • 405 B
JavaScript
var Supplier = require('docparse-supplier');
module.exports = function(supplierCode, cb) {
if (!cb) {
cb = supplierCode;
return cb('no supplierCode provided');
}
Supplier.find({supplier_code: supplierCode}, function (err, reply) {
if (err) { return cb(err); }
if (!reply) { return cb('no supplier found with the given supplier code: ' + supplierCode); }
cb(null, reply);
});
};