From 27a67c5f4a7b4ace76a2af03f819d855769af4b0 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 6 Apr 2023 10:36:29 -0700 Subject: [PATCH] Added team pay calculator. --- .../time-ticket-list-team-pay.component.jsx | 276 ++++++++++++++++++ .../time-ticket-list.component.jsx | 15 + ...me-tickets-summary-employees.component.jsx | 22 +- 3 files changed, 312 insertions(+), 1 deletion(-) create mode 100644 client/src/components/time-ticket-list/time-ticket-list-team-pay.component.jsx diff --git a/client/src/components/time-ticket-list/time-ticket-list-team-pay.component.jsx b/client/src/components/time-ticket-list/time-ticket-list-team-pay.component.jsx new file mode 100644 index 000000000..ca13499d2 --- /dev/null +++ b/client/src/components/time-ticket-list/time-ticket-list-team-pay.component.jsx @@ -0,0 +1,276 @@ +import { + Button, + Form, + InputNumber, + Modal, + Radio, + Select, + Space, + Table, + Typography, +} from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; +import JobSearchSelectComponent from "../job-search-select/job-search-select.component"; +import LayoutFormRow from "../layout-form-row/layout-form-row.component"; +import Dinero from "dinero.js"; +import { useQuery } from "@apollo/client"; +import { GET_JOB_INFO_DRAW_CALCULATIONS } from "../../graphql/jobs-lines.queries"; +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(TimeTicketListTeamPay); + +export function TimeTicketListTeamPay({ bodyshop, context, actions }) { + const { refetch } = actions; + const { jobId } = context; + const [visible, setVisible] = useState(false); + const [form] = Form.useForm(); + const { t } = useTranslation(); + const { loading, data: lineTicketData } = useQuery( + GET_JOB_INFO_DRAW_CALCULATIONS, + { + variables: { id: jobId }, + skip: !jobId, + fetchPolicy: "network-only", + nextFetchPolicy: "network-only", + } + ); + + const handleOk = () => { + setVisible(false); + }; + + return ( + <> + setVisible(false)} + > +
+ + + {() => ( + + + + )} + + + + + + + + +