diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 65c608655..776e3e524 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -35220,6 +35220,27 @@
+
+ markexported
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
payment
false
diff --git a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx
index 05e5277dd..61b1bb5f9 100644
--- a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx
+++ b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx
@@ -1,19 +1,20 @@
import { Card, Input, Space, Table } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
+import { connect } from "react-redux";
import { Link } from "react-router-dom";
+import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.utils";
+import { selectBodyshop } from "../../redux/user/user.selectors";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
import { alphaSort, dateSort } from "../../utils/sorters";
+import ExportLogsCountDisplay from "../export-logs-count-display/export-logs-count-display.component";
+import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
import PaymentExportButton from "../payment-export-button/payment-export-button.component";
+import PaymentMarkSelectedExported from "../payment-mark-selected-exported/payment-mark-selected-exported.component";
import PaymentsExportAllButton from "../payments-export-all-button/payments-export-all-button.component";
import QboAuthorizeComponent from "../qbo-authorize/qbo-authorize.component";
-import { connect } from "react-redux";
-import { createStructuredSelector } from "reselect";
-import { selectBodyshop } from "../../redux/user/user.selectors";
-import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
-import ExportLogsCountDisplay from "../export-logs-count-display/export-logs-count-display.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -184,6 +185,13 @@ export function AccountingPayablesTableComponent({
+
({
+ //setUserLanguage: language => dispatch(setUserLanguage(language))
+});
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(PaymentMarkSelectedExported);
+
+export function PaymentMarkSelectedExported({
+ bodyshop,
+ currentUser,
+ paymentIds,
+ disabled,
+ loadingCallback,
+ completedCallback,
+ refetch,
+}) {
+ const { t } = useTranslation();
+ const [loading, setLoading] = useState(false);
+ const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
+ const [updatePayments] = useMutation(gql`
+ mutation UPDATE_PAYMENTS($paymentIds: [uuid!]!, $exportedat: timestamptz!) {
+ update_payments(
+ where: { id: { _in: $paymentIds } }
+ _set: { exportedat: $exportedat }
+ ) {
+ returning {
+ id
+ exportedat
+ }
+ }
+ }
+ `);
+
+ const handleUpdate = async () => {
+ setLoading(true);
+ loadingCallback(true);
+ const result = await updatePayments({
+ variables: { paymentIds: paymentIds, exportedat: new Date() },
+ update(cache) {},
+ });
+
+ await insertExportLog({
+ variables: {
+ logs: paymentIds.map((id) => {
+ return {
+ bodyshopid: bodyshop.id,
+ paymentid: id,
+ successful: true,
+ message: JSON.stringify([t("general.labels.markedexported")]),
+ useremail: currentUser.email,
+ };
+ }),
+ },
+ });
+
+ if (!result.errors) {
+ notification["success"]({
+ message: t("payments.successes.markexported"),
+ });
+ } else {
+ notification["error"]({
+ message: t("bills.errors.saving", {
+ error: JSON.stringify(result.errors),
+ }),
+ });
+ }
+ loadingCallback(false);
+ completedCallback && completedCallback([]);
+ setLoading(false);
+ refetch && refetch();
+ };
+
+ return (
+
+ );
+}
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index a83e17ba6..81da5a4d8 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -2085,6 +2085,7 @@
},
"successes": {
"exported": "Payment(s) exported successfully.",
+ "markexported": "Payment(s) marked exported.",
"payment": "Payment created successfully. ",
"stripe": "Credit card transaction charged successfully."
}
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 1044b521c..713cacc30 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -2085,6 +2085,7 @@
},
"successes": {
"exported": "",
+ "markexported": "",
"payment": "",
"stripe": ""
}
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 57f9cdb9b..566c5e541 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -2085,6 +2085,7 @@
},
"successes": {
"exported": "",
+ "markexported": "",
"payment": "",
"stripe": ""
}