theendsoaper
Version:
Access Untill Tills with SOAP from Node.js and parse the results as objects, some extra useful functions in as well.
23 lines (22 loc) • 789 B
JavaScript
const ArticleItem = require('./articleitem');
const Printer = require('../printobject');
module.exports = class Item {
constructor(item) {
// console.log('making item');
this.id = item['Id'];
this.dateTime = item['DateTime'];
this.computerName = item['ComputerName'];
this.userId = item['UserId'];
this.salesAreaId = item['SalesAreaId'];
var list = [];
if (item['Items']['item'].length === undefined) {
list.push(new ArticleItem(item['Items']['item']));
} else {
for (var i in item['Items']['item']) {
list.push(new ArticleItem(item['Items']['item'][i]));
}
}
this.items = list;
this.extra = item['Extra'];
}
}