Commit 51b644cc authored by d.arizona's avatar d.arizona

apdet

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