WIP PBS AP.
This commit is contained in:
@@ -22,6 +22,9 @@ const {
|
||||
PbsSelectedCustomer,
|
||||
} = require("../accounting/pbs/pbs-job-export");
|
||||
|
||||
const PbsCalculateAllocationsAp =
|
||||
require("../accounting/pbs/pbs-ap-allocations").default;
|
||||
|
||||
io.use(function (socket, next) {
|
||||
try {
|
||||
if (socket.handshake.auth.token) {
|
||||
@@ -101,7 +104,7 @@ io.on("connection", (socket) => {
|
||||
});
|
||||
//END CDK
|
||||
|
||||
//PBS
|
||||
//PBS AR
|
||||
socket.on("pbs-calculate-allocations", async (jobid, callback) => {
|
||||
const allocations = await CdkCalculateAllocations(socket, jobid);
|
||||
createLogEvent(socket, "DEBUG", `Allocations calculated.`);
|
||||
@@ -125,7 +128,21 @@ io.on("connection", (socket) => {
|
||||
socket.selectedCustomerId = selectedCustomerId;
|
||||
PbsSelectedCustomer(socket, selectedCustomerId);
|
||||
});
|
||||
//End PBS
|
||||
//End PBS AR
|
||||
|
||||
//PBS AP
|
||||
socket.on("pbs-calculate-allocations-ap", async (billids, callback) => {
|
||||
const allocations = await PbsCalculateAllocationsAp(socket, billids);
|
||||
createLogEvent(socket, "DEBUG", `AP Allocations calculated.`);
|
||||
createLogEvent(
|
||||
socket,
|
||||
"TRACE",
|
||||
`Allocations calculated. ${JSON.stringify(allocations, null, 2)}`
|
||||
);
|
||||
|
||||
callback(allocations);
|
||||
});
|
||||
//END PBS AP
|
||||
|
||||
socket.on("disconnect", () => {
|
||||
createLogEvent(socket, "DEBUG", `User disconnected.`);
|
||||
|
||||
Reference in New Issue
Block a user