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> </translation>
</translations> </translations>
</concept_node> </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> <concept_node>
<name>disablecontactvehiclecreation</name> <name>disablecontactvehiclecreation</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>
@@ -27556,6 +27577,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </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> <concept_node>
<name>invoicedatefuture</name> <name>invoicedatefuture</name>
<definition_loaded>false</definition_loaded> <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 React, { useState, useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
@@ -90,6 +90,9 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
</Button> </Button>
} }
> >
{bodyshop.pbs_configuration?.disablebillwip && (
<Alert type="warning" message={t("jobs.labels.dms.disablebillwip")} />
)}
<Table <Table
pagination={{ position: "top", defaultPageSize: 50 }} pagination={{ position: "top", defaultPageSize: 50 }}
columns={columns} columns={columns}

View File

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

View File

@@ -264,6 +264,7 @@
"dms": { "dms": {
"cashierid": "Cashier ID", "cashierid": "Cashier ID",
"default_journal": "Default Journal", "default_journal": "Default Journal",
"disablebillwip": "Disable bill WIP for A/P Posting",
"disablecontactvehiclecreation": "Disable Contact & Vehicle Updates/Creation", "disablecontactvehiclecreation": "Disable Contact & Vehicle Updates/Creation",
"dms_acctnumber": "DMS Account #", "dms_acctnumber": "DMS Account #",
"dms_wip_acctnumber": "DMS W.I.P. Account #", "dms_wip_acctnumber": "DMS W.I.P. Account #",
@@ -1624,6 +1625,7 @@
"apexported": "AP export completed. See logs for details.", "apexported": "AP export completed. See logs for details.",
"damageto": "Damage to $t(jobs.fields.area_of_damage_impact.{{area_of_damage}}).", "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}}", "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.", "invoicedatefuture": "Invoice date must be today or in the future for CDK posting.",
"kmoutnotgreaterthankmin": "Mileage out must be greater than mileage in.", "kmoutnotgreaterthankmin": "Mileage out must be greater than mileage in.",
"logs": "Logs", "logs": "Logs",

View File

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

View File

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

View File

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