IO-888 Sorted Speedprint
This commit is contained in:
@@ -208,7 +208,9 @@ export function BillsListTableComponent({
|
|||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
loading={billsQuery.loading}
|
loading={billsQuery.loading}
|
||||||
scroll={{ x: true, y: "50rem" }}
|
scroll={{
|
||||||
|
x: true, // y: "50rem"
|
||||||
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={bills}
|
dataSource={bills}
|
||||||
|
|||||||
@@ -158,7 +158,9 @@ export default function ContractsList({ loading, contracts, refetch, total }) {
|
|||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: "50%", y: "40rem" }}
|
scroll={{
|
||||||
|
x: "50%", //y: "40rem"
|
||||||
|
}}
|
||||||
pagination={{
|
pagination={{
|
||||||
position: "top",
|
position: "top",
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ export function Jobd3RdPartyModal({ bodyshop, jobId }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { data: VendorAutoCompleteData } = useQuery(
|
const { data: VendorAutoCompleteData } = useQuery(
|
||||||
SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR
|
SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR,
|
||||||
|
{
|
||||||
|
skip: !isModalVisible,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ export default function JobCostingPartsTable({ data, summaryData }) {
|
|||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
scroll={{ x: "50%", y: "40rem" }}
|
scroll={{
|
||||||
|
x: "50%", //y: "40rem"
|
||||||
|
}}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Checkbox, Table } from "antd";
|
import { Checkbox, PageHeader, Table } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
@@ -86,7 +86,7 @@ export default function JobReconciliationBillsTable({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<PageHeader title={t("bills.labels.bills")}>
|
||||||
<Table
|
<Table
|
||||||
pagination={false}
|
pagination={false}
|
||||||
scroll={{ y: "40vh", x: true }}
|
scroll={{ y: "40vh", x: true }}
|
||||||
@@ -99,6 +99,6 @@ export default function JobReconciliationBillsTable({
|
|||||||
selectedRowKeys: selectedLines,
|
selectedRowKeys: selectedLines,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</PageHeader>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Table } from "antd";
|
import { PageHeader, Table } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
@@ -102,7 +102,7 @@ export default function JobReconcilitionPartsTable({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<PageHeader title={t("jobs.labels.lines")}>
|
||||||
<Table
|
<Table
|
||||||
pagination={false}
|
pagination={false}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -122,6 +122,6 @@ export default function JobReconcilitionPartsTable({
|
|||||||
<div style={{ fontStyle: "italic", margin: "4px" }}>
|
<div style={{ fontStyle: "italic", margin: "4px" }}>
|
||||||
{t("jobs.labels.reconciliation.removedpartsstrikethrough")}
|
{t("jobs.labels.reconciliation.removedpartsstrikethrough")}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PageHeader>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,18 +321,19 @@ export function PartsOrderListTableComponent({
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title={record && `${record.vendor.name} - ${record.order_number}`}
|
title={record && `${record.vendor.name} - ${record.order_number}`}
|
||||||
extra={recordActions(record)}
|
extra={recordActions(record)}
|
||||||
/>
|
/>
|
||||||
<Table
|
<Table
|
||||||
scroll={{ x: true, y: "50rem" }}
|
scroll={{ x: true, //y: "50rem"
|
||||||
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={record.parts_order_lines}
|
dataSource={record.parts_order_lines}
|
||||||
/>
|
/>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -367,7 +368,9 @@ export function PartsOrderListTableComponent({
|
|||||||
</Drawer>
|
</Drawer>
|
||||||
<Table
|
<Table
|
||||||
loading={billsQuery.loading}
|
loading={billsQuery.loading}
|
||||||
scroll={{ x: true, y: "50rem" }}
|
scroll={{ x: true,
|
||||||
|
//y: "50rem"
|
||||||
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={parts_orders}
|
dataSource={parts_orders}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export function PrintCenterJobsComponent({ printCenterModal }) {
|
|||||||
//Group it, create cards, and then filter out.
|
//Group it, create cards, and then filter out.
|
||||||
|
|
||||||
const grouped = _.groupBy(filteredJobsReportsList, "group");
|
const grouped = _.groupBy(filteredJobsReportsList, "group");
|
||||||
console.log("grouped :>> ", grouped);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -217,7 +217,8 @@ const JobRelatedTicketsTable = ({
|
|||||||
<Card title={t("timetickets.labels.jobhours")}>
|
<Card title={t("timetickets.labels.jobhours")}>
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: true, y: "50rem" }}
|
scroll={{ x: true,// y: "50rem"
|
||||||
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={data}
|
dataSource={data}
|
||||||
@@ -301,7 +302,8 @@ const ShiftRelatedTicketsTable = ({
|
|||||||
<Card title={t("timetickets.labels.clockhours")}>
|
<Card title={t("timetickets.labels.clockhours")}>
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: true, y: "50rem" }}
|
scroll={{ x: true,// y: "50rem"
|
||||||
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={data}
|
dataSource={data}
|
||||||
|
|||||||
@@ -250,7 +250,8 @@ export function BillsListPage({
|
|||||||
|
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: "50%", y: "40rem" }}
|
scroll={{ x: "50%",// y: "40rem"
|
||||||
|
}}
|
||||||
pagination={{
|
pagination={{
|
||||||
position: "top",
|
position: "top",
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { setEmailOptions } from "../redux/email/email.actions";
|
|||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import client from "../utils/GraphQLClient";
|
import client from "../utils/GraphQLClient";
|
||||||
import { TemplateList } from "./TemplateConstants";
|
import { TemplateList } from "./TemplateConstants";
|
||||||
|
import _ from "lodash";
|
||||||
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
|
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
|
||||||
jsreport.serverUrl = server;
|
jsreport.serverUrl = server;
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ export async function RenderTemplates(
|
|||||||
renderAsHtml = false
|
renderAsHtml = 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 templateAndData = [];
|
let unsortedTemplatesAndData = [];
|
||||||
let proms = [];
|
let proms = [];
|
||||||
templateObjects.forEach((template) => {
|
templateObjects.forEach((template) => {
|
||||||
proms.push(
|
proms.push(
|
||||||
@@ -71,7 +72,7 @@ export async function RenderTemplates(
|
|||||||
let { contextData, useShopSpecificTemplate } = await fetchContextData(
|
let { contextData, useShopSpecificTemplate } = await fetchContextData(
|
||||||
template
|
template
|
||||||
);
|
);
|
||||||
templateAndData.push({
|
unsortedTemplatesAndData.push({
|
||||||
templateObject: template,
|
templateObject: template,
|
||||||
contextData,
|
contextData,
|
||||||
useShopSpecificTemplate,
|
useShopSpecificTemplate,
|
||||||
@@ -80,6 +81,22 @@ export async function RenderTemplates(
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
await Promise.all(proms);
|
await Promise.all(proms);
|
||||||
|
|
||||||
|
//Re-order list to follow speedprint.
|
||||||
|
// var templateAndData = _.sortBy(unsortedTemplatesAndData, function (item) {
|
||||||
|
// return templateObjects.findIndex(
|
||||||
|
// (template) => template.name === item.templateObject.name
|
||||||
|
// );
|
||||||
|
// });
|
||||||
|
|
||||||
|
unsortedTemplatesAndData.sort(function (a, b) {
|
||||||
|
return (
|
||||||
|
templateObjects.findIndex((x) => x.name === a.templateObject.name) -
|
||||||
|
templateObjects.findIndex((x) => x.name === b.templateObject.name)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
const templateAndData = unsortedTemplatesAndData;
|
||||||
|
|
||||||
let rootTemplate = templateAndData.shift();
|
let rootTemplate = templateAndData.shift();
|
||||||
|
|
||||||
let reportRequest = {
|
let reportRequest = {
|
||||||
|
|||||||
Reference in New Issue
Block a user