Commit a8ceac6f authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 102f3767 b6c52c49
......@@ -176,7 +176,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const uploadFoto = (body) => api.post('attachment/upload_foto', body)
// MANAGEMENT DOCUMENT
const getDocumentCategory = () => api.get('document_category/get_all_document_category')
const getDocumentCategory = (body) => api.post('setting/get_all_setting_document_category', body)
const getAllDocument = (body) => api.post('document/get_all_document', body)
const uploadDocument = (body) => api.post('document/upload_document', body)
......
......@@ -309,7 +309,7 @@ export default class BudgetTahunan extends Component {
this.setState({ alert: false })
}
getDataBalanceSheet(data) {
saveToMasterBudget(data) {
this.setState({ loading: true })
// console.log(JSON.stringify(data));
api.create().createSubmitReport(data).then(response => {
......@@ -318,7 +318,11 @@ export default class BudgetTahunan extends Component {
if (response.data.status === "success") {
this.getReport()
this.getSubmission()
} else {
this.setState({ loading: true })
}
} else {
this.setState({ loading: true })
}
})
}
......@@ -646,18 +650,21 @@ export default class BudgetTahunan extends Component {
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
getDataBalanceSheet={this.getDataBalanceSheet.bind(this)}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleBudgetTahunan: true })}
/>
)}
{this.state.visiblePL && (
<ProfitLoss
open={this.props.open}
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visiblePL: false, visibleBudgetTahunan: true })}
/>
......
......@@ -6,6 +6,8 @@ import api from '../../api';
import AddIcon from '@material-ui/icons/Add';
import { values } from 'ramda';
import PropagateLoader from "react-spinners/PropagateLoader"
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -746,7 +748,7 @@ export default class BalanceSheet extends Component {
"balance_sheet": data
}
// console.log(data);
this.props.getDataBalanceSheet(payload)
this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
......@@ -2002,11 +2004,59 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Balance Sheet</Typography>
</div>
<div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between'}}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%'}}>
<div style={{justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.template} />
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.upload} />
</button>
</a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
</div>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}>
<MuiThemeProvider theme={getMuiTheme()}>
......
......@@ -16,9 +16,8 @@ const style = {
};
const style2 = {
position: "sticky",
left: 420,
background: "white",
zIndex: 101
zIndex: 100
};
export default class FixedAssetsMovement extends Component {
......@@ -231,14 +230,14 @@ export default class FixedAssetsMovement extends Component {
name: "Account",
options: {
customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 388 }}>
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 388 }}>
<div style={{ width: 300 }}>
{tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
......@@ -254,8 +253,8 @@ export default class FixedAssetsMovement extends Component {
name: "31 Dec 2020 Actual",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
......@@ -323,10 +322,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "January 2021",
name: "Jan 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -395,10 +394,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "February 2021",
name: "Feb 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -467,10 +466,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "March 2021",
name: "Mar 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -539,10 +538,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "April 2021",
name: "Apr 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -614,7 +613,7 @@ export default class FixedAssetsMovement extends Component {
name: "May 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -683,10 +682,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "June 2021",
name: "Jun 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -755,10 +754,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "July 2021",
name: "Jul 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -827,10 +826,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "August 2021",
name: "Aug 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -899,10 +898,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "September 2021",
name: "Sep 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -971,10 +970,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "October 2021",
name: "Oct 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -1043,10 +1042,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "November 2021",
name: "Nov 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -1115,10 +1114,10 @@ export default class FixedAssetsMovement extends Component {
}
}
}, {
name: "December 2021",
name: "Dec 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -1190,8 +1189,8 @@ export default class FixedAssetsMovement extends Component {
name: "Current Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
......
......@@ -5,6 +5,9 @@ import NumberFormat from 'react-number-format';
import api from '../../api';
import AddIcon from '@material-ui/icons/Add';
import { values } from 'ramda';
import PropagateLoader from "react-spinners/PropagateLoader"
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -48,11 +51,13 @@ export default class ProfitLoss extends Component {
}
getItemHierarki() {
this.setState({ loading: true })
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
}
api.create().getDetailReportMB(payload).then(response => {
console.log(response);
......@@ -68,6 +73,7 @@ export default class ProfitLoss extends Component {
item.formula,
item.level,
item.description,
item.profit_loss.notes,
item.profit_loss.total_actual_before,
item.profit_loss.january,
item.profit_loss.february,
......@@ -95,6 +101,7 @@ export default class ProfitLoss extends Component {
i.formula,
i.level,
i.description,
i.profit_loss.notes,
i.profit_loss.total_actual_before,
i.profit_loss.january,
i.profit_loss.february,
......@@ -121,6 +128,7 @@ export default class ProfitLoss extends Component {
val.formula,
val.level,
val.description,
val.profit_loss.notes,
val.profit_loss.total_actual_before,
val.profit_loss.january,
val.profit_loss.february,
......@@ -147,6 +155,7 @@ export default class ProfitLoss extends Component {
items.formula,
items.level,
items.description,
items.profit_loss.notes,
items.profit_loss.total_actual_before,
items.profit_loss.january,
items.profit_loss.february,
......@@ -173,6 +182,7 @@ export default class ProfitLoss extends Component {
itemss.formula,
itemss.level,
itemss.description,
itemss.profit_loss.notes,
itemss.profit_loss.total_actual_before,
itemss.profit_loss.january,
itemss.profit_loss.february,
......@@ -199,6 +209,7 @@ export default class ProfitLoss extends Component {
item1.formula,
item1.level,
item1.description,
item1.profit_loss.notes,
item1.profit_loss.total_actual_before,
item1.profit_loss.january,
item1.profit_loss.february,
......@@ -225,6 +236,7 @@ export default class ProfitLoss extends Component {
item2.formula,
item2.level,
item2.description,
item2.profit_loss.notes,
item2.profit_loss.total_actual_before,
item2.profit_loss.january,
item2.profit_loss.february,
......@@ -251,6 +263,7 @@ export default class ProfitLoss extends Component {
item3.formula,
item3.level,
item3.description,
item3.profit_loss.notes,
item3.profit_loss.total_actual_before,
item3.profit_loss.january,
item3.profit_loss.february,
......@@ -277,6 +290,7 @@ export default class ProfitLoss extends Component {
item4.formula,
item4.level,
item4.description,
item4.profit_loss.notes,
item4.profit_loss.total_actual_before,
item4.profit_loss.january,
item4.profit_loss.february,
......@@ -303,6 +317,7 @@ export default class ProfitLoss extends Component {
item5.formula,
item5.level,
item5.description,
item5.profit_loss.notes,
item5.profit_loss.total_actual_before,
item5.profit_loss.january,
item5.profit_loss.february,
......@@ -329,6 +344,7 @@ export default class ProfitLoss extends Component {
item6.formula,
item6.level,
item6.description,
item6.profit_loss.notes,
item6.profit_loss.total_actual_before,
item6.profit_loss.january,
item6.profit_loss.february,
......@@ -354,6 +370,7 @@ export default class ProfitLoss extends Component {
item6.formula,
item6.level,
item6.description,
item6.profit_loss.notes,
item6.profit_loss.total_actual_before,
item6.profit_loss.january,
item6.profit_loss.february,
......@@ -381,6 +398,7 @@ export default class ProfitLoss extends Component {
item5.formula,
item5.level,
item5.description,
item5.profit_loss.notes,
item5.profit_loss.total_actual_before,
item5.profit_loss.january,
item5.profit_loss.february,
......@@ -408,6 +426,7 @@ export default class ProfitLoss extends Component {
item4.formula,
item4.level,
item4.description,
item4.profit_loss.notes,
item4.profit_loss.total_actual_before,
item4.profit_loss.january,
item4.profit_loss.february,
......@@ -435,6 +454,7 @@ export default class ProfitLoss extends Component {
item3.formula,
item3.level,
item3.description,
item3.profit_loss.notes,
item3.profit_loss.total_actual_before,
item3.profit_loss.january,
item3.profit_loss.february,
......@@ -462,6 +482,7 @@ export default class ProfitLoss extends Component {
item2.formula,
item2.level,
item2.description,
item2.profit_loss.notes,
item2.profit_loss.total_actual_before,
item2.profit_loss.january,
item2.profit_loss.february,
......@@ -489,6 +510,7 @@ export default class ProfitLoss extends Component {
item1.formula,
item1.level,
item1.description,
item1.profit_loss.notes,
item1.profit_loss.total_actual_before,
item1.profit_loss.january,
item1.profit_loss.february,
......@@ -516,6 +538,7 @@ export default class ProfitLoss extends Component {
itemss.formula,
itemss.level,
itemss.description,
itemss.profit_loss.notes,
itemss.profit_loss.total_actual_before,
itemss.profit_loss.january,
itemss.profit_loss.february,
......@@ -543,6 +566,7 @@ export default class ProfitLoss extends Component {
items.formula,
items.level,
items.description,
items.profit_loss.notes,
items.profit_loss.total_actual_before,
items.profit_loss.january,
items.profit_loss.february,
......@@ -570,6 +594,7 @@ export default class ProfitLoss extends Component {
val.formula,
val.level,
val.description,
val.profit_loss.notes,
val.profit_loss.total_actual_before,
val.profit_loss.january,
val.profit_loss.february,
......@@ -597,6 +622,7 @@ export default class ProfitLoss extends Component {
i.formula,
i.level,
i.description,
i.profit_loss.notes,
i.profit_loss.total_actual_before,
i.profit_loss.january,
i.profit_loss.february,
......@@ -623,6 +649,7 @@ export default class ProfitLoss extends Component {
i.formula,
i.level,
i.description,
i.profit_loss.notes,
i.profit_loss.total_actual_before,
i.profit_loss.january,
i.profit_loss.february,
......@@ -650,6 +677,7 @@ export default class ProfitLoss extends Component {
item.formula,
item.level,
item.description,
item.profit_loss.notes,
item.profit_loss.total_actual_before,
item.profit_loss.january,
item.profit_loss.february,
......@@ -669,9 +697,11 @@ export default class ProfitLoss extends Component {
])
}
})
console.log(dataTable);
this.setState({ dataTable })
// console.log(dataTable);
this.setState({ dataTable, loading: false })
}
} else {
this.setState({ loading: false })
}
})
}
......@@ -708,6 +738,45 @@ export default class ProfitLoss extends Component {
// }, () => console.log(this.state.dataTable))
}
backToMasterBudget(type) {
let data = []
console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
notes: String(i[6]),
total_actual_before: String(i[7]),
january: String(i[8]),
february: String(i[9]),
march: String(i[10]),
april: String(i[11]),
may: String(i[12]),
june: String(i[13]),
july: String(i[14]),
august: String(i[15]),
september: String(i[16]),
october: String(i[17]),
november: String(i[18]),
december: String(i[19]),
total_current_year: String(i[20]),
total_next_year: String(i[21]),
total_more_year: String(i[22])
})
})
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": this.props.report_id,
"status": type,
"profit_loss": data
}
console.log(data);
this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -723,6 +792,16 @@ export default class ProfitLoss extends Component {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
}
}
const handleNotes = (value, tableMeta) => {
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
}
}
const handleValue = (data) => {
let total = 0
dataTable2.map((item, index) => {
......@@ -771,7 +850,7 @@ export default class ProfitLoss extends Component {
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300}}>
<div style={{ width: 300 }}>
{tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
......@@ -784,7 +863,44 @@ export default class ProfitLoss extends Component {
}
}
}, {
name: "31-Dec-2020 OL PA",
name: "Notes",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[4] !== 0 || tableMeta.rowData[4] !== 1 ?
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleNotes(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/> : null}
</div>
</div>
)
}
}
}, {
name: "31 Dec 2020 Actual",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......@@ -1720,11 +1836,11 @@ export default class ProfitLoss extends Component {
}
}
}, {
name: "31-Dec-21 MB",
name: "Current Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
......@@ -1792,7 +1908,7 @@ export default class ProfitLoss extends Component {
}
}
}, {
name: "31-Dec-22 Forcast",
name: "31 Dec 2022 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......@@ -1864,7 +1980,7 @@ export default class ProfitLoss extends Component {
}
}
}, {
name: "31-Dec-23 Forcast",
name: "31 Dec 2023 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......@@ -1937,27 +2053,84 @@ export default class ProfitLoss extends Component {
}
}
]
console.log(this.props.width);
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography>
</div>
{this.state.loading && loadingComponent}
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Profit & Loss</Typography>
</div>
<div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.template} />
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.upload} />
</button>
</a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
</div>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) , height: this.props.height - 400 }}>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
......@@ -1967,17 +2140,17 @@ export default class ProfitLoss extends Component {
</MuiThemeProvider>
</div>
</div>
<div className="grid grid-2x" style={{ marginTop: 20}}>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<button
className="button"
type="button"
onClick={() => this.backToMasterBudget('draft')}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
onClick={() => this.props.onClickClose()}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
......@@ -1985,12 +2158,37 @@ export default class ProfitLoss extends Component {
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
onClick={() => {
this.props.onClickClose()
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography>
</div>
</button>
<button
type="button"
onClick={() => this.backToMasterBudget('submitted')}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div>
</button>
<button
className="button"
type="button"
......@@ -1998,8 +2196,11 @@ export default class ProfitLoss extends Component {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
onClick={() => {
this.forceUpdate()
}}
onClick={() => this.forceUpdate()}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography>
......
......@@ -14,23 +14,32 @@ export default class AuditTahunan extends Component {
super(props)
this.state = {
dataTable: [],
visibleCreate: false
visibleCreate: false,
refresh: ''
}
}
componentDidMount() {
console.log(this.props.data)
// console.log(this.props.data)
this.getData()
}
componentWillReceiveProps(props) {
// console.log(props);
const { refresh, id } = this.props;
if (props.refresh !== refresh) {
this.getData()
}
}
getData() {
let payload = {
"company_id": 1,
"document_category_id": 1
"setting_id": this.props.data.setting_id
}
api.create().getAllDocument(payload).then(respone => {
let dataTable = respone.data.data.map(item => {
api.create().getAllDocument(payload).then(response => {
console.log(response)
let dataTable = response.data.data.map(item => {
return [
item.document_name,
item.description,
......
......@@ -83,15 +83,21 @@ export default class CreateManagementDoc extends Component {
}
getDataDocument() {
api.create().getDocumentCategory().then(response => {
let payload = {
"setting_group_id": 7,
"setting_type_id": 167,
"company_id": 0
}
api.create().getDocumentCategory(payload).then(response => {
console.log(response);
if (response.data) {
if (response.data.status == 'success') {
let data = response.data.data
let typeData = data.map((item) => {
return {
document_category_id: item.document_category_id,
document_category_name: item.document_category_name
document_category_id: item.setting_id,
document_category_name: item.value
}
})
let typeProps = {
......@@ -173,7 +179,7 @@ export default class CreateManagementDoc extends Component {
const formData = new FormData();
formData.append("file", this.state.file);
formData.append("companyId", this.state.getPerusahaan.company_id);
formData.append("documentCategoryId", this.state.getDocument.document_category_id);
formData.append("settingId", this.state.getDocument.document_category_id);
formData.append("documentPeriode", this.state.periode.periode);
formData.append("description", this.state.description);
formData.append("extension", this.state.fileType);
......@@ -186,6 +192,12 @@ export default class CreateManagementDoc extends Component {
createDocument(){
api.create().uploadDocument(this.state.formData).then(response => {
console.log(response)
if (response) {
if (response.data.status === "success") {
this.props.getDataDocument(this.props.setting_id)
this.props.onClickClose()
}
}
})
}
......
......@@ -20,21 +20,37 @@ export default class DocumentManagement extends Component {
selectTab = (event, newEvent) => {
this.setState({ tab: newEvent })
console.log(this.state.tab)
// console.log(this.state.tab)
}
componentDidMount() {
this.getDataDocument()
}
getDataDocument() {
api.create().getDocumentCategory().then(response => {
getDataDocument(id) {
let payload = {
"setting_group_id": 7,
"setting_type_id": 167,
"company_id": 0
}
api.create().getDocumentCategory(payload).then(response => {
console.log(response);
if (response) {
if (response.data.status === "success") {
this.setState({
listData: response.data.data,
id: response.data.data[0].document_category_id,
loadTable: true
id: id === undefined ? response.data.data[0].setting_id : id,
loadTable: true,
refresh: id === undefined ? '' : 'create'
})
console.log(this.state.listData)
// console.log(this.state.listData)
} else {
}
} else {
}
})
}
......@@ -54,7 +70,7 @@ export default class DocumentManagement extends Component {
<div style={{ display: 'grid', justifyContent: 'flex-end' }}>
<button
type="button"
onClick={() => this.setState({ visibleCreate: true })}
onClick={() => this.setState({ visibleCreate: true, refresh: '' })}
style={{ marginRight: 25 }}
>
<div style={{ width: 150, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
......@@ -74,19 +90,20 @@ export default class DocumentManagement extends Component {
{this.state.listData.map((item, index) => {
return (
<Tab
onClick={() => this.setState({ id: item.document_category_id })}
label={item.document_category_name}
onClick={() => this.setState({ id: item.setting_id })}
label={item.value}
/>
)
})}
</Tabs>
{this.state.loadTable && (
this.state.id === 2 ?
this.state.id === 68542 ?
<AuditTahunan
data={this.state.listData[this.state.tab]}
refresh={this.state.refresh}
/>
:
this.state.id === 1 ?
this.state.id === 68541 ?
<ManualBookTia />
:
this.state.id === 3 ?
......@@ -104,6 +121,8 @@ export default class DocumentManagement extends Component {
{this.state.visibleCreate && (
<CreateManagementDoc
onClickClose={() => this.setState({ visibleCreate: false })}
getDataDocument={this.getDataDocument.bind(this)}
setting_id={this.state.id}
/>
)}
</div>
......
......@@ -143,7 +143,11 @@ export default class CreatePerusahaan extends Component {
options: perusahaanData,
getOptionLabel: (option) => option.company_name,
};
if (this.props.type === 'edit') {
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPC: index === -1 ? 'Company has been Inactive' : "", errorPC: index === -1 ? true : false })
} else {
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index] })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......@@ -183,7 +187,11 @@ export default class CreatePerusahaan extends Component {
options: typeData,
getOptionLabel: (option) => option.business_unit_name,
};
if (this.props.type === 'edit') {
this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? null : typeData[index], msgErrorUB: index === -1 ? 'Business Unit has been Inactive' : "", errorUB: index === -1 ? true : false })
} else {
this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? null : typeData[index] })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......
......@@ -439,6 +439,33 @@ export default class Perusahaan extends Component {
})
}
updateHierarchy = (payload) => {
this.setState({ visibleVisual: false, visiblePerusahaan: true })
api.create().saveVisualisasiPerusahaan(payload).then((response) => {
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
downloadFile = async () => {
let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=CompanyTemplate&&fileType=xlsx"
......@@ -737,9 +764,9 @@ export default class Perusahaan extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
onClick={() => this.setState({ visibleVisual: true, visiblePerusahaan: false })}
>
<img src={Images.visualisasi} onClick={() => this.setState({ visibleVisual: true, visiblePerusahaan: false })} />
<img src={Images.visualisasi} />
</button>
</a>
<ReactTooltip border={true} id="visual" place="bottom" type="light" effect="solid" />
......@@ -783,6 +810,7 @@ export default class Perusahaan extends Component {
buttonEdit={this.state.edit}
onClickClose={() => this.setState({ visibleVisual: false, visiblePerusahaan: true })}
height={this.props.height}
updateHierarchy={this.updateHierarchy.bind(this)}
/>
:
<div>
......
......@@ -100,7 +100,9 @@ export default class VisualPerusahaan extends Component {
let payload = {
"company": this.state.items
}
api.create().saveVisualisasiPerusahaan(payload).then((response) => {
this.props.updateHierarchy(payload)
/* api.create().saveVisualisasiPerusahaan(payload).then((response) => {
// console.log(response.data)
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -129,7 +131,7 @@ export default class VisualPerusahaan extends Component {
// } else {
// alert(response.data.message)
// }
})
}) */
}
renderItem = ({ item, collapseIcon }) => {
......
......@@ -163,7 +163,7 @@ export default class AddUser extends Component {
let uniqueCompany = company.filter((val, id, array) => {
return array.indexOf(val) == id;
});
company = this.state.role.role_id === 1? uniqueCompany : []
company = this.state.role == null? [] : this.state.role.role_id === 1? uniqueCompany : []
// console.log(uniqueCompany)
this.setState({
......
......@@ -147,7 +147,7 @@ export default class EditUser extends Component {
let uniqueCompany = company.filter((val, id, array) => {
return array.indexOf(val) == id;
});
company = this.state.role.role_id === 1? uniqueCompany : []
company = this.state.role == null? [] : this.state.role.role_id === 1? uniqueCompany : []
// console.log(uniqueCompany)
this.setState({
......@@ -213,6 +213,8 @@ export default class EditUser extends Component {
this.setState({ errorStartDate: true, msgErrorSD: 'Valid From Cannot be Empty' })
} else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'Valid To Cannot be Empty' })
} else if (this.state.company.length < 1) {
this.setState({ alert: true, messageAlert: 'Authorization company cannot be empty', tipeAlert: 'warning' })
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
......
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