Lint all the things
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||
import { Form, Input, Radio, Select } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -21,7 +20,7 @@ export function PaymentFormComponent({ form, bodyshop, disabled }) {
|
||||
} = useSplitTreatments({
|
||||
attributes: {},
|
||||
names: ["Qb_Multi_Ar"],
|
||||
splitKey: bodyshop && bodyshop.imexshopid
|
||||
splitKey: bodyshop?.imexshopid
|
||||
});
|
||||
|
||||
const { t } = useTranslation();
|
||||
@@ -95,15 +94,13 @@ export function PaymentFormComponent({ form, bodyshop, disabled }) {
|
||||
<Select disabled={disabled}>
|
||||
<Select.Option value={t("payments.labels.customer")}>{t("payments.labels.customer")}</Select.Option>
|
||||
{Qb_Multi_Ar.treatment === "on" ? (
|
||||
<>
|
||||
<Select.OptGroup label={t("payments.labels.external")}>
|
||||
{bodyshop.md_ins_cos.map((i, idx) => (
|
||||
<Select.Option key={idx} value={i.name}>
|
||||
{i.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select.OptGroup>
|
||||
</>
|
||||
<Select.OptGroup label={t("payments.labels.external")}>
|
||||
{bodyshop.md_ins_cos.map((i, idx) => (
|
||||
<Select.Option key={idx} value={i.name}>
|
||||
{i.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select.OptGroup>
|
||||
) : (
|
||||
<Select.Option value={t("payments.labels.insurance")}>{t("payments.labels.insurance")}</Select.Option>
|
||||
)}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useQuery } from "@apollo/client";
|
||||
import { Statistic } from "antd";
|
||||
import Dinero from "dinero.js";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { QUERY_JOB_PAYMENT_TOTALS } from "../../graphql/payments.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
@@ -22,7 +21,7 @@ export default function PaymentFormTotalPayments({ jobid }) {
|
||||
|
||||
if (!data) return <></>;
|
||||
const totalPayments = data.jobs_by_pk.payments.reduce((acc, val) => {
|
||||
return acc.add(Dinero({ amount: Math.round(((val && val.amount) || 0) * 100) }));
|
||||
return acc.add(Dinero({ amount: Math.round((val?.amount || 0) * 100) }));
|
||||
}, Dinero());
|
||||
|
||||
const balance =
|
||||
|
||||
Reference in New Issue
Block a user