Commit 30ff1786 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !846
parents 99a47381 51b644cc
// contents of .env
REACT_APP_URL_MAIN_BE=https://tia.eksad.com/tia-reporting-dev
REACT_APP_URL_MAIN_FE=/tia-web-dev
\ No newline at end of file
REACT_APP_URL_MAIN_FE=/tia-web-dev
"cpy_file_build_windows" : "robocopy E:\tia-web\src\tia-dev\src E:\tia-web\src /e",
"cpy_sya_bundar": "public, build, package, packaglock, src to src"
\ No newline at end of file
......@@ -47,7 +47,8 @@ export default class FixedAssetsMovementMR extends Component {
loading: true,
visibleFAMMR: true,
updateBy: '-',
notesUpdate: '-'
notesUpdate: '-',
get_for: 'view'
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -57,6 +58,13 @@ export default class FixedAssetsMovementMR extends Component {
this.getLatestUpdate()
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.getItemHierarki()
this.getLatestUpdate()
})
}
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
......@@ -96,7 +104,8 @@ export default class FixedAssetsMovementMR extends Component {
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id
"months": this.props.month.month_id,
"get_for": this.state.get_for
}
api.create().getHierarkiMontlyReportFAM(payload).then(response => {
// console.log(payload);
......@@ -450,7 +459,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(valuezz);
}
} else {
let data = tableMeta.rowData[16]
let data = tableMeta.rowData[16] == null? [] : tableMeta.rowData[16]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) {
let valuezz = data[indexID].value
......@@ -875,10 +884,10 @@ export default class FixedAssetsMovementMR extends Component {
<NumberFormat
thousandSeparator={true}
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
value={Number(tableMeta.rowData[8]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 8)
......@@ -1275,7 +1284,7 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover === true ?
{this.props.isApprover === true || this.state.get_for == 'view'?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
......@@ -1389,7 +1398,27 @@ export default class FixedAssetsMovementMR extends Component {
<div className="col-2"></div>
:
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
<button
{this.state.get_for == 'view' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.handleGetFor('edit')
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
className="button"
type="button"
style={{
......@@ -1411,8 +1440,8 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
className="button"
type="button"
style={{
......@@ -1440,8 +1469,8 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
type="button"
disabled={this.state.buttonError}
onClick={() =>
......@@ -1468,7 +1497,7 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div>
</button>
</button>}
</div>
}
</div>
......
This diff is collapsed.
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