Commit 3e4aeeeb authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

push sebelum liburan

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