Commit 99106b36 authored by TJHeeringa's avatar TJHeeringa

Added Finanical Settings Page

parent 59070d6b
......@@ -12,6 +12,7 @@ import PeopleRoundedIcon from "@material-ui/icons/PeopleRounded";
import PersonIcon from "@material-ui/icons/Person";
import PersonAddIcon from "@material-ui/icons/PersonAdd";
import PersonAddDisabledIcon from "@material-ui/icons/PersonAddDisabled";
import SettingsIcon from "@material-ui/icons/Settings";
import ShareIcon from "@material-ui/icons/Share";
import StorageIcon from "@material-ui/icons/Storage";
import SubjectIcon from "@material-ui/icons/Subject";
......@@ -127,6 +128,11 @@ const AssociationBoardDrawer = (props) => {
icon: <EuroIcon />,
primary: "Financial",
items: [
{
icon: <SettingsIcon />,
primary: "Settings",
to: url + "/financial/settings"
},
{
icon: <PaymentIcon />,
primary: "Debt collections",
......
import Button from "@material-ui/core/Button";
import Container from "@material-ui/core/Container";
import Typography from "@material-ui/core/Typography";
import React, {useState} from "react";
import {ValidatorForm} from "react-material-ui-form-validator";
import NumberField from "../../Components/Fields/NumberField";
import Wrapper from "../../Components/Fields/Wrapper";
import Block from "../../Components/PageLayout/Content/Block";
import {useAlertHandler} from "../../Contexts/AlertHandler";
const Settings = (props) => {
const alerthandler = useAlertHandler();
const [association, setAssociation] = useState({debt_collection_threshold: 0});
const handleSubmit = () => {
alerthandler.handleAlertHandler("info", "Not implemented");
};
const handleAssociationChange = (field, value) => {
setAssociation(prevState => ({
...prevState,
[field]: value
}));
};
return (
<Container>
<Block>
<Typography variant={"h5"}>Financial Settings</Typography>
<hr className={"box-title-separator"}/>
<ValidatorForm
onSubmit={handleSubmit}
onError={(errors)=>console.error(errors)}
>
<Wrapper>
<NumberField
name={"Debt Collection Threshold"}
value={association.debt_collection_threshold}
onChange={(event) => handleAssociationChange("debt_collection_threshold", event.target.value)}
InputProps={{
inputProps: {
step: 0.1, min: 0
}
}}
helperText={
"Debt Collection Entries below this amount will not be included in the debt collection, " +
"unless its the final debt collection of a membership"
}
/>
</Wrapper>
<Wrapper>
<div/>
<Button
variant={"contained"}
color={"primary"}
type={"submit"}
>
Save
</Button>
</Wrapper>
</ValidatorForm>
</Block>
</Container>
);
};
Settings.propTypes = {
};
export default Settings;
\ No newline at end of file
......@@ -21,6 +21,7 @@ import PropTypes from "prop-types";
import React from "react";
import { Route } from "react-router-dom";
import Settings from "../../../Pages/Financial/Settings";
const BoardMemberRoutes = (props) => {
const {path, association_membership, association} = props;
......@@ -117,6 +118,15 @@ const BoardMemberRoutes = (props) => {
/>
}
/>
<Route
path={path+"/financial/settings"}
render={() =>
<Settings
association={association}
path={path}
/>
}
/>
{ /*Emails*/ }
<Route
path={path+"/emails/send"}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment