Skip to content

Commit

Permalink
アキュムレータをループの近くに持ってった
Browse files Browse the repository at this point in the history
p.19

Slide Statement
  • Loading branch information
wand2016 committed Aug 12, 2019
1 parent 36e73b7 commit 0943f62
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.php
Expand Up @@ -45,14 +45,13 @@ function statement($invoice, $plays)
// ----------------------------------------

$totalAmount = 0;
$volumeCredits = 0;
$result = "Statement for ${invoice['customer']}";

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

0 comments on commit 0943f62

Please sign in to comment.