- the great reformat

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-06 18:20:58 -05:00
parent 30c530bcc4
commit e83badb454
912 changed files with 108516 additions and 107493 deletions

View File

@@ -1,41 +1,42 @@
import { Button } from "antd";
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 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 dayjs from "../../utils/day";
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 searchParams = queryString.parse(useLocation().search);
const {start, end} = searchParams;
const {t} = useTranslation();
const [loading, setLoading] = useState(false);
const handleClick = async () => {
setLoading(true);
const handleClick = async () => {
setLoading(true);
await GenerateDocument(
{
name: PayrollTemplate.key,
variables: {
start: start
? start
: dayjs().startOf("week").subtract(7, "day").format("YYYY-MM-DD"),
end: end ? end : dayjs().endOf("week").format("YYYY-MM-DD"),
},
},
{},
"x"
await GenerateDocument(
{
name: PayrollTemplate.key,
variables: {
start: start
? start
: dayjs().startOf("week").subtract(7, "day").format("YYYY-MM-DD"),
end: end ? end : dayjs().endOf("week").format("YYYY-MM-DD"),
},
},
{},
"x"
);
setLoading(false);
};
return (
<Button loading={loading} onClick={handleClick}>
{t("printcenter.payments.exported_payroll")}
</Button>
);
setLoading(false);
};
return (
<Button loading={loading} onClick={handleClick}>
{t("printcenter.payments.exported_payroll")}
</Button>
);
}