/var/www/greso.tech/server/nsm/responseModels/report
Edit: /var/www/greso.tech/server/nsm/responseModels/report/salemanPerformanceList.model.js (1092B)
module.exports = class SalemanPerformanceListModel {
constructor({ rows, time, page, limit, count }) {
this.cols = {
id: "",
name: "Sales Representative",
totalIn: "Total in",
emailsSent: "E-mails SENT",
estimatesSent: "Quote / Estimates SENT",
booked: "Booked",
local: "Local",
long: "Long",
canceled: "",
bookedEstimatesSum: "Booked Etimates $",
customerPayments: "Cusotmer Payments $",
refund: "Refund $",
}
this.list = rows
? rows.map((item) => {
const { id, name, totalIn, emailsSent, estimatesSent, booked, local, long, canceled, bookedEstimatesSum, customerPayments, refund } = item
return {
id,
name,
totalIn,
emailsSent,
estimatesSent,
booked,
local,
long,
canceled,
bookedEstimatesSum: bookedEstimatesSum.toFixed(2),
customerPayments: customerPayments.toFixed(2),
refund: refund.toFixed(2),
}
})
: []
this.count = count || 0
this.page = page ? page : 1
this.limit = limit ? limit : 1
this.time = time ? time : 0
}
}