IO-1868 Prevent returns on invoiced RO.

This commit is contained in:
Patrick Fic
2022-05-26 15:11:44 -07:00
parent e1e5dda710
commit 653692b2a5

View File

@@ -4,6 +4,7 @@ import React, { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { createStructuredSelector } from "reselect"; import { createStructuredSelector } from "reselect";
import { selectJobReadOnly } from "../../redux/application/application.selectors";
import { setModalContext } from "../../redux/modals/modals.actions"; import { setModalContext } from "../../redux/modals/modals.actions";
import { selectBodyshop } from "../../redux/user/user.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors";
import CurrencyFormatter from "../../utils/CurrencyFormatter"; import CurrencyFormatter from "../../utils/CurrencyFormatter";
@@ -14,7 +15,7 @@ import BillDeleteButton from "../bill-delete-button/bill-delete-button.component
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component"; import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
//jobRO: selectJobReadOnly, jobRO: selectJobReadOnly,
bodyshop: selectBodyshop, bodyshop: selectBodyshop,
}); });
@@ -29,6 +30,7 @@ const mapDispatchToProps = (dispatch) => ({
export function BillsListTableComponent({ export function BillsListTableComponent({
bodyshop, bodyshop,
jobRO,
job, job,
billsQuery, billsQuery,
handleOnRowClick, handleOnRowClick,
@@ -58,7 +60,9 @@ export function BillsListTableComponent({
<BillDeleteButton bill={record} /> <BillDeleteButton bill={record} />
<Button <Button
disabled={ disabled={
record.is_credit_memo || record.vendorid === bodyshop.inhousevendorid record.is_credit_memo ||
record.vendorid === bodyshop.inhousevendorid ||
jobRO
} }
onClick={() => { onClick={() => {
setPartsOrderContext({ setPartsOrderContext({