Merged in release/2022-11-10 (pull request #615)

PBS AP: skip posting of bills/wip for AR
This commit is contained in:
Patrick Fic
2022-11-07 22:23:14 +00:00
8 changed files with 89 additions and 20 deletions

View File

@@ -4213,6 +4213,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>disablebillwip</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>disablecontactvehiclecreation</name>
<definition_loaded>false</definition_loaded>
@@ -27556,6 +27577,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>disablebillwip</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>invoicedatefuture</name>
<definition_loaded>false</definition_loaded>

View File

@@ -1,4 +1,4 @@
import { Button, Card, Table, Typography } from "antd";
import { Alert, Button, Card, Table, Typography } from "antd";
import React, { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -90,6 +90,9 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
</Button>
}
>
{bodyshop.pbs_configuration?.disablebillwip && (
<Alert type="warning" message={t("jobs.labels.dms.disablebillwip")} />
)}
<Table
pagination={{ position: "top", defaultPageSize: 50 }}
columns={columns}

View File

@@ -148,6 +148,15 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
<Switch />
</Form.Item>
)}
{bodyshop.pbs_serialnumber && (
<Form.Item
label={t("bodyshop.fields.dms.disablebillwip")}
valuePropName="checked"
name={["pbs_configuration", "disablebillwip"]}
>
<Switch />
</Form.Item>
)}
</LayoutFormRow>
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
<Form.List name={["cdk_configuration", "payers"]}>

View File

@@ -264,6 +264,7 @@
"dms": {
"cashierid": "Cashier ID",
"default_journal": "Default Journal",
"disablebillwip": "Disable bill WIP for A/P Posting",
"disablecontactvehiclecreation": "Disable Contact & Vehicle Updates/Creation",
"dms_acctnumber": "DMS Account #",
"dms_wip_acctnumber": "DMS W.I.P. Account #",
@@ -1624,6 +1625,7 @@
"apexported": "AP export completed. See logs for details.",
"damageto": "Damage to $t(jobs.fields.area_of_damage_impact.{{area_of_damage}}).",
"defaultstory": "B/S RO: {{ro_number}}. Owner: {{ownr_nm}}. Insurance Co: {{ins_co_nm}}. Claim/PO #: {{clm_po}}",
"disablebillwip": "Cost and WIP for bills has been ignored per shop configuration.",
"invoicedatefuture": "Invoice date must be today or in the future for CDK posting.",
"kmoutnotgreaterthankmin": "Mileage out must be greater than mileage in.",
"logs": "Logs",

View File

@@ -264,6 +264,7 @@
"dms": {
"cashierid": "",
"default_journal": "",
"disablebillwip": "",
"disablecontactvehiclecreation": "",
"dms_acctnumber": "",
"dms_wip_acctnumber": "",
@@ -1624,6 +1625,7 @@
"apexported": "",
"damageto": "",
"defaultstory": "",
"disablebillwip": "",
"invoicedatefuture": "",
"kmoutnotgreaterthankmin": "",
"logs": "",

View File

@@ -264,6 +264,7 @@
"dms": {
"cashierid": "",
"default_journal": "",
"disablebillwip": "",
"disablecontactvehiclecreation": "",
"dms_acctnumber": "",
"dms_wip_acctnumber": "",
@@ -1624,6 +1625,7 @@
"apexported": "",
"damageto": "",
"defaultstory": "",
"disablebillwip": "",
"invoicedatefuture": "",
"kmoutnotgreaterthankmin": "",
"logs": "",

View File

@@ -118,26 +118,34 @@ exports.default = async function (socket, jobid) {
} for cost export.`
);
const costCenterHash = job.bills.reduce((bill_acc, bill_val) => {
bill_val.billlines.map((line_val) => {
if (!bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]])
let costCenterHash = {};
//Check whether to skip this if PBS and using AP module.
const disablebillwip = !!bodyshop?.pbs_configuration?.disablebillwip;
if (!disablebillwip) {
costCenterHash = job.bills.reduce((bill_acc, bill_val) => {
bill_val.billlines.map((line_val) => {
if (
!bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]]
)
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
Dinero();
let lineDinero = Dinero({
amount: Math.round((line_val.actual_cost || 0) * 100),
})
.multiply(line_val.quantity)
.multiply(bill_val.is_credit_memo ? -1 : 1);
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
Dinero();
let lineDinero = Dinero({
amount: Math.round((line_val.actual_cost || 0) * 100),
})
.multiply(line_val.quantity)
.multiply(bill_val.is_credit_memo ? -1 : 1);
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]].add(
lineDinero
);
return null;
});
return bill_acc;
}, {});
bill_acc[
selectedDmsAllocationConfig.costs[line_val.cost_center]
].add(lineDinero);
return null;
});
return bill_acc;
}, {});
}
job.timetickets.forEach((ticket) => {
//Get the total amount of the ticket.

View File

@@ -1351,6 +1351,7 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
id
md_responsibility_centers
cdk_configuration
pbs_configuration
}
ro_number
dms_allocation