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