Merged in release/2023-05-05 (pull request #744)

Release/2023 05 05
This commit is contained in:
Allan Carr
2023-05-03 17:10:48 +00:00
committed by Patrick Fic
8 changed files with 12 additions and 5 deletions

View File

@@ -0,0 +1,3 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE INDEX idx_associations_active_true ON associations(active) WHERE active = true;

View File

@@ -0,0 +1 @@
CREATE INDEX idx_associations_active_true ON associations(active) WHERE active = true;

View File

@@ -0,0 +1 @@
DROP INDEX IF EXISTS "public"."idx_associations_shopid_user";

View File

@@ -0,0 +1,2 @@
CREATE INDEX "idx_associations_shopid_user" on
"public"."associations" using btree ("shopid", "useremail", "active");

View File

@@ -164,7 +164,7 @@ async function PbsCalculateAllocationsAp(socket, billids) {
let APAmount = Dinero();
Object.keys(billHash).map((key) => {
if (billHash[key].Amount.getAmount() > 0) {
if (billHash[key].Amount.getAmount() > 0 || billHash[key].Amount.getAmount() < 0) {
transactionObject.Posting.Lines.push({
...billHash[key],
Amount: billHash[key].Amount.toFormat("0.00"),

View File

@@ -772,7 +772,7 @@ const CreateCosts = (job) => {
billTotalsByCostCenters[
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
] = Dinero({
amount: (job.mixdata[0] && job.mixdata[0].totalliquidcost * 100) || 0,
amount: Math.round((job.mixdata[0] && job.mixdata[0].totalliquidcost || 0) * 100)
});
} else {
billTotalsByCostCenters[
@@ -799,7 +799,7 @@ const CreateCosts = (job) => {
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mapa * 100) ||
0,
}).multiply(materialsHours.mapaHrs)
}).multiply(job.job_totals.rates.mapa.hours)
);
}
}

View File

@@ -28,7 +28,7 @@ exports.sendServerEmail = async function ({ subject, text }) {
transporter.sendMail(
{
from: `ImEX Online API - ${process.env.NODE_ENV} <noreply@imex.online>`,
to: ["patrick@imexsystems.ca"],
to: ["patrick@imexsystems.ca", "support@thinkimex.com"],
subject: subject,
text: text,
ses: {

View File

@@ -626,7 +626,7 @@ function GenerateCostingData(job) {
billTotalsByCostCenters.additionalCosts[
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
] = Dinero({
amount: (job.mixdata[0] && job.mixdata[0].totalliquidcost * 100) || 0,
amount: Math.round((job.mixdata[0] && job.mixdata[0].totalliquidcost || 0) * 100)
});
} else {
billTotalsByCostCenters.additionalCosts[