parent
e0add846bb
commit
6b23dea477
|
@ -97,6 +97,12 @@ export class PdfController {
|
|||
else {
|
||||
runner.group.fullName = `${runner.group.parentGroup.name}/${runner.group.name}`;
|
||||
}
|
||||
runner.donationPerDistanceTotal = runner.distanceDonations.reduce(function (sum, current) {
|
||||
return sum + current.amountPerDistance;
|
||||
}, 0);
|
||||
runner.donationTotal = runner.distanceDonations.reduce(function (sum, current) {
|
||||
return sum + current.amount;
|
||||
}, 0);
|
||||
response.push(runner)
|
||||
}
|
||||
return response;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {
|
||||
IsArray
|
||||
IsArray, IsNumber, IsOptional
|
||||
} from "class-validator";
|
||||
import { DistanceDonation } from './DistanceDonation';
|
||||
import { Runner } from './Runner';
|
||||
|
@ -13,4 +13,13 @@ export class CertificateRunner extends Runner {
|
|||
*/
|
||||
@IsArray()
|
||||
distanceDonations: DistanceDonation[];
|
||||
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
donationPerDistanceTotal?: number = 0;
|
||||
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
donationTotal?: number = 0;
|
||||
|
||||
}
|
||||
|
|
|
@ -79,8 +79,8 @@
|
|||
</tbody>
|
||||
<tfoot>
|
||||
<td>{{__ "gesamt"}}</td>
|
||||
<td>0.5 {{../currency_symbol}}</td>
|
||||
<td>1 {{../currency_symbol}}</td>
|
||||
<td>{{--format_currency this.donationPerDistanceTotal}} {{../currency_symbol}}</td>
|
||||
<td>{{--format_currency this.donationTotal}} {{../currency_symbol}}</td>
|
||||
</tfoot>
|
||||
</table>
|
||||
</main>
|
||||
|
|
Loading…
Reference in New Issue