Skip to content

Commit

Permalink
WordCamp Report: Check that the report has invoices in the currency b…
Browse files Browse the repository at this point in the history
…efore checking the conversion rates.
  • Loading branch information
dd32 committed Jan 8, 2025
1 parent a7c6e08 commit f609590
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@
</tr>
</thead>
<tbody>
<?php foreach ( array_keys( $payments['amount_by_currency'] ) as $currency ) : ?>
<?php foreach ( array_keys( $payments['amount_by_currency'] ) as $currency ) :
$has_invoices = ( $invoices['amount_by_currency'][ $currency ] ?? 0 ) > 0;
?>
<tr>
<td><?php echo esc_html( $currency ); ?></td>
<td class="number"><?php echo number_format_i18n( $payments['amount_by_currency'][ $currency ] ); ?></td>
<td class="number">
<?php echo number_format_i18n( $payments['converted_amounts'][ $currency ] ); ?>
<?php if ( $invoices['amount_by_currency'][ $currency ] > 0 && $invoices['converted_amounts'][ $currency ] === 0 ) : $asterisk2 = true; ?>
<?php if ( $has_invoices && $invoices['converted_amounts'][ $currency ] === 0 ) : $asterisk2 = true; ?>
**
<?php endif; ?>
</td>
Expand Down

0 comments on commit f609590

Please sign in to comment.