mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
feature(expense)/ cost landed checkbox.
This commit is contained in:
@@ -8,9 +8,7 @@ const Schema = Yup.object().shape({
|
|||||||
payment_account_id: Yup.number()
|
payment_account_id: Yup.number()
|
||||||
.required()
|
.required()
|
||||||
.label(intl.get('payment_account_')),
|
.label(intl.get('payment_account_')),
|
||||||
payment_date: Yup.date()
|
payment_date: Yup.date().required().label(intl.get('payment_date_')),
|
||||||
.required()
|
|
||||||
.label(intl.get('payment_date_')),
|
|
||||||
reference_no: Yup.string().min(1).max(DATATYPES_LENGTH.STRING).nullable(),
|
reference_no: Yup.string().min(1).max(DATATYPES_LENGTH.STRING).nullable(),
|
||||||
currency_code: Yup.string()
|
currency_code: Yup.string()
|
||||||
.nullable()
|
.nullable()
|
||||||
@@ -33,6 +31,7 @@ const Schema = Yup.object().shape({
|
|||||||
is: (amount) => !isBlank(amount),
|
is: (amount) => !isBlank(amount),
|
||||||
then: Yup.number().required(),
|
then: Yup.number().required(),
|
||||||
}),
|
}),
|
||||||
|
landed_cost: Yup.boolean(),
|
||||||
description: Yup.string().max(DATATYPES_LENGTH.TEXT).nullable(),
|
description: Yup.string().max(DATATYPES_LENGTH.TEXT).nullable(),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Button, Tooltip, Intent, Position } from '@blueprintjs/core';
|
import { Button, Tooltip, Intent, Position, Checkbox } from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T } from 'components';
|
import { FormattedMessage as T } from 'components';
|
||||||
import { Icon, Hint } from 'components';
|
import { Icon, Hint } from 'components';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
@@ -49,6 +49,35 @@ const ActionsCellRenderer = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Landed cost cell.
|
||||||
|
*/
|
||||||
|
const LandedCostCell = ({
|
||||||
|
row: { index },
|
||||||
|
column: { id },
|
||||||
|
cell: { value: initialValue },
|
||||||
|
data,
|
||||||
|
payload,
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<Tooltip content={''} position={Position.RIGHT}>
|
||||||
|
<Checkbox minimal={true} className="ml2" />
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Landed cost header cell.
|
||||||
|
*/
|
||||||
|
const LandedCostHeaderCell = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<T id={'cost'} />
|
||||||
|
<Hint content={''} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amount footer cell.
|
* Amount footer cell.
|
||||||
*/
|
*/
|
||||||
@@ -114,6 +143,15 @@ export function useExpenseFormTableColumns() {
|
|||||||
className: 'description',
|
className: 'description',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Header: LandedCostHeaderCell,
|
||||||
|
accessor: 'landed_cost',
|
||||||
|
Cell: LandedCostCell,
|
||||||
|
disableSortBy: true,
|
||||||
|
disableResizing: true,
|
||||||
|
width: 70,
|
||||||
|
className: 'landed_cost',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Header: '',
|
Header: '',
|
||||||
accessor: 'action',
|
accessor: 'action',
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export const defaultExpenseEntry = {
|
|||||||
amount: '',
|
amount: '',
|
||||||
expense_account_id: '',
|
expense_account_id: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
landed_cost: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExpense = {
|
export const defaultExpense = {
|
||||||
|
|||||||
Reference in New Issue
Block a user