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