remove common area calculation
This commit is contained in:
26
src/Data.js
26
src/Data.js
@@ -32,30 +32,14 @@ class Flat {
|
||||
return room ? this.sizeShared / this.numPeople * room.numPeople : 0;
|
||||
}
|
||||
|
||||
// Calculates the share of the project wide common area
|
||||
// the party has to pay for.
|
||||
// Currently done by number of people in the party.
|
||||
calcCommonAreaShare(room = null) {
|
||||
var numPeople;
|
||||
if (room) {
|
||||
numPeople = room.numPeople;
|
||||
} else {
|
||||
numPeople = this.numRooms;
|
||||
}
|
||||
|
||||
return commonArea / numPeopleTotal * numPeople;
|
||||
}
|
||||
|
||||
// Calculates the total area the party has to pay for
|
||||
// Includes the private area, share of the common area and for
|
||||
// WGs and clusters the share of the internal shared area
|
||||
// Includes the private area and if applicable share of
|
||||
// the internal common area of WGs and cluster flats
|
||||
calcTotalPayedArea(room = null) {
|
||||
var commonAreaShare = this.calcCommonAreaShare(room);
|
||||
|
||||
if (!room) {
|
||||
return this.sizePrivate + commonAreaShare;
|
||||
return this.sizePrivate;
|
||||
} else {
|
||||
return room.size + commonAreaShare + this.calcInternalAreaShare(room);
|
||||
return room.size + this.calcInternalAreaShare(room);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,8 +113,6 @@ const addedCost = 1.2;
|
||||
export const minRent = 9.45 + addedCost;
|
||||
export const maxRent = 13.06 + addedCost;
|
||||
|
||||
const commonArea = 388.80;
|
||||
|
||||
// Calculate total number of people
|
||||
var _numPeople = 0;
|
||||
|
||||
|
||||
@@ -103,24 +103,33 @@ export function FlatDetailsCard({ flat, room }) {
|
||||
|
||||
var sizeSharedBox = null;
|
||||
|
||||
var commonAreaShare = flat.calcCommonAreaShare(room);
|
||||
var internalAreaShare = flat.calcInternalAreaShare(room);
|
||||
var totalSizeToPay = flat.calcTotalPayedArea(room);
|
||||
|
||||
if (flat.wgRoomList.length > 0) {
|
||||
|
||||
sizeSharedBox = <Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Interne Gemeinschaftsfläche
|
||||
</Heading>
|
||||
<Text pt='2' fontSize='sm'>
|
||||
{flat.sizeShared.toFixed(2)} m²
|
||||
</Text>
|
||||
</Box>;
|
||||
sizeSharedBox = [
|
||||
<Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Anteil Interne Gemeinschaftsfläche (WG und Cluster)
|
||||
</Heading>
|
||||
<Text pt='2' fontSize='sm'>
|
||||
{internalAreaShare.toFixed(2)} m²
|
||||
</Text>
|
||||
</Box >,
|
||||
<Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Zahlfläche
|
||||
</Heading>
|
||||
<Text pt='2' fontSize='sm'>
|
||||
{sizePrivate.toFixed(2)} m² + {internalAreaShare.toFixed(2)} m² (WG/Cluster-Fläche)
|
||||
</Text>
|
||||
<Text pt={3} size='s' fontWeight='bold'>Gesamt: {totalSizeToPay.toFixed(2)} m² </Text>
|
||||
</Box>
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
var totalSizeToPay = flat.calcTotalPayedArea(room);
|
||||
|
||||
body = <CardBody>
|
||||
|
||||
<Stack divider={<StackDivider />} spacing='4'>
|
||||
@@ -135,34 +144,18 @@ export function FlatDetailsCard({ flat, room }) {
|
||||
</Box>
|
||||
<Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Zimmeranzahl
|
||||
Zimmeranzahl und Gesamtfläche
|
||||
</Heading>
|
||||
<Text pt='2' fontSize='sm'>
|
||||
{flat.numRooms}
|
||||
{flat.numRooms} Zimmer, {flat.sizePrivate.toFixed(2)} m²
|
||||
</Text>
|
||||
</Box>
|
||||
{sizeSharedBox}
|
||||
<Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Anteil Gemeinschaftsfläche
|
||||
</Heading>
|
||||
<Text pt='2' fontSize='sm'>
|
||||
{commonAreaShare.toFixed(2)} m² {internalAreaShare ? ("(Allmendefläche) + " + internalAreaShare.toFixed(2) + " m² (WG/Cluster-Fläche)") : ""}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Zahlfläche
|
||||
</Heading>
|
||||
<Text pt='2' fontSize='sm'>
|
||||
{sizePrivate.toFixed(2)} m² + {commonAreaShare.toFixed(2)} m² (Allmendefläche) {internalAreaShare ? " + " + (internalAreaShare.toFixed(2) + " m² (WG/Cluster-Fläche)") : null}
|
||||
</Text>
|
||||
<Text pt={3} size='s' fontWeight='bold'>Gesamt: {totalSizeToPay.toFixed(2)} m² </Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Heading size='xs' textTransform='uppercase'>
|
||||
Mindestmiete
|
||||
</Heading>
|
||||
<Text fontSize="xs">Die Mindestmiete ergibt sich aus dem WBS Satz für die private Fläche (4,45 €/m²), den Nebenkosten (1,20 €/m²) und der Küchen-Nutzungspauschale von 50€ pro Küche</Text>
|
||||
<Text pt='2' fontSize='m' fontWeight='bold'>
|
||||
{((sizePrivate + internalAreaShare) * minRent + 50).toFixed(2)} €
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user