Merge branch 'feature/pbs' into release/2021-10-22
This commit is contained in:
@@ -199,7 +199,7 @@ export function AccountingReceivablesTableComponent({
|
||||
<Card
|
||||
extra={
|
||||
<Space wrap>
|
||||
{!bodyshop.cdk_dealerid && (
|
||||
{!bodyshop.cdk_dealerid && !bodyshop.pbs_serialnumber && (
|
||||
<JobsExportAllButton
|
||||
jobIds={selectedJobs}
|
||||
disabled={transInProgress || selectedJobs.length === 0}
|
||||
|
||||
@@ -37,7 +37,7 @@ export function JobsCloseExportButton({
|
||||
|
||||
const handleQbxml = async () => {
|
||||
//Check if it's a CDK setup.
|
||||
if (bodyshop.cdk_dealerid) {
|
||||
if (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) {
|
||||
history.push(`/manage/dms?jobId=${jobId}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,6 +203,14 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
</LayoutFormRow>
|
||||
</>
|
||||
)}
|
||||
|
||||
{bodyshop.pbs_serialnumber && (
|
||||
<>
|
||||
<DataLabel label={t("bodyshop.labels.dms.pbs_serialnumber")}>
|
||||
{form.getFieldValue("pbs_serialnumber")}
|
||||
</DataLabel>
|
||||
</>
|
||||
)}
|
||||
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.costs")}>
|
||||
<Form.List name={["md_responsibility_centers", "costs"]}>
|
||||
{(fields, { add, remove }) => {
|
||||
|
||||
@@ -96,6 +96,8 @@ export const QUERY_BODYSHOP = gql`
|
||||
cdk_configuration
|
||||
md_estimators
|
||||
md_ded_notes
|
||||
pbs_configuration
|
||||
pbs_serialnumber
|
||||
employees {
|
||||
id
|
||||
active
|
||||
@@ -188,6 +190,8 @@ export const UPDATE_SHOP = gql`
|
||||
cdk_configuration
|
||||
md_estimators
|
||||
md_ded_notes
|
||||
pbs_configuration
|
||||
pbs_serialnumber
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."bodyshops" add column "pbs_configuration" jsonb
|
||||
-- null default jsonb_build_object();
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."bodyshops" add column "pbs_configuration" jsonb
|
||||
null default jsonb_build_object();
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."bodyshops" add column "pbs_serialnumber" text
|
||||
-- null;
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."bodyshops" add column "pbs_serialnumber" text
|
||||
null;
|
||||
21
server/accounting/pbs/pbs-constants.js
Normal file
21
server/accounting/pbs/pbs-constants.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const path = require("path");
|
||||
require("dotenv").config({
|
||||
path: path.resolve(
|
||||
process.cwd(),
|
||||
`.env.${process.env.NODE_ENV || "development"}`
|
||||
),
|
||||
});
|
||||
const CdkBase = require("../web-sockets/web-socket");
|
||||
|
||||
const IMEX_PBS_USER = process.env.IMEX_PBS_USER,
|
||||
IMEX_PBS_PASSWORD = process.env.IMEX_PBS_PASSWORD;
|
||||
const PBS_CREDENTIALS = {
|
||||
password: IMEX_PBS_PASSWORD,
|
||||
username: IMEX_PBS_USER,
|
||||
};
|
||||
|
||||
exports.PBS_CREDENTIALS = PBS_CREDENTIALS;
|
||||
// const cdkDomain =
|
||||
// process.env.NODE_ENV === "production"
|
||||
// ? "https://3pa.dmotorworks.com"
|
||||
// : "https://uat-3pa.dmotorworks.com";
|
||||
35
server/accounting/pbs/pbs-job-export.js
Normal file
35
server/accounting/pbs/pbs-job-export.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const path = require("path");
|
||||
require("dotenv").config({
|
||||
path: path.resolve(
|
||||
process.cwd(),
|
||||
`.env.${process.env.NODE_ENV || "development"}`
|
||||
),
|
||||
});
|
||||
const GraphQLClient = require("graphql-request").GraphQLClient;
|
||||
const soap = require("soap");
|
||||
const queries = require("../../graphql-client/queries");
|
||||
const CdkBase = require("../../web-sockets/web-socket");
|
||||
|
||||
//const { CDK_CREDENTIALS, CheckCdkResponseForError } = require("./cdk-wsdl");
|
||||
//const CalcualteAllocations = require("./cdk-calculate-allocations").default;
|
||||
|
||||
const moment = require("moment");
|
||||
|
||||
exports.default = async function (socket, jobid) {
|
||||
socket.logEvents = [];
|
||||
socket.recordid = jobid;
|
||||
|
||||
try {
|
||||
CdkBase.createLogEvent(
|
||||
socket,
|
||||
"DEBUG",
|
||||
`Received Job export request for id ${jobid}`
|
||||
);
|
||||
} catch (error) {
|
||||
CdkBase.createLogEvent(
|
||||
socket,
|
||||
"ERROR",
|
||||
`Error encountered in PbsJobExport. ${error}`
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -17,6 +17,7 @@ const CdkCalculateAllocations =
|
||||
require("../cdk/cdk-calculate-allocations").default;
|
||||
const { isArray } = require("lodash");
|
||||
const logger = require("../utils/logger");
|
||||
const PbsExportJob = require("../accounting/pbs/pbs-job-export");
|
||||
|
||||
io.use(function (socket, next) {
|
||||
try {
|
||||
@@ -57,6 +58,7 @@ io.on("connection", (socket) => {
|
||||
});
|
||||
});
|
||||
|
||||
///CDK
|
||||
socket.on("cdk-export-job", (jobid) => {
|
||||
CdkJobExport(socket, jobid);
|
||||
});
|
||||
@@ -94,6 +96,13 @@ io.on("connection", (socket) => {
|
||||
|
||||
callback(allocations);
|
||||
});
|
||||
//END CDK
|
||||
|
||||
//PBS
|
||||
socket.on("pbs-export-job", (jobid) => {
|
||||
PbsExportJob(socket, jobid);
|
||||
});
|
||||
//End PBS
|
||||
|
||||
socket.on("disconnect", () => {
|
||||
createLogEvent(socket, "DEBUG", `User disconnected.`);
|
||||
|
||||
Reference in New Issue
Block a user