Resolve stripe issues on export IO-490

This commit is contained in:
Patrick Fic
2021-02-18 11:37:01 -08:00
parent 01500e4c9c
commit cd6866fc5c
9 changed files with 39 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
<babeledit_project be_version="2.7.1" version="1.2"> <babeledit_project version="1.2" be_version="2.7.1">
<!-- <!--
BabelEdit project file BabelEdit project file
@@ -23448,6 +23448,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>exporting-partner</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children> </children>
</folder_node> </folder_node>
<folder_node> <folder_node>

View File

@@ -57,7 +57,9 @@ export function JobChecklistForm({
...(type === "intake" && { ...(type === "intake" && {
scheduled_completion: values.scheduled_completion, scheduled_completion: values.scheduled_completion,
}), }),
...(type === "deliver" && {
actual_completion: values.actual_completion,
}),
[(type === "intake" && "intakechecklist") || [(type === "intake" && "intakechecklist") ||
(type === "deliver" && "deliverchecklist")]: { (type === "deliver" && "deliverchecklist")]: {
...values, ...values,
@@ -154,7 +156,7 @@ export function JobChecklistForm({
{type === "deliver" && ( {type === "deliver" && (
<div> <div>
<Form.Item <Form.Item
name="actualCompletion" name="actual_completion"
label={t("jobs.fields.actual_completion")} label={t("jobs.fields.actual_completion")}
rules={[ rules={[
{ {

View File

@@ -32,11 +32,7 @@ export default function ShopEmployeesListComponent({
dataIndex: "last_name", dataIndex: "last_name",
key: "last_name", key: "last_name",
}, },
{
title: t("employees.fields.cost_center"),
dataIndex: "cost_center",
key: "cost_center",
},
{ {
title: t("employees.fields.base_rate"), title: t("employees.fields.base_rate"),
dataIndex: "base_rate", dataIndex: "base_rate",

View File

@@ -198,7 +198,7 @@ export const QUERY_DELIVER_CHECKLIST = gql`
`; `;
export const QUERY_STRIPE_ID = gql` export const QUERY_STRIPE_ID = gql`
query QUERY_STRIPE_ID { query QUERY_STRIPE_ID {
bodyshops { bodyshops(where: { associations: { active: { _eq: true } } }) {
stripe_acct_id stripe_acct_id
} }
} }

View File

@@ -148,9 +148,12 @@ const { Content, Header } = Layout;
const stripePromise = new Promise((resolve, reject) => { const stripePromise = new Promise((resolve, reject) => {
client.query({ query: QUERY_STRIPE_ID }).then((resp) => { client.query({ query: QUERY_STRIPE_ID }).then((resp) => {
console.log(resp);
resolve( resolve(
loadStripe(process.env.REACT_APP_STRIPE_PUBLIC_KEY, { loadStripe(process.env.REACT_APP_STRIPE_PUBLIC_KEY, {
stripeAccount: resp.data.bodyshops[0].stripe_acct_id || "", stripeAccount:
resp.data.bodyshops[0].stripe_acct_id || "No Stripe Id Resolve",
}) })
); );
}); });

View File

@@ -1423,7 +1423,8 @@
}, },
"payments": { "payments": {
"errors": { "errors": {
"exporting": "Error exporting payment(s). {{error}}" "exporting": "Error exporting payment(s). {{error}}",
"exporting-partner": "Error exporting to partner. Please check the partner interaction log for more errors."
}, },
"fields": { "fields": {
"amount": "Amount", "amount": "Amount",

View File

@@ -1423,7 +1423,8 @@
}, },
"payments": { "payments": {
"errors": { "errors": {
"exporting": "" "exporting": "",
"exporting-partner": ""
}, },
"fields": { "fields": {
"amount": "", "amount": "",

View File

@@ -1423,7 +1423,8 @@
}, },
"payments": { "payments": {
"errors": { "errors": {
"exporting": "" "exporting": "",
"exporting-partner": ""
}, },
"fields": { "fields": {
"amount": "", "amount": "",

View File

@@ -110,8 +110,7 @@ const generatePayment = (payment) => {
payment.job.bodyshop.md_responsibility_centers.ar.accountname, payment.job.bodyshop.md_responsibility_centers.ar.accountname,
}, },
TxnDate: moment(payment.date).format("YYYY-MM-DD"), //Trim String TxnDate: moment(payment.date).format("YYYY-MM-DD"), //Trim String
RefNumber: RefNumber: payment.paymentnum || payment.transactionid,
payment.paymentnum || payment.stripeid || payment.transactionid,
TotalAmount: Dinero({ TotalAmount: Dinero({
amount: Math.round(payment.amount * 100), amount: Math.round(payment.amount * 100),
}).toFormat(DineroQbFormat), }).toFormat(DineroQbFormat),