mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
Merge branch 'master' of https://github.com/abouolia/Bigcapital
This commit is contained in:
@@ -106,7 +106,7 @@ const ItemCategoryList = ({
|
|||||||
setDeleteCategory(false);
|
setDeleteCategory(false);
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: formatMessage({
|
message: formatMessage({
|
||||||
id: 'the_item_category_has_been_successfully_deleted',
|
id: 'the_item_category_has_been_deleted_successfully',
|
||||||
}),
|
}),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
@@ -135,7 +135,7 @@ const ItemCategoryList = ({
|
|||||||
setBulkDelete(false);
|
setBulkDelete(false);
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: formatMessage({
|
message: formatMessage({
|
||||||
id: 'the_item_categories_has_been_successfully_deleted',
|
id: 'the_item_categories_has_been_deleted_successfully',
|
||||||
}),
|
}),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -221,8 +221,8 @@ export default {
|
|||||||
'The item category has been successfully created.',
|
'The item category has been successfully created.',
|
||||||
the_item_category_has_been_successfully_edited:
|
the_item_category_has_been_successfully_edited:
|
||||||
'The item category has been successfully edited.',
|
'The item category has been successfully edited.',
|
||||||
the_item_category_has_been_successfully_deleted:
|
the_item_category_has_been_deleted_successfully:
|
||||||
'The item category has been successfully deleted',
|
'The item category has been deleted successfully.',
|
||||||
once_delete_these_item_categories_you_will_not_able_restore_them:
|
once_delete_these_item_categories_you_will_not_able_restore_them:
|
||||||
"Once you delete these categories, you won't be able to retrieve them later. Are you sure you want to delete them?",
|
"Once you delete these categories, you won't be able to retrieve them later. Are you sure you want to delete them?",
|
||||||
once_delete_these_views_you_will_not_able_restore_them:
|
once_delete_these_views_you_will_not_able_restore_them:
|
||||||
@@ -855,4 +855,5 @@ export default {
|
|||||||
posting_date: 'Posting date',
|
posting_date: 'Posting date',
|
||||||
customer: 'Customer',
|
customer: 'Customer',
|
||||||
email_is_already_used: 'The email is already used.',
|
email_is_already_used: 'The email is already used.',
|
||||||
|
the_item_categories_has_been_deleted_successfully: 'The item categories has been deleted successfully .',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export const getAccountsListFactory = () =>
|
|||||||
return treeToList(accountsTree, {
|
return treeToList(accountsTree, {
|
||||||
idFieldKey: 'id',
|
idFieldKey: 'id',
|
||||||
childrenFieldKey: 'children',
|
childrenFieldKey: 'children',
|
||||||
|
nodeFilter: (node, depth) => accountsItems[node.id],
|
||||||
nodeMapper: (node, depth) => {
|
nodeMapper: (node, depth) => {
|
||||||
const account = accountsItems[node.id];
|
const account = accountsItems[node.id];
|
||||||
const spaceChar = String.fromCharCode(160);
|
const spaceChar = String.fromCharCode(160);
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ export default persistReducer({
|
|||||||
'pageSubtitle',
|
'pageSubtitle',
|
||||||
'pageHint',
|
'pageHint',
|
||||||
'preferencesPageTitle',
|
'preferencesPageTitle',
|
||||||
'topbarEditViewId'
|
'topbarEditViewId',
|
||||||
|
'backLink'
|
||||||
],
|
],
|
||||||
storage,
|
storage,
|
||||||
}, reducerInstance);
|
}, reducerInstance);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export const deleteItemCategory = (id) => {
|
|||||||
export const deleteBulkItemCategories = ({ ids }) => {
|
export const deleteBulkItemCategories = ({ ids }) => {
|
||||||
return (dispatch) =>
|
return (dispatch) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
ApiService.delete(`item_categories/bulk`, { params: { ids } })
|
ApiService.delete(`item_categories`, { params: { ids } })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: t.ITEM_CATEGORIES_BULK_DELETE,
|
type: t.ITEM_CATEGORIES_BULK_DELETE,
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
.dashboard__insider--expense-form{
|
.dashboard__insider--expense-form{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
.dashboard__insider--expenses{
|
||||||
|
|
||||||
|
|
||||||
|
.bigcapital-datatable{
|
||||||
|
|
||||||
|
.tbody{
|
||||||
|
.tr .td.total_amount{
|
||||||
|
span{
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.page-form--expense{
|
.page-form--expense{
|
||||||
$self: '.page-form';
|
$self: '.page-form';
|
||||||
|
|
||||||
|
|||||||
@@ -329,15 +329,16 @@ export function treeToList(
|
|||||||
idFieldKey = 'id',
|
idFieldKey = 'id',
|
||||||
childrenFieldKey = 'children',
|
childrenFieldKey = 'children',
|
||||||
nodeMapper = (node, depth) => node,
|
nodeMapper = (node, depth) => node,
|
||||||
|
nodeFilter = (node, depth) => true,
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
let depth = 0;
|
let depth = 0;
|
||||||
|
|
||||||
const walker = (tree) => {
|
const walker = (tree) => {
|
||||||
return tree.reduce(function (acc, o) {
|
return tree.reduce((acc, o) => {
|
||||||
depth += 1;
|
depth += 1;
|
||||||
|
|
||||||
if (o[idFieldKey]) {
|
if (o[idFieldKey] && nodeFilter(o, depth)) {
|
||||||
acc.push(nodeMapper(o, depth));
|
acc.push(nodeMapper(o, depth));
|
||||||
}
|
}
|
||||||
if (o[childrenFieldKey]) {
|
if (o[childrenFieldKey]) {
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ export default class ExpensesController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
async bulkDeleteExpenses(req: Request, res: Response, next: NextFunction) {
|
async bulkDeleteExpenses(req: Request, res: Response, next: NextFunction) {
|
||||||
const { tenantId, user } = req;
|
const { tenantId, user } = req;
|
||||||
const { ids: expensesIds } = req.params;
|
const { ids: expensesIds } = req.query;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.expensesService.deleteBulkExpenses(
|
await this.expensesService.deleteBulkExpenses(
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export default class ItemsCategoriesController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
get categoriesBulkValidationSchema() {
|
get categoriesBulkValidationSchema() {
|
||||||
return [
|
return [
|
||||||
query('ids').isArray({ min: 2 }),
|
query('ids').isArray({ min: 1 }),
|
||||||
query('ids.*').isNumeric().toInt(),
|
query('ids.*').isNumeric().toInt(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ export default class ExpenseRepository extends TenantRepository {
|
|||||||
* @param {number[]} expensesIds
|
* @param {number[]} expensesIds
|
||||||
*/
|
*/
|
||||||
async bulkDelete(expensesIds: number[]): Promise<void> {
|
async bulkDelete(expensesIds: number[]): Promise<void> {
|
||||||
const { Expense } = this.models;
|
const { Expense, ExpenseCategory } = this.models;
|
||||||
|
|
||||||
await Expense.query().whereIn('expense_id', expensesIds).delete();
|
await ExpenseCategory.query().whereIn('expense_id', expensesIds).delete();
|
||||||
await Expense.query().whereIn('id', expensesIds).delete();
|
await Expense.query().whereIn('id', expensesIds).delete();
|
||||||
|
|
||||||
this.flushCache();
|
this.flushCache();
|
||||||
|
|||||||
Reference in New Issue
Block a user