|
@@ -3,6 +3,7 @@ import Player from './player' // Everything that has to do with players
|
|
|
import Match from './match' // Everything that has to do with matches
|
|
|
import Excel from './excel' // Helper files to create Excel files
|
|
|
import { date2s, time2s } from './helpers'
|
|
|
+import 'bootstrap/dist/css/bootstrap.css'
|
|
|
|
|
|
/**
|
|
|
* General Application Design
|
|
@@ -133,7 +134,7 @@ class App extends React.Component {
|
|
|
worksheets['Calendar'] = worksheet
|
|
|
this.setState({ worksheets })
|
|
|
|
|
|
- if (worksheet[2].length !== 8) {
|
|
|
+ if (worksheet[2].length < 8 | worksheet[2].length > 9) {
|
|
|
throw Error('Wrong file structure.')
|
|
|
}
|
|
|
const matches = worksheet.slice(2, worksheet.length).map((matchData) => new Match.MatchClass(matchData))
|
|
@@ -280,14 +281,26 @@ class App extends React.Component {
|
|
|
if (player.Bezahlt) {
|
|
|
paid = 'OK'
|
|
|
}
|
|
|
- payListPerPlace.push([ paid, match.Konkurrenz, time2s(match.Datum), matchPlayer ])
|
|
|
+ let price
|
|
|
+ if (player.isDoubles) {
|
|
|
+ price = (player.isJunior ? 15 : 25) + (player.isJuniorDP ? 15 : 25)
|
|
|
+ } else {
|
|
|
+ price = player.isJunior ? 30 : 50
|
|
|
+ }
|
|
|
+ payListPerPlace.push([ paid, match.Konkurrenz, time2s(match.Datum), `${matchPlayer} (${price}.-)` ])
|
|
|
}
|
|
|
})
|
|
|
- console.log('Generated pay list per place:', payListPerPlace)
|
|
|
- worksheets[place] = Excel.SheetFromArray(header.concat(payListPerPlace))
|
|
|
- paylist.SheetNames.push(place)
|
|
|
- paylist.Sheets[place] = worksheets[place]
|
|
|
})
|
|
|
+
|
|
|
+ let footer = [
|
|
|
+ [],
|
|
|
+ ['Turnierleiter', null, null, 'Kassierer'],
|
|
|
+ ['Betrag von Spielern erhalten', null, null, 'Betrag von Turnierleiter erhalten']
|
|
|
+ ]
|
|
|
+ console.log(`Generated pay list per place ${place}:`, payListPerPlace)
|
|
|
+ worksheets[place] = Excel.SheetFromArray(header.concat(payListPerPlace, footer))
|
|
|
+ paylist.SheetNames.push(place)
|
|
|
+ paylist.Sheets[place] = worksheets[place]
|
|
|
})
|
|
|
Excel.saveAs(paylist, 'Zahlliste.xlsx')
|
|
|
}
|