Add job reconciliation & autohouse filtering.

This commit is contained in:
Patrick Fic
2022-06-24 09:45:11 -07:00
parent 623d407a6c
commit c07458babf
8 changed files with 66 additions and 5 deletions

View File

@@ -179,7 +179,6 @@ exports.default = async (req, res) => {
ret.push({ paymentid: payment.id, success: true });
} catch (error) {
logger.log("qbo-payment-create-error", "ERROR", req.user.email, {
error:
(error && error.authResponse && error.authResponse.body) ||
(error && error.message),
@@ -217,7 +216,10 @@ exports.default = async (req, res) => {
res.status(200).json(ret);
} catch (error) {
console.log(error);
logger.log("qbo-payment-create-error", "ERROR", req.user.email, { error: error.message, stack: error.stack });
logger.log("qbo-payment-create-error", "ERROR", req.user.email, {
error: error.message,
stack: error.stack,
});
res.status(400).json(error);
}
};
@@ -240,7 +242,7 @@ async function InsertPayment(
if (invoices && invoices.length !== 1) {
throw new Error(
`More than 1 invoice with DocNumber ${payment.ro_number} found.`
`More than 1 invoice with DocNumber ${payment.job.ro_number} found.`
);
}

View File

@@ -889,7 +889,7 @@ const GenerateDetailLines = (job, line, statuses) => {
OriginalCost: null,
OriginalInvoiceNumber: null,
PriceEach: line.act_price || 0,
PartNumber: _.escape(line.oem_partno),
PartNumber: _.escape(line.oem_partno.replace(/[^\x00-\x7F]/g, "")),
ProfitPercent: null,
PurchaseOrderNumber: null,
Qty: line.part_qty || 0,