mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: add inventory adjustment entries.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Card } from 'components';
|
||||
import { useTransactionsByReference } from 'hooks/query';
|
||||
import { useInventoryAdjustmentDrawerContext } from './InventoryAdjustmentDrawerProvider';
|
||||
|
||||
import JournalEntriesTable, {
|
||||
AmountDisplayedBaseCurrencyMessage,
|
||||
} from '../../JournalEntriesTable/JournalEntriesTable';
|
||||
|
||||
/**
|
||||
* Inentory adjustmet detail GL entries panel.
|
||||
* @returns {React.JSX}
|
||||
*/
|
||||
export default function InventoryAdjustmentDetailGLEntriesPanel() {
|
||||
const { inventoryId } = useInventoryAdjustmentDrawerContext();
|
||||
|
||||
// Handle fetch transaction by reference.
|
||||
const {
|
||||
data: { transactions },
|
||||
isLoading: isTransactionLoading,
|
||||
} = useTransactionsByReference(
|
||||
{
|
||||
reference_id: inventoryId,
|
||||
reference_type: 'inventoryAdjustment',
|
||||
},
|
||||
{ enabled: !!inventoryId },
|
||||
);
|
||||
|
||||
return (
|
||||
<InventoryAdjustmentGLEntriesRoot>
|
||||
<AmountDisplayedBaseCurrencyMessage />
|
||||
<JournalEntriesTable
|
||||
loading={isTransactionLoading}
|
||||
transactions={transactions}
|
||||
/>
|
||||
</InventoryAdjustmentGLEntriesRoot>
|
||||
);
|
||||
}
|
||||
|
||||
const InventoryAdjustmentGLEntriesRoot = styled(Card)``;
|
||||
Reference in New Issue
Block a user