@@ -1,4 +1,4 @@
|
|||||||
<babeledit_project version="1.2" be_version="2.7.1">
|
<babeledit_project be_version="2.7.1" version="1.2">
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
BabelEdit project file
|
BabelEdit project file
|
||||||
@@ -35691,6 +35691,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>exported_payroll</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>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ export default function ProductionListDate({
|
|||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
value={(record[field] && moment(record[field])) || null}
|
value={(record[field] && moment(record[field])) || null}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
minuteStep={15}
|
||||||
format="hh:mm a"
|
format="hh:mm a"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("scoreboard.labels.dailyactual")}
|
title={t("scoreboard.labels.dailyactual")}
|
||||||
value={values.todayBody}
|
value={values.todayBody.toFixed(1)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
@@ -116,7 +116,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("scoreboard.labels.weeklyactual")}
|
title={t("scoreboard.labels.weeklyactual")}
|
||||||
value={values.weeklyBody}
|
value={values.weeklyBody.toFixed(1)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
@@ -140,7 +140,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("scoreboard.labels.todateactual")}
|
title={t("scoreboard.labels.todateactual")}
|
||||||
value={values.toDateBody}
|
value={values.toDateBody.toFixed(1)}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
@@ -152,7 +152,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic value={values.todayPaint} />
|
<Statistic value={values.todayPaint.toFixed(1)} />
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
@@ -163,7 +163,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic value={values.weeklyPaint} />
|
<Statistic value={values.weeklyPaint.toFixed(1)} />
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic
|
<Statistic
|
||||||
@@ -182,7 +182,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...statSpans}>
|
<Col {...statSpans}>
|
||||||
<Statistic value={values.toDatePaint} />
|
<Statistic value={values.toDatePaint.toFixed(1)} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
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 PayrollTemplate = TemplateList("special").exported_payroll;
|
||||||
|
export default function TimeTicketsPayrollTable() {
|
||||||
|
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: PayrollTemplate.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.payments.exported_payroll")}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Col, Row } from "antd";
|
import { Col, Row, Space } from "antd";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
@@ -11,6 +11,7 @@ import AlertComponent from "../../components/alert/alert.component";
|
|||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import TimeTicketsDatesSelector from "../../components/ticket-tickets-dates-selector/time-tickets-dates-selector.component";
|
import TimeTicketsDatesSelector from "../../components/ticket-tickets-dates-selector/time-tickets-dates-selector.component";
|
||||||
import TimeTicketList from "../../components/time-ticket-list/time-ticket-list.component";
|
import TimeTicketList from "../../components/time-ticket-list/time-ticket-list.component";
|
||||||
|
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 TimeTicketsSummaryEmployees from "../../components/time-tickets-summary-employees/time-tickets-summary-employees.component";
|
||||||
import { QUERY_TIME_TICKETS_IN_RANGE } from "../../graphql/timetickets.queries";
|
import { QUERY_TIME_TICKETS_IN_RANGE } from "../../graphql/timetickets.queries";
|
||||||
import {
|
import {
|
||||||
@@ -68,7 +69,12 @@ export function TimeTicketsContainer({
|
|||||||
<TimeTicketList
|
<TimeTicketList
|
||||||
loading={loading}
|
loading={loading}
|
||||||
timetickets={data ? data.timetickets : []}
|
timetickets={data ? data.timetickets : []}
|
||||||
extra={<TimeTicketsDatesSelector />}
|
extra={
|
||||||
|
<Space wrap>
|
||||||
|
<TimeTicketsPayrollTable />
|
||||||
|
<TimeTicketsDatesSelector />
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
|
|||||||
@@ -2117,7 +2117,8 @@
|
|||||||
"title": "Print Center"
|
"title": "Print Center"
|
||||||
},
|
},
|
||||||
"payments": {
|
"payments": {
|
||||||
"ca_bc_etf_table": "ICBC ETF Table"
|
"ca_bc_etf_table": "ICBC ETF Table",
|
||||||
|
"exported_payroll": "Payroll Table"
|
||||||
},
|
},
|
||||||
"subjects": {
|
"subjects": {
|
||||||
"jobs": {
|
"jobs": {
|
||||||
|
|||||||
@@ -2117,7 +2117,8 @@
|
|||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
"payments": {
|
"payments": {
|
||||||
"ca_bc_etf_table": ""
|
"ca_bc_etf_table": "",
|
||||||
|
"exported_payroll": ""
|
||||||
},
|
},
|
||||||
"subjects": {
|
"subjects": {
|
||||||
"jobs": {
|
"jobs": {
|
||||||
|
|||||||
@@ -2117,7 +2117,8 @@
|
|||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
"payments": {
|
"payments": {
|
||||||
"ca_bc_etf_table": ""
|
"ca_bc_etf_table": "",
|
||||||
|
"exported_payroll": ""
|
||||||
},
|
},
|
||||||
"subjects": {
|
"subjects": {
|
||||||
"jobs": {
|
"jobs": {
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ const Templates = TemplateList();
|
|||||||
export default async function RenderTemplate(
|
export default async function RenderTemplate(
|
||||||
templateObject,
|
templateObject,
|
||||||
bodyshop,
|
bodyshop,
|
||||||
renderAsHtml = false
|
renderAsHtml = false,
|
||||||
|
renderAsExcel = false
|
||||||
) {
|
) {
|
||||||
//Query assets that match the template name. Must be in format <<templateName>>.query
|
//Query assets that match the template name. Must be in format <<templateName>>.query
|
||||||
let { contextData, useShopSpecificTemplate } = await fetchContextData(
|
let { contextData, useShopSpecificTemplate } = await fetchContextData(
|
||||||
@@ -29,7 +30,8 @@ export default async function RenderTemplate(
|
|||||||
name: useShopSpecificTemplate
|
name: useShopSpecificTemplate
|
||||||
? `/${bodyshop.imexshopid}/${templateObject.name}`
|
? `/${bodyshop.imexshopid}/${templateObject.name}`
|
||||||
: `/${templateObject.name}`,
|
: `/${templateObject.name}`,
|
||||||
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
|
// ...(renderAsHtml && !renderAsExcel ? {} : { recipe: "chrome-pdf" }),
|
||||||
|
...(renderAsExcel ? { recipe: "html-to-xlsx" } : {}),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
...contextData,
|
...contextData,
|
||||||
@@ -182,6 +184,9 @@ export const GenerateDocument = async (
|
|||||||
template,
|
template,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
} else if (sendType === "x") {
|
||||||
|
console.log("excel")
|
||||||
|
await RenderTemplate(template, bodyshop, false, true);
|
||||||
} else {
|
} else {
|
||||||
await RenderTemplate(template, bodyshop);
|
await RenderTemplate(template, bodyshop);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1635,6 +1635,13 @@ export const TemplateList = (type, context) => {
|
|||||||
key: "ca_bc_etf_table",
|
key: "ca_bc_etf_table",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
exported_payroll: {
|
||||||
|
title: i18n.t("printcenter.payments.exported_payroll"),
|
||||||
|
description: "Est Detail",
|
||||||
|
subject: i18n.t("printcenter.payments.exported_payroll"),
|
||||||
|
key: "exported_payroll",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
production_by_technician_one: {
|
production_by_technician_one: {
|
||||||
title: i18n.t(
|
title: i18n.t(
|
||||||
"reportcenter.templates.production_by_technician_one"
|
"reportcenter.templates.production_by_technician_one"
|
||||||
|
|||||||
Reference in New Issue
Block a user