Commit 5b7da6bc authored by d.arizona's avatar d.arizona

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

parents d373357d 3243630e
......@@ -1069,6 +1069,7 @@ export default class BudgetTahunan extends Component {
onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })}
getReport={this.getCompanyActive.bind(this)}
status={this.state.status}
isApprover={this.state.isApprover}
/>
)}
{this.state.visibleFAM && (
......@@ -1085,6 +1086,7 @@ export default class BudgetTahunan extends Component {
onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })}
getReport={this.getCompanyActive.bind(this)}
status={this.state.status}
isApprover={this.state.isApprover}
/>
)}
{this.state.visibleCAT && (
......
......@@ -45,7 +45,8 @@ export default class BalanceSheet extends Component {
editable: false,
buttonError: false,
judulColumn: null,
updateBy: '-'
updateBy: '-',
handleTekTekTek: 0
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -326,7 +327,7 @@ export default class BalanceSheet extends Component {
item.total_current_year,
item.total_next_year,
item.total_more_year,
item.order,
item.orders,
item.error
]
})
......@@ -2126,13 +2127,14 @@ export default class BalanceSheet extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.state.editable === true ?
onClick={() =>
this.state.editable === true ?
null :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMasterBudget('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>
......@@ -2141,17 +2143,14 @@ export default class BalanceSheet extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => {
onClick={() =>
this.state.buttonError ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning', loading: false })
}, 100);
})
: this.setState({ loading: true }, () => {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMasterBudget('submitted')
})
}}
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
......@@ -2233,11 +2232,14 @@ export default class BalanceSheet extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('draft')
}, 100);
})}
})
)}
style={{ marginRight: 20 }}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
......@@ -2247,11 +2249,14 @@ export default class BalanceSheet extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('submitted')
}, 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 & Complete</Typography>
......
......@@ -444,7 +444,7 @@ export default class FixedAssetsMovement extends Component {
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: true })
this.setState({ loading: false, buttonError: false, editable: false })
} else {
this.setState({ loading: false, buttonError: true, editable: true })
}
......@@ -725,6 +725,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
......@@ -812,6 +813,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -900,6 +902,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -988,6 +991,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1076,6 +1080,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1164,6 +1169,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1252,6 +1258,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1340,6 +1347,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1428,6 +1436,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1516,6 +1525,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1604,6 +1614,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1692,6 +1703,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1818,6 +1830,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1906,6 +1919,7 @@ export default class FixedAssetsMovement extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2009,6 +2023,7 @@ export default class FixedAssetsMovement extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover === true ? null :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
......@@ -2058,6 +2073,7 @@ export default class FixedAssetsMovement extends Component {
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
}
</div>
</div>
......@@ -2096,6 +2112,7 @@ export default class FixedAssetsMovement extends Component {
</div>
</button>
</div>
{this.props.isApprover === true ? null :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%'}}>
<button
className="button"
......@@ -2123,24 +2140,20 @@ export default class FixedAssetsMovement extends Component {
<button
className="button"
type="button"
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.state.editable === true ?
null :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.backToMasterBudget('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>
......@@ -2148,7 +2161,7 @@ export default class FixedAssetsMovement extends Component {
</button>
<button
type="button"
// disabled={this.state.buttonError}
disabled={this.state.buttonError}
onClick={() => {
this.state.buttonError ?
this.setState({ loading: true }, () => {
......@@ -2156,7 +2169,9 @@ export default class FixedAssetsMovement extends Component {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning', loading: false })
}, 100);
})
: this.backToMasterBudget('submitted')
: this.setState({ loading: true }, () => {
this.backToMasterBudget('submitted')
})
}}
style={{
backgroundColor: 'transparent',
......@@ -2166,10 +2181,11 @@ export default class FixedAssetsMovement extends Component {
}}
>
<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</Typography>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
}
</div>
</Paper>
:
......
......@@ -9,6 +9,7 @@ import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
import * as R from 'ramda';
const LightTooltip = withStyles((theme) => ({
tooltip: {
......@@ -45,7 +46,9 @@ export default class ProfitLoss extends Component {
editable: false,
buttonError: false,
judulColumn: null,
updateBy: '-'
updateBy: '-',
buttonDraft: true,
handleTekTekTek: 0
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -163,9 +166,9 @@ export default class ProfitLoss extends Component {
}
}
})
this.setState({ dataTable, loading: false, buttonError: true })
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else {
this.setState({ dataTable, loading: false, buttonError: true })
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
}
})
......@@ -230,7 +233,8 @@ export default class ProfitLoss extends Component {
"status": type,
"profit_loss": data
}
// console.log(data);
console.log(data);
this.setState({ loading: false })
this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
......@@ -331,7 +335,7 @@ export default class ProfitLoss extends Component {
item.total_current_year,
item.total_next_year,
item.total_more_year,
item.order,
item.orders,
item.error
]
})
......@@ -419,7 +423,7 @@ export default class ProfitLoss extends Component {
handleValidate() {
let data = []
console.log(this.state.dataTable)
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
......@@ -454,7 +458,7 @@ export default class ProfitLoss extends Component {
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: true })
this.setState({ loading: false, buttonError: false, editable: false })
} else {
this.setState({ loading: false, buttonError: true, editable: true })
}
......@@ -554,7 +558,7 @@ export default class ProfitLoss extends Component {
} else if (opt == "kali") {
total = Number(total) * Number(item)
} else if (opt == "bagi") {
total = Number(total) / Number(item)
total = R.equals((Number(total) / Number(item)), NaN) ? '0' : Number(total) / Number(item)
} else {
total += item
}
......@@ -641,7 +645,7 @@ export default class ProfitLoss extends Component {
return (
<div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
<FormControlLabel
style={{ margin: 0 }}
// value={value}
......@@ -651,6 +655,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
defaultValue={value}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -679,7 +684,8 @@ export default class ProfitLoss extends Component {
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
null
:
: tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -724,10 +730,11 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -812,11 +819,12 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
......@@ -901,6 +909,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -990,6 +999,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1079,6 +1089,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1168,6 +1179,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1257,6 +1269,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1346,6 +1359,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1435,6 +1449,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1524,6 +1539,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1613,6 +1629,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1702,6 +1719,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1829,6 +1847,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1918,6 +1937,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2034,6 +2054,7 @@ export default class ProfitLoss extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover == true ? null :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
......@@ -2083,6 +2104,7 @@ export default class ProfitLoss extends Component {
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
}
</div>
</div>
......@@ -2119,6 +2141,7 @@ export default class ProfitLoss extends Component {
</div>
</button>
</div>
{this.props.isApprover === true ? null :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
......@@ -2131,7 +2154,7 @@ export default class ProfitLoss extends Component {
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true }, () => {
this.setState({ loading: true, dataTable: dataTable2, buttonDraft: false}, () => {
setTimeout(() => {
this.handleValidate()
}, 100);
......@@ -2147,22 +2170,25 @@ export default class ProfitLoss extends Component {
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
disabled={this.state.buttonDraft}
onClick={() =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
})
}
// onClick={() => this.state.editable === true ?
// null :
// this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.backToMasterBudget('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>
......@@ -2171,15 +2197,24 @@ export default class ProfitLoss extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => {
this.state.buttonError ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning', loading: false })
}, 100);
})
: this.backToMasterBudget('submitted')
}}
// onClick={() => {
// this.state.buttonError ?
// this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning', loading: false })
// }, 100);
// })
// : this.setState({ loading: true }, () => {
// this.backToMasterBudget('submitted')
// })
// }}
onClick={() => this.state.buttonError?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
this.backToMasterBudget('submitted')
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
......@@ -2192,6 +2227,7 @@ export default class ProfitLoss extends Component {
</div>
</button>
</div>
}
</div>
</Paper>
:
......@@ -2260,12 +2296,22 @@ export default class ProfitLoss extends Component {
<button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
// onClick={() => this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.uploadProfitLoss('draft')
// }, 100);
// })}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadProfitLoss('draft')
this.uploadProfitLoss("draft")
}, 100);
})}
style={{ marginRight: 20 }}
})
)}
style={{
marginRight: 20
}}
>
<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>
......@@ -2274,11 +2320,19 @@ export default class ProfitLoss extends Component {
<button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
// onClick={() => this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.uploadProfitLoss('submitted')
// }, 100);
// })}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadProfitLoss('submitted')
this.uploadProfitLoss("submitted")
}, 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 & Complete</Typography>
......
......@@ -11,6 +11,7 @@ import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
import * as R from 'ramda';
const LightTooltip = withStyles((theme) => ({
tooltip: {
......@@ -48,7 +49,10 @@ export default class TaxPlanning extends Component {
editable: false,
buttonError: false,
judulColumn: null,
updateBy: '-'
updateBy: '-',
buttonDraft: true,
handleTekTekTek: 0
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -170,9 +174,9 @@ export default class TaxPlanning extends Component {
}
}
})
this.setState({ dataTable, loading: false, buttonError: true })
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else {
this.setState({ dataTable, loading: false, buttonError: true })
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
}
})
}
......@@ -693,7 +697,7 @@ export default class TaxPlanning extends Component {
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: true, })
this.setState({ loading: false, buttonError: false, editable: false })
// alert("Type Input Can't be Empty")
} else {
this.setState({ loading: false, buttonError: true, editable: true })
......@@ -717,6 +721,8 @@ export default class TaxPlanning extends Component {
}
async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url);
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
)
......@@ -820,7 +826,7 @@ export default class TaxPlanning extends Component {
"formula": rilFormula
}
api.create().countingFormula(body).then(response => {
console.log(response);
// console.log(response);
})
} else {
let body = {
......@@ -832,10 +838,10 @@ export default class TaxPlanning extends Component {
"formula": rilFormula
}
api.create().countingFormula(body).then(response => {
console.log(response)
console.log(tableMeta)
console.log(tableMeta.rowIndex)
console.log(rowColumn)
// console.log(response)
// console.log(tableMeta)
// console.log(tableMeta.rowIndex)
// console.log(rowColumn)
if (response.data) {
if (response.data.status === "success") {
return response.data.data.result
......@@ -884,7 +890,14 @@ export default class TaxPlanning extends Component {
}
}
})
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total)
if (R.equals(Number(total), NaN) ){
total = {tbc: "", fcp: "", tbf: ""}
} else {
total = Number(total)
}
// console.log(Number(total))
// console.log(dataTable2[tableMeta.rowIndex])
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return a
}
......@@ -1009,6 +1022,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1085,6 +1099,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1163,6 +1178,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1271,6 +1287,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1348,6 +1365,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1426,6 +1444,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1537,6 +1556,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1614,6 +1634,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1692,6 +1713,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1802,6 +1824,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1879,6 +1902,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1957,6 +1981,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2067,6 +2092,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2144,6 +2170,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2222,6 +2249,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2332,6 +2360,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2409,6 +2438,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2487,6 +2517,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2597,6 +2628,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2674,6 +2706,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2752,6 +2785,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2862,6 +2896,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -2939,6 +2974,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3017,6 +3053,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3127,6 +3164,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3204,6 +3242,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3282,6 +3321,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3392,6 +3432,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3469,6 +3510,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3547,6 +3589,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3657,6 +3700,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3734,6 +3778,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3812,6 +3857,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3922,6 +3968,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -3999,6 +4046,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4077,6 +4125,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4192,7 +4241,7 @@ export default class TaxPlanning extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={true}
disabled={this.props.isApprover}
value={Number(handleTotal(tableMeta)).toFixed(1)}
/>
}
......@@ -4298,6 +4347,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4375,6 +4425,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4453,6 +4504,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4563,6 +4615,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4640,6 +4693,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4718,6 +4772,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
disabled={this.props.isApprover}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -4825,6 +4880,7 @@ export default class TaxPlanning extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover == true ? null :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
......@@ -4874,6 +4930,7 @@ export default class TaxPlanning extends Component {
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
}
</div>
</div>
......@@ -4910,6 +4967,7 @@ export default class TaxPlanning extends Component {
</div>
</button>
</div>
{this.props.isApprover === true ? null :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
......@@ -4923,7 +4981,7 @@ export default class TaxPlanning extends Component {
}}
onClick={() => {
// this.forceUpdate()
this.setState({ loading: true }, () => {
this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => {
// this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate()
......@@ -4938,21 +4996,24 @@ export default class TaxPlanning extends Component {
<button
className="button"
type="button"
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
disabled={this.state.buttonDraft}
// onClick={() => this.state.editable === true ?
// null :
// this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.backToMasterBudget('draft')
// }, 100);
// })
// }
onClick={() =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})
}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......@@ -4966,15 +5027,24 @@ export default class TaxPlanning extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => {
this.state.buttonError ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning', loading: false })
}, 100);
})
: this.backToMasterBudget('submitted')
}}
// onClick={() => {
// this.state.buttonError ?
// this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning', loading: false })
// }, 100);
// })
// : this.setState({ loading: true }, () => {
// this.backToMasterBudget('submitted')
// })
// }}
onClick={() => this.state.buttonError?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
this.backToMasterBudget('submitted')
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
......@@ -4987,6 +5057,7 @@ export default class TaxPlanning extends Component {
</div>
</button>
</div>
}
</div>
</Paper>
:
......@@ -5054,13 +5125,28 @@ export default class TaxPlanning extends Component {
</button>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
disabled={this.state.buttonError}
// onClick={() => this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.uploadTP('draft')
// }, 100);
// })}
// style={{ marginRight: 20}}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadTP('draft')
this.uploadTP("draft")
}, 100);
})}
style={{ marginRight: 20}}
})
)}
>
<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>
......@@ -5069,11 +5155,19 @@ export default class TaxPlanning extends Component {
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
// onClick={() => this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.uploadTP('submitted')
// }, 100);
// })}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadTP('submitted')
this.uploadTP("submitted")
}, 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 & Complete</Typography>
......
......@@ -55,7 +55,6 @@ export default class CreateManagementDoc extends Component {
this.getPeriode()
this.getMonth()
this.getFileSize()
console.log(this.props.setting_id)
console.log(this.props.name)
}
......@@ -69,9 +68,15 @@ export default class CreateManagementDoc extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
if(response.data.data.length == 0){
this.setState({
sizeUpload: response.data.data[0] ? response.data.data[0].value === undefined ? "1" : response.data.data[0].value : "1"
sizeUpload: "1"
})
} else
this.setState({
sizeUpload: response.data.data[0].value
})
console.log(this.state.sizeUpload)
}
}
})
......@@ -121,7 +126,7 @@ export default class CreateManagementDoc extends Component {
// }
api.create().getDocumentCategory().then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status == 'success') {
let data = response.data.data
......@@ -155,7 +160,7 @@ export default class CreateManagementDoc extends Component {
getPeriode() {
api.create().getPeriodeTransaction().then(response => {
let dateNow = new Date
console.log(dateNow)
// console.log(dateNow)
let year = format(dateNow, 'yyyy')
if (response.data) {
if (response.data.status === "success") {
......@@ -179,7 +184,6 @@ export default class CreateManagementDoc extends Component {
getMonth(){
api.create().getMonthTransaction().then(response => {
let dateNow = new Date
console.log(dateNow)
// let bulan = format(dateNow, 'MMMM')
if (response.data) {
if (response.data.status === "success") {
......@@ -220,7 +224,7 @@ export default class CreateManagementDoc extends Component {
let length = event.name.split(".").length
let fileType = event.name.split(".")[length - 1]
ExcelRenderer(fileObj, (err, resp) => {
console.log(fileType)
// console.log(fileType)
if (err) {
console.log(err);
}
......@@ -248,7 +252,7 @@ export default class CreateManagementDoc extends Component {
formData.append("documentPeriode", null);
formData.append("documentMonth", null);
this.setState({ formData }, ()=> {
this.props.createDocument(this.state.formData, this.props.setting_id)
this.props.createDocument(this.state.formData, this.props.setting_id, this.props.name)
})
}
......@@ -274,7 +278,7 @@ export default class CreateManagementDoc extends Component {
formData.append("documentPeriode", this.state.periode.periode);
formData.append("documentMonth", this.state.monthId.month_id);
this.setState({ formData }, ()=> {
this.props.createDocument(this.state.formData, this.props.setting_id)
this.props.createDocument(this.state.formData, this.props.setting_id, this.props.name)
})
}
}
......
......@@ -37,7 +37,7 @@ export default class DocumentManagement extends Component {
menu: "document management"
}
api.create().getPermission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -95,7 +95,7 @@ export default class DocumentManagement extends Component {
})
}
createDocument(payload, settingID) {
createDocument(payload, settingID, menuName) {
api.create().uploadDocument(payload).then(response => {
console.log(response)
if (response.data) {
......@@ -106,8 +106,8 @@ export default class DocumentManagement extends Component {
})
}
else if (response.data.message === "Upload Document Success") {
this.getDataDocument(settingID)
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', settingID, visibleCreate: false })
this.getDataDocument(settingID, menuName)
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', settingID, menuName, visibleCreate: false })
}
else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -146,7 +146,7 @@ export default class DocumentManagement extends Component {
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
this.getDataDocument(this.state.settingID)
this.getDataDocument(this.state.settingID, this.state.menuName)
this.setState({ konfirmasi: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', visibleCreate: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......
......@@ -57,7 +57,6 @@ export default class EditManagementDoc extends Component {
this.getFileSize()
if (this.props.type === 'edit') {
this.getDetailDoc()
console.log(this.props.data)
}
}
......@@ -265,12 +264,11 @@ export default class EditManagementDoc extends Component {
}
fileHandler = (event) => {
console.log(event)
let fileObj = event
let length = event.name.split(".").length
let fileType = event.name.split(".")[length - 1]
ExcelRenderer(fileObj, (err, resp) => {
console.log(fileType)
// console.log(fileType)
if (err) {
console.log(err);
}
......@@ -321,12 +319,6 @@ export default class EditManagementDoc extends Component {
this.setState({ formData }, () => {
this.props.updateDocument(this.state.formData)
})
var object = {};
formData.forEach(function(value, key){
object[key] = value;
});
var json = JSON.stringify(object);
console.log(json)
}
}
......
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