Compare commits
12 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92fd5b0315 | ||
|
|
be2df79555 | ||
|
|
9c733702e4 | ||
|
|
997aebddb0 | ||
|
|
17e3f39706 | ||
|
|
d90acf4b89 | ||
|
|
68dd7f33ab | ||
|
|
2a931181d1 | ||
|
|
1b08e4c54c | ||
|
|
4b419bf62b | ||
|
|
8decbf8874 | ||
|
|
4192c87a34 |
@@ -67,6 +67,7 @@ export function JobsDocumentsLocalGallery({
|
||||
src: val.thumbnail,
|
||||
height: val.thumbnailHeight,
|
||||
width: val.thumbnailWidth,
|
||||
tags: [{ value: val.filename, title: val.filename }],
|
||||
...(val.optimized && { src: val.optimized, fullsize: val.src })
|
||||
});
|
||||
if (val.optimized) optimized = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Checkbox } from "antd";
|
||||
import { Tag } from "antd";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
|
||||
/**
|
||||
@@ -187,6 +188,30 @@ export function LocalMediaGrid({
|
||||
transition: "opacity .25s ease"
|
||||
}}
|
||||
/>
|
||||
{img.tags && img.tags.length > 0 && (
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
padding: "2px 6px",
|
||||
borderRadius: "0 0 4px 4px",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
display: "flex",
|
||||
flexWrap: "wrap",
|
||||
gap: "4px"
|
||||
}}
|
||||
>
|
||||
{img.tags.map((tag, tagIdx) => (
|
||||
<Tag key={tagIdx} variant="outlined" color="gold" style={{ opacity: 0.8 }}>
|
||||
{tag.value || tag.title}
|
||||
</Tag>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
})()}
|
||||
|
||||
@@ -45,7 +45,7 @@ exports.default = async (req, res) => {
|
||||
|
||||
exports.refresh = async (oauthClient, req) => {
|
||||
try {
|
||||
// logger.log("qbo-token-refresh", "DEBUG", req.user.email, null, null);
|
||||
logger.log("qbo-token-refresh", "DEBUG", req.user.email, null, null);
|
||||
const authResponse = await oauthClient.refresh();
|
||||
await client.request(queries.SET_QBO_AUTH, {
|
||||
email: req.user.email,
|
||||
@@ -59,10 +59,12 @@ exports.refresh = async (oauthClient, req) => {
|
||||
};
|
||||
|
||||
exports.setNewRefreshToken = async (email, apiResponse) => {
|
||||
//logger.log("qbo-token-updated", "DEBUG", email, null, null);
|
||||
// Deprecated - tokens are now auto-updated in the oauthClient and the token isn't pushed back from QBO API calls anymore
|
||||
|
||||
await client.request(queries.SET_QBO_AUTH, {
|
||||
email,
|
||||
qbo_auth: { ...apiResponse.token, createdAt: Date.now() }
|
||||
});
|
||||
// logger.log("qbo-token-updated", "DEBUG", email, null, {apiResponse: apiResponse});
|
||||
|
||||
// await client.request(queries.SET_QBO_AUTH, {
|
||||
// email,
|
||||
// qbo_auth: { ...apiResponse.token, createdAt: Date.now() }
|
||||
// });
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const CdkBase = require("../web-sockets/web-socket");
|
||||
const { createLogEvent } = require("../web-sockets/createLogEvent");
|
||||
|
||||
const IMEX_CDK_USER = process.env.IMEX_CDK_USER,
|
||||
IMEX_CDK_PASSWORD = process.env.IMEX_CDK_PASSWORD;
|
||||
@@ -14,7 +14,7 @@ const cdkDomain =
|
||||
function CheckCdkResponseForError(socket, soapResponse) {
|
||||
if (!soapResponse[0]) {
|
||||
//The response was null, this might be ok, it might not.
|
||||
CdkBase.createLogEvent(
|
||||
createLogEvent(
|
||||
socket,
|
||||
"warn",
|
||||
`Warning detected in CDK Response - it appears to be null. Stack: ${new Error().stack}`
|
||||
@@ -43,11 +43,7 @@ function checkIndividualResult(socket, ResultToCheck) {
|
||||
//TODO: Verify that this is the best way to detect errors.
|
||||
return;
|
||||
else {
|
||||
CdkBase.createLogEvent(
|
||||
socket,
|
||||
"ERROR",
|
||||
`Error detected in CDK Response - ${JSON.stringify(ResultToCheck, null, 2)}`
|
||||
);
|
||||
createLogEvent(socket, "ERROR", `Error detected in CDK Response - ${JSON.stringify(ResultToCheck, null, 2)}`);
|
||||
|
||||
throw new Error(`Error found while validating CDK response for ${JSON.stringify(ResultToCheck, null, 2)}:`);
|
||||
}
|
||||
|
||||
@@ -304,6 +304,7 @@ function GenerateCostingData(job) {
|
||||
if (
|
||||
job.cieca_pfl &&
|
||||
job.cieca_pfl[val.mod_lbr_ty.toUpperCase()] &&
|
||||
typeof job.cieca_pfl[val.mod_lbr_ty.toUpperCase()].lbr_adjp === "number" &&
|
||||
job.cieca_pfl[val.mod_lbr_ty.toUpperCase()].lbr_adjp !== 0
|
||||
) {
|
||||
let adjp = 0;
|
||||
@@ -338,7 +339,7 @@ function GenerateCostingData(job) {
|
||||
if (!acc.labor[laborProfitCenter]) acc.labor[laborProfitCenter] = Dinero();
|
||||
acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(laborAmount);
|
||||
|
||||
if (val.mod_lb_hrs === 0 && val.act_price > 0 && val.lbr_op === "OP14") {
|
||||
if (val.act_price > 0 && val.lbr_op === "OP14") {
|
||||
//Scenario where SGI may pay out hours using a part price.
|
||||
acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(
|
||||
Dinero({
|
||||
@@ -469,10 +470,7 @@ function GenerateCostingData(job) {
|
||||
}
|
||||
|
||||
//Additional Profit Center
|
||||
if (
|
||||
(!val.part_type && !val.mod_lbr_ty) ||
|
||||
(!val.part_type && val.mod_lbr_ty && val.act_price > 0 && val.lbr_op !== "OP14")
|
||||
) {
|
||||
if ((!val.part_type && !val.mod_lbr_ty) || (!val.part_type && val.mod_lbr_ty && val.lbr_op !== "OP14")) {
|
||||
//Does it already have a defined profit center?
|
||||
//If so, use it, otherwise try to use the same from the auto-allocate logic in IO app jobs-close-auto-allocate.
|
||||
const partsProfitCenter = val.profitcenter_part || getAdditionalCostCenter(val, defaultProfits) || "Unknown";
|
||||
@@ -524,7 +522,12 @@ function GenerateCostingData(job) {
|
||||
}).multiply(materialsHours.mapaHrs || 0)
|
||||
);
|
||||
let adjp = 0;
|
||||
if (job.materials["MAPA"] && job.materials["MAPA"].mat_adjp) {
|
||||
if (
|
||||
job.materials["MAPA"] &&
|
||||
job.materials["MAPA"].mat_adjp &&
|
||||
typeof job.materials["MAPA"].mat_adjp === "number" &&
|
||||
job.materials["MAPA"].mat_adjp !== 0
|
||||
) {
|
||||
adjp =
|
||||
Math.abs(job.materials["MAPA"].mat_adjp) > 1
|
||||
? job.materials["MAPA"].mat_adjp
|
||||
@@ -551,7 +554,12 @@ function GenerateCostingData(job) {
|
||||
}).multiply(materialsHours.mashHrs || 0)
|
||||
);
|
||||
let adjp = 0;
|
||||
if (job.materials["MASH"] && job.materials["MASH"].mat_adjp) {
|
||||
if (
|
||||
job.materials["MASH"] &&
|
||||
job.materials["MASH"].mat_adjp &&
|
||||
typeof job.materials["MASH"].mat_adjp === "number" &&
|
||||
job.materials["MASH"].mat_adjp !== 0
|
||||
) {
|
||||
adjp =
|
||||
Math.abs(job.materials["MASH"].mat_adjp) > 1
|
||||
? job.materials["MASH"].mat_adjp
|
||||
@@ -575,7 +583,7 @@ function GenerateCostingData(job) {
|
||||
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = Dinero();
|
||||
|
||||
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = stlTowing
|
||||
? Dinero({ amount: Math.round(stlTowing.ttl_amt * 100) })
|
||||
? Dinero({ amount: Math.round((stlTowing.ttl_amt || 0) * 100) })
|
||||
: Dinero({
|
||||
amount: Math.round((job.towing_payable || 0) * 100)
|
||||
});
|
||||
@@ -584,7 +592,7 @@ function GenerateCostingData(job) {
|
||||
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = Dinero();
|
||||
|
||||
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = stlStorage
|
||||
? Dinero({ amount: Math.round(stlStorage.ttl_amt * 100) })
|
||||
? Dinero({ amount: Math.round((stlStorage.ttl_amt || 0) * 100) })
|
||||
: Dinero({
|
||||
amount: Math.round((job.storage_payable || 0) * 100)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user