mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 07:40:32 +00:00
Compare commits
25 Commits
BIG-237-va
...
BIG-359-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c49a240280 | ||
|
|
dbf4666dfc | ||
|
|
b0cf8f723f | ||
|
|
b0a826e62a | ||
|
|
6daa9f09a5 | ||
|
|
f828d85880 | ||
|
|
46d895bef9 | ||
|
|
1fa26c7cb7 | ||
|
|
41d2fc63cb | ||
|
|
4814a40fa9 | ||
|
|
b903aa3eb2 | ||
|
|
872b98fb0d | ||
|
|
b849bfaa95 | ||
|
|
756af3c4d3 | ||
|
|
b935d13918 | ||
|
|
4aea9cb19b | ||
|
|
d22212e6e3 | ||
|
|
6a6ff16c48 | ||
|
|
d08894820d | ||
|
|
2db32b8ee8 | ||
|
|
86c6de361b | ||
|
|
9bd13b0d46 | ||
|
|
30b17d697f | ||
|
|
ce674466fe | ||
|
|
373a695c4c |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -2,6 +2,27 @@
|
||||
|
||||
All notable changes to Bigcapital server-side will be in this file.
|
||||
|
||||
## [1.7.1-rc.2] - 30-03-2022
|
||||
|
||||
## Added
|
||||
- `BIG-141` Add inactive status to item drawer details.
|
||||
- `BIG-278` Add created at date on expense details.
|
||||
- `BIG-350` Add empty status content of warehouse transfers service.
|
||||
- `BIG-344` Add branch details to manual journal and expense details.
|
||||
## Fixed
|
||||
- `BIG-221` Remove Non-inventory radio choice on item form.
|
||||
- `BIG-236` Validate estimate expiration date should be equal or bigger than estimate date.
|
||||
- `BIG-237` Validate invoice due date should be equal or bigger than invoice date.
|
||||
- `BIG-238` Validate bill due date should be equal or bigger than bill date.
|
||||
- `BIG-280` Optimize style of multi-select accounts menu.
|
||||
- `BIG-284` Cashflow statement loading bar.
|
||||
- `BIG-296` Creating a new child account from accounts list.
|
||||
- `BIG-301` Navigation bar divider on actions bar hide with permissions control.
|
||||
- `BIG-304` Adding cash or bank account from cash flow service.
|
||||
- `BIG-351` Invalid date in the inventory adjustment detail.
|
||||
- `BIG-352` Fix terms and notes fields on footer of all services.
|
||||
- `BIG-354` Validate the warehouse transfer quantity should be above zero.
|
||||
|
||||
## [1.7.0-rc.1] - 24-03-2022
|
||||
|
||||
## Added
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bigcapital-client",
|
||||
"version": "1.6.3",
|
||||
"version": "1.7.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/core": "7.8.4",
|
||||
|
||||
8
src/common/journalTypes.js
Normal file
8
src/common/journalTypes.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const journalTypes = [
|
||||
{
|
||||
name: intl.get('journal'),
|
||||
value: 'Journal',
|
||||
},
|
||||
];
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
FormGroup,
|
||||
Position,
|
||||
ControlGroup,
|
||||
Classes,
|
||||
} from '@blueprintjs/core';
|
||||
import { FastField, ErrorMessage } from 'formik';
|
||||
import { DateInput } from '@blueprintjs/datetime';
|
||||
@@ -11,6 +12,8 @@ import { FormattedMessage as T } from 'components';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { journalTypes } from '../../../common/journalTypes';
|
||||
import { FFormGroup } from '../../../components';
|
||||
import {
|
||||
momentFormatter,
|
||||
compose,
|
||||
@@ -28,12 +31,13 @@ import {
|
||||
} from 'components';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import { useMakeJournalFormContext } from './MakeJournalProvider';
|
||||
import { JournalExchangeRateInputField } from './components';
|
||||
import { JournalExchangeRateInputField, JournalTypeSelect } from './components';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import {
|
||||
currenciesFieldShouldUpdate,
|
||||
useObserveJournalNoSettings,
|
||||
} from './utils';
|
||||
|
||||
/**
|
||||
* Make journal entries header.
|
||||
*/
|
||||
@@ -169,21 +173,18 @@ function MakeJournalEntriesHeader({
|
||||
</FastField>
|
||||
|
||||
{/*------------ Journal type -----------*/}
|
||||
<FastField name={'journal_type'}>
|
||||
{({ form, field, meta: { error, touched } }) => (
|
||||
<FormGroup
|
||||
label={<T id={'journal_type'} />}
|
||||
className={classNames('form-group--account-type', CLASSES.FILL)}
|
||||
inline={true}
|
||||
>
|
||||
<InputGroup
|
||||
intent={inputIntent({ error, touched })}
|
||||
fill={true}
|
||||
{...field}
|
||||
/>
|
||||
</FormGroup>
|
||||
)}
|
||||
</FastField>
|
||||
<FFormGroup
|
||||
name={'journal_type'}
|
||||
label={<T id={'journal_type'} />}
|
||||
inline={true}
|
||||
className={classNames('form-group--select-list', Classes.FILL)}
|
||||
>
|
||||
<JournalTypeSelect
|
||||
items={journalTypes}
|
||||
name={'journal_type'}
|
||||
popoverProps={{ minimal: true }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
{/*------------ Currency -----------*/}
|
||||
<FastField
|
||||
|
||||
@@ -4,7 +4,13 @@ import { Popover2 } from '@blueprintjs/popover2';
|
||||
import { useFormikContext } from 'formik';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import { ExchangeRateInputGroup, Icon, Hint, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
ExchangeRateInputGroup,
|
||||
Icon,
|
||||
Hint,
|
||||
FormattedMessage as T,
|
||||
FSelect,
|
||||
} from 'components';
|
||||
import {
|
||||
AccountsListFieldCell,
|
||||
MoneyFieldCell,
|
||||
@@ -63,7 +69,10 @@ export const ActionsCellRenderer = ({
|
||||
};
|
||||
const exampleMenu = (
|
||||
<Menu>
|
||||
<MenuItem onClick={handleClickRemoveRole} text="Remove line" />
|
||||
<MenuItem
|
||||
onClick={handleClickRemoveRole}
|
||||
text={intl.get('make_journal.entries.remove_row')}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
return (
|
||||
@@ -175,3 +184,71 @@ export function JournalExchangeRateInputField({ ...props }) {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} query
|
||||
* @param {*} journal
|
||||
* @param {*} _index
|
||||
* @param {*} exactMatch
|
||||
* @returns
|
||||
*/
|
||||
const itemPredicate = (query, journal, _index, exactMatch) => {
|
||||
const normalizedTitle = journal.name.toLowerCase();
|
||||
const normalizedQuery = query.toLowerCase();
|
||||
|
||||
if (exactMatch) {
|
||||
return normalizedTitle === normalizedQuery;
|
||||
} else {
|
||||
return normalizedTitle.indexOf(normalizedQuery) >= 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} item
|
||||
* @param {*} param1
|
||||
* @returns
|
||||
*/
|
||||
const itemRenderer = (item, { handleClick, modifiers, query }) => {
|
||||
return (
|
||||
<MenuItem
|
||||
active={modifiers.active}
|
||||
disabled={modifiers.disabled}
|
||||
text={item.name}
|
||||
label={item.label}
|
||||
key={item.id}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const itemSelectProps = {
|
||||
itemPredicate: itemPredicate,
|
||||
itemRenderer: itemRenderer,
|
||||
valueAccessor: 'name',
|
||||
labelAccessor: 'name',
|
||||
};
|
||||
|
||||
export function JournalTypeSelect({ items, ...rest }) {
|
||||
return (
|
||||
<FSelect
|
||||
{...itemSelectProps}
|
||||
{...rest}
|
||||
items={items}
|
||||
input={itemSelectButton}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} label
|
||||
* @returns
|
||||
*/
|
||||
function itemSelectButton({ label }) {
|
||||
return (
|
||||
<Button
|
||||
text={label ? label : intl.get('make_journal.label.select_journal_type')}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
Col,
|
||||
DetailItem,
|
||||
DetailsMenu,
|
||||
FormatDate,
|
||||
ExchangeRateDetailItem,
|
||||
FormattedMessage as T,
|
||||
} from 'components';
|
||||
@@ -64,10 +65,12 @@ export default function ExpenseDrawerHeader() {
|
||||
minLabelSize={'180px'}
|
||||
>
|
||||
<DetailItem label={<T id={'published_at'} />}>
|
||||
{moment(expense.published_at).format('YYYY MMM DD')}
|
||||
<FormatDate value={expense.published_at} />
|
||||
</DetailItem>
|
||||
|
||||
<DetailItem label={<T id={'created_at'} />}>2021 Aug 24</DetailItem>
|
||||
<DetailItem label={<T id={'created_at'} />}>
|
||||
<FormatDate value={expense.created_at} />
|
||||
</DetailItem>
|
||||
</DetailsMenu>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { useExpense } from 'hooks/query';
|
||||
import { DrawerLoading } from 'components';
|
||||
import { DrawerHeaderContent, DrawerLoading } from 'components';
|
||||
import { Features } from 'common';
|
||||
import { useFeatureCan } from 'hooks/state';
|
||||
|
||||
const ExpenseDrawerDrawerContext = React.createContext();
|
||||
|
||||
@@ -8,6 +11,9 @@ const ExpenseDrawerDrawerContext = React.createContext();
|
||||
* Expense drawer provider.
|
||||
*/
|
||||
function ExpenseDrawerProvider({ expenseId, ...props }) {
|
||||
// Features guard.
|
||||
const { featureCan } = useFeatureCan();
|
||||
|
||||
// Fetch the expense details.
|
||||
const {
|
||||
data: expense,
|
||||
@@ -28,6 +34,17 @@ function ExpenseDrawerProvider({ expenseId, ...props }) {
|
||||
|
||||
return (
|
||||
<DrawerLoading loading={isExpenseLoading}>
|
||||
<DrawerHeaderContent
|
||||
name="expense-drawer"
|
||||
title={intl.get('expense.drawer.title')}
|
||||
subTitle={
|
||||
featureCan(Features.Branches)
|
||||
? intl.get('expense.drawer.subtitle', {
|
||||
value: expense.branch?.name,
|
||||
})
|
||||
: null
|
||||
}
|
||||
/>
|
||||
<ExpenseDrawerDrawerContext.Provider value={provider} {...props} />
|
||||
</DrawerLoading>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import React, { lazy } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import { Drawer, DrawerSuspense } from 'components';
|
||||
import withDrawers from 'containers/Drawer/withDrawers';
|
||||
|
||||
@@ -22,7 +20,6 @@ function ExpenseDrawer({
|
||||
<Drawer
|
||||
isOpen={isOpen}
|
||||
name={name}
|
||||
title={intl.get('expense.drawer.title')}
|
||||
size={'65%'}
|
||||
style={{ minWidth: '700px', maxWidth: '900px' }}
|
||||
>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { DrawerHeaderContent, DrawerLoading } from 'components';
|
||||
import { useItem } from 'hooks/query';
|
||||
import { inactiveStatus } from './utlis';
|
||||
|
||||
const ItemDetailDrawerContext = React.createContext();
|
||||
|
||||
@@ -27,7 +28,10 @@ function ItemDetailDrawerProvider({ itemId, ...props }) {
|
||||
|
||||
return (
|
||||
<DrawerLoading loading={isItemLoading}>
|
||||
<DrawerHeaderContent name="item-detail-drawer" title={item?.name} />
|
||||
<DrawerHeaderContent
|
||||
name="item-detail-drawer"
|
||||
title={inactiveStatus(item)}
|
||||
/>
|
||||
<ItemDetailDrawerContext.Provider value={provider} {...props} />
|
||||
</DrawerLoading>
|
||||
);
|
||||
|
||||
27
src/containers/Drawers/ItemDetailDrawer/utlis.js
Normal file
27
src/containers/Drawers/ItemDetailDrawer/utlis.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Intent, Tag } from '@blueprintjs/core';
|
||||
import { Choose, FormattedMessage as T } from '../../../components';
|
||||
|
||||
/**
|
||||
* items inactive status.
|
||||
* @returns {React.JSX}
|
||||
*/
|
||||
export function inactiveStatus(item) {
|
||||
return (
|
||||
<Choose>
|
||||
<Choose.When condition={!item.active}>
|
||||
{item.name}
|
||||
<StatusTag intent={Intent.NONE} minimal={true} round={true}>
|
||||
<T id={'item.details.inactive'} />
|
||||
</StatusTag>
|
||||
</Choose.When>
|
||||
<Choose.Otherwise>{item.name}</Choose.Otherwise>
|
||||
</Choose>
|
||||
);
|
||||
}
|
||||
|
||||
const StatusTag = styled(Tag)`
|
||||
font-size: 11px;
|
||||
margin-left: 10px;
|
||||
`;
|
||||
@@ -3,6 +3,8 @@ import React from 'react';
|
||||
import { Tag, Intent, Classes, Tooltip, Position } from '@blueprintjs/core';
|
||||
|
||||
import { T, Choose, FormatNumberCell, If, Icon } from '../../../components';
|
||||
import { Features } from 'common';
|
||||
import { useFeatureCan } from 'hooks/state';
|
||||
|
||||
/**
|
||||
* Note column accessor.
|
||||
@@ -46,8 +48,9 @@ export function ManualJournalDetailsStatus({ manualJournal }) {
|
||||
/**
|
||||
* Retrieve read-only manual journal entries columns.
|
||||
*/
|
||||
export const useManualJournalEntriesColumns = () =>
|
||||
React.useMemo(
|
||||
export const useManualJournalEntriesColumns = () => {
|
||||
const { featureCan } = useFeatureCan();
|
||||
return React.useMemo(
|
||||
() => [
|
||||
{
|
||||
Header: intl.get('account_name'),
|
||||
@@ -70,6 +73,17 @@ export const useManualJournalEntriesColumns = () =>
|
||||
disableSortBy: true,
|
||||
className: 'note',
|
||||
},
|
||||
...(featureCan(Features.Branches)
|
||||
? [
|
||||
{
|
||||
Header: intl.get('branch'),
|
||||
width: 130,
|
||||
accessor: 'branch.name',
|
||||
disableSortBy: true,
|
||||
className: 'branch',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
Header: intl.get('credit'),
|
||||
accessor: 'credit',
|
||||
@@ -93,5 +107,6 @@ export const useManualJournalEntriesColumns = () =>
|
||||
align: 'right',
|
||||
},
|
||||
],
|
||||
[],
|
||||
[featureCan],
|
||||
);
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ export function ActionsCellRenderer({
|
||||
|
||||
const exampleMenu = (
|
||||
<Menu>
|
||||
<MenuItem onClick={onRemoveRole} text="Remove line" />
|
||||
<MenuItem onClick={onRemoveRole} text={'item_entries.remove_row'} />
|
||||
</Menu>
|
||||
);
|
||||
|
||||
|
||||
@@ -48,7 +48,10 @@ const ActionsCellRenderer = ({
|
||||
};
|
||||
const exampleMenu = (
|
||||
<Menu>
|
||||
<MenuItem onClick={handleClickRemoveRole} text="Remove line" />
|
||||
<MenuItem
|
||||
onClick={handleClickRemoveRole}
|
||||
text={intl.get('expense.entries.remove_row')}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
return (
|
||||
@@ -163,4 +166,4 @@ export function ExpensesExchangeRateInputField({ ...props }) {
|
||||
/>
|
||||
);
|
||||
}
|
||||
ExpensesExchangeRateInputField.cellType = CellType.Field;
|
||||
ExpensesExchangeRateInputField.cellType = CellType.Field;
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function ItemFormFormik({
|
||||
// Handles the form submit.
|
||||
const handleFormSubmit = (values, form) => {
|
||||
const { setSubmitting, resetForm, setErrors } = form;
|
||||
const formValues = { ...values };
|
||||
const formValues = { ...values, type: values.type.toString() };
|
||||
|
||||
setSubmitting(true);
|
||||
|
||||
@@ -96,7 +96,7 @@ export default function ItemFormFormik({
|
||||
validationSchema={isNewMode ? CreateItemFormSchema : EditItemFormSchema}
|
||||
initialValues={initialValues}
|
||||
onSubmit={handleFormSubmit}
|
||||
>
|
||||
>
|
||||
<Form>
|
||||
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
|
||||
<ItemFormPrimarySection />
|
||||
|
||||
@@ -7,7 +7,12 @@ import {
|
||||
Radio,
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, FormattedHTMLMessage } from 'components';
|
||||
import {
|
||||
FormattedMessage as T,
|
||||
FormattedHTMLMessage,
|
||||
FCheckbox,
|
||||
FFormGroup,
|
||||
} from 'components';
|
||||
import { ErrorMessage, FastField } from 'formik';
|
||||
import {
|
||||
CategoriesSelectList,
|
||||
@@ -29,7 +34,7 @@ import { categoriesFieldShouldUpdate } from './utils';
|
||||
export default function ItemFormPrimarySection() {
|
||||
// Item form context.
|
||||
const { isNewMode, item, itemsCategories } = useItemFormContext();
|
||||
|
||||
console.log(item.type, 'XXX');
|
||||
const nameFieldRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -53,7 +58,34 @@ export default function ItemFormPrimarySection() {
|
||||
return (
|
||||
<div className={classNames(CLASSES.PAGE_FORM_HEADER_PRIMARY)}>
|
||||
{/*----------- Item type ----------*/}
|
||||
<FastField name={'type'}>
|
||||
<FFormGroup
|
||||
name={'type'}
|
||||
label={<T id={'item_type'} />}
|
||||
labelInfo={
|
||||
<span>
|
||||
<FieldRequiredHint />
|
||||
<Hint
|
||||
content={itemTypeHintContent}
|
||||
position={Position.BOTTOM_LEFT}
|
||||
/>
|
||||
</span>
|
||||
}
|
||||
inline={true}
|
||||
>
|
||||
<FCheckbox
|
||||
inline={true}
|
||||
name="type"
|
||||
label={<T id={'service'} />}
|
||||
value="service"
|
||||
/>
|
||||
<FCheckbox
|
||||
inline={true}
|
||||
name="type"
|
||||
label={<T id={'inventory'} />}
|
||||
value="inventory"
|
||||
/>
|
||||
</FFormGroup>
|
||||
{/* <FastField name={'type'}>
|
||||
{({ form, field: { value }, meta: { touched, error } }) => (
|
||||
<FormGroup
|
||||
medium={true}
|
||||
@@ -85,7 +117,7 @@ export default function ItemFormPrimarySection() {
|
||||
</RadioGroup>
|
||||
</FormGroup>
|
||||
)}
|
||||
</FastField>
|
||||
</FastField> */}
|
||||
|
||||
<Row>
|
||||
<Col xs={7}>
|
||||
|
||||
@@ -50,7 +50,7 @@ function ItemsCategoryTable({
|
||||
loading={isCategoriesLoading}
|
||||
headerLoading={isCategoriesLoading}
|
||||
progressBarLoading={isCategoriesFetching}
|
||||
expandable={true}
|
||||
expandable={false}
|
||||
sticky={true}
|
||||
selectionColumn={true}
|
||||
TableLoadingRenderer={TableSkeletonRows}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import * as Yup from 'yup';
|
||||
import moment from 'moment';
|
||||
import intl from 'react-intl-universal';
|
||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||
import { isBlank } from 'utils';
|
||||
|
||||
const BillFormSchema = Yup.object().shape({
|
||||
vendor_id: Yup.number()
|
||||
.required()
|
||||
.label(intl.get('vendor_name_')),
|
||||
bill_date: Yup.date()
|
||||
.required()
|
||||
.label(intl.get('bill_date_')),
|
||||
vendor_id: Yup.number().required().label(intl.get('vendor_name_')),
|
||||
bill_date: Yup.date().required().label(intl.get('bill_date_')),
|
||||
due_date: Yup.date()
|
||||
.min(Yup.ref('bill_date'), ({ path, min }) =>
|
||||
intl.get('bill.validation.due_date', {
|
||||
path,
|
||||
min: moment(min).format('YYYY/MM/DD'),
|
||||
}),
|
||||
)
|
||||
.required()
|
||||
.label(intl.get('due_date_')),
|
||||
bill_number: Yup.string()
|
||||
@@ -25,7 +28,7 @@ const BillFormSchema = Yup.object().shape({
|
||||
open: Yup.boolean(),
|
||||
branch_id: Yup.string(),
|
||||
warehouse_id: Yup.string(),
|
||||
exchange_rate:Yup.number(),
|
||||
exchange_rate: Yup.number(),
|
||||
entries: Yup.array().of(
|
||||
Yup.object().shape({
|
||||
quantity: Yup.number()
|
||||
|
||||
@@ -2,16 +2,19 @@ import * as Yup from 'yup';
|
||||
import intl from 'react-intl-universal';
|
||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||
import { isBlank } from 'utils';
|
||||
import moment from 'moment';
|
||||
|
||||
const Schema = Yup.object().shape({
|
||||
customer_id: Yup.number()
|
||||
.label(intl.get('customer_name_'))
|
||||
.required(),
|
||||
estimate_date: Yup.date()
|
||||
.required()
|
||||
.label(intl.get('estimate_date_')),
|
||||
customer_id: Yup.number().label(intl.get('customer_name_')).required(),
|
||||
estimate_date: Yup.date().required().label(intl.get('estimate_date_')),
|
||||
expiration_date: Yup.date()
|
||||
.required()
|
||||
.min(Yup.ref('estimate_date'), ({ path, min }) =>
|
||||
intl.get('estimate.validation.expiration_date', {
|
||||
path,
|
||||
min: moment(min).format('YYYY/MM/DD'),
|
||||
}),
|
||||
)
|
||||
.label(intl.get('expiration_date_')),
|
||||
estimate_number: Yup.string()
|
||||
.max(DATATYPES_LENGTH.STRING)
|
||||
|
||||
@@ -72,18 +72,6 @@ function WarehouseTransferForm({
|
||||
// Handles form submit.
|
||||
const handleSubmit = (values, { setSubmitting, setErrors, resetForm }) => {
|
||||
setSubmitting(true);
|
||||
const totalQuantity = sumBy(values.entries, 'quantity');
|
||||
|
||||
if (totalQuantity <= 0) {
|
||||
AppToaster.show({
|
||||
message: intl.get(
|
||||
'warehouse_transfer.quantity_cannot_be_zero_or_empty',
|
||||
),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Transformes the values of the form to request.
|
||||
const form = {
|
||||
...transformValueToRequest(values),
|
||||
|
||||
@@ -20,7 +20,7 @@ const Schema = Yup.object().shape({
|
||||
Yup.object().shape({
|
||||
item_id: Yup.number().nullable(),
|
||||
description: Yup.string().nullable().max(DATATYPES_LENGTH.TEXT),
|
||||
quantity: Yup.number().nullable().max(DATATYPES_LENGTH.INT_10),
|
||||
quantity: Yup.number().min(1).max(DATATYPES_LENGTH.INT_10),
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function WarehouseTransferFormEntriesTable({
|
||||
item_id: newRowMeta.itemId,
|
||||
warehouses: newRowMeta.warehouses,
|
||||
description: '',
|
||||
quantity: 0,
|
||||
quantity: '',
|
||||
};
|
||||
const newRows = mutateTableRow(newRowMeta.rowIndex, newRow, entries);
|
||||
|
||||
|
||||
@@ -21,7 +21,10 @@ export function ActionsCellRenderer({
|
||||
|
||||
const exampleMenu = (
|
||||
<Menu>
|
||||
<MenuItem onClick={onRemoveRole} text="Remove line" />
|
||||
<MenuItem
|
||||
onClick={onRemoveRole}
|
||||
text={intl.get('warehouse_transfer.entries.remove_row')}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
|
||||
@@ -1989,6 +1989,7 @@
|
||||
"payment_made_form.label.total": "إجمالي",
|
||||
"make_journal.label.subtotal": "المجموع",
|
||||
"make_journal.label.total": "إجمالي",
|
||||
"make_journal.label.select_journal_type":"حدد نوع القيد",
|
||||
"expense.label.subtotal": "المجموع",
|
||||
"expense.label.total": "إجمالي",
|
||||
"expense.branch_button.label": "الفرع: {label}",
|
||||
@@ -2005,9 +2006,17 @@
|
||||
"estimate.warehouse_button.label": "المخزن: {label}",
|
||||
"receipt.branch_button.label": "الفرع: {label}",
|
||||
"receipt.warehouse_button.label": "المخزن: {label}",
|
||||
"warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المستودعات",
|
||||
"warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
|
||||
"warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المخازن",
|
||||
"warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مخازن متعددة لطلبات نقل البضائع من مخزن إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
|
||||
"warehouse_transfer.form.reason.label": "أسباب النقل",
|
||||
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.",
|
||||
"item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ",
|
||||
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.",
|
||||
"invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}"
|
||||
"invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}",
|
||||
"estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}",
|
||||
"make_journal.entries.remove_row": "حذف الصف",
|
||||
"expense.entries.remove_row": "حذف الصف",
|
||||
"warehouse_transfer.entries.remove_row": "حذف الصف",
|
||||
"item.details.inactive": "غير نشط",
|
||||
"bill.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}"
|
||||
}
|
||||
@@ -1756,6 +1756,7 @@
|
||||
"payment_made.drawer.subtitle": "Branch: {value}",
|
||||
"manual_journal.drawer.title": "Manual journal details ({number})",
|
||||
"expense.drawer.title": "Expense details",
|
||||
"expense.drawer.subtitle": "Branch: {value}",
|
||||
"global_error.you_dont_have_permissions": "You do not have permissions to access this page.",
|
||||
"global_error.transactions_locked": "Transactions before {lockedToDate} has been locked. Hence action cannot be performed.",
|
||||
"global_error.authorized_user_inactive": "The authorized user is inactive.",
|
||||
@@ -1988,6 +1989,7 @@
|
||||
"payment_made.form.internal_note.placeholder": "Internal note (Not visible to the vendor).",
|
||||
"make_journal.label.subtotal": "Subtotal",
|
||||
"make_journal.label.total": "TOTAL",
|
||||
"make_journal.label.select_journal_type":"Select Journal Type",
|
||||
"expense.label.subtotal": "Subtotal",
|
||||
"expense.label.total": "TOTAL",
|
||||
"expense.branch_button.label": "Branch: {label}",
|
||||
@@ -2009,5 +2011,11 @@
|
||||
"warehouse_transfer.form.reason.label": "Reason",
|
||||
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.",
|
||||
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.",
|
||||
"invoice.validation.due_date": "{path} field must be later than {min}"
|
||||
"invoice.validation.due_date": "{path} field must be later than {min}",
|
||||
"estimate.validation.expiration_date": "{path} field must be later than {min}",
|
||||
"make_journal.entries.remove_row": "Remove line",
|
||||
"expense.entries.remove_row": "Remove line",
|
||||
"warehouse_transfer.entries.remove_row": "Remove line",
|
||||
"item.details.inactive": "Inactive",
|
||||
"bill.validation.due_date": "{path} field must be later than {min}"
|
||||
}
|
||||
Reference in New Issue
Block a user