Add notification of complete export.
This commit is contained in:
@@ -66,7 +66,13 @@ async function PbsCalculateAllocationsAp(socket, billids) {
|
||||
//Each bill will enter it's own top level transaction.
|
||||
|
||||
const transactionlist = [];
|
||||
|
||||
if (bills.length === 0) {
|
||||
CdkBase.createLogEvent(
|
||||
socket,
|
||||
"ERROR",
|
||||
`No bills found for export. Ensure they have not already been exported and try again.`
|
||||
);
|
||||
}
|
||||
bills.forEach((bill) => {
|
||||
//Keep the allocations at the bill level.
|
||||
|
||||
@@ -240,10 +246,15 @@ exports.PbsExportAp = async function (socket, { billids, txEnvelope }) {
|
||||
CdkBase.createLogEvent(socket, "DEBUG", `Marking bill as exported.`);
|
||||
await MarkApExported(socket, [billid]);
|
||||
|
||||
// socket.emit("export-success", billids);
|
||||
socket.emit("ap-export-success", billid);
|
||||
} else {
|
||||
CdkBase.createLogEvent(socket, "ERROR", `Export was not succesful.`);
|
||||
socket.emit("ap-export-failure", {
|
||||
billid,
|
||||
error: AccountPostingChange.Message,
|
||||
});
|
||||
}
|
||||
socket.emit("ap-export-complete");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1659,7 +1659,7 @@ query GET_PBS_AP_ALLOCATIONS($billids: [uuid!]) {
|
||||
pbs_serialnumber
|
||||
id
|
||||
}
|
||||
bills(where: {id: {_in: $billids}}) {
|
||||
bills(where: {id: {_in: $billids}, exported:{_eq: false}}) {
|
||||
id
|
||||
date
|
||||
isinhouse
|
||||
@@ -1692,6 +1692,4 @@ query GET_PBS_AP_ALLOCATIONS($billids: [uuid!]) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user