|  |  |  | 
|---|
|  |  |  | useGetOne, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | EditBase, | 
|---|
|  |  |  | ReferenceField, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { useWatch, useFormContext } from "react-hook-form"; | 
|---|
|  |  |  | import { Stack, Grid, Box, Typography, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (data == null || data == undefined) { return } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <EditBase | 
|---|
|  |  |  | id={record?.id} | 
|---|
|  |  |  | resource="asnOrderItem" | 
|---|
|  |  |  | mutationMode={EDIT_MODE} | 
|---|
|  |  |  | actions={<CustomerTopToolBar />} | 
|---|
|  |  |  | <Dialog | 
|---|
|  |  |  | open={open} | 
|---|
|  |  |  | onClose={handleClose} | 
|---|
|  |  |  | aria-labelledby="form-dialog-title" | 
|---|
|  |  |  | fullWidth | 
|---|
|  |  |  | disableRestoreFocus | 
|---|
|  |  |  | maxWidth="md" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Dialog | 
|---|
|  |  |  | open={open} | 
|---|
|  |  |  | onClose={handleClose} | 
|---|
|  |  |  | aria-labelledby="form-dialog-title" | 
|---|
|  |  |  | fullWidth | 
|---|
|  |  |  | disableRestoreFocus | 
|---|
|  |  |  | maxWidth="md" | 
|---|
|  |  |  | <DialogTitle id="form-dialog-title" sx={{ | 
|---|
|  |  |  | position: 'sticky', | 
|---|
|  |  |  | top: 0, | 
|---|
|  |  |  | backgroundColor: 'background.paper', | 
|---|
|  |  |  | zIndex: 1000 | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <DialogTitle id="form-dialog-title" sx={{ | 
|---|
|  |  |  | position: 'sticky', | 
|---|
|  |  |  | top: 0, | 
|---|
|  |  |  | backgroundColor: 'background.paper', | 
|---|
|  |  |  | zIndex: 1000 | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | {translate('update.title')} | 
|---|
|  |  |  | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> | 
|---|
|  |  |  | <DialogCloseButton onClose={handleClose} /> | 
|---|
|  |  |  | </Box> | 
|---|
|  |  |  | </DialogTitle> | 
|---|
|  |  |  | <DialogContent sx={{ mt: 2 }}> | 
|---|
|  |  |  | <EditBase | 
|---|
|  |  |  | id={record?.id} | 
|---|
|  |  |  | resource="asnOrderItem" | 
|---|
|  |  |  | mutationMode={EDIT_MODE} | 
|---|
|  |  |  | actions={<CustomerTopToolBar />} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | {translate('update.title')} | 
|---|
|  |  |  | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> | 
|---|
|  |  |  | <DialogCloseButton onClose={handleClose} /> | 
|---|
|  |  |  | </Box> | 
|---|
|  |  |  | </DialogTitle> | 
|---|
|  |  |  | <DialogContent sx={{ mt: 2 }}> | 
|---|
|  |  |  | <Form | 
|---|
|  |  |  | shouldUnregister | 
|---|
|  |  |  | warnWhenUnsavedChanges | 
|---|
|  |  |  | 
|---|
|  |  |  | <Grid item xs={24} md={14}> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.asnId" | 
|---|
|  |  |  | source="asnId" | 
|---|
|  |  |  | label="table.field.asnOrderItem.orderId" | 
|---|
|  |  |  | source="orderId" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.asnCode" | 
|---|
|  |  |  | source="asnCode" | 
|---|
|  |  |  | label="table.field.asnOrderItem.orderCode" | 
|---|
|  |  |  | source="orderCode" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | 
|---|
|  |  |  | label="table.field.asnOrderItem.matnrId" | 
|---|
|  |  |  | source="matnrId" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.matnrCode" | 
|---|
|  |  |  | source="matnrCode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.maktx" | 
|---|
|  |  |  | source="maktx" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.anfme" | 
|---|
|  |  |  | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.qty" | 
|---|
|  |  |  | source="qty" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.splrCode" | 
|---|
|  |  |  | source="splrCode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <ReferenceInput source="splrName" label="table.field.asnOrderItem.splrName" reference="companys" filter={{type: 'supplier'}}> | 
|---|
|  |  |  | <AutocompleteInput optionText="name" label="table.field.asnOrderItem.splrName" /> | 
|---|
|  |  |  | </ReferenceInput> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.splrName" | 
|---|
|  |  |  | source="splrName" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.qrcode" | 
|---|
|  |  |  | source="qrcode" | 
|---|
|  |  |  | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.barcode" | 
|---|
|  |  |  | source="barcode" | 
|---|
|  |  |  | source="trackCode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.asnOrderItem.packName" | 
|---|
|  |  |  | 
|---|
|  |  |  | </Toolbar> | 
|---|
|  |  |  | </DialogActions> | 
|---|
|  |  |  | </Form> | 
|---|
|  |  |  | </DialogContent> | 
|---|
|  |  |  | </Dialog> | 
|---|
|  |  |  | </EditBase > | 
|---|
|  |  |  | </EditBase > | 
|---|
|  |  |  | </DialogContent> | 
|---|
|  |  |  | </Dialog> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|