feat: expand sidebar once open form editor page.

feat: rounding money amount.
feat: optimize page form structure.
feat: refactoring make journal and expense form with FastField component.
This commit is contained in:
Ahmed Bouhuolia
2020-11-29 00:06:59 +02:00
parent 53dd447540
commit 011542e2a3
118 changed files with 3883 additions and 2660 deletions

View File

@@ -148,10 +148,9 @@ export const defaultExpanderReducer = (tableRows, level) => {
export function formattedAmount(cents, currency) {
const { symbol, decimal_digits: precision } = Currency[currency];
const amount = cents / Math.pow(10, precision);
return accounting.formatMoney(amount, { symbol, precision });
return accounting.formatMoney(cents, { symbol, precision });
}
export function formattedExchangeRate(amount, currency) {
const options = {
style: 'currency',
@@ -368,3 +367,7 @@ export function defaultToTransform(
? _defaultValue
: _transfromedValue;
}
export function isBlank(value) {
return _.isEmpty(value) && !_.isNumber(value) || _.isNaN(value);
}