mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
feat(webapp): add tax compund tag to tax rates
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Intent, Tag } from '@blueprintjs/core';
|
import { Intent, Tag } from '@blueprintjs/core';
|
||||||
import { Align } from '@/constants';
|
import { Align } from '@/constants';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const codeAccessor = (taxRate) => {
|
const codeAccessor = (taxRate) => {
|
||||||
return (
|
return (
|
||||||
@@ -23,6 +24,19 @@ const statusAccessor = (taxRate) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const nameAccessor = (taxRate) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<span>{taxRate.name}</span>
|
||||||
|
{!!taxRate.is_compound && <CompoundText>(Compound tax)</CompoundText>}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const DescriptionAccessor = (taxRate) => {
|
||||||
|
return <DescriptionText>{taxRate.description}</DescriptionText>;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the tax rates table columns.
|
* Retrieves the tax rates table columns.
|
||||||
*/
|
*/
|
||||||
@@ -30,8 +44,8 @@ export const useTaxRatesTableColumns = () => {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
Header: 'Name',
|
Header: 'Name',
|
||||||
accessor: 'name',
|
accessor: nameAccessor,
|
||||||
width: 50,
|
width: 60,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Code',
|
Header: 'Code',
|
||||||
@@ -46,8 +60,8 @@ export const useTaxRatesTableColumns = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Description',
|
Header: 'Description',
|
||||||
accessor: 'description',
|
accessor: DescriptionAccessor,
|
||||||
width: 110,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Status',
|
Header: 'Status',
|
||||||
@@ -57,3 +71,12 @@ export const useTaxRatesTableColumns = () => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const CompoundText = styled('span')`
|
||||||
|
color: #738091;
|
||||||
|
margin-left: 5px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const DescriptionText = styled('span')`
|
||||||
|
color: #5f6b7c;
|
||||||
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user