Commit baa2462a authored by Deni Rinaldi's avatar Deni Rinaldi

push sebelum liburan

parent 85eea79e
......@@ -2,10 +2,19 @@ import React from 'react';
import './assets/sass/app.css';
import Route from './router'
import 'bootstrap/dist/css/bootstrap.min.css';
import Constant from './library/Constant';
if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded');
} else {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}
sessionStorage.setItem('reloaded', 'yes');
function App() {
return (
<Route/>
<Route />
// <div className="App">
// <header className="App-header">
// <img src={logo} className="App-logo" alt="logo" />
......
......@@ -10,6 +10,34 @@
color: #273b80 !important;
}
.color-pallete1{
background-color: #273b80 !important;
}
.color-pallete2{
background-color: #1c71b8 !important;
}
.color-pallete3{
background-color: #37b5e6 !important;
}
.color-pallete4{
background-color: #07a7d0 !important;
}
.color-pallete5{
background-color: #768895 !important;
}
.color-pallete6{
background-color: #211e1e !important;
}
.color-pallete7{
background-color: #242021 !important;
}
.btn-save{
width: 102px;
height: 30px;
import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel } from '@material-ui/core';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, Snackbar, withStyles } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import Images from '../assets/Images';
import BalanceSheet from './BudgetTahunan/BalanceSheet';
import api from '../api';
import Autocomplete from '@material-ui/lab/Autocomplete';
import MuiAlert from '@material-ui/lab/Alert';
import { titleCase } from '../library/Utils';
import ProfitLoss from './BudgetTahunan/ProfitLoss';
import TaxPlanning from './BudgetTahunan/TaxPlanning';
......@@ -13,6 +14,10 @@ import CorporateAnnualTarget from './BudgetTahunan/CorporateAnnualTarget';
import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../library/Upload";
import { format } from 'date-fns';
import Constant from '../library/Constant';
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
export default class BudgetTahunan extends Component {
constructor(props) {
......@@ -33,7 +38,10 @@ export default class BudgetTahunan extends Component {
visibleCAT: false,
listAttachment: [],
visibleUpload: false,
revisionTable: null
revisionTable: null,
alert: false,
tipeAlert: '',
messageAlert: '',
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -88,24 +96,36 @@ export default class BudgetTahunan extends Component {
getCompanyActive() {
api.create().getPerusahaanActive().then((response) => {
if (response.data.status === 'success') {
let data = response.data.data
let companyData = data.map((item) => {
return {
company_id: item.company_id,
company_name: item.company_name,
}
})
let defaultProps = {
options: companyData,
getOptionLabel: (option) => titleCase(option.company_name),
};
this.setState({ listCompany: defaultProps, company: companyData[0] }, () => {
this.getPeriode()
})
if (response.data) {
if (response.data.status === 'success') {
let data = response.data.data
let companyData = data.map((item) => {
return {
company_id: item.company_id,
company_name: item.company_name,
}
})
let defaultProps = {
options: companyData,
getOptionLabel: (option) => titleCase(option.company_name),
};
this.setState({ listCompany: defaultProps, company: companyData[0] }, () => {
this.getPeriode()
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
alert(response.data.message)
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', listCompany: null, company: null })
}
})
}
......@@ -264,6 +284,10 @@ export default class BudgetTahunan extends Component {
})
}
closeAlert() {
this.setState({ alert: false })
}
render() {
const columns = ["#", "Jenis Laporan",
{
......@@ -395,6 +419,11 @@ export default class BudgetTahunan extends Component {
]
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
{this.state.visibleBudgetTahunan && (
<div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
......@@ -558,6 +587,7 @@ export default class BudgetTahunan extends Component {
{this.state.visibleBS && (
<BalanceSheet
open={this.props.open}
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
......
This diff is collapsed.
......@@ -373,14 +373,6 @@ export default function MiniDrawer() {
})
}
if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded');
} else {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}
sessionStorage.setItem('reloaded', 'yes');
const logout = () => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -649,7 +641,7 @@ export default function MiniDrawer() {
key={index}
path={route.path}
// exact={route.exact}
children={<route.main height={height} width={width} />}
children={<route.main height={height} width={width} open={open}/>}
/>
))}
</Switch>
......
......@@ -678,7 +678,7 @@ export default class CreateParameter extends Component {
margin="normal"
id="start_date"
label="Valid From"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
value={this.state.tempData === null ? '' : this.state.tempData.start_date}
error={this.state.errorStartDate}
helperText={this.state.msgErrorStartDate}
......@@ -846,7 +846,7 @@ export default class CreateParameter extends Component {
margin="normal"
id="end_date"
label="Valid To"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
minDate={this.state.tempData === null ? null : this.state.tempData.start_date}
......@@ -1057,7 +1057,7 @@ export default class CreateParameter extends Component {
margin="normal"
id="startDate"
label="Valid From"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
error={this.state.errorStartDate}
helperText={this.state.msgErrorStartDate}
value={this.state.startDate == "" ? null : this.state.startDate}
......@@ -1216,7 +1216,7 @@ export default class CreateParameter extends Component {
margin="normal"
id="endDate"
label="Valid To"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
minDate={this.state.startDate}
......
......@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
import Images from '../../../assets/Images';
import MUIDataTable from "mui-datatables";
import { InputBase, Snackbar, withStyles } from "@material-ui/core";
import { InputBase, Snackbar, withStyles, Typography } from "@material-ui/core";
import MuiAlert from '@material-ui/lab/Alert';
import CreateParameter from '../Parameter/CreateParameter';
import api from '../../../api';
......@@ -268,16 +268,16 @@ export default class Parameter extends Component {
if (item.length > 0) {
payload.push({
id: index + 1,
group: item[0],
parameter: item[1],
company: item[2],
group: item[0] === undefined ? "" : item[0] ,
parameter: item[1] === undefined ? "" : item[1],
company: item[2] === undefined ? "" : item[2],
description: item[3],
orders: item[4],
value: item[5],
min_value: item[6],
max_value: item[7],
start_date: item[8],
end_date: item[9],
start_date: item[8] === undefined ? "" : item[8],
end_date: item[9] === undefined ? "" : item[9],
})
}
})
......@@ -329,9 +329,9 @@ export default class Parameter extends Component {
<div style={{ display: 'flex' }}>
{tableMeta.rowData[11] != null && check > -1 ?
<a data-tip={tableMeta.rowData[11][check].message} data-for="group">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
}
<ReactTooltip border={true} id="group" place="bottom" type="light" effect="solid" />
</div >
......@@ -354,9 +354,9 @@ export default class Parameter extends Component {
<div style={{ display: 'flex' }}>
{tableMeta.rowData[11] != null && check > -1 ?
<a data-tip={tableMeta.rowData[11][check].message} data-for="parameter">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
}
<ReactTooltip border={true} id="parameter" place="bottom" type="light" effect="solid" />
</div >
......@@ -379,9 +379,9 @@ export default class Parameter extends Component {
<div style={{ display: 'flex' }}>
{tableMeta.rowData[11] != null && check > -1 ?
<a data-tip={tableMeta.rowData[11][check].message} data-for="company">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
}
<ReactTooltip border={true} id="company" place="bottom" type="light" effect="solid" />
</div >
......@@ -529,9 +529,9 @@ export default class Parameter extends Component {
<div style={{ display: 'flex' }}>
{tableMeta.rowData[11] != null && check > -1 ?
<a data-tip={tableMeta.rowData[11][check].message} data-for="start_date">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
}
<ReactTooltip border={true} id="start_date" place="bottom" type="light" effect="solid" />
</div >
......@@ -554,9 +554,9 @@ export default class Parameter extends Component {
<div style={{ display: 'flex' }}>
{tableMeta.rowData[11] != null && check > -1 ?
<a data-tip={tableMeta.rowData[11][check].message} data-for="enddate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "-" : val}</span>
}
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
</div >
......@@ -797,8 +797,8 @@ export default class Parameter extends Component {
{this.state.visibleParameter === true ?
<div>
{this.state.load && (
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -180 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Parameter</label>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -182 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '40%', }}>Parameter</label>
{/* <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
<img src={Images.searchBlack} style={{ marginRight: 10 }} />
<InputBase
......@@ -809,7 +809,7 @@ export default class Parameter extends Component {
inputProps={{ 'aria-label': 'naked' }}
/>
</div> */}
<div style={{ width: '30%', justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<div style={{ width: '40%', justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
style={{
......
This diff is collapsed.
......@@ -215,7 +215,7 @@ export default class CreateUnitBisnis extends Component {
margin="normal"
id="startDate"
label="Valid From"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
value={this.state.startDate}
onChange={(e) => this.handleChange(e, 'start_date')}
KeyboardButtonProps={{
......@@ -300,7 +300,7 @@ export default class CreateUnitBisnis extends Component {
margin="normal"
id="startDate"
label="Valid To"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
minDate={this.state.startDate}
......@@ -403,7 +403,7 @@ export default class CreateUnitBisnis extends Component {
margin="normal"
id="startDate"
label="Valid From"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
value={this.state.startDate == "" ? null : this.state.startDate}
onChange={(e) => this.handleChange(e, 'start_date')}
KeyboardButtonProps={{
......@@ -482,7 +482,7 @@ export default class CreateUnitBisnis extends Component {
margin="normal"
id="endDate"
label="Valid To"
format="dd MMMM yyyy"
format="dd-MM-yyyy"
error={this.state.errorEndDate}
helperText={this.state.msgErrorEndDate}
minDate={this.state.startDate}
......
......@@ -119,6 +119,8 @@ export default class Profile extends Component {
setTimeout(() => {
window.location.reload();
}, 1000);
} else if (response.data.message === "Old Password is Not Correct") {
this.setState({ errorOldPassword: true, msgOldPassword: 'Incorrect password.' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
......
......@@ -166,6 +166,7 @@ exports.customTable = function () {
toolButton: {
display: "flex",
height: "auto",
whiteSpace: 'nowrap'
},
data: {
display: "inline-block",
......@@ -445,11 +446,15 @@ exports.customTable3 = function () {
fontSize: "10pt"
}
},
ColorPallete3: {
backgroundColor: '#37b5e6'
},
MuiTableCell: {
root: {
display: 'table-cell',
padding: 7,
paddingLeft: 25,
paddingRight: 25,
fontSize: '0.875rem',
textAlign: 'left',
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
......
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