mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
fix(server): Trial balance total row shouldn't show if accounts have no balances
This commit is contained in:
@@ -252,10 +252,6 @@ export default class TrialBalanceSheet extends FinancialSheet {
|
|||||||
* @return {ITrialBalanceSheetData}
|
* @return {ITrialBalanceSheetData}
|
||||||
*/
|
*/
|
||||||
public reportData(): ITrialBalanceSheetData {
|
public reportData(): ITrialBalanceSheetData {
|
||||||
// Don't return noting if the journal has no transactions.
|
|
||||||
if (this.repository.totalAccountsLedger.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// Retrieve accounts nodes.
|
// Retrieve accounts nodes.
|
||||||
const accounts = this.accountsSection(this.repository.accounts);
|
const accounts = this.accountsSection(this.repository.accounts);
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export class TrialBalanceSheetTable extends R.compose(
|
|||||||
*/
|
*/
|
||||||
public tableRows = (): ITableRow[] => {
|
public tableRows = (): ITableRow[] => {
|
||||||
return R.compose(
|
return R.compose(
|
||||||
R.append(this.totalTableRow()),
|
R.unless(R.isEmpty, R.append(this.totalTableRow())),
|
||||||
R.concat(this.accountsTableRows())
|
R.concat(this.accountsTableRows())
|
||||||
)([]);
|
)([]);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user