Merged in release/2022-05-06 (pull request #460)
release/2022-05-06 Approved-by: Patrick Fic
This commit is contained in:
@@ -8927,6 +8927,48 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>md_to_emails</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>md_to_emails_emails</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>messagingpresets</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -13996,6 +14038,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>external_id</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>first_name</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -36674,6 +36737,32 @@
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>special</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>attendance_detail_csv</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>
|
||||
<folder_node>
|
||||
<name>subjects</name>
|
||||
<children>
|
||||
|
||||
@@ -42,7 +42,12 @@ export function EmailOverlayComponent({
|
||||
const { t } = useTranslation();
|
||||
const handleClick = ({ item, key, keyPath }) => {
|
||||
const email = item.props.value;
|
||||
form.setFieldsValue({ to: _.uniq([...form.getFieldValue("to"), email]) });
|
||||
form.setFieldsValue({
|
||||
to: _.uniq([
|
||||
...form.getFieldValue("to"),
|
||||
...(typeof email === "string" ? [email] : email),
|
||||
]),
|
||||
});
|
||||
};
|
||||
|
||||
const menu = (
|
||||
@@ -55,6 +60,11 @@ export function EmailOverlayComponent({
|
||||
{`${e.first_name} ${e.last_name}`}
|
||||
</Menu.Item>
|
||||
))}
|
||||
{bodyshop.md_to_emails.map((e, idx) => (
|
||||
<Menu.Item value={e.emails} key={idx + "group"}>
|
||||
{e.label}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -328,6 +328,12 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("employees.fields.external_id")}
|
||||
name="external_id"
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
<Form.List name={["rates"]}>
|
||||
{(fields, { add, remove, move }) => {
|
||||
|
||||
@@ -1393,6 +1393,60 @@ export default function ShopInfoGeneral({ form }) {
|
||||
}}
|
||||
</Form.List>
|
||||
</LayoutFormRow>
|
||||
<LayoutFormRow grow header={t("bodyshop.labels.md_to_emails")}>
|
||||
<Form.List name={["md_to_emails"]}>
|
||||
{(fields, { add, remove, move }) => {
|
||||
return (
|
||||
<div>
|
||||
{fields.map((field, index) => (
|
||||
<Form.Item key={field.key}>
|
||||
<LayoutFormRow noDivider>
|
||||
<Form.Item
|
||||
label={t("general.labels.label")}
|
||||
key={`${index}label`}
|
||||
name={[field.name, "label"]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.labels.md_to_emails_emails")}
|
||||
key={`${index}emails`}
|
||||
name={[field.name, "emails"]}
|
||||
>
|
||||
<Select mode="tags" tokenSeparators={[",", ";"]} />
|
||||
</Form.Item>
|
||||
|
||||
<Space>
|
||||
<DeleteFilled
|
||||
onClick={() => {
|
||||
remove(field.name);
|
||||
}}
|
||||
/>
|
||||
<FormListMoveArrows
|
||||
move={move}
|
||||
index={index}
|
||||
total={fields.length}
|
||||
/>
|
||||
</Space>
|
||||
</LayoutFormRow>
|
||||
</Form.Item>
|
||||
))}
|
||||
<Form.Item>
|
||||
<Button
|
||||
type="dashed"
|
||||
onClick={() => {
|
||||
add();
|
||||
}}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
{t("general.actions.add")}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Form.List>
|
||||
</LayoutFormRow>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,11 @@ export function TimeTicketModalComponent({
|
||||
return Promise.reject(
|
||||
t("timetickets.validation.clockoffwithoutclockon")
|
||||
);
|
||||
if (value && !value.isSameOrAfter(clockon))
|
||||
if (
|
||||
value &&
|
||||
value.isSameOrAfter &&
|
||||
!value.isSameOrAfter(clockon)
|
||||
)
|
||||
return Promise.reject(
|
||||
t("timetickets.validation.clockoffmustbeafterclockon")
|
||||
);
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Button } from "antd";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import moment from "moment";
|
||||
const AttendanceCsv = TemplateList("special").attendance_detail_csv;
|
||||
|
||||
export default function TimeTicketsAttendanceTable() {
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const { start, end } = searchParams;
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleClick = async () => {
|
||||
setLoading(true);
|
||||
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: AttendanceCsv.key,
|
||||
variables: {
|
||||
start: start
|
||||
? start
|
||||
: moment().startOf("week").subtract(7, "days").format("YYYY-MM-DD"),
|
||||
end: end ? end : moment().endOf("week").format("YYYY-MM-DD"),
|
||||
},
|
||||
},
|
||||
{},
|
||||
"x"
|
||||
);
|
||||
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<Button loading={loading} onClick={handleClick}>
|
||||
{t("printcenter.special.attendance_detail_csv")}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -106,6 +106,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
last_name_first
|
||||
md_parts_order_comment
|
||||
bill_allow_post_to_closed
|
||||
md_to_emails
|
||||
employees {
|
||||
user_email
|
||||
id
|
||||
@@ -114,6 +115,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
last_name
|
||||
employee_number
|
||||
rates
|
||||
external_id
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,6 +211,7 @@ export const UPDATE_SHOP = gql`
|
||||
last_name_first
|
||||
md_parts_order_comment
|
||||
bill_allow_post_to_closed
|
||||
md_to_emails
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
@@ -217,6 +220,7 @@ export const UPDATE_SHOP = gql`
|
||||
employee_number
|
||||
rates
|
||||
user_email
|
||||
external_id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ export const QUERY_EMPLOYEE_BY_ID = gql`
|
||||
rates
|
||||
pin
|
||||
user_email
|
||||
external_id
|
||||
employee_vacations(order_by: { start: desc }) {
|
||||
id
|
||||
start
|
||||
|
||||
@@ -14,6 +14,7 @@ import TimeTicketList from "../../components/time-ticket-list/time-ticket-list.c
|
||||
import TimeTicketsPayrollTable from "../../components/time-tickets-payroll-table/time-tickets-payroll-table.component";
|
||||
import TimeTicketsSummaryEmployees from "../../components/time-tickets-summary-employees/time-tickets-summary-employees.component";
|
||||
import { QUERY_TIME_TICKETS_IN_RANGE } from "../../graphql/timetickets.queries";
|
||||
import TimeTicketsAttendanceTable from "../../components/time-tickets-attendance-table/time-tickets-attendance-table.component";
|
||||
import {
|
||||
setBreadcrumbs,
|
||||
setSelectedHeader,
|
||||
@@ -71,6 +72,7 @@ export function TimeTicketsContainer({
|
||||
timetickets={data ? data.timetickets : []}
|
||||
extra={
|
||||
<Space wrap>
|
||||
<TimeTicketsAttendanceTable />
|
||||
<TimeTicketsPayrollTable />
|
||||
<TimeTicketsDatesSelector />
|
||||
</Space>
|
||||
|
||||
@@ -544,6 +544,8 @@
|
||||
"jobstatuses": "Job Statuses",
|
||||
"laborrates": "Labor Rates",
|
||||
"licensing": "Licensing",
|
||||
"md_to_emails": "Preset To Emails",
|
||||
"md_to_emails_emails": "Emails",
|
||||
"messagingpresets": "Messaging Presets",
|
||||
"notemplatesavailable": "No templates available to add.",
|
||||
"notespresets": "Notes Presets",
|
||||
@@ -877,6 +879,7 @@
|
||||
"base_rate": "Base Rate",
|
||||
"cost_center": "Cost Center",
|
||||
"employee_number": "Employee Number",
|
||||
"external_id": "External Employee ID",
|
||||
"first_name": "First Name",
|
||||
"flat_rate": "Flat Rate (Disabled is Straight Time)",
|
||||
"hire_date": "Hire Date",
|
||||
@@ -2171,6 +2174,9 @@
|
||||
"ca_bc_etf_table": "ICBC ETF Table",
|
||||
"exported_payroll": "Payroll Table"
|
||||
},
|
||||
"special": {
|
||||
"attendance_detail_csv": "Attendance Table"
|
||||
},
|
||||
"subjects": {
|
||||
"jobs": {
|
||||
"parts_order": "Parts Order PO: {{ro_number}} - {{name}}"
|
||||
|
||||
@@ -544,6 +544,8 @@
|
||||
"jobstatuses": "",
|
||||
"laborrates": "",
|
||||
"licensing": "",
|
||||
"md_to_emails": "",
|
||||
"md_to_emails_emails": "",
|
||||
"messagingpresets": "",
|
||||
"notemplatesavailable": "",
|
||||
"notespresets": "",
|
||||
@@ -877,6 +879,7 @@
|
||||
"base_rate": "Tasa básica",
|
||||
"cost_center": "Centro de costos",
|
||||
"employee_number": "Numero de empleado",
|
||||
"external_id": "",
|
||||
"first_name": "Nombre de pila",
|
||||
"flat_rate": "Tarifa plana (deshabilitado es tiempo recto)",
|
||||
"hire_date": "Fecha de contratación",
|
||||
@@ -2171,6 +2174,9 @@
|
||||
"ca_bc_etf_table": "",
|
||||
"exported_payroll": ""
|
||||
},
|
||||
"special": {
|
||||
"attendance_detail_csv": ""
|
||||
},
|
||||
"subjects": {
|
||||
"jobs": {
|
||||
"parts_order": ""
|
||||
|
||||
@@ -544,6 +544,8 @@
|
||||
"jobstatuses": "",
|
||||
"laborrates": "",
|
||||
"licensing": "",
|
||||
"md_to_emails": "",
|
||||
"md_to_emails_emails": "",
|
||||
"messagingpresets": "",
|
||||
"notemplatesavailable": "",
|
||||
"notespresets": "",
|
||||
@@ -877,6 +879,7 @@
|
||||
"base_rate": "Taux de base",
|
||||
"cost_center": "Centre de coûts",
|
||||
"employee_number": "Numéro d'employé",
|
||||
"external_id": "",
|
||||
"first_name": "Prénom",
|
||||
"flat_rate": "Taux fixe (désactivé est le temps normal)",
|
||||
"hire_date": "Date d'embauche",
|
||||
@@ -2171,6 +2174,9 @@
|
||||
"ca_bc_etf_table": "",
|
||||
"exported_payroll": ""
|
||||
},
|
||||
"special": {
|
||||
"attendance_detail_csv": ""
|
||||
},
|
||||
"subjects": {
|
||||
"jobs": {
|
||||
"parts_order": ""
|
||||
|
||||
@@ -1668,6 +1668,13 @@ export const TemplateList = (type, context) => {
|
||||
key: "exported_payroll",
|
||||
disabled: false,
|
||||
},
|
||||
attendance_detail_csv: {
|
||||
title: i18n.t("printcenter.special.attendance_detail_csv"),
|
||||
description: "Est Detail",
|
||||
subject: i18n.t("printcenter.special.attendance_detail_csv"),
|
||||
key: "attendance_detail_csv",
|
||||
disabled: false,
|
||||
},
|
||||
production_by_technician_one: {
|
||||
title: i18n.t(
|
||||
"reportcenter.templates.production_by_technician_one"
|
||||
|
||||
@@ -858,6 +858,7 @@
|
||||
- md_referral_sources
|
||||
- md_responsibility_centers
|
||||
- md_ro_statuses
|
||||
- md_to_emails
|
||||
- messagingservicesid
|
||||
- pbs_configuration
|
||||
- pbs_serialnumber
|
||||
@@ -944,6 +945,7 @@
|
||||
- md_referral_sources
|
||||
- md_responsibility_centers
|
||||
- md_ro_statuses
|
||||
- md_to_emails
|
||||
- pbs_configuration
|
||||
- phone
|
||||
- prodtargethrs
|
||||
@@ -1953,6 +1955,7 @@
|
||||
- active
|
||||
- created_at
|
||||
- employee_number
|
||||
- external_id
|
||||
- first_name
|
||||
- flat_rate
|
||||
- hire_date
|
||||
@@ -1971,6 +1974,7 @@
|
||||
- active
|
||||
- created_at
|
||||
- employee_number
|
||||
- external_id
|
||||
- first_name
|
||||
- flat_rate
|
||||
- hire_date
|
||||
@@ -1999,6 +2003,7 @@
|
||||
- active
|
||||
- created_at
|
||||
- employee_number
|
||||
- external_id
|
||||
- first_name
|
||||
- flat_rate
|
||||
- hire_date
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."bodyshops" add column "md_to_emails" jsonb
|
||||
-- null default jsonb_build_array();
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."bodyshops" add column "md_to_emails" jsonb
|
||||
null default jsonb_build_array();
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."employees" add column "external_id" text
|
||||
-- null;
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."employees" add column "external_id" text
|
||||
null;
|
||||
Reference in New Issue
Block a user