Merge branch 'release/2023-05-19' into feature/america

This commit is contained in:
Patrick Fic
2023-05-17 13:49:05 -07:00
15 changed files with 330 additions and 50 deletions

View File

@@ -34582,6 +34582,179 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>type</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>
<folder_node>
<name>types</name>
<children>
<concept_node>
<name>customer</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>general</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>office</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>paint</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>parts</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>shop</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>supplement</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>
</children>
</folder_node>
<concept_node> <concept_node>
<name>updatedat</name> <name>updatedat</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

View File

@@ -219,13 +219,15 @@ export function JobsConvertButton({
</Select> </Select>
</Form.Item> </Form.Item>
)} )}
<Form.Item {bodyshop.region_config.toLowerCase().startsWith("ca") && (
label={t("jobs.fields.ca_gst_registrant")} <Form.Item
name="ca_gst_registrant" label={t("jobs.fields.ca_gst_registrant")}
valuePropName="checked" name="ca_gst_registrant"
> valuePropName="checked"
<Switch /> >
</Form.Item> <Switch />
</Form.Item>
)}
<Form.Item <Form.Item
label={t("jobs.fields.driveable")} label={t("jobs.fields.driveable")}
name="driveable" name="driveable"

View File

@@ -224,13 +224,15 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
> >
<CurrencyInput /> <CurrencyInput />
</Form.Item> </Form.Item>
<Form.Item {bodyshop.region_config.toLowerCase().startsWith("ca") && (
label={t("jobs.fields.ca_gst_registrant")} <Form.Item
name="ca_gst_registrant" label={t("jobs.fields.ca_gst_registrant")}
valuePropName="checked" name="ca_gst_registrant"
> valuePropName="checked"
<Switch /> >
</Form.Item> <Switch />
</Form.Item>
)}
<Form.Item <Form.Item
label={t("jobs.fields.other_amount_payable")} label={t("jobs.fields.other_amount_payable")}
name="other_amount_payable" name="other_amount_payable"

View File

@@ -40,24 +40,26 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
> >
<CurrencyInput disabled={jobRO} min={0} /> <CurrencyInput disabled={jobRO} min={0} />
</Form.Item> </Form.Item>
<Tooltip title={t("jobs.labels.ca_gst_all_if_null")}> {bodyshop.region_config.toLowerCase().startsWith("ca") && (
<Form.Item <Tooltip title={t("jobs.labels.ca_gst_all_if_null")}>
label={t("jobs.fields.ca_customer_gst")} <Form.Item
name="ca_customer_gst" label={t("jobs.fields.ca_customer_gst")}
> name="ca_customer_gst"
<CurrencyInput >
disabled={jobRO} <CurrencyInput
min={0} disabled={jobRO}
max={ min={0}
Math.round( max={
(job.job_totals && Math.round(
job.job_totals.totals.federal_tax.amount) || (job.job_totals &&
0 job.job_totals.totals.federal_tax.amount) ||
) / 100 0
} ) / 100
/> }
</Form.Item> />
</Tooltip> </Form.Item>
</Tooltip>
)}
<Form.Item <Form.Item
label={t("jobs.fields.other_amount_payable")} label={t("jobs.fields.other_amount_payable")}
name="other_amount_payable" name="other_amount_payable"
@@ -82,12 +84,14 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
> >
<CurrencyInput disabled={jobRO || bodyshop.cdk_dealerid} /> <CurrencyInput disabled={jobRO || bodyshop.cdk_dealerid} />
</Form.Item> </Form.Item>
<Space align="center"> {bodyshop.region_config === "CA_BC" && (
<Form.Item label={t("jobs.fields.ca_bc_pvrt")} name="ca_bc_pvrt"> <Space align="center">
<CurrencyInput disabled={jobRO} min={0} /> <Form.Item label={t("jobs.fields.ca_bc_pvrt")} name="ca_bc_pvrt">
</Form.Item> <CurrencyInput disabled={jobRO} min={0} />
<CABCpvrtCalculator form={form} disabled={jobRO} /> </Form.Item>
</Space> <CABCpvrtCalculator form={form} disabled={jobRO} />
</Space>
)}
<Form.Item <Form.Item
label={t("jobs.fields.auto_add_ats")} label={t("jobs.fields.auto_add_ats")}
name="auto_add_ats" name="auto_add_ats"
@@ -141,13 +145,15 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
> >
<InputNumber min={0} max={1} precision={2} disabled={jobRO} /> <InputNumber min={0} max={1} precision={2} disabled={jobRO} />
</Form.Item> </Form.Item>
<Form.Item {bodyshop.region_config.toLowerCase().startsWith("ca") && (
label={t("jobs.fields.ca_gst_registrant")} <Form.Item
name="ca_gst_registrant" label={t("jobs.fields.ca_gst_registrant")}
valuePropName="checked" name="ca_gst_registrant"
> valuePropName="checked"
<Switch disabled={jobRO} /> >
</Form.Item> <Switch disabled={jobRO} />
</Form.Item>
)}
</FormRow> </FormRow>
<Divider <Divider
orientation="left" orientation="left"

