IO-1552 Autohouse include additional fields.
This commit is contained in:
@@ -113,6 +113,14 @@ exports.default = async (req, res) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for (const xmlObj of allxmlsToUpload) {
|
||||||
|
// fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// res.json(allxmlsToUpload);
|
||||||
|
// return;
|
||||||
|
|
||||||
let sftp = new Client();
|
let sftp = new Client();
|
||||||
sftp.on("error", (errors) =>
|
sftp.on("error", (errors) =>
|
||||||
logger.log("autohouse-sftp-error", "ERROR", "api", null, {
|
logger.log("autohouse-sftp-error", "ERROR", "api", null, {
|
||||||
@@ -744,7 +752,12 @@ const GenerateDetailLines = (line, statuses) => {
|
|||||||
IOUPart: 0,
|
IOUPart: 0,
|
||||||
LineNumber: line.line_no || 0,
|
LineNumber: line.line_no || 0,
|
||||||
MarkUp: null,
|
MarkUp: null,
|
||||||
OrderedOn: null,
|
OrderedOn:
|
||||||
|
(line.parts_order_lines[0] &&
|
||||||
|
moment(line.parts_order_lines[0].parts_order.order_date).format(
|
||||||
|
AhDateFormat
|
||||||
|
)) ||
|
||||||
|
"",
|
||||||
OriginalCost: null,
|
OriginalCost: null,
|
||||||
OriginalInvoiceNumber: null,
|
OriginalInvoiceNumber: null,
|
||||||
PriceEach: (line.billlines[0] && line.billlines[0].retail_price) || 0,
|
PriceEach: (line.billlines[0] && line.billlines[0].retail_price) || 0,
|
||||||
@@ -760,7 +773,9 @@ const GenerateDetailLines = (line, statuses) => {
|
|||||||
VendorPrice: (line.billlines[0] && line.billlines[0].actual_price) || 0,
|
VendorPrice: (line.billlines[0] && line.billlines[0].actual_price) || 0,
|
||||||
Deleted: null,
|
Deleted: null,
|
||||||
ExpectedOn: null,
|
ExpectedOn: null,
|
||||||
ReceivedOn: null,
|
ReceivedOn:
|
||||||
|
line.billlines[0] &&
|
||||||
|
moment(line.billlines[0].bill.date).format(AhDateFormat),
|
||||||
OrderedBy: null,
|
OrderedBy: null,
|
||||||
ShipVia: null,
|
ShipVia: null,
|
||||||
VendorContact: null,
|
VendorContact: null,
|
||||||
@@ -780,7 +795,7 @@ const generateNullDetailLine = () => {
|
|||||||
IOUPart: 0,
|
IOUPart: 0,
|
||||||
LineNumber: 0,
|
LineNumber: 0,
|
||||||
MarkUp: null,
|
MarkUp: null,
|
||||||
OrderedOn: null,
|
OrderedOn: "",
|
||||||
OriginalCost: null,
|
OriginalCost: null,
|
||||||
OriginalInvoiceNumber: null,
|
OriginalInvoiceNumber: null,
|
||||||
PriceEach: 0,
|
PriceEach: 0,
|
||||||
|
|||||||
@@ -642,7 +642,13 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
|||||||
lbr_op
|
lbr_op
|
||||||
profitcenter_part
|
profitcenter_part
|
||||||
profitcenter_labor
|
profitcenter_labor
|
||||||
billlines(order_by: {bill: {date: desc_nulls_last}}) {
|
parts_order_lines(order_by: {parts_order: {order_date: desc_nulls_last}} limit: 1){
|
||||||
|
parts_order{
|
||||||
|
id
|
||||||
|
order_date
|
||||||
|
}
|
||||||
|
}
|
||||||
|
billlines(order_by: {bill: {date: desc_nulls_last}} limit: 1) {
|
||||||
actual_cost
|
actual_cost
|
||||||
actual_price
|
actual_price
|
||||||
quantity
|
quantity
|
||||||
@@ -651,6 +657,7 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
|||||||
name
|
name
|
||||||
}
|
}
|
||||||
invoice_number
|
invoice_number
|
||||||
|
date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -695,8 +702,6 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports.ENTEGRAL_EXPORT = `
|
exports.ENTEGRAL_EXPORT = `
|
||||||
|
|||||||
Reference in New Issue
Block a user