UNPKG

theendsoaper

Version:

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

26 lines (24 loc) 1.09 kB
const Order = require('./active-tables-order'); module.exports = class Transaction { constructor(transaction){ this.id = transaction['Id']; this.openDateTime = transaction['OpenDateTime']; this.closeDateTime = transaction['CloseDateTime']; this.tranNumber = transaction['TranNumber']; this.tableNumber = transaction['TableNumber']; this.tablePart = transaction['TablePart']; this.covers = transaction['Covers']; this.userId = transaction['UserId']; this.discountOnTotal = transaction['DiscountOnTotal']; this.serviceCharge = transaction['ServiceCharge']; this.clientName = transaction['ClientName']; if(transaction['Orders'] !== undefined){ this.orders = new Order(transaction['Orders']); } this.bills = transaction['Bills']; this.proformas = transaction['Proformas']; this.billReprints = transaction['BillReprints']; this.extra = transaction['Extra']; this.clientId = transaction['ClientId']; } }