Skip to content

Commit

Permalink
OBPIH-1344: Fixed bug during creation of new stock movement
Browse files Browse the repository at this point in the history
  • Loading branch information
awalkowiak committed Oct 29, 2018
1 parent 0df100c commit de44f42
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ class CreateStockMovement extends Component {
checkStockMovementChange(newValues) {
const { origin, destination, stockList } = this.props.initialValues;

const originLocs = newValues.origin && origin;
const isOldSupplier = origin && origin.type === 'SUPPLIER';
const isNewSupplier = newValues.origin && newValues.type === 'SUPPLIER';
const checkOrigin = (!isOldSupplier && newValues.origin) || (isOldSupplier && !isNewSupplier) ?
const checkOrigin = originLocs && (!isOldSupplier || (isOldSupplier && !isNewSupplier)) ?
newValues.origin.id !== origin.id : false;

const checkDest = stockList && newValues.destination && destination ?
Expand Down

0 comments on commit de44f42

Please sign in to comment.