Compare commits
16 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c97213bc96 | ||
|
|
9b1488ac3b | ||
|
|
7bab9bf4cb | ||
|
|
8278242e6f | ||
|
|
aa81cddcf1 | ||
|
|
85e60dcd6b | ||
|
|
a005f1bb45 | ||
|
|
f904fa4e18 | ||
|
|
27ffee0c7a | ||
|
|
187938286d | ||
|
|
6ad0272135 | ||
|
|
86db96f47d | ||
|
|
ac8c84543a | ||
|
|
78a2ff0fa1 | ||
|
|
dac1ed42df | ||
|
|
bc5f9f88d1 |
@@ -96,6 +96,7 @@ export function BillEnterModalLinesComponent({
|
||||
|
||||
// Only fill actual_cost when the user forward-tabs out of Retail (actual_price)
|
||||
const autofillActualCost = (index) => {
|
||||
if (bodyshop.accountingconfig?.disableBillCostCalculation) return;
|
||||
Promise.resolve().then(() => {
|
||||
const retailRaw = form.getFieldValue(["billlines", index, "actual_price"]);
|
||||
const actualRaw = form.getFieldValue(["billlines", index, "actual_cost"]);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { store } from "../../redux/store";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { TimeFormatter } from "../../utils/DateFormatter";
|
||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
||||
import { onlyUnique } from "../../utils/arrayHelper";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||
import { alphaSort, dateSort, statusSort } from "../../utils/sorters";
|
||||
@@ -28,6 +28,7 @@ import ProductionListColumnCategory from "./production-list-columns.status.categ
|
||||
import ProductionListColumnStatus from "./production-list-columns.status.component";
|
||||
import ProductionListColumnTouchTime from "./prodution-list-columns.touchtime.component";
|
||||
import ShareToTeamsButton from "../share-to-teams/share-to-teams.component.jsx";
|
||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component.jsx";
|
||||
|
||||
const getEmployeeName = (employeeId, employees) => {
|
||||
const employee = employees.find((e) => e.id === employeeId);
|
||||
@@ -271,14 +272,24 @@ const productionListColumnsData = ({ technician, state, activeStatuses, data, bo
|
||||
dataIndex: "ownr_ph1",
|
||||
key: "ownr_ph1",
|
||||
ellipsis: true,
|
||||
render: (text, record) => <PhoneFormatter type={record.ownr_ph1_ty}>{record.ownr_ph1}</PhoneFormatter>
|
||||
render: (text, record) =>
|
||||
technician ? (
|
||||
<PhoneNumberFormatter type={record.ownr_ph1_ty}>{record.ownr_ph1}</PhoneNumberFormatter>
|
||||
) : (
|
||||
<ChatOpenButton type={record.ownr_ph1_ty} phone={record.ownr_ph1} jobid={record.id} />
|
||||
)
|
||||
},
|
||||
{
|
||||
title: i18n.t("jobs.fields.ownr_ph2"),
|
||||
dataIndex: "ownr_ph2",
|
||||
key: "ownr_ph2",
|
||||
ellipsis: true,
|
||||
render: (text, record) => <PhoneFormatter type={record.ownr_ph2_ty}>{record.ownr_ph2}</PhoneFormatter>
|
||||
render: (text, record) =>
|
||||
technician ? (
|
||||
<PhoneNumberFormatter type={record.ownr_ph2_ty}>{record.ownr_ph2}</PhoneNumberFormatter>
|
||||
) : (
|
||||
<ChatOpenButton type={record.ownr_ph2_ty} phone={record.ownr_ph2} jobid={record.id} />
|
||||
)
|
||||
},
|
||||
{
|
||||
title: i18n.t("jobs.fields.specialcoveragepolicy"),
|
||||
|
||||
@@ -316,9 +316,8 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
|
||||
<LayoutFormRow grow>
|
||||
<Form.Item
|
||||
label={t("employees.fields.cost_center")}
|
||||
key={`${index}`}
|
||||
key={`${field.key}-cost_center`}
|
||||
name={[field.name, "cost_center"]}
|
||||
valuePropName="value"
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
@@ -343,7 +342,7 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("employees.fields.rate")}
|
||||
key={`${index}`}
|
||||
key={`${field.key}-rate`}
|
||||
name={[field.name, "rate"]}
|
||||
rules={[
|
||||
{
|
||||
|
||||
@@ -342,6 +342,14 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>,
|
||||
<Form.Item
|
||||
key="disableBillCostCalculation"
|
||||
name={["accountingconfig", "disableBillCostCalculation"]}
|
||||
label={t("bodyshop.fields.disableBillCostCalculation")}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
]
|
||||
: []),
|
||||
|
||||
@@ -152,7 +152,7 @@ export function VendorsFormComponent({ bodyshop, form, formLoading, handleDelete
|
||||
{!isPartsEntry && (
|
||||
<>
|
||||
<Form.Item label={t("vendors.fields.discount")} name="discount">
|
||||
<InputNumber min={0} max={1} precision={2} step={0.01} />
|
||||
<InputNumber min={0} max={1} precision={3} step={0.01} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label={t("vendors.fields.due_date")} name="due_date">
|
||||
|
||||
@@ -339,6 +339,7 @@
|
||||
"require_actual_delivery_date": "Require Actual Delivery",
|
||||
"templates": "Delivery Templates"
|
||||
},
|
||||
"disableBillCostCalculation": "Disable Automatic Bill Cost Calculation",
|
||||
"dms": {
|
||||
"apcontrol": "AP Control Number",
|
||||
"appostingaccount": "AP Posting Account",
|
||||
|
||||
@@ -339,6 +339,7 @@
|
||||
"require_actual_delivery_date": "",
|
||||
"templates": ""
|
||||
},
|
||||
"disableBillCostCalculation": "",
|
||||
"dms": {
|
||||
"apcontrol": "",
|
||||
"appostingaccount": "",
|
||||
|
||||
@@ -339,6 +339,7 @@
|
||||
"require_actual_delivery_date": "",
|
||||
"templates": ""
|
||||
},
|
||||
"disableBillCostCalculation": "",
|
||||
"dms": {
|
||||
"apcontrol": "",
|
||||
"appostingaccount": "",
|
||||
|
||||
@@ -116,6 +116,32 @@ async function TotalsServerSide(req, res) {
|
||||
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
|
||||
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);
|
||||
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_tax_adjustment);
|
||||
|
||||
if (Math.abs(totalUsTaxes) === 0) {
|
||||
const laborRates = Object.values(job.cieca_pfl)
|
||||
.map((v) => v.lbr_taxp)
|
||||
.filter((v) => v != null);
|
||||
const materialRates = Object.values(job.materials)
|
||||
.map((v) => v.mat_taxp)
|
||||
.filter((v) => v != null);
|
||||
const partsRates = Object.values(job.parts_tax_rates)
|
||||
.map((v) => {
|
||||
const field = v.prt_tax_rt ?? v.part_tax_rt;
|
||||
if (field == null) return null;
|
||||
const raw = typeof field === "object" ? field.parsedValue : field;
|
||||
return raw != null ? raw * 100 : null;
|
||||
})
|
||||
.filter((v) => v != null);
|
||||
const taxRate = Math.max(...laborRates, ...materialRates, ...partsRates);
|
||||
|
||||
const totalTaxes = ret.totals.taxableAmounts.total.multiply(taxRate > 1 ? taxRate / 100 : taxRate);
|
||||
ret.totals.taxableAmounts.total = ret.totals.taxableAmounts.total
|
||||
.multiply(emsTaxTotal)
|
||||
.divide(totalTaxes.toUnit());
|
||||
} else {
|
||||
ret.totals.taxableAmounts.total = ret.totals.taxableAmounts.total.multiply(emsTaxTotal).divide(totalUsTaxes);
|
||||
}
|
||||
|
||||
logger.log("job-totals-USA-ttl-tax-adj", "debug", null, job.id, {
|
||||
adjAmount: ttlTaxDifference
|
||||
});
|
||||
@@ -979,6 +1005,8 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
}
|
||||
});
|
||||
|
||||
taxableAmounts.total = Object.values(taxableAmounts).reduce((acc, amount) => acc.add(amount), Dinero({ amount: 0 }));
|
||||
|
||||
// console.log("*** Taxable Amounts***");
|
||||
// console.table(JSON.parse(JSON.stringify(taxableAmounts)));
|
||||
|
||||
@@ -1174,6 +1202,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
|
||||
let ret = {
|
||||
subtotal: subtotal,
|
||||
taxableAmounts: taxableAmounts,
|
||||
federal_tax: subtotal
|
||||
.percentage((job.federal_tax_rate || 0) * 100)
|
||||
.add(otherTotals.additional.pvrt.percentage((job.federal_tax_rate || 0) * 100)),
|
||||
|
||||
Reference in New Issue
Block a user