IO-1708 Add shop timezone & update server side calculations.
This commit is contained in:
@@ -14,9 +14,10 @@ const { PBS_ENDPOINTS, PBS_CREDENTIALS } = require("./pbs-constants");
|
||||
const CalculateAllocations =
|
||||
require("../../cdk/cdk-calculate-allocations").default;
|
||||
const CdkBase = require("../../web-sockets/web-socket");
|
||||
const moment = require("moment");
|
||||
const moment = require("moment-timezone");
|
||||
const Dinero = require("dinero.js");
|
||||
const axios = AxiosLib.create();
|
||||
|
||||
axios.interceptors.request.use((x) => {
|
||||
const socket = x.socket;
|
||||
|
||||
@@ -553,7 +554,9 @@ async function InsertAccountPostingData(socket) {
|
||||
//Comment: "String",
|
||||
//AdditionalInfo: "String",
|
||||
InvoiceNumber: socket.JobData.ro_number,
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced).toISOString(),
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced)
|
||||
.tz(socket.JobData.bodyshop.timezone)
|
||||
.toISOString(),
|
||||
};
|
||||
wips.push(item);
|
||||
}
|
||||
@@ -567,7 +570,9 @@ async function InsertAccountPostingData(socket) {
|
||||
//Comment: "String",
|
||||
//AdditionalInfo: "String",
|
||||
InvoiceNumber: socket.JobData.ro_number,
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced).toISOString(),
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced)
|
||||
.tz(socket.JobData.bodyshop.timezone)
|
||||
.toISOString(),
|
||||
};
|
||||
wips.push(item);
|
||||
|
||||
@@ -578,7 +583,9 @@ async function InsertAccountPostingData(socket) {
|
||||
//Comment: "String",
|
||||
//AdditionalInfo: "String",
|
||||
InvoiceNumber: socket.JobData.ro_number,
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced).toISOString(),
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced)
|
||||
.tz(socket.JobData.bodyshop.timezone)
|
||||
.toISOString(),
|
||||
};
|
||||
wips.push(itemWip);
|
||||
//Add to the WIP account.
|
||||
@@ -593,7 +600,9 @@ async function InsertAccountPostingData(socket) {
|
||||
//Comment: "String",
|
||||
//AdditionalInfo: "String",
|
||||
InvoiceNumber: socket.JobData.ro_number,
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced).toISOString(),
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced)
|
||||
.tz(socket.JobData.bodyshop.timezone)
|
||||
.toISOString(),
|
||||
};
|
||||
wips.push(item2);
|
||||
}
|
||||
@@ -609,7 +618,9 @@ async function InsertAccountPostingData(socket) {
|
||||
//Comment: "String",
|
||||
//AdditionalInfo: "String",
|
||||
InvoiceNumber: socket.JobData.ro_number,
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced).toISOString(),
|
||||
InvoiceDate: moment(socket.JobData.date_invoiced)
|
||||
.tz(socket.JobData.bodyshop.timezone)
|
||||
.toISOString(),
|
||||
};
|
||||
|
||||
wips.push(item);
|
||||
@@ -622,7 +633,9 @@ async function InsertAccountPostingData(socket) {
|
||||
Posting: {
|
||||
Reference: socket.JobData.ro_number,
|
||||
JournalCode: socket.txEnvelope.journal,
|
||||
TransactionDate: moment(socket.JobData.date_invoiced).toISOString(), //"0001-01-01T00:00:00.0000000Z",
|
||||
TransactionDate: moment(socket.JobData.date_invoiced)
|
||||
.tz(socket.JobData.bodyshop.timezone)
|
||||
.toISOString(), //"0001-01-01T00:00:00.0000000Z",
|
||||
Description: socket.txEnvelope.story,
|
||||
//AdditionalInfo: "String",
|
||||
Source: "ImEX Online",
|
||||
|
||||
Reference in New Issue
Block a user