mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix: customers/vendor reports.
This commit is contained in:
@@ -26,8 +26,13 @@ export default class TransactionsByCustomersTableRows extends TransactionsByCont
|
||||
return {
|
||||
...tableRowMapper(customer, columns, { rowTypes: [ROW_TYPE.CUSTOMER] }),
|
||||
children: R.pipe(
|
||||
R.concat(this.contactTransactions(customer)),
|
||||
R.prepend(this.contactOpeningBalance(customer)),
|
||||
R.when(
|
||||
R.always(customer.transactions.length > 0),
|
||||
R.pipe(
|
||||
R.concat(this.contactTransactions(customer)),
|
||||
R.prepend(this.contactOpeningBalance(customer)),
|
||||
),
|
||||
),
|
||||
R.append(this.contactClosingBalance(customer))
|
||||
)([]),
|
||||
};
|
||||
|
||||
@@ -17,13 +17,25 @@ export default class TransactionsByVendorsTableRows extends TransactionsByContac
|
||||
* @returns {ITableRow[]}
|
||||
*/
|
||||
private vendorDetails(vendor: ITransactionsByVendorsVendor) {
|
||||
const columns = [{ key: 'vendorName', accessor: 'vendorName' }];
|
||||
const columns = [
|
||||
{ key: 'vendorName', accessor: 'vendorName' },
|
||||
...R.repeat({ key: 'empty', value: '' }, 5),
|
||||
{
|
||||
key: 'closingBalanceValue',
|
||||
accessor: 'closingBalance.formattedAmount',
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
...tableRowMapper(vendor, columns, { rowTypes: [ROW_TYPE.VENDOR] }),
|
||||
children: R.pipe(
|
||||
R.append(this.contactOpeningBalance(vendor)),
|
||||
R.concat(this.contactTransactions(vendor)),
|
||||
R.when(
|
||||
R.always(vendor.transactions.length > 0),
|
||||
R.pipe(
|
||||
R.append(this.contactOpeningBalance(vendor)),
|
||||
R.concat(this.contactTransactions(vendor))
|
||||
)
|
||||
),
|
||||
R.append(this.contactClosingBalance(vendor))
|
||||
)([]),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user