View File

@@ -75,6 +75,27 @@ export function JobNotesComponent({
</span> </span>
), ),
}, },
{
title: t("notes.fields.type"),
dataIndex: "type",
key: "type",
width: 120,
filteredValue: filter?.type || null,
filters: [
{ value: "general", text: t("notes.fields.types.general") },
{ value: "customer", text: t("notes.fields.types.customer") },
{ value: "shop", text: t("notes.fields.types.shop") },
{ value: "office", text: t("notes.fields.types.office") },
{ value: "parts", text: t("notes.fields.types.parts") },
{ value: "paint", text: t("notes.fields.types.paint") },
{
value: "supplement",
text: t("notes.fields.types.supplement"),
},
],
onFilter: (value, record) => value.includes(record.type),
render: (text, record) => t(`notes.fields.types.${record.type}`),
},
{ {
title: t("notes.fields.text"), title: t("notes.fields.text"),
dataIndex: "text", dataIndex: "text",
@@ -106,7 +127,7 @@ export function JobNotesComponent({
title: t("notes.actions.actions"), title: t("notes.actions.actions"),
dataIndex: "actions", dataIndex: "actions",
key: "actions", key: "actions",
width: 150, width: 200,
render: (text, record) => ( render: (text, record) => (
<Space wrap> <Space wrap>
<Button <Button

View File

@@ -207,7 +207,7 @@ export function LaborAllocationsTable({
<Card title={t("jobs.labels.laborallocations")}> <Card title={t("jobs.labels.laborallocations")}>
<Table <Table
columns={columns} columns={columns}
rowKey="cost_center" rowKey={(record) => `${record.cost_center} ${record.mod_lbr_ty}`}
pagination={false} pagination={false}
onChange={handleTableChange} onChange={handleTableChange}
dataSource={totals} dataSource={totals}

View File

@@ -1,4 +1,14 @@
import { Checkbox, Col, Form, Input, Row, Space, Switch, Tag } from "antd"; import {
Checkbox,
Col,
Form,
Input,
Row,
Select,
Space,
Switch,
Tag,
} from "antd";
import React from "react"; import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
@@ -46,6 +56,28 @@ export function NoteUpsertModalComponent({ form, noteUpsertModal }) {
<Switch /> <Switch />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}>
<Form.Item
label={t("notes.fields.type")}
name="type"
initialValue="general"
>
<Select
options={[
{ value: "general", label: t("notes.fields.types.general") },
{ value: "customer", label: t("notes.fields.types.customer") },
{ value: "shop", label: t("notes.fields.types.shop") },
{ value: "office", label: t("notes.fields.types.office") },
{ value: "parts", label: t("notes.fields.types.parts") },
{ value: "paint", label: t("notes.fields.types.paint") },
{
value: "supplement",
label: t("notes.fields.types.supplement"),
},
]}
/>
</Form.Item>
</Col>
<Col span={8}> <Col span={8}>
<NotesPresetButton form={form} /> <NotesPresetButton form={form} />
</Col> </Col>

View File

@@ -13,6 +13,7 @@ export const INSERT_NEW_NOTE = gql`
text text
updated_at updated_at
audit audit
type
} }
} }
} }
@@ -41,6 +42,7 @@ export const QUERY_NOTES_BY_JOB_PK = gql`
text text
updated_at updated_at
audit audit
type
} }
} }
} }
@@ -60,6 +62,7 @@ export const UPDATE_NOTE = gql`
text text
updated_at updated_at
audit audit
type
} }
} }
} }

View File

@@ -1437,7 +1437,7 @@
"ded_amt": "Deductible", "ded_amt": "Deductible",
"ded_note": "Deductible Note", "ded_note": "Deductible Note",
"ded_status": "Deductible Status", "ded_status": "Deductible Status",
"depreciation_taxes": "Depreciation/Taxes", "depreciation_taxes": "Betterment/Depreciation/Taxes",
"dms": { "dms": {
"address": "Customer Address", "address": "Customer Address",
"amount": "Amount", "amount": "Amount",
@@ -2037,6 +2037,16 @@
"critical": "Critical", "critical": "Critical",
"private": "Private", "private": "Private",
"text": "Contents", "text": "Contents",
"type": "Type",
"types": {
"customer": "Customer",
"general": "General",
"office": "Office",
"paint": "Paint",
"parts": "Parts",
"shop": "Shop",
"supplement": "Supplement"
},
"updatedat": "Updated At" "updatedat": "Updated At"
}, },
"labels": { "labels": {

View File

@@ -2037,6 +2037,16 @@
"critical": "Crítico", "critical": "Crítico",
"private": "Privado", "private": "Privado",
"text": "Contenido", "text": "Contenido",
"type": "",
"types": {
"customer": "",
"general": "",
"office": "",
"paint": "",
"parts": "",
"shop": "",
"supplement": ""
},
"updatedat": "Actualizado en" "updatedat": "Actualizado en"
}, },
"labels": { "labels": {

View File

@@ -2037,6 +2037,16 @@
"critical": "Critique", "critical": "Critique",
"private": "privé", "private": "privé",
"text": "Contenu", "text": "Contenu",
"type": "",
"types": {
"customer": "",
"general": "",
"office": "",
"paint": "",
"parts": "",
"shop": "",
"supplement": ""
},
"updatedat": "Mis à jour à" "updatedat": "Mis à jour à"
}, },
"labels": { "labels": {

View File

@@ -4333,6 +4333,7 @@
- jobid - jobid
- private - private
- text - text
- type
- updated_at - updated_at
select_permissions: select_permissions:
- role: user - role: user
@@ -4346,6 +4347,7 @@
- jobid - jobid
- private - private
- text - text
- type
- updated_at - updated_at
filter: filter:
job: job:
@@ -4369,6 +4371,7 @@
- jobid - jobid
- private - private
- text - text
- type
- updated_at - updated_at
filter: filter:
job: job:

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."notes" add column "type" text
-- not null default 'general';

View File

@@ -0,0 +1,2 @@
alter table "public"."notes" add column "type" text
not null default 'general';

View File

@@ -840,7 +840,9 @@ function GenerateCostingData(job) {
//Push adjustments to bottom line. //Push adjustments to bottom line.
if (job.adjustment_bottom_line) { if (job.adjustment_bottom_line) {
//Add to totals. //Add to totals.
const Adjustment = Dinero({ amount: job.adjustment_bottom_line * 100 }); //Need to invert, since this is being assigned as a cost. const Adjustment = Dinero({
amount: Math.round(job.adjustment_bottom_line * 100),
}); //Need to invert, since this is being assigned as a cost.
summaryData.totalLaborSales = summaryData.totalLaborSales.add(Adjustment); summaryData.totalLaborSales = summaryData.totalLaborSales.add(Adjustment);
summaryData.totalSales = summaryData.totalSales.add(Adjustment); summaryData.totalSales = summaryData.totalSales.add(Adjustment);
//Add to lines. //Add to lines.