mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-13 03:10:31 +00:00
Compare commits
7 Commits
hotfix-pdf
...
v0.13.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abffdd1029 | ||
|
|
d052c23560 | ||
|
|
f02afd3c9f | ||
|
|
3df17390e2 | ||
|
|
df38f8893d | ||
|
|
8882bc677e | ||
|
|
f03d01113c |
@@ -87,6 +87,15 @@
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "xprnio",
|
||||
"name": "Ragnar Laud",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/3042904?v=4",
|
||||
"profile": "https://ragnarlaud.dev",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
||||
@@ -116,6 +116,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="http://cschuijt.nl"><img src="https://avatars.githubusercontent.com/u/5460015?v=4?s=100" width="100px;" alt="Casper Schuijt"/><br /><sub><b>Casper Schuijt</b></sub></a><br /><a href="https://github.com/bigcapitalhq/bigcapital/issues?q=author%3Acschuijt" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ANasouf"><img src="https://avatars.githubusercontent.com/u/19536487?v=4?s=100" width="100px;" alt="ANasouf"/><br /><sub><b>ANasouf</b></sub></a><br /><a href="https://github.com/bigcapitalhq/bigcapital/commits?author=ANasouf" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://ragnarlaud.dev"><img src="https://avatars.githubusercontent.com/u/3042904?v=4?s=100" width="100px;" alt="Ragnar Laud"/><br /><sub><b>Ragnar Laud</b></sub></a><br /><a href="https://github.com/bigcapitalhq/bigcapital/issues?q=author%3Axprnio" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -7,8 +7,12 @@ import {
|
||||
} from '@/services/Cashflow/utils';
|
||||
import AccountTransaction from './AccountTransaction';
|
||||
import { CASHFLOW_DIRECTION } from '@/services/Cashflow/constants';
|
||||
|
||||
import { getTransactionTypeLabel } from '@/utils/transactions-types';
|
||||
export default class CashflowTransaction extends TenantModel {
|
||||
transactionType: string;
|
||||
amount: number;
|
||||
exchangeRate: number;
|
||||
|
||||
/**
|
||||
* Table name.
|
||||
*/
|
||||
@@ -55,9 +59,10 @@ export default class CashflowTransaction extends TenantModel {
|
||||
|
||||
/**
|
||||
* Transaction type formatted.
|
||||
* @returns {string}
|
||||
*/
|
||||
get transactionTypeFormatted() {
|
||||
return AccountTransaction.getReferenceTypeFormatted(this.transactionType);
|
||||
return getTransactionTypeLabel(this.transactionType);
|
||||
}
|
||||
|
||||
get typeMeta() {
|
||||
|
||||
@@ -259,6 +259,6 @@ export class InventoryValuationSheet extends FinancialSheet {
|
||||
const items = this.itemsSection();
|
||||
const total = this.totalSection(items);
|
||||
|
||||
return items.length > 0 ? { items, total } : {};
|
||||
return { items, total };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,9 @@ export class InventoryValuationSheetTable extends R.compose(
|
||||
const itemsRows = this.itemsRowsMapper(this.data.items);
|
||||
const totalRow = this.totalRowMapper(this.data.total);
|
||||
|
||||
return [...itemsRows, totalRow];
|
||||
return R.compose(
|
||||
R.when(R.always(R.not(R.isEmpty(itemsRows))), R.append(totalRow))
|
||||
)([...itemsRows]) as ITableRow[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
IAccountTransaction,
|
||||
ISalesByItemsItem,
|
||||
ISalesByItemsTotal,
|
||||
ISalesByItemsSheetStatement,
|
||||
ISalesByItemsSheetData,
|
||||
IItem,
|
||||
} from '@/interfaces';
|
||||
|
||||
@@ -146,7 +146,7 @@ export default class SalesByItemsReport extends FinancialSheet {
|
||||
* @param {IInventoryValuationItem[]} items
|
||||
* @returns {IInventoryValuationTotal}
|
||||
*/
|
||||
totalSection(items: ISalesByItemsItem[]): ISalesByItemsTotal {
|
||||
private totalSection(items: ISalesByItemsItem[]): ISalesByItemsTotal {
|
||||
const quantitySold = sumBy(items, (item) => item.quantitySold);
|
||||
const soldCost = sumBy(items, (item) => item.soldCost);
|
||||
|
||||
@@ -163,12 +163,12 @@ export default class SalesByItemsReport extends FinancialSheet {
|
||||
|
||||
/**
|
||||
* Retrieve the sheet data.
|
||||
* @returns {ISalesByItemsSheetStatement}
|
||||
* @returns {ISalesByItemsSheetData}
|
||||
*/
|
||||
reportData(): ISalesByItemsSheetStatement {
|
||||
public reportData(): ISalesByItemsSheetData {
|
||||
const items = this.itemsSection();
|
||||
const total = this.totalSection(items);
|
||||
|
||||
return items.length > 0 ? { items, total } : {};
|
||||
return { items, total };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,9 @@ export class SalesByItemsTable extends R.compose(
|
||||
const itemsRows = this.itemsMap(this.data.items);
|
||||
const totalRow = this.totalMap(this.data.total);
|
||||
|
||||
return [...itemsRows, totalRow];
|
||||
return R.compose(
|
||||
R.when(R.always(R.not(R.isEmpty(itemsRows))), R.append(totalRow))
|
||||
)([...itemsRows]) as ITableRow[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ const AccountInactivateAlert = React.lazy(
|
||||
() => import('@/containers/Alerts/Accounts/AccountInactivateAlert'),
|
||||
);
|
||||
const AccountActivateAlert = React.lazy(
|
||||
() => import('@/containers/Alerts/Accounts/AccountDeleteAlert'),
|
||||
() => import('@/containers/Alerts/Accounts/AccountActivateAlert'),
|
||||
);
|
||||
|
||||
export default [
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { MoneyInDialogProvider } from './MoneyInDialogProvider';
|
||||
import MoneyInForm from './MoneyInForm';
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ function MoneyInForm({
|
||||
};
|
||||
|
||||
// Handles the form submit.
|
||||
const handleFormSubmit = (values, { setSubmitting, setErrors }) => {
|
||||
const handleFormSubmit = (values, { setSubmitting }) => {
|
||||
const form = {
|
||||
...omit(values, ['currency_code']),
|
||||
publish: true,
|
||||
|
||||
@@ -51,7 +51,6 @@ function MoneyOutForm({
|
||||
accountId,
|
||||
accountType,
|
||||
createCashflowTransactionMutate,
|
||||
submitPayload,
|
||||
} = useMoneyOutDialogContext();
|
||||
|
||||
// transaction number.
|
||||
|
||||
@@ -14,6 +14,7 @@ import { useUpdateEffect } from '@/hooks';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { transactionNumber } from '@/utils';
|
||||
|
||||
/**
|
||||
* Syncs cashflow auto-increment settings to the form once update.
|
||||
|
||||
@@ -9,11 +9,11 @@ import ReferenceNumberForm from '@/containers/JournalNumber/ReferenceNumberForm'
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import { compose } from '@/utils';
|
||||
import {
|
||||
transformFormToSettings,
|
||||
transformSettingsToForm,
|
||||
} from '@/containers/JournalNumber/utils';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
* Transaction number dialog content.
|
||||
|
||||
@@ -5,6 +5,9 @@ import useApiRequest from '../useRequest';
|
||||
import t from './types';
|
||||
|
||||
const commonInvalidateQueries = (queryClient) => {
|
||||
// Invalidate settings.
|
||||
queryClient.invalidateQueries([t.SETTING, t.SETTING_CASHFLOW]);
|
||||
|
||||
// Invalidate accounts.
|
||||
queryClient.invalidateQueries(t.ACCOUNTS);
|
||||
queryClient.invalidateQueries(t.ACCOUNT);
|
||||
|
||||
Reference in New Issue
Block a user