Skip to content

Commit

Permalink
Fix asset purchases/asset financings
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Dec 2, 2024
1 parent b302b46 commit fad9936
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions centrifuge-app/src/components/Report/CashflowStatement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ export function CashflowStatement({ pool }: { pool: Pool }) {
heading: false,
formatter: (v: any) => (v ? formatBalance(v, pool.currency.displayName, 2) : ''),
},
{
name: 'Asset financings',
value:
data?.map((day) => (day.subtype === 'privateCredit' ? day?.assetFinancing?.toDecimal().neg() : 0)) ||
[],
heading: false,
formatter: (v: any) => `${formatBalance(v, pool.currency.displayName, 2)}`,
},
]
: []),
{
Expand All @@ -143,12 +151,26 @@ export function CashflowStatement({ pool }: { pool: Pool }) {
heading: false,
formatter: (v: any) => (v ? formatBalance(v, pool.currency.displayName, 2) : ''),
},
{
name: poolMetadata?.pool?.asset.class === 'Private credit' ? 'Asset financings' : 'Asset purchases',
value: data?.map((day) => day.assetAcquisitions.toDecimal().neg()) || [],
heading: false,
formatter: (v: any) => `${formatBalance(v, pool.currency.displayName, 2)}`,
},
...(poolMetadata?.pool?.asset.class === 'Public credit'
? [
{
name: 'Asset financings',
value:
data?.map((day) => (day.subtype === 'publicCredit' ? day?.assetPurchases?.toDecimal().neg() : 0)) || [],
heading: false,
formatter: (v: any) => `${formatBalance(v, pool.currency.displayName, 2)}`,
},
]
: [
{
name: 'Asset purchases',
value:
data?.map((day) => (day.subtype === 'privateCredit' ? day?.assetFinancing?.toDecimal().neg() : 0)) ||
[],
heading: false,
formatter: (v: any) => `${formatBalance(v, pool.currency.displayName, 2)}`,
},
]),
{
name: 'Net cash flow from assets',
value: data?.map((state) => state.netCashflowAsset.toDecimal()) || [],
Expand Down

0 comments on commit fad9936

Please sign in to comment.