Resolved bulk printing & status for printing items. IO-690

This commit is contained in:
Patrick Fic
2021-02-23 10:34:31 -08:00
parent fad4ee4ef5
commit 666931aacd
6 changed files with 197 additions and 120 deletions

View File

@@ -1,16 +1,14 @@
import React from "react";
import { Statistic, Space, List, Button, Typography } from "antd";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import { useTranslation } from "react-i18next";
import { Button, List, Space, Statistic, Typography } from "antd";
import moment from "moment";
import RenderTemplate, {
displayTemplateInWindow,
} from "../../utils/RenderTemplate";
import { TemplateList } from "../../utils/TemplateConstants";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { onlyUnique } from "../../utils/arrayHelper";
import { GenerateDocument } from "../../utils/RenderTemplate";
import { TemplateList } from "../../utils/TemplateConstants";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -68,15 +66,14 @@ export function TimeTicketsSummaryEmployees({
});
const handlePrintEmployeeTicket = async (empId) => {
alert("Missing Key!");
const html = await RenderTemplate(
GenerateDocument(
{
name: TemplateList().time_tickets_by_employee.key,
variables: { id: empId, start: startDate, end: endDate },
},
bodyshop
{},
"p"
);
displayTemplateInWindow(html);
};
return (