UNPKG

theendsoaper

Version:

Access Untill Tills with SOAP from Node.js and parse the results as objects, some extra useful functions in as well.

25 lines (24 loc) 716 B
module.exports = class InOutItem { constructor(item){ this.id = item['Id']; this.dateTime = item['DateTime']; this.computerName = item['ComputerName']; this.userId = item['UserId']; if(item['Amount'] !== undefined){ this.amount = item['Amount']; } else { this.amount = 0; } if(item['Reason'] !== undefined){ this.reason = item['Reason']; } else { this.reason = ""; } if(item['Supplier'] !== undefined){ this.supplier = item['Supplier']; } else { this.supplier = ""; } this.extra = item['Extra']; } }