fix: inventory adjustment cost out of range.

This commit is contained in:
a.bouhuolia
2021-08-07 08:09:37 +02:00
parent 0ab4596836
commit c21236c4ae
4 changed files with 32 additions and 14 deletions

View File

@@ -83,7 +83,7 @@ export function useCustomersTableColumns() {
Header: '',
accessor: AvatarCell,
className: 'avatar',
width: 50,
width: 45,
disableResizing: true,
disableSortBy: true,
},

View File

@@ -8,6 +8,9 @@ import { FormattedMessage as T } from 'components';
import withDialogActions from 'containers/Dialog/withDialogActions';
import { compose } from 'utils';
/**
* Currency dialog form footer action.
*/
function CurrencyFormFooter({
// #withDialogActions
closeDialog,
@@ -23,10 +26,10 @@ function CurrencyFormFooter({
return (
<div className={Classes.DIALOG_FOOTER}>
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
<Button onClick={handleClose}>
<Button onClick={handleClose} disabled={isSubmitting}>
<T id={'cancel'} />
</Button>
<Button intent={Intent.PRIMARY} type="submit" disabled={isSubmitting}>
<Button intent={Intent.PRIMARY} type="submit" loading={isSubmitting}>
{!isEditMode ? <T id={'submit'} /> : <T id={'edit'} />}
</Button>
</div>

View File

@@ -13,7 +13,7 @@ const accountNameMapper = (column) => ({
accessor: 'cells[0].value',
className: 'account_name',
textOverview: true,
width: 240,
width: 400,
disableSortBy: true,
});
@@ -25,7 +25,10 @@ const dateRangeMapper = (data, index, column) => ({
Header: column.label,
key: column.key,
accessor: `cells[${index}].value`,
width: getColumnWidth(data, `cells.${index}.value`, { minWidth: 100 }),
width: getColumnWidth(data, `cells.${index}.value`, {
magicSpacing: 10,
minWidth: 100,
}),
className: `date-period ${column.key}`,
disableSortBy: true,
textOverview: true,
@@ -41,7 +44,10 @@ const totalMapper = (data, index, column) => ({
className: 'total',
textOverview: true,
Cell: CellTextSpan,
width: getColumnWidth(data, `cells[${index}].value`, { minWidth: 100 }),
width: getColumnWidth(data, `cells[${index}].value`, {
magicSpacing: 10,
minWidth: 100,
}),
disableSortBy: true,
});

View File

@@ -1,16 +1,25 @@
exports.up = function(knex) {
return knex.schema.createTable('inventory_adjustments_entries', table => {
exports.up = function (knex) {
return knex.schema.createTable('inventory_adjustments_entries', (table) => {
table.increments();
table.integer('adjustment_id').unsigned().index().references('id').inTable('inventory_adjustments');
table
.integer('adjustment_id')
.unsigned()
.index()
.references('id')
.inTable('inventory_adjustments');
table.integer('index').unsigned();
table.integer('item_id').unsigned().index().references('id').inTable('items');
table
.integer('item_id')
.unsigned()
.index()
.references('id')
.inTable('items');
table.integer('quantity');
table.decimal('cost').unsigned();
table.decimal('value').unsigned();
table.decimal('cost', 13, 3).unsigned();
table.decimal('value', 13, 3).unsigned();
});
};
exports.down = function(knex) {
exports.down = function (knex) {
return knex.schema.dropTableIfExists('inventory_adjustments_entries');
};