mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: Cashflow transactions types
This commit is contained in:
@@ -1,5 +1,36 @@
|
||||
import { TransactionTypes } from '@/data/TransactionTypes';
|
||||
import { isObject, upperFirst, camelCase } from 'lodash';
|
||||
import {
|
||||
TransactionTypes,
|
||||
CashflowTransactionTypes,
|
||||
} from '@/data/TransactionTypes';
|
||||
|
||||
export const getTransactionTypeLabel = (transactionType: string) => {
|
||||
return TransactionTypes[transactionType];
|
||||
/**
|
||||
* Retrieves the formatted type of account transaction.
|
||||
* @param {string} referenceType
|
||||
* @param {string} transactionType
|
||||
* @returns {string}
|
||||
*/
|
||||
export const getTransactionTypeLabel = (
|
||||
referenceType: string,
|
||||
transactionType?: string
|
||||
) => {
|
||||
const _referenceType = upperFirst(camelCase(referenceType));
|
||||
const _transactionType = upperFirst(camelCase(transactionType));
|
||||
|
||||
return isObject(TransactionTypes[_referenceType])
|
||||
? TransactionTypes[_referenceType][_transactionType]
|
||||
: TransactionTypes[_referenceType] || null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted type of cashflow transaction.
|
||||
* @param {string} transactionType
|
||||
* @returns {string¿}
|
||||
*/
|
||||
export const getCashflowTransactionFormattedType = (
|
||||
transactionType: string
|
||||
) => {
|
||||
const _transactionType = upperFirst(camelCase(transactionType));
|
||||
|
||||
return CashflowTransactionTypes[_transactionType] || null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user