Skip to content

Commit

Permalink
UIOR-569 Revert "UIOR-433 revert" (#909)
Browse files Browse the repository at this point in the history
* Revert "UIOR-433 revert (#892)"
  • Loading branch information
aliaksei-chumakou committed Jul 8, 2020
1 parent 942b4ae commit 2971a7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## (IN PROGRESS)

### Stories
* [UIOR-569](https://issues.folio.org/browse/UIOR-569) Ability to change price and fund distribution information for Open order

### Bug fixes
* [UIOR-578](https://issues.folio.org/browse/UIOR-578) Claim filters not working
Expand Down
13 changes: 6 additions & 7 deletions src/components/POLine/Cost/CostForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
stripesShape,
} from '@folio/stripes/core';

import { ifDisabledToChangePaymentInfo, isWorkflowStatusIsPending } from '../../PurchaseOrder/util';
import { ifDisabledToChangePaymentInfo } from '../../PurchaseOrder/util';
import parseNumber from '../../Utils/parseNumber';
import FieldCurrency from './FieldCurrency';
import {
Expand Down Expand Up @@ -95,7 +95,6 @@ class CostForm extends Component {
render() {
const { order, required, formValues, stripes } = this.props;
const orderFormat = formValues.orderFormat;
const isPostPendingOrder = !isWorkflowStatusIsPending(order);
const isDisabledToChangePaymentInfo = ifDisabledToChangePaymentInfo(order);

let validateEresourcesPrices = ATTRS_TO_DISABLE_FIELD;
Expand Down Expand Up @@ -136,7 +135,7 @@ class CostForm extends Component {
name="cost.listUnitPrice"
parse={parseNumberFieldValue}
type="number"
disabled={isPostPendingOrder}
disabled={isDisabledToChangePaymentInfo}
{...validatePhresourcesPrices}
/>
</Col>
Expand All @@ -146,7 +145,7 @@ class CostForm extends Component {
md={3}
>
<FieldCurrency
disabled={isPostPendingOrder}
disabled={isDisabledToChangePaymentInfo}
required={required}
/>
</Col>
Expand Down Expand Up @@ -179,7 +178,7 @@ class CostForm extends Component {
parse={parseNumberFieldValue}
type="number"
validate={validateNotNegative}
disabled={isPostPendingOrder}
disabled={isDisabledToChangePaymentInfo}
/>
</Col>
{isElectornicFieldsVisible && (
Expand All @@ -194,7 +193,7 @@ class CostForm extends Component {
name="cost.listUnitPriceElectronic"
parse={parseNumberFieldValue}
type="number"
disabled={isPostPendingOrder}
disabled={isDisabledToChangePaymentInfo}
{...validateEresourcesPrices}
/>
</Col>
Expand All @@ -215,7 +214,7 @@ class CostForm extends Component {
name="cost.discount"
normalize={this.normalizeDiscount}
validate={validateNotNegative}
disabled={isPostPendingOrder}
disabled={isDisabledToChangePaymentInfo}
/>
</Col>
{isElectornicFieldsVisible && (
Expand Down
6 changes: 3 additions & 3 deletions src/components/POLine/POLineForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import getMaterialTypesForSelect from '../Utils/getMaterialTypesForSelect';
import getIdentifierTypesForSelect from '../Utils/getIdentifierTypesForSelect';
import getContributorNameTypesForSelect from '../Utils/getContributorNameTypesForSelect';
import getOrderTemplatesForSelect from '../Utils/getOrderTemplatesForSelect';
import { isWorkflowStatusIsPending } from '../PurchaseOrder/util';
import { ifDisabledToChangePaymentInfo } from '../PurchaseOrder/util';
import calculateEstimatedPrice from './calculateEstimatedPrice';
import asyncValidate from './asyncValidate';
import validate from './validate';
Expand Down Expand Up @@ -247,7 +247,7 @@ class POLineForm extends Component {
const orderTemplates = getOrderTemplatesForSelect(parentResources);
const locations = parentResources?.locations?.records;
const locationIds = locations?.map(({ id }) => id);
const isPostPendingOrder = !isWorkflowStatusIsPending(order);
const isDisabledToChangePaymentInfo = ifDisabledToChangePaymentInfo(order);
const estimatedPrice = calculateEstimatedPrice(formValues, stripes.currency);
const { accounts } = vendor;
const fundDistribution = get(formValues, 'fundDistribution');
Expand Down Expand Up @@ -358,7 +358,7 @@ class POLineForm extends Component {
formName="POLineForm"
fundDistribution={fundDistribution}
name="fundDistribution"
disabled={isPostPendingOrder}
disabled={isDisabledToChangePaymentInfo}
totalAmount={estimatedPrice}
/>
</Accordion>
Expand Down

0 comments on commit 2971a7d

Please sign in to comment.