Add Stock Events Section to Stock Audit Info Component

- Introduced StockEventIcon and added a new section for Stock Events in the StockAuditInfo component.
- Updated the collapse state management to include stock events, enhancing the user interface and data visibility.
- Modified the ObjectTable to display stock events related to the selected stock audit, improving data representation and user experience.
This commit is contained in:
Tom Butcher 2026-09-01 16:34:58 +01:00
parent 3475c1b35d
commit 6800702881

View File

@ -14,6 +14,7 @@ import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx'
import NoteIcon from '../../../Icons/NoteIcon.jsx' import NoteIcon from '../../../Icons/NoteIcon.jsx'
import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx' import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx'
import StockAuditIcon from '../../../Icons/StockAuditIcon.jsx' import StockAuditIcon from '../../../Icons/StockAuditIcon.jsx'
import StockEventIcon from '../../../Icons/StockEventIcon.jsx'
import ObjectForm from '../../common/ObjectForm.jsx' import ObjectForm from '../../common/ObjectForm.jsx'
import EditButtons from '../../common/EditButtons.jsx' import EditButtons from '../../common/EditButtons.jsx'
import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx' import ObjectTableNavigationButtons from '../../common/ObjectTableNavigationButtons.jsx'
@ -41,6 +42,7 @@ const StockAuditInfo = () => {
{ {
info: true, info: true,
auditLines: true, auditLines: true,
stockEvents: true,
notes: true, notes: true,
auditLogs: false auditLogs: false
} }
@ -108,6 +110,7 @@ const StockAuditInfo = () => {
items={[ items={[
{ key: 'info', label: 'Stock Audit Information' }, { key: 'info', label: 'Stock Audit Information' },
{ key: 'auditLines', label: 'Audit Lines' }, { key: 'auditLines', label: 'Audit Lines' },
{ key: 'stockEvents', label: 'Stock Events' },
{ key: 'notes', label: 'Notes' }, { key: 'notes', label: 'Notes' },
{ key: 'auditLogs', label: 'Audit Logs' } { key: 'auditLogs', label: 'Audit Logs' }
]} ]}
@ -212,6 +215,32 @@ const StockAuditInfo = () => {
</ObjectForm> </ObjectForm>
</ActionHandler> </ActionHandler>
<InfoCollapse
title='Stock Events'
icon={<StockEventIcon />}
active={collapseState.stockEvents}
onToggle={(expanded) =>
updateCollapseState('stockEvents', expanded)
}
collapseKey='stockEvents'
>
{objectFormState.loading ? (
<InfoCollapsePlaceholder />
) : (
<ObjectTable
type='stockEvent'
masterFilter={{
owner:
getModelByName('stockAudit').prefix + ':' + stockAuditId
}}
visibleColumns={{
owner: false,
'owner.type': false
}}
/>
)}
</InfoCollapse>
<InfoCollapse <InfoCollapse
title='Notes' title='Notes'
icon={<NoteIcon />} icon={<NoteIcon />}