Add job reconciliation & autohouse filtering.
This commit is contained in:
@@ -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.`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user