Commit 31cf40bd authored by Deni Rinaldi's avatar Deni Rinaldi

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

gajelas

See merge request !482
parents 0b262a12 ce1548a0
......@@ -104,31 +104,31 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before == ""? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == ""? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == ""? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == ""? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == ""? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == ""? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == ""? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == ""? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == ""? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == ""? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == ""? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
])
}
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item,index) => {
res.map((item, index) => {
dataTable.push([
item.type_report_id,
item.id,
......@@ -137,41 +137,41 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before == ""? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == ""? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == ""? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == ""? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == ""? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == ""? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == ""? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == ""? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == ""? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == ""? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == ""? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.master_budget.total_actual_before == "" ? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1 ? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == "" ? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1 ? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == "" ? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1 ? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == "" ? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1 ? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.april == "" ? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1 ? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.may == "" ? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1 ? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.june == "" ? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1 ? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.july == "" ? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1 ? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.august == "" ? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1 ? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.september == "" ? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1 ? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.october == "" ? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1 ? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items,indexs) => {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
})
this.setState({dataTable, loading: false}, () => {
if(this.state.dataTable.length == 0) {
this.setState({emptyData: true})
this.setState({ dataTable, loading: false }, () => {
if (this.state.dataTable.length == 0) {
this.setState({ emptyData: true })
}
})
})
}
createData(type) {
let payloadMB = []
this.state.dataTable.map((item,index) => {
this.state.dataTable.map((item, index) => {
payloadMB.push({
"item_report_id": item[1],
"total_actual_before": String(Number(item[7]).toFixed(1)),
......@@ -284,12 +284,12 @@ export default class BalanceSheet extends Component {
async downloadAllData() {
// console.log('masuk')
let bram = [this.props.data.operatingIndID,this.props.report_id,this.props.data.company.company_id,this.props.data.periode]
let bram = [this.props.data.operatingIndID, this.props.report_id, this.props.data.company.company_id, this.props.data.periode]
console.log(bram)
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/export_operating_indicator?operating_indicator_id=${this.props.data.operatingIndID == null? "" : this.props.data.operatingIndID}&&report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/export_operating_indicator?operating_indicator_id=${this.props.data.operatingIndID == null ? "" : this.props.data.operatingIndID}&&report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
)
res = await res.blob()
console.log(res)
this.setState({ loading: false })
......@@ -398,7 +398,7 @@ export default class BalanceSheet extends Component {
data.push({
"item_report_id": i[1],
"item_report": String(i[5]),
"total_actual_before": String(Number(i[7] == null? "0": i[7]).toFixed(1)),
"total_actual_before": String(Number(i[7] == null ? "0" : i[7]).toFixed(1)),
"january": String(Number(i[8]).toFixed(1)),
"february": String(Number(i[9]).toFixed(1)),
"march": String(Number(i[10]).toFixed(1)),
......@@ -442,7 +442,7 @@ export default class BalanceSheet extends Component {
closeAlert() {
this.setState({ alert: false })
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -463,13 +463,13 @@ export default class BalanceSheet extends Component {
let val = String(value).split(",").join("")
let total = 0
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
dataTable2[tableMeta.rowIndex].map((item,index) => {
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 8 && index <= 19) {
let valItem = item == undefined || item == ""? 0 : item
let valItem = item == undefined || item == "" ? 0 : item
total += Number(valItem)
}
})
dataTable2[tableMeta.rowIndex][20] = total
dataTable2[tableMeta.rowIndex][20] = total
return total
}
......@@ -557,19 +557,26 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[21] ?
tableMeta.rowData[21].length > 0 ?
tableMeta.rowData[21][0].field === 'item' ?
tableMeta.rowData[4] == 0 ?
<a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
</a>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
tableMeta.rowData[21] ?
tableMeta.rowData[21].length > 0 ?
tableMeta.rowData[21][0].field === 'item' ?
tableMeta.rowData[4] == 0 ?
<a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
</a>
</div>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</a>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
......@@ -584,13 +591,6 @@ export default class BalanceSheet extends Component {
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
}
<ReactTooltip border={true} id="account" place="bottom" type="light" effect="solid" />
</div>
......@@ -612,7 +612,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 ?
null
:
<FormControlLabel
<FormControlLabel
style={{ margin: 0 }}
// value={value}
control={
......@@ -625,15 +625,15 @@ export default class BalanceSheet extends Component {
// color={"#5198ea"}
value={value}
disabled={true}
// onBlur={(event) => {
// console.log(event.target.value)
// // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// }}
// onBlur={(event) => {
// console.log(event.target.value)
// // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// }}
/>
}
/>}
}
/>}
</div>
)
}
......@@ -650,18 +650,18 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
/>}
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
/>}
</div>
)
}
......@@ -678,7 +678,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -701,14 +701,14 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
}
}
}
, {
, {
name: `Feb ${this.props.data.periode}`,
options: {
customHeadRender: (columnMeta) => (
......@@ -720,7 +720,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -743,7 +743,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -784,7 +784,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -802,7 +802,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -825,7 +825,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -843,7 +843,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -866,7 +866,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -884,7 +884,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -907,7 +907,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -925,7 +925,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -948,7 +948,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -966,7 +966,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -989,7 +989,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -1007,7 +1007,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -1030,7 +1030,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -1048,7 +1048,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -1071,7 +1071,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -1089,7 +1089,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -1112,7 +1112,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -1130,7 +1130,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -1153,7 +1153,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -1171,7 +1171,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -1194,7 +1194,7 @@ export default class BalanceSheet extends Component {
/>
}
/>
</div>
</div>
}
</div>
)
......@@ -1312,11 +1312,10 @@ export default class BalanceSheet extends Component {
cursor: 'pointer',
borderColor: 'transparent',
}}
onClick={() =>
{
this.props.onClickClose()
this.props.getReport()
}
onClick={() => {
this.props.onClickClose()
this.props.getReport()
}
}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
......@@ -1327,7 +1326,7 @@ export default class BalanceSheet extends Component {
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
onClick={() =>
this.setState({ loading: true, editable: false }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false })
......@@ -1416,12 +1415,12 @@ export default class BalanceSheet extends Component {
cursor: 'pointer',
borderColor: 'transparent',
}}
onClick={() =>
onClick={() =>
this.setState({ loading: true, visibleOI: true }, () => {
setTimeout(() => {
this.getDataDetail()
}, 100)
})}
setTimeout(() => {
this.getDataDetail()
}, 100)
})}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
......@@ -1431,7 +1430,7 @@ export default class BalanceSheet extends Component {
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
onClick={() =>
this.setState({ loading: true, editable: false }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false })
......@@ -1447,7 +1446,6 @@ export default class BalanceSheet extends Component {
<button
className="button"
type="button"
disabled={this.state.editable}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer',
......@@ -1455,11 +1453,13 @@ export default class BalanceSheet extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadOI("draft")
}, 100);
})}
onClick={() =>
this.state.editable === true ?
null : this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadOI("draft")
}, 100);
})}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
......@@ -1467,12 +1467,14 @@ export default class BalanceSheet extends Component {
</button>
<button
type="button"
disabled={this.state.editable}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadOI("submitted")
}, 100);
})}
onClick={() =>
this.state.editable === true ?
null :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadOI("submitted")
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer',
......
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