Successful 2tier and 3 tier export of invoices. BOD-83 BOD-131

This commit is contained in:
Patrick Fic
2020-06-02 09:19:46 -07:00
parent 5564b5dc4a
commit 73040064d4
16 changed files with 265 additions and 112 deletions

View File

@@ -0,0 +1,43 @@
import { Button } from "antd";
import axios from "axios";
import React from "react";
import { useTranslation } from "react-i18next";
import { auth } from "../../firebase/firebase.utils";
export default function JobsCloseExportButton({ jobId, disabled }) {
const { t } = useTranslation();
const handleQbxml = async () => {
const response = await axios.post(
"/accounting/qbxml/receivables",
{ jobId: jobId },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
},
}
);
console.log("handle -> XML", response);
try {
const response2 = await axios.post(
"http://e9c5a8ed9079.ngrok.io/qb/receivables",
response.data,
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
},
}
);
console.log("handle -> result", response2);
} catch (error) {
console.log("error", error, JSON.stringify(error));
}
};
return (
<Button onClick={handleQbxml} disabled={disabled} type="dashed">
{t("jobs.actions.export")}
</Button>
);
}