fix: BIG-196 Bill landed cost transactions formatted allocate type.

This commit is contained in:
a.bouhuolia
2022-01-01 18:06:46 +02:00
parent cdb8ea6721
commit e0c565388a
2 changed files with 14 additions and 10 deletions

View File

@@ -27,11 +27,12 @@ function LocatedLandedCostTable({
// #withDrawerActions // #withDrawerActions
openDrawer, openDrawer,
}) { }) {
// Located landed cost table columns.
const columns = useLocatedLandedCostColumns(); const columns = useLocatedLandedCostColumns();
// Bill drawer context.
const { transactions, billId } = useBillDrawerContext(); const { transactions, billId } = useBillDrawerContext();
// Handle the transaction delete action. // Handle the transaction delete action.
const handleDeleteTransaction = ({ id }) => { const handleDeleteTransaction = ({ id }) => {
openAlert('bill-located-cost-delete', { BillId: id }); openAlert('bill-located-cost-delete', { BillId: id });

View File

@@ -1,10 +1,11 @@
import React from 'react'; import React from 'react';
import intl from 'react-intl-universal'; import intl from 'react-intl-universal';
import styled from 'styled-components'; import styled from 'styled-components';
import clsx from 'classnames';
import { Intent, MenuItem, Menu } from '@blueprintjs/core'; import { Intent, MenuItem, Menu } from '@blueprintjs/core';
import { safeCallback } from 'utils'; import { safeCallback } from 'utils';
import { Can, Icon } from 'components'; import { CLASSES } from 'common/classes';
import { BillAction, AbilitySubject } from '../../../common/abilityOption'; import { Icon } from 'components';
/** /**
* Actions menu. * Actions menu.
@@ -63,26 +64,28 @@ export function useLocatedLandedCostColumns() {
Header: intl.get('name'), Header: intl.get('name'),
accessor: NameAccessor, accessor: NameAccessor,
width: 150, width: 150,
className: 'name', textOverview: true,
}, },
{ {
Header: intl.get('amount'), Header: intl.get('amount'),
accessor: 'formatted_amount', accessor: 'formatted_amount',
width: 100, width: 100,
className: 'amount', align: 'right',
textOverview: true,
className: clsx(CLASSES.FONT_BOLD),
}, },
{ {
id: 'from_transaction', id: 'from_transaction',
Header: intl.get('From transaction'), Header: intl.get('From transaction'),
Cell: FromTransactionCell, Cell: FromTransactionCell,
width: 100, width: 100,
className: 'from-transaction', textOverview: true,
}, },
{ {
Header: intl.get('allocation_method'), Header: intl.get('allocation_method'),
accessor: 'allocation_method', accessor: 'allocation_method_formatted',
width: 100, width: 100,
className: 'allocation-method', textOverview: true,
}, },
], ],
[], [],
@@ -93,7 +96,7 @@ const LabelName = styled.div``;
const LabelDescription = styled.div` const LabelDescription = styled.div`
font-size: 12px; font-size: 12px;
margin-top: 6px; margin-top: 2px;
display: block; display: block;
opacity: 0.75; opacity: 0.75;
`; `;