Skip to content

Commit

Permalink
Merge pull request #5356 from msupply-foundation/5354-Hide-extra-colu…
Browse files Browse the repository at this point in the history
…mns-if-Requisition-is-created-from-Internal-Order

5354 Hide extra columns for general requisitions
  • Loading branch information
roxy-dao authored Nov 10, 2024
2 parents 5eeca4b + 5880cc6 commit 3a50162
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const LabelAndOptions = <T,>({
<Grid item>
{noOptionsDisplay || (
<Autocomplete
width="300"
width="450"
renderOption={renderOption}
getOptionDisabled={getOptionDisabled}
autoFocus={autoFocus}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,84 +107,88 @@ export const ResponseLineEdit = ({
sx={{ marginBottom: 1 }}
/>
)}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.incomingUnits}
onChange={value => update({ incomingUnits: value })}
onBlur={save}
{isProgram && (
<>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.incomingUnits}
onChange={value => update({ incomingUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.incoming-stock')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.incoming-stock')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.outgoingUnits}
onChange={value => update({ outgoingUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.outgoingUnits}
onChange={value => update({ outgoingUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.outgoing')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.outgoing')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.lossInUnits}
onChange={value => update({ lossInUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.lossInUnits}
onChange={value => update({ lossInUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.losses')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.losses')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.additionInUnits}
onChange={value => update({ additionInUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.additionInUnits}
onChange={value => update({ additionInUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.additions')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.additions')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.expiringUnits}
onChange={value => update({ expiringUnits: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.expiringUnits}
onChange={value => update({ expiringUnits: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.short-expiry')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.short-expiry')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.daysOutOfStock}
onChange={value => update({ daysOutOfStock: value })}
onBlur={save}
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={draft?.daysOutOfStock}
onChange={value => update({ daysOutOfStock: value })}
onBlur={save}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.days-out-of-stock')}
sx={{ marginBottom: 1 }}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.days-out-of-stock')}
sx={{ marginBottom: 1 }}
/>
</>
)}
<InputWithLabelRow
Input={
<NumericTextInput
Expand All @@ -200,18 +204,20 @@ export const ResponseLineEdit = ({
label={t('label.amc')}
sx={{ marginBottom: 1 }}
/>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={MOS}
disabled
decimalLimit={2}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.months-of-stock')}
/>
{isProgram && (
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={MOS}
disabled
decimalLimit={2}
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.months-of-stock')}
/>
)}
</Box>
<Box>
{/* Right column content */}
Expand Down Expand Up @@ -275,18 +281,20 @@ export const ResponseLineEdit = ({
)}
</Box>
</Box>
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={available}
disabled
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.available')}
sx={{ marginBottom: 1 }}
/>
{isProgram && (
<InputWithLabelRow
Input={
<NumericTextInput
width={INPUT_WIDTH}
value={available}
disabled
/>
}
labelWidth={LABEL_WIDTH}
label={t('label.available')}
sx={{ marginBottom: 1 }}
/>
)}
<InputWithLabelRow
Input={
<NumericTextInput
Expand Down Expand Up @@ -376,26 +384,28 @@ export const ResponseLineEdit = ({
)}
</Box>
</Box>
<InputWithLabelRow
Input={
<ReasonOptionsSearchInput
value={draft?.reason}
onChange={value => {
update({ reason: value });
}}
width={200}
type={ReasonOptionNodeType.RequisitionLineVariance}
isDisabled={
draft?.requestedQuantity === draft?.suggestedQuantity ||
!!hasLinkedRequisition
}
onBlur={save}
/>
}
labelWidth={'66px'}
label={t('label.reason')}
sx={{ marginBottom: 1 }}
/>
{isProgram && (
<InputWithLabelRow
Input={
<ReasonOptionsSearchInput
value={draft?.reason}
onChange={value => {
update({ reason: value });
}}
width={200}
type={ReasonOptionNodeType.RequisitionLineVariance}
isDisabled={
draft?.requestedQuantity === draft?.suggestedQuantity ||
!!hasLinkedRequisition
}
onBlur={save}
/>
}
labelWidth={'66px'}
label={t('label.reason')}
sx={{ marginBottom: 1 }}
/>
)}
<InputWithLabelRow
Input={
<TextArea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const RequestStoreStats: React.FC<RequestStoreStatsProps> = ({
: 100;

return (
<Box sx={{ height: 400, width: 500 }}>
<Box sx={{ maxHeight: 400, width: 500, minHeight: 200 }}>
<Box display="flex" flexDirection="column" paddingTop={2} paddingLeft={4}>
<Box display="flex">
<Typography fontSize={12} fontWeight={700}>
Expand Down
Loading

0 comments on commit 3a50162

Please sign in to comment.