u
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { legacy_connect as connect } from 'react-redux';
|
||||||
import Alert from '@mui/material/Alert';
|
import Alert from '@mui/material/Alert';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import CircularProgress from '@mui/material/CircularProgress';
|
import CircularProgress from '@mui/material/CircularProgress';
|
||||||
@@ -269,16 +269,16 @@ class LieferungNeuPage extends PureComponent {
|
|||||||
: null;
|
: null;
|
||||||
const newLines = Array.isArray(rawItems)
|
const newLines = Array.isArray(rawItems)
|
||||||
? rawItems.map((l) => ({
|
? rawItems.map((l) => ({
|
||||||
name: l.name ?? l.articleName ?? null,
|
name: l.name ?? l.articleName ?? null,
|
||||||
sku: l.sku ?? l.liefArtNr ?? '',
|
sku: l.sku ?? l.liefArtNr ?? '',
|
||||||
amount: (l.amount ?? l.count) != null ? String(l.amount ?? l.count) : '',
|
amount: (l.amount ?? l.count) != null ? String(l.amount ?? l.count) : '',
|
||||||
pu: (l.pu ?? l.vpe) != null ? String(l.pu ?? l.vpe) : '',
|
pu: (l.pu ?? l.vpe) != null ? String(l.pu ?? l.vpe) : '',
|
||||||
unit: l.unit ?? '',
|
unit: l.unit ?? '',
|
||||||
taxrate: (l.taxrate ?? l.tax ?? l.mwst) != null ? String(l.taxrate ?? l.tax ?? l.mwst) : '',
|
taxrate: (l.taxrate ?? l.tax ?? l.mwst) != null ? String(l.taxrate ?? l.tax ?? l.mwst) : '',
|
||||||
netprice: (l.netprice ?? l.net ?? (l.eknetto != null ? (l.eknetto / 100).toFixed(2) : null)) != null
|
netprice: (l.netprice ?? l.net ?? (l.eknetto != null ? (l.eknetto / 100).toFixed(2) : null)) != null
|
||||||
? String(l.netprice ?? l.net ?? (l.eknetto != null ? (l.eknetto / 100).toFixed(2) : ''))
|
? String(l.netprice ?? l.net ?? (l.eknetto != null ? (l.eknetto / 100).toFixed(2) : ''))
|
||||||
: '',
|
: '',
|
||||||
}))
|
}))
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
this.setState((prev) => ({
|
this.setState((prev) => ({
|
||||||
@@ -405,13 +405,13 @@ class LieferungNeuPage extends PureComponent {
|
|||||||
const doc = data[cfg.docField];
|
const doc = data[cfg.docField];
|
||||||
const apiLines = requireArray(doc.lines, `${cfg.docField}.lines`);
|
const apiLines = requireArray(doc.lines, `${cfg.docField}.lines`);
|
||||||
const lines = apiLines.length > 0 ? apiLines.map(lineFromApi) : [emptyLine()];
|
const lines = apiLines.length > 0 ? apiLines.map(lineFromApi) : [emptyLine()];
|
||||||
|
|
||||||
this.props.setDate(dateInputValue(doc.date));
|
this.props.setDate(dateInputValue(doc.date));
|
||||||
if (doc[cfg.partyField] != null) this.props.setDeliveryEntity(doc[cfg.partyField]);
|
if (doc[cfg.partyField] != null) this.props.setDeliveryEntity(doc[cfg.partyField]);
|
||||||
if (doc.number != null) this.props.setNumber(doc.number);
|
if (doc.number != null) this.props.setNumber(doc.number);
|
||||||
if (doc.externalNumber != null) this.props.setExternalNumber(String(doc.externalNumber));
|
if (doc.externalNumber != null) this.props.setExternalNumber(String(doc.externalNumber));
|
||||||
this.props.setLineitems(lines);
|
this.props.setLineitems(lines);
|
||||||
|
|
||||||
enqueueSnackbar(cfg.savedMsg, { variant: 'success' });
|
enqueueSnackbar(cfg.savedMsg, { variant: 'success' });
|
||||||
this.setState({ saving: false });
|
this.setState({ saving: false });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user