Skip to content

Commit

Permalink
Removing Total Volume Credits
Browse files Browse the repository at this point in the history
p.18
Split Loop
  • Loading branch information
wand2016 committed Aug 12, 2019
1 parent e45fc20 commit 36e73b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.php
Expand Up @@ -49,12 +49,13 @@ function statement($invoice, $plays)
$result = "Statement for ${invoice['customer']}";

foreach ($invoice['performances'] as $perf) {
$volumeCredits += $volumeCreditsFor($perf);

// print line for this order
$result .= ' ' . $playFor($perf)['name']. ': ' . $usd($amountFor($perf)) . "(${perf['audience']} seats)" . PHP_EOL;
$totalAmount += $amountFor($perf);
}
foreach ($invoice['performances'] as $perf) {
$volumeCredits += $volumeCreditsFor($perf);
}

$result .= 'Amount owed is ' . $usd($totalAmount) . PHP_EOL;
$result .= "You earned ${volumeCredits} credits" . PHP_EOL;
Expand Down

0 comments on commit 36e73b7

Please sign in to comment.