@@ -102,7 +113,6 @@ function TrialBalanceSheet({
pageFilter={filter}
onSubmitFilter={handleFilterSubmit}
/>
-
diff --git a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js
index 7455557df..cf60323a0 100644
--- a/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js
+++ b/client/src/containers/FinancialStatements/TrialBalanceSheet/TrialBalanceSheetTable.js
@@ -31,11 +31,7 @@ function TrialBalanceSheetTable({
},
{
Header: formatMessage({ id: 'credit' }),
- accessor: 'credit',
- Cell: ({ cell }) => {
- const { currency_code, credit } = cell.row.original;
- return
;
- },
+ accessor: 'formatted_credit',
className: 'credit',
width: getColumnWidth(trialBalanceTableRows, `credit`, {
minWidth: 95,
@@ -43,20 +39,12 @@ function TrialBalanceSheetTable({
},
{
Header: formatMessage({ id: 'debit' }),
- accessor: 'debit',
- Cell: ({ cell }) => {
- const { currency_code, debit } = cell.row.original;
- return
;
- },
+ accessor: 'formatted_debit',
width: getColumnWidth(trialBalanceTableRows, `debit`, { minWidth: 95 }),
},
{
Header: formatMessage({ id: 'balance' }),
- accessor: 'balance',
- Cell: ({ cell }) => {
- const { currency_code, balance } = cell.row.original;
- return
;
- },
+ accessor: 'formatted_balance',
className: 'balance',
width: getColumnWidth(trialBalanceTableRows, `balance`, {
minWidth: 95,
diff --git a/client/src/containers/FinancialStatements/common.js b/client/src/containers/FinancialStatements/common.js
index 6a82653ad..a4ea8fc64 100644
--- a/client/src/containers/FinancialStatements/common.js
+++ b/client/src/containers/FinancialStatements/common.js
@@ -1,4 +1,5 @@
import { mapKeys, omit, snakeCase } from 'lodash';
+import { transformToCamelCase, flatObject } from 'utils';
import { formatMessage } from 'services/intl';
export const displayColumnsByOptions = [
@@ -52,10 +53,11 @@ export const transformDisplayColumnsType = (form) => {
};
export const transformFilterFormToQuery = (form) => {
- return mapKeys({
+ const transformed = transformToCamelCase({
...omit(form, ['accountsFilter']),
...transformDisplayColumnsType(form),
noneZero: form.accountsFilter === 'without-zero-balance',
noneTransactions: form.accountsFilter === 'with-transactions',
- }, (v, k) => snakeCase(k));
+ });
+ return flatObject(transformed);
};
diff --git a/client/src/lang/en/index.js b/client/src/lang/en/index.js
index 0921db063..6884f433e 100644
--- a/client/src/lang/en/index.js
+++ b/client/src/lang/en/index.js
@@ -960,9 +960,9 @@ export default {
select_adjustment_account: 'Select adjustment account',
qty: 'Quantity on hand',
money_format: 'Money format',
- show_zero: 'Show zero',
- show_negative_in_red: 'Show negative in red',
- divide_on_1000: 'Divide on 1000',
+ show_zero: 'Show zero.',
+ show_negative_in_red: 'Show negative in red.',
+ divide_on_1000: 'Divide on 1000.',
negative_format: 'Negative format',
decimal_places: 'Decimal places',
run: 'Run',
diff --git a/client/src/static/json/icons.js b/client/src/static/json/icons.js
index e57bef279..69a814291 100644
--- a/client/src/static/json/icons.js
+++ b/client/src/static/json/icons.js
@@ -354,4 +354,12 @@ export default {
path: ['M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'],
viewBox: '0 0 24 24',
},
+ 'numbers': {
+ path: [
+ 'M2.9377,11V5.26q0-.3633.0069-.9238T2.98,3.3a3.6334,3.6334,0,0,1-.35.3785q-.1677.1538-.3642.3076L1.16,4.9105.0535,3.5246,3.19,1.0046H5.08V11Z',
+ 'M7.8655,11V9.5158l2.5058-2.5332q.7559-.77,1.2178-1.295a4.512,4.512,0,0,0,.6719-.9521,2.0537,2.0537,0,0,0,.21-.917,1.0375,1.0375,0,0,0-.3711-.875,1.455,1.455,0,0,0-.917-.2871,2.2924,2.2924,0,0,0-1.0712.2661A6.6756,6.6756,0,0,0,9,3.6789L7.8376,2.2926A10.771,10.771,0,0,1,8.7615,1.6a4.4132,4.4132,0,0,1,1.1264-.5323A4.931,4.931,0,0,1,11.3791.8644a3.9291,3.9291,0,0,1,1.7012.3433,2.6249,2.6249,0,0,1,1.1123.9521,2.5386,2.5386,0,0,1,.3926,1.4068A3.5845,3.5845,0,0,1,14.27,5.0788a5.32,5.32,0,0,1-.9307,1.3579q-.6166.6715-1.4981,1.498L10.595,9.1378v.07h4.27V11Z',
+ 'M18.91,11.14a7.8841,7.8841,0,0,1-1.582-.14,7.3067,7.3067,0,0,1-1.3155-.4062v-1.82a5.5853,5.5853,0,0,0,1.3438.498,5.9318,5.9318,0,0,0,1.3164.16,2.5022,2.5022,0,0,0,1.5742-.3779,1.2582,1.2582,0,0,0,.4556-1.0216,1.105,1.105,0,0,0-.5459-1.0078,3.7194,3.7194,0,0,0-1.8477-.336h-.7422V5.0368h.7558a3.0031,3.0031,0,0,0,1.708-.378,1.167,1.167,0,0,0,.5322-.9941.93.93,0,0,0-.3779-.8052,1.7126,1.7126,0,0,0-1.0225-.2729,3.1339,3.1339,0,0,0-1.28.2451,6.4963,6.4963,0,0,0-.917.4829l-.9248-1.4277a6.0463,6.0463,0,0,1,1.3867-.7212A5.67,5.67,0,0,1,19.4149.8644a3.838,3.838,0,0,1,2.3945.6514,2.08,2.08,0,0,1,.84,1.729,2.2193,2.2193,0,0,1-.6231,1.6518,3.2277,3.2277,0,0,1-1.5332.84v.042a3.1845,3.1845,0,0,1,1.8272.7422,2.1271,2.1271,0,0,1,.623,1.624,2.8,2.8,0,0,1-.4267,1.5185A2.9013,2.9013,0,0,1,21.2,10.7415,5.6336,5.6336,0,0,1,18.91,11.14Z'
+ ],
+ viewBox: '0 0 23 12',
+ }
};
diff --git a/client/src/store/financialStatement/financialStatements.mappers.js b/client/src/store/financialStatement/financialStatements.mappers.js
index f4bbc42f2..dd8d4e419 100644
--- a/client/src/store/financialStatement/financialStatements.mappers.js
+++ b/client/src/store/financialStatement/financialStatements.mappers.js
@@ -104,7 +104,7 @@ export const ARAgingSummaryTableRowsMapper = (sheet, total) => {
return [
...rows,
{
- name: 'Total Aged Receivable',
+ name: '',
rowType: 'total',
current: sheet.total.current.formatted_amount,
...mapAging(sheet.total.aging),
diff --git a/client/src/style/App.scss b/client/src/style/App.scss
index 9f8ce8864..08fe2f622 100644
--- a/client/src/style/App.scss
+++ b/client/src/style/App.scss
@@ -26,12 +26,9 @@
@import 'components/Tooltip';
// Pages
-@import 'pages/financial-statements';
@import 'pages/view-form';
@import 'pages/register-organizaton';
-@import 'pages/number-format.scss';
-
// Views
@import 'views/filter-dropdown';
diff --git a/client/src/style/pages/Dashboard/Dashboard.scss b/client/src/style/pages/Dashboard/Dashboard.scss
index b56ab27a5..2ef7cb029 100644
--- a/client/src/style/pages/Dashboard/Dashboard.scss
+++ b/client/src/style/pages/Dashboard/Dashboard.scss
@@ -136,7 +136,7 @@
}
.#{$ns}-button {
color: #32304a;
- padding: 8px 12px;
+ padding: 8px 10px;
&:hover {
background: rgba(167, 182, 194, 0.12);
diff --git a/client/src/style/pages/FinancialStatements/ARAgingSummary.scss b/client/src/style/pages/FinancialStatements/ARAgingSummary.scss
index 4433a3b2e..c331c9511 100644
--- a/client/src/style/pages/FinancialStatements/ARAgingSummary.scss
+++ b/client/src/style/pages/FinancialStatements/ARAgingSummary.scss
@@ -15,9 +15,11 @@
.tbody{
.tr .td{
border-bottom: 0;
+ padding-top: 0.4rem;
+ padding-bottom: 0.4rem;
}
.tr:not(:first-child) .td{
- border-top: 1px solid #E8E8E8;
+ border-top: 1px solid transparent;
}
.tr.row-type--total{
font-weight: 500;
diff --git a/client/src/style/pages/FinancialStatements/BalanceSheet.scss b/client/src/style/pages/FinancialStatements/BalanceSheet.scss
index 094eb763e..35e909077 100644
--- a/client/src/style/pages/FinancialStatements/BalanceSheet.scss
+++ b/client/src/style/pages/FinancialStatements/BalanceSheet.scss
@@ -14,6 +14,8 @@
.tbody{
.tr .td{
border-bottom: 0;
+ padding-top: 0.4rem;
+ padding-bottom: 0.4rem;
}
.tr.row_type--total-row .td{
border-top: 1px solid #BBB;
diff --git a/client/src/style/pages/financial-statements.scss b/client/src/style/pages/FinancialStatements/FinancialSheet.scss
similarity index 61%
rename from client/src/style/pages/financial-statements.scss
rename to client/src/style/pages/FinancialStatements/FinancialSheet.scss
index 8ff4dc93b..f3e7530ba 100644
--- a/client/src/style/pages/financial-statements.scss
+++ b/client/src/style/pages/FinancialStatements/FinancialSheet.scss
@@ -1,7 +1,3 @@
-// .form-group-display-columns-by{
-// position: relative;
-// }
-
.bigcapital-datatable{
@@ -20,15 +16,3 @@
}
}
}
-
-
-
-.financial-statement--journal{
-
-
- .financial-header-drawer{
- .bp3-drawer{
- max-height: 350px;
- }
- }
-}
\ No newline at end of file
diff --git a/client/src/style/pages/FinancialStatements/Journal.scss b/client/src/style/pages/FinancialStatements/Journal.scss
index 004ce2775..7447d752b 100644
--- a/client/src/style/pages/FinancialStatements/Journal.scss
+++ b/client/src/style/pages/FinancialStatements/Journal.scss
@@ -28,4 +28,4 @@
max-height: 350px;
}
}
-}
\ No newline at end of file
+}
diff --git a/client/src/style/pages/FinancialStatements/NumberFormatDropdown.scss b/client/src/style/pages/FinancialStatements/NumberFormatDropdown.scss
new file mode 100644
index 000000000..de6107dd9
--- /dev/null
+++ b/client/src/style/pages/FinancialStatements/NumberFormatDropdown.scss
@@ -0,0 +1,43 @@
+
+
+.number-format-dropdown{
+ width: 300px;
+ padding: 15px;
+
+ .bp3-form-group{
+ margin-bottom: 6px;
+
+ label.bp3-label{
+ font-size: 13px;
+ margin-bottom: 4px;
+ font-weight: 500;
+ }
+ .bp3-button{
+ min-height: 28px;
+ min-width: 28px;
+ }
+ }
+ .bp3-control.bp3-inline{
+ margin-bottom: 0;
+ margin-top: 0;
+ }
+ .toggles-fields{
+ margin-top: 14px;
+ }
+ &__footer{
+ text-align: right;
+ padding-top: 10px;
+
+ .bp3-button.bp3-small,
+ .bp3-button:not([class*="bp3-intent-"]):not(.bp3-minimal).bp3-small{
+ min-width: 65px;
+ height: 26px;
+ min-height: 26px;
+ }
+ }
+
+ .bp3-control .bp3-control-indicator{
+ height: 16px;
+ width: 16px;
+ }
+}
\ No newline at end of file
diff --git a/client/src/style/pages/FinancialStatements/ProfitLossSheet.scss b/client/src/style/pages/FinancialStatements/ProfitLossSheet.scss
index 0f0689544..97e3e4bad 100644
--- a/client/src/style/pages/FinancialStatements/ProfitLossSheet.scss
+++ b/client/src/style/pages/FinancialStatements/ProfitLossSheet.scss
@@ -12,6 +12,8 @@
.tbody{
.tr .td{
border-bottom: 0;
+ padding-top: 0.4rem;
+ padding-bottom: 0.4rem;
}
.tr.row_type--total{
font-weight: 500;
diff --git a/client/src/style/pages/FinancialStatements/TrialBalanceSheet.scss b/client/src/style/pages/FinancialStatements/TrialBalanceSheet.scss
index 28a7f4036..4dce5a389 100644
--- a/client/src/style/pages/FinancialStatements/TrialBalanceSheet.scss
+++ b/client/src/style/pages/FinancialStatements/TrialBalanceSheet.scss
@@ -5,10 +5,18 @@
min-width: 720px;
.financial-sheet__table{
-
+ .thead,
+ .tbody{
+ .tr .td:not(:first-child),
+ .tr .th:not(:first-child) {
+ justify-content: flex-end;
+ }
+ }
.tbody{
.tr .td{
border-bottom: 0;
+ padding-top: 0.4rem;
+ padding-bottom: 0.4rem;
}
.balance.td{
border-top-color: #000;
diff --git a/client/src/style/pages/number-format.scss b/client/src/style/pages/number-format.scss
deleted file mode 100644
index dce18cf3f..000000000
--- a/client/src/style/pages/number-format.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-.number-format {
- width: 400px;
- padding: 12px;
- // width: 300px;
- // padding: 10px;
- &__content {
- .bp3-form-group {
- margin-bottom: 5px;
- // margin-bottom: 0px;
- .bp3-form-content {
- .bp3-label {
- margin-bottom: 3px;
- }
- .bp3-control {
- margin: 5px 0px 0px;
- }
- }
- }
- }
- &__footer {
- display: flex;
- justify-content: flex-end;
- }
-}
diff --git a/client/src/utils.js b/client/src/utils.js
index 616a2be99..0ba62b39f 100644
--- a/client/src/utils.js
+++ b/client/src/utils.js
@@ -4,6 +4,8 @@ import { Intent } from '@blueprintjs/core';
import Currency from 'js-money/lib/currency';
import PProgress from 'p-progress';
import accounting from 'accounting';
+import deepMapKeys from 'deep-map-keys';
+
export function removeEmptyFromObject(obj) {
obj = Object.assign({}, obj);
@@ -371,8 +373,6 @@ export function isBlank(value) {
return _.isEmpty(value) && !_.isNumber(value) || _.isNaN(value);
}
-
-
export const getColumnWidth = (
rows,
accessor,
@@ -389,7 +389,32 @@ export const getColumnWidth = (
return result;
};
-
export const toSafeNumber = (number) => {
return _.toNumber(_.defaultTo(number, 0));
+};
+
+export const transformToCamelCase = (object) => {
+ return deepMapKeys(object, (key) => _.snakeCase(key));
+};
+
+
+export function flatObject(obj) {
+ const flatObject = {};
+ const path = []; // current path
+
+ function dig(obj) {
+ if (obj !== Object(obj))
+ /*is primitive, end of path*/
+ return flatObject[path.join('.')] = obj; /*<- value*/
+
+ //no? so this is an object with keys. go deeper on each key down
+ for (let key in obj) {
+ path.push(key);
+ dig(obj[key]);
+ path.pop();
+ }
+ }
+
+ dig(obj);
+ return flatObject;
}
\ No newline at end of file