Compare commits
13 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f186d9f8be | ||
|
|
71a74c5437 | ||
|
|
6fe4d982f5 | ||
|
|
5ec032d8d6 | ||
|
|
2718a66fb0 | ||
|
|
4c737371e3 | ||
|
|
ee7a3d0bdf | ||
|
|
181af581e5 | ||
|
|
11e2f5d83d | ||
|
|
cbc723fa38 | ||
|
|
95c310119f | ||
|
|
ebe1facbd1 | ||
|
|
b021992552 |
@@ -133,15 +133,19 @@ const CardPaymentModalComponent = ({
|
||||
if (window.intellipay) {
|
||||
// eslint-disable-next-line no-eval
|
||||
eval(response.data);
|
||||
SetIntellipayCallbackFunctions();
|
||||
window.intellipay.autoOpen();
|
||||
pollForIntelliPay(() => {
|
||||
SetIntellipayCallbackFunctions();
|
||||
window.intellipay.autoOpen();
|
||||
});
|
||||
} else {
|
||||
const rg = document.createRange();
|
||||
const node = rg.createContextualFragment(response.data);
|
||||
document.documentElement.appendChild(node);
|
||||
SetIntellipayCallbackFunctions();
|
||||
window.intellipay.isAutoOpen = true;
|
||||
window.intellipay.initialize();
|
||||
pollForIntelliPay(() => {
|
||||
SetIntellipayCallbackFunctions();
|
||||
window.intellipay.isAutoOpen = true;
|
||||
window.intellipay.initialize();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
notification.open({
|
||||
@@ -345,3 +349,27 @@ const CardPaymentModalComponent = ({
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(CardPaymentModalComponent);
|
||||
|
||||
//Poll for window.IntelliPay.fixAmount for 5 seconds. If it doesn't come up, just try anyways to force the possible error.
|
||||
function pollForIntelliPay(callbackFunction) {
|
||||
const timeout = 5000;
|
||||
const interval = 150; // Poll every 100 milliseconds
|
||||
const startTime = Date.now();
|
||||
|
||||
function checkFixAmount() {
|
||||
if (window.intellipay && window.intellipay.fixAmount !== undefined) {
|
||||
callbackFunction();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Date.now() - startTime >= timeout) {
|
||||
console.log("Stopped polling IntelliPay after 10 seconds. Attemping to set functions anyways.");
|
||||
callbackFunction();
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(checkFixAmount, interval);
|
||||
}
|
||||
|
||||
checkFixAmount();
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { createStructuredSelector } from "reselect";
|
||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||
import { selectCardPayment } from "../../redux/modals/modals.selectors";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import CardPaymentModalComponent from "./card-payment-modal.component.";
|
||||
import CardPaymentModalComponent from "./card-payment-modal.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
cardPaymentModal: selectCardPayment,
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Form, Input, notification, Popover, Select, Space, Switch } from "antd";
|
||||
import axios from "axios";
|
||||
import React, { useState } from "react";
|
||||
import { some } from "lodash";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -18,7 +19,14 @@ const mapStateToProps = createStructuredSelector({
|
||||
jobRO: selectJobReadOnly
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type }))
|
||||
insertAuditTrail: ({ jobid, operation, type }) =>
|
||||
dispatch(
|
||||
insertAuditTrail({
|
||||
jobid,
|
||||
operation,
|
||||
type
|
||||
})
|
||||
)
|
||||
});
|
||||
|
||||
export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTrail, parentFormIsFieldsTouched }) {
|
||||
@@ -27,6 +35,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
||||
const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO);
|
||||
const { t } = useTranslation();
|
||||
const [form] = Form.useForm();
|
||||
const allFormValues = Form.useWatch([], form);
|
||||
|
||||
const handleConvert = async ({ employee_csr, category, ...values }) => {
|
||||
if (parentFormIsFieldsTouched()) {
|
||||
@@ -69,6 +78,8 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const submitDisabled = useCallback(() => some(allFormValues, (v) => v === undefined), [allFormValues]);
|
||||
|
||||
const popMenu = (
|
||||
<div>
|
||||
<Form
|
||||
@@ -77,9 +88,12 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
||||
onFinish={handleConvert}
|
||||
initialValues={{
|
||||
driveable: true,
|
||||
towin: false,
|
||||
towin: job.towin,
|
||||
ca_gst_registrant: job.ca_gst_registrant,
|
||||
employee_csr: job.employee_csr,
|
||||
category: job.category
|
||||
category: job.category,
|
||||
referral_source: job.referral_source,
|
||||
referral_source_extra: job.referral_source_extra ?? ""
|
||||
}}
|
||||
>
|
||||
<Form.Item
|
||||
@@ -209,7 +223,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Space wrap>
|
||||
<Button type="primary" danger onClick={() => form.submit()} loading={loading}>
|
||||
<Button disabled={submitDisabled()} type="primary" danger onClick={() => form.submit()} loading={loading}>
|
||||
{t("jobs.actions.convert")}
|
||||
</Button>
|
||||
<Button onClick={() => setOpen(false)}>{t("general.actions.close")}</Button>
|
||||
@@ -231,11 +245,6 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
setOpen(true);
|
||||
form.setFieldsValue({
|
||||
driveable: true,
|
||||
towin: false,
|
||||
employee_csr: job.employee_csr
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.convert")}
|
||||
|
||||
@@ -31,7 +31,7 @@ import { addAlerts } from "../../redux/application/application.actions.js";
|
||||
const JobsPage = lazy(() => import("../jobs/jobs.page"));
|
||||
|
||||
const CardPaymentModalContainer = lazy(
|
||||
() => import("../../components/card-payment-modal/card-payment-modal.container.")
|
||||
() => import("../../components/card-payment-modal/card-payment-modal.container.jsx")
|
||||
);
|
||||
|
||||
const JobsDetailPage = lazy(() => import("../jobs-detail/jobs-detail.page.container"));
|
||||
|
||||
@@ -380,11 +380,11 @@
|
||||
"md_parts_order_comment": "Parts Orders Comments",
|
||||
"md_parts_scan": {
|
||||
"caseInsensitive": "Case Insensitive",
|
||||
"expression": "",
|
||||
"field": "Field",
|
||||
"flags": "",
|
||||
"operation": "Operation",
|
||||
"value": "Value"
|
||||
"expression": "",
|
||||
"field": "Field",
|
||||
"flags": "",
|
||||
"operation": "Operation",
|
||||
"value": "Value"
|
||||
},
|
||||
"md_payment_types": "Payment Types",
|
||||
"md_referral_sources": "Referral Sources",
|
||||
@@ -715,15 +715,15 @@
|
||||
"workingdays": "Working Days"
|
||||
},
|
||||
"operations": {
|
||||
"contains": "Contains",
|
||||
"ends_with": "Ends With",
|
||||
"equals": "Equals",
|
||||
"greater_than": "Greater Than",
|
||||
"less_than": "Less Than",
|
||||
"not_equals": "Not Equals",
|
||||
"starts_with": "Starts With"
|
||||
},
|
||||
"successes": {
|
||||
"contains": "Contains",
|
||||
"ends_with": "Ends With",
|
||||
"equals": "Equals",
|
||||
"greater_than": "Greater Than",
|
||||
"less_than": "Less Than",
|
||||
"not_equals": "Not Equals",
|
||||
"starts_with": "Starts With"
|
||||
},
|
||||
"successes": {
|
||||
"areyousure": "Are you sure you want to continue?",
|
||||
"defaultviewcreated": "Default view created successfully.",
|
||||
"save": "Shop configuration saved successfully. ",
|
||||
@@ -1437,13 +1437,13 @@
|
||||
"adjustment": "Adjustment",
|
||||
"ah_detail_line": "Mark as Detail Labor Line (Autohouse Only)",
|
||||
"alt_partno": "Alt Part #",
|
||||
"amount": "Amount",
|
||||
"amount": "Amount",
|
||||
"assigned_team": "Team",
|
||||
"assigned_team_name": "Team {{name}}",
|
||||
"create_ppc": "Create PPC?",
|
||||
"db_price": "List Price",
|
||||
"include_in_part_cnt": "Include in Parts Status Count",
|
||||
"lbr_types": {
|
||||
"lbr_types": {
|
||||
"LA1": "LA1",
|
||||
"LA2": "LA2",
|
||||
"LA3": "LA3",
|
||||
@@ -3071,7 +3071,7 @@
|
||||
"production_by_repair_status": "Production by Status",
|
||||
"production_by_repair_status_one": "Production filtered by Status",
|
||||
"production_by_ro": "Production by RO",
|
||||
"production_by_target_date": "Production by Target Date",
|
||||
"production_by_target_date": "Production by Scheduled Completion",
|
||||
"production_by_technician": "Production by Technician",
|
||||
"production_by_technician_one": "Production filtered by Technician",
|
||||
"production_not_production_status": "Production not in Production Status",
|
||||
@@ -3081,7 +3081,8 @@
|
||||
"purchase_return_ratio_grouped_by_vendor_detail": "Purchase & Return Ratio by Vendor (Detail)",
|
||||
"purchase_return_ratio_grouped_by_vendor_summary": "Purchase & Return Ratio by Vendor (Summary)",
|
||||
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
|
||||
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)","purchases_by_date_excel": "Purchases by Date - Excel",
|
||||
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
||||
"purchases_by_date_excel": "Purchases by Date - Excel",
|
||||
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
||||
"purchases_by_date_range_summary": "Purchases by Date - Summary",
|
||||
"purchases_by_ro_detail_date": "Purchases by RO - Detail",
|
||||
|
||||
@@ -380,11 +380,11 @@
|
||||
"md_parts_order_comment": "",
|
||||
"md_parts_scan": {
|
||||
"caseInsensitive": "",
|
||||
"expression": "",
|
||||
"field": "",
|
||||
"expression": "",
|
||||
"field": "",
|
||||
"flags": "",
|
||||
"operation": "",
|
||||
"value": ""
|
||||
"operation": "",
|
||||
"value": ""
|
||||
},
|
||||
"md_payment_types": "",
|
||||
"md_referral_sources": "",
|
||||
@@ -715,15 +715,15 @@
|
||||
"workingdays": ""
|
||||
},
|
||||
"operations": {
|
||||
"contains": "",
|
||||
"ends_with": "",
|
||||
"equals": "",
|
||||
"greater_than": "",
|
||||
"less_than": "",
|
||||
"not_equals": "",
|
||||
"starts_with": ""
|
||||
},
|
||||
"successes": {
|
||||
"contains": "",
|
||||
"ends_with": "",
|
||||
"equals": "",
|
||||
"greater_than": "",
|
||||
"less_than": "",
|
||||
"not_equals": "",
|
||||
"starts_with": ""
|
||||
},
|
||||
"successes": {
|
||||
"areyousure": "",
|
||||
"defaultviewcreated": "",
|
||||
"save": "",
|
||||
@@ -1437,13 +1437,13 @@
|
||||
"adjustment": "",
|
||||
"ah_detail_line": "",
|
||||
"alt_partno": "",
|
||||
"amount": "",
|
||||
"amount": "",
|
||||
"assigned_team": "",
|
||||
"assigned_team_name": "",
|
||||
"create_ppc": "",
|
||||
"db_price": "Precio de base de datos",
|
||||
"include_in_part_cnt": "",
|
||||
"lbr_types": {
|
||||
"lbr_types": {
|
||||
"LA1": "",
|
||||
"LA2": "",
|
||||
"LA3": "",
|
||||
@@ -3082,7 +3082,7 @@
|
||||
"purchase_return_ratio_grouped_by_vendor_summary": "",
|
||||
"purchases_by_cost_center_detail": "",
|
||||
"purchases_by_cost_center_summary": "",
|
||||
"purchases_by_date_excel": "",
|
||||
"purchases_by_date_excel": "",
|
||||
"purchases_by_date_range_detail": "",
|
||||
"purchases_by_date_range_summary": "",
|
||||
"purchases_by_ro_detail_date": "",
|
||||
|
||||
@@ -380,11 +380,11 @@
|
||||
"md_parts_order_comment": "",
|
||||
"md_parts_scan": {
|
||||
"caseInsensitive": "",
|
||||
"expression": "",
|
||||
"field": "",
|
||||
"expression": "",
|
||||
"field": "",
|
||||
"flags": "",
|
||||
"operation": "",
|
||||
"value": ""
|
||||
"operation": "",
|
||||
"value": ""
|
||||
},
|
||||
"md_payment_types": "",
|
||||
"md_referral_sources": "",
|
||||
@@ -715,15 +715,15 @@
|
||||
"workingdays": ""
|
||||
},
|
||||
"operations": {
|
||||
"contains": "",
|
||||
"ends_with": "",
|
||||
"equals": "",
|
||||
"greater_than": "",
|
||||
"less_than": "",
|
||||
"not_equals": "",
|
||||
"starts_with": ""
|
||||
},
|
||||
"successes": {
|
||||
"contains": "",
|
||||
"ends_with": "",
|
||||
"equals": "",
|
||||
"greater_than": "",
|
||||
"less_than": "",
|
||||
"not_equals": "",
|
||||
"starts_with": ""
|
||||
},
|
||||
"successes": {
|
||||
"areyousure": "",
|
||||
"defaultviewcreated": "",
|
||||
"save": "",
|
||||
@@ -1437,13 +1437,13 @@
|
||||
"adjustment": "",
|
||||
"ah_detail_line": "",
|
||||
"alt_partno": "",
|
||||
"amount": "",
|
||||
"amount": "",
|
||||
"assigned_team": "",
|
||||
"assigned_team_name": "",
|
||||
"create_ppc": "",
|
||||
"db_price": "Prix de la base de données",
|
||||
"include_in_part_cnt": "",
|
||||
"lbr_types": {
|
||||
"lbr_types": {
|
||||
"LA1": "",
|
||||
"LA2": "",
|
||||
"LA3": "",
|
||||
@@ -3082,7 +3082,7 @@
|
||||
"purchase_return_ratio_grouped_by_vendor_summary": "",
|
||||
"purchases_by_cost_center_detail": "",
|
||||
"purchases_by_cost_center_summary": "",
|
||||
"purchases_by_date_excel": "",
|
||||
"purchases_by_date_excel": "",
|
||||
"purchases_by_date_range_detail": "",
|
||||
"purchases_by_date_range_summary": "",
|
||||
"purchases_by_ro_detail_date": "",
|
||||
|
||||
@@ -818,6 +818,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
PAG: Dinero(),
|
||||
PAO: Dinero(),
|
||||
PAS: Dinero(),
|
||||
PASL: Dinero(),
|
||||
PAP: Dinero(),
|
||||
PAM: Dinero(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